aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/CreatureAI.cpp4
-rw-r--r--src/game/CreatureAI.h5
-rw-r--r--src/game/CreatureEventAI.cpp282
-rw-r--r--src/game/CreatureEventAI.h2
-rw-r--r--src/game/GridNotifiers.h12
-rw-r--r--src/game/GuardAI.cpp62
-rw-r--r--src/game/PetAI.cpp60
-rw-r--r--src/game/ReactorAI.cpp10
-rw-r--r--src/game/ScriptedCreature.cpp140
-rw-r--r--src/game/ScriptedCreature.h14
-rw-r--r--src/game/ScriptedEscortAI.cpp116
-rw-r--r--src/game/ScriptedEscortAI.h2
-rw-r--r--src/game/ScriptedFollowerAI.cpp120
-rw-r--r--src/game/ScriptedGuardAI.cpp68
-rw-r--r--src/game/ScriptedSimpleAI.cpp38
-rw-r--r--src/game/TotemAI.cpp34
-rw-r--r--src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp32
-rw-r--r--src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp28
-rw-r--r--src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/arathi_highlands.cpp26
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp200
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp32
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp32
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp58
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp38
-rw-r--r--src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp44
-rw-r--r--src/scripts/eastern_kingdoms/boss_kruul.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/burning_steppes.cpp2
-rw-r--r--src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/dun_morogh.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/duskwood.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/eastern_plaguelands.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/elwynn_forest.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/eversong_woods.cpp72
-rw-r--r--src/scripts/eastern_kingdoms/ghostlands.cpp34
-rw-r--r--src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp140
-rw-r--r--src/scripts/eastern_kingdoms/hinterlands.cpp36
-rw-r--r--src/scripts/eastern_kingdoms/isle_of_queldanas.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp40
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp84
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp70
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp50
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp72
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp116
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp88
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp52
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp230
-rw-r--r--src/scripts/eastern_kingdoms/karazhan/karazhan.cpp54
-rw-r--r--src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp164
-rw-r--r--src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp168
-rw-r--r--src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp60
-rw-r--r--src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp26
-rw-r--r--src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp2
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp58
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/redridge_mountains.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp48
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp28
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp200
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp84
-rw-r--r--src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp50
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp24
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/silvermoon_city.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/silverpine_forest.cpp36
-rw-r--r--src/scripts/eastern_kingdoms/stormwind_city.cpp84
-rw-r--r--src/scripts/eastern_kingdoms/stranglethorn_vale.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp74
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp30
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp14
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp4
-rw-r--r--src/scripts/eastern_kingdoms/stratholme/stratholme.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp78
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp152
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp134
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp12
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp212
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp76
-rw-r--r--src/scripts/eastern_kingdoms/tirisfal_glades.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp78
-rw-r--r--src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/uldaman/uldaman.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/undercity.cpp16
-rw-r--r--src/scripts/eastern_kingdoms/western_plaguelands.cpp20
-rw-r--r--src/scripts/eastern_kingdoms/westfall.cpp70
-rw-r--r--src/scripts/eastern_kingdoms/wetlands.cpp22
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp88
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp96
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp102
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp116
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp122
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp124
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/zulaman.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp50
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp8
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp6
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp46
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp42
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp48
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp56
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp18
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp114
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp38
-rw-r--r--src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp2
-rw-r--r--src/scripts/examples/example_creature.cpp36
-rw-r--r--src/scripts/examples/example_escort.cpp38
-rw-r--r--src/scripts/kalimdor/ashenvale.cpp44
-rw-r--r--src/scripts/kalimdor/azshara.cpp58
-rw-r--r--src/scripts/kalimdor/azuremyst_isle.cpp106
-rw-r--r--src/scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp26
-rw-r--r--src/scripts/kalimdor/blackfathom_depths/boss_aku_mai.cpp2
-rw-r--r--src/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp6
-rw-r--r--src/scripts/kalimdor/bloodmyst_isle.cpp4
-rw-r--r--src/scripts/kalimdor/boss_azuregos.cpp22
-rw-r--r--src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp10
-rw-r--r--src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp40
-rw-r--r--src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp12
-rw-r--r--src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp16
-rw-r--r--src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp196
-rw-r--r--src/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp20
-rw-r--r--src/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp20
-rw-r--r--src/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp20
-rw-r--r--src/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp60
-rw-r--r--src/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp8
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp62
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp126
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp42
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp44
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp42
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp172
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp224
-rw-r--r--src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp20
-rw-r--r--src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp18
-rw-r--r--src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp18
-rw-r--r--src/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp148
-rw-r--r--src/scripts/kalimdor/darkshore.cpp28
-rw-r--r--src/scripts/kalimdor/desolace.cpp14
-rw-r--r--src/scripts/kalimdor/durotar.cpp14
-rw-r--r--src/scripts/kalimdor/dustwallow_marsh.cpp44
-rw-r--r--src/scripts/kalimdor/feralas.cpp36
-rw-r--r--src/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp8
-rw-r--r--src/scripts/kalimdor/maraudon/boss_landslide.cpp10
-rw-r--r--src/scripts/kalimdor/maraudon/boss_noxxion.cpp32
-rw-r--r--src/scripts/kalimdor/maraudon/boss_princess_theradras.cpp8
-rw-r--r--src/scripts/kalimdor/moonglade.cpp46
-rw-r--r--src/scripts/kalimdor/mulgore.cpp44
-rw-r--r--src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp56
-rw-r--r--src/scripts/kalimdor/orgrimmar.cpp6
-rw-r--r--src/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp26
-rw-r--r--src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp4
-rw-r--r--src/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp40
-rw-r--r--src/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp8
-rw-r--r--src/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp10
-rw-r--r--src/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp24
-rw-r--r--src/scripts/kalimdor/silithus.cpp160
-rw-r--r--src/scripts/kalimdor/stonetalon_mountains.cpp16
-rw-r--r--src/scripts/kalimdor/tanaris.cpp94
-rw-r--r--src/scripts/kalimdor/teldrassil.cpp8
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp38
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp182
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp28
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp20
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp20
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp34
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp62
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp94
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp30
-rw-r--r--src/scripts/kalimdor/the_barrens.cpp90
-rw-r--r--src/scripts/kalimdor/thousand_needles.cpp62
-rw-r--r--src/scripts/kalimdor/thunder_bluff.cpp8
-rw-r--r--src/scripts/kalimdor/ungoro_crater.cpp50
-rw-r--r--src/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp88
-rw-r--r--src/scripts/kalimdor/zulfarrak/zulfarrak.cpp8
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp32
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp42
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp18
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp174
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp74
-rw-r--r--src/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp38
-rw-r--r--src/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp30
-rw-r--r--src/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp78
-rw-r--r--src/scripts/northrend/borean_tundra.cpp430
-rw-r--r--src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp62
-rw-r--r--src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp34
-rw-r--r--src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp174
-rw-r--r--src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp56
-rw-r--r--src/scripts/northrend/crystalsong_forest.cpp4
-rw-r--r--src/scripts/northrend/dalaran.cpp2
-rw-r--r--src/scripts/northrend/draktharon_keep/boss_dred.cpp4
-rw-r--r--src/scripts/northrend/draktharon_keep/boss_novos.cpp52
-rw-r--r--src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp26
-rw-r--r--src/scripts/northrend/draktharon_keep/boss_trollgore.cpp18
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp34
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp70
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp82
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp26
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp86
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp42
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp44
-rw-r--r--src/scripts/northrend/grizzly_hills.cpp70
-rw-r--r--src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp70
-rw-r--r--src/scripts/northrend/gundrak/boss_eck.cpp12
-rw-r--r--src/scripts/northrend/gundrak/boss_gal_darah.cpp46
-rw-r--r--src/scripts/northrend/gundrak/boss_moorabi.cpp34
-rw-r--r--src/scripts/northrend/gundrak/boss_slad_ran.cpp26
-rw-r--r--src/scripts/northrend/howling_fjord.cpp12
-rw-r--r--src/scripts/northrend/icecrown.cpp12
-rw-r--r--src/scripts/northrend/naxxramas/boss_anubrekhan.cpp14
-rw-r--r--src/scripts/northrend/naxxramas/boss_faerlina.cpp4
-rw-r--r--src/scripts/northrend/naxxramas/boss_gothik.cpp30
-rw-r--r--src/scripts/northrend/naxxramas/boss_grobbulus.cpp4
-rw-r--r--src/scripts/northrend/naxxramas/boss_kelthuzad.cpp30
-rw-r--r--src/scripts/northrend/naxxramas/boss_patchwerk.cpp12
-rw-r--r--src/scripts/northrend/naxxramas/boss_razuvious.cpp2
-rw-r--r--src/scripts/northrend/naxxramas/boss_sapphiron.cpp4
-rw-r--r--src/scripts/northrend/naxxramas/boss_thaddius.cpp28
-rw-r--r--src/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp18
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_anomalus.cpp32
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp38
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp50
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_ormorok.cpp44
-rw-r--r--src/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp4
-rw-r--r--src/scripts/northrend/nexus/oculus/boss_drakos.cpp30
-rw-r--r--src/scripts/northrend/nexus/oculus/boss_urom.cpp8
-rw-r--r--src/scripts/northrend/nexus/oculus/boss_varos.cpp8
-rw-r--r--src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp204
-rw-r--r--src/scripts/northrend/sholazar_basin.cpp20
-rw-r--r--src/scripts/northrend/storm_peaks.cpp12
-rw-r--r--src/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp58
-rw-r--r--src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp56
-rw-r--r--src/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp32
-rw-r--r--src/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp84
-rw-r--r--src/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp14
-rw-r--r--src/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp20
-rw-r--r--src/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp28
-rw-r--r--src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp124
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp72
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp96
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp6
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp56
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_freya.cpp6
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_hodir.cpp6
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_ignis.cpp20
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp6
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp70
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_thorim.cpp8
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_xt002.cpp128
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp116
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp68
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp66
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp14
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp178
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp42
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp54
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp58
-rw-r--r--src/scripts/northrend/vault_of_archavon/boss_archavon.cpp8
-rw-r--r--src/scripts/northrend/vault_of_archavon/boss_emalon.cpp28
-rw-r--r--src/scripts/northrend/vault_of_archavon/boss_koralon.cpp4
-rw-r--r--src/scripts/northrend/vault_of_archavon/boss_toravon.cpp12
-rw-r--r--src/scripts/northrend/violet_hold/boss_cyanigosa.cpp12
-rw-r--r--src/scripts/northrend/violet_hold/boss_erekem.cpp68
-rw-r--r--src/scripts/northrend/violet_hold/boss_ichoron.cpp76
-rw-r--r--src/scripts/northrend/violet_hold/boss_lavanthor.cpp18
-rw-r--r--src/scripts/northrend/violet_hold/boss_moragg.cpp12
-rw-r--r--src/scripts/northrend/violet_hold/boss_xevozz.cpp46
-rw-r--r--src/scripts/northrend/violet_hold/boss_zuramat.cpp24
-rw-r--r--src/scripts/northrend/violet_hold/violet_hold.cpp32
-rw-r--r--src/scripts/northrend/zuldrak.cpp190
-rw-r--r--src/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp58
-rw-r--r--src/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp28
-rw-r--r--src/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp64
-rw-r--r--src/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp14
-rw-r--r--src/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp34
-rw-r--r--src/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp36
-rw-r--r--src/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp26
-rw-r--r--src/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp14
-rw-r--r--src/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp52
-rw-r--r--src/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp44
-rw-r--r--src/scripts/outland/black_temple/boss_bloodboil.cpp66
-rw-r--r--src/scripts/outland/black_temple/boss_illidan.cpp480
-rw-r--r--src/scripts/outland/black_temple/boss_mother_shahraz.cpp30
-rw-r--r--src/scripts/outland/black_temple/boss_reliquary_of_souls.cpp156
-rw-r--r--src/scripts/outland/black_temple/boss_shade_of_akama.cpp164
-rw-r--r--src/scripts/outland/black_temple/boss_supremus.cpp48
-rw-r--r--src/scripts/outland/black_temple/boss_teron_gorefiend.cpp92
-rw-r--r--src/scripts/outland/black_temple/boss_warlord_najentus.cpp30
-rw-r--r--src/scripts/outland/black_temple/illidari_council.cpp112
-rw-r--r--src/scripts/outland/blades_edge_mountains.cpp42
-rw-r--r--src/scripts/outland/boss_doomlord_kazzak.cpp22
-rw-r--r--src/scripts/outland/boss_doomwalker.cpp26
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp116
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp60
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp136
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp198
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp90
-rw-r--r--src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp42
-rw-r--r--src/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp8
-rw-r--r--src/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp36
-rw-r--r--src/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp32
-rw-r--r--src/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp16
-rw-r--r--src/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp14
-rw-r--r--src/scripts/outland/gruuls_lair/boss_gruul.cpp34
-rw-r--r--src/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp124
-rw-r--r--src/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp10
-rw-r--r--src/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp58
-rw-r--r--src/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp10
-rw-r--r--src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp28
-rw-r--r--src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp88
-rw-r--r--src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp30
-rw-r--r--src/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp110
-rw-r--r--src/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp42
-rw-r--r--src/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp42
-rw-r--r--src/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp46
-rw-r--r--src/scripts/outland/hellfire_peninsula.cpp50
-rw-r--r--src/scripts/outland/nagrand.cpp106
-rw-r--r--src/scripts/outland/netherstorm.cpp164
-rw-r--r--src/scripts/outland/shadowmoon_valley.cpp216
-rw-r--r--src/scripts/outland/shattrath_city.cpp96
-rw-r--r--src/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp114
-rw-r--r--src/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp46
-rw-r--r--src/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp40
-rw-r--r--src/scripts/outland/tempest_keep/botanica/boss_laj.cpp96
-rw-r--r--src/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp34
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp140
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp96
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp348
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp30
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/the_eye.cpp8
-rw-r--r--src/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp16
-rw-r--r--src/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp38
-rw-r--r--src/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp34
-rw-r--r--src/scripts/outland/terokkar_forest.cpp80
-rw-r--r--src/scripts/outland/zangarmarsh.cpp18
-rw-r--r--src/scripts/world/boss_emeriss.cpp16
-rw-r--r--src/scripts/world/boss_taerar.cpp30
-rw-r--r--src/scripts/world/boss_ysondre.cpp14
-rw-r--r--src/scripts/world/guards.cpp8
-rw-r--r--src/scripts/world/mob_generic_creature.cpp42
-rw-r--r--src/scripts/world/npcs_special.cpp294
403 files changed, 9853 insertions, 9854 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index bdd78f0fa63..628b156fcf1 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -152,7 +152,7 @@ void CreatureAI::EnterEvadeMode()
if (Unit *owner = me->GetCharmerOrOwner())
{
me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, m_creature->GetFollowAngle(), MOTION_SLOT_ACTIVE);
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
}
else
me->GetMotionMaster()->MoveTargetedHome();
@@ -166,6 +166,6 @@ void CreatureAI::EnterEvadeMode()
/*void CreatureAI::AttackedBy(Unit* attacker)
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
AttackStart(attacker);
}*/
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index abbdc24036b..d06fe80d0fa 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -68,7 +68,6 @@ class CreatureAI : public UnitAI
{
protected:
Creature * const me;
- Creature * const m_creature;
bool UpdateVictim();
bool UpdateVictimWithGaze();
@@ -83,7 +82,7 @@ class CreatureAI : public UnitAI
Creature *DoSummonFlyer(uint32 uiEntry, WorldObject *obj, float fZ, float fRadius = 5.0f, uint32 uiDespawntime = 30000, TempSummonType uiType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
public:
- explicit CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c), m_creature(c), m_MoveInLineOfSight_locked(false) {}
+ explicit CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c), m_MoveInLineOfSight_locked(false) {}
virtual ~CreatureAI() {}
@@ -169,7 +168,7 @@ class CreatureAI : public UnitAI
/// == Fields =======================================
// Pointer to controlled by AI creature
- //Creature* const m_creature;
+ //Creature* const me;
virtual void PassengerBoarded(Unit *who, int8 seatId, bool apply) {}
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index ef6f556ca99..ce70e0961ef 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -59,7 +59,7 @@ int CreatureEventAI::Permissible(const Creature *creature)
CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c)
{
// Need make copy for filter unneeded steps and safe in case table reload
- CreatureEventAI_Event_Map::const_iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
+ CreatureEventAI_Event_Map::const_iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(me->GetEntry());
if (CreatureEvents != CreatureEAI_Mgr.GetCreatureEventAIMap().end())
{
std::vector<CreatureEventAI_Event>::const_iterator i;
@@ -71,9 +71,9 @@ CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c)
if ((*i).event_flags & EFLAG_DEBUG_ONLY)
continue;
#endif
- if (m_creature->GetMap()->IsDungeon())
+ if (me->GetMap()->IsDungeon())
{
- if ((1 << (m_creature->GetMap()->GetSpawnMode()+1)) & (*i).event_flags)
+ if ((1 << (me->GetMap()->GetSpawnMode()+1)) & (*i).event_flags)
{
//event flagged for instance mode
CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
@@ -84,10 +84,10 @@ CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c)
}
//EventMap had events but they were not added because they must be for instance
if (CreatureEventAIList.empty())
- sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry());
+ sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry());
}
else
- sLog.outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", m_creature->GetEntry());
+ sLog.outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry());
bEmptyList = CreatureEventAIList.empty();
Phase = 0;
@@ -122,52 +122,52 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
switch (event.event_type)
{
case EVENT_T_TIMER:
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.timer.repeatMin,event.timer.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax);
break;
case EVENT_T_TIMER_OOC:
- if (m_creature->isInCombat())
+ if (me->isInCombat())
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.timer.repeatMin,event.timer.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax);
break;
case EVENT_T_HP:
{
- if (!m_creature->isInCombat() || !m_creature->GetMaxHealth())
+ if (!me->isInCombat() || !me->GetMaxHealth())
return false;
- uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
+ uint32 perc = (me->GetHealth()*100) / me->GetMaxHealth();
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
break;
}
case EVENT_T_MANA:
{
- if (!m_creature->isInCombat() || !m_creature->GetMaxPower(POWER_MANA))
+ if (!me->isInCombat() || !me->GetMaxPower(POWER_MANA))
return false;
- uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
+ uint32 perc = (me->GetPower(POWER_MANA)*100) / me->GetMaxPower(POWER_MANA);
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
break;
}
case EVENT_T_AGGRO:
break;
case EVENT_T_KILL:
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.kill.repeatMin,event.kill.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.kill.repeatMin,event.kill.repeatMax);
break;
case EVENT_T_DEATH:
case EVENT_T_EVADE:
@@ -176,43 +176,43 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
//Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.spell_hit.repeatMin,event.spell_hit.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.spell_hit.repeatMin,event.spell_hit.repeatMax);
break;
case EVENT_T_RANGE:
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.range.repeatMin,event.range.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.range.repeatMin,event.range.repeatMax);
break;
case EVENT_T_OOC_LOS:
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.ooc_los.repeatMin,event.ooc_los.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.ooc_los.repeatMin,event.ooc_los.repeatMax);
break;
case EVENT_T_RESET:
case EVENT_T_SPAWNED:
break;
case EVENT_T_TARGET_HP:
{
- if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
+ if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth())
return false;
- uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
+ uint32 perc = (me->getVictim()->GetHealth()*100) / me->getVictim()->GetMaxHealth();
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
break;
}
case EVENT_T_TARGET_CASTING:
- if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
+ if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true))
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.target_casting.repeatMin,event.target_casting.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.target_casting.repeatMin,event.target_casting.repeatMax);
break;
case EVENT_T_FRIENDLY_HP:
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return false;
Unit* pUnit = DoSelectLowestHpFriendly(event.friendly_hp.radius, event.friendly_hp.hpDeficit);
@@ -222,12 +222,12 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = pUnit;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.friendly_hp.repeatMin,event.friendly_hp.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.friendly_hp.repeatMin,event.friendly_hp.repeatMax);
break;
}
case EVENT_T_FRIENDLY_IS_CC:
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return false;
std::list<Creature*> pList;
@@ -241,7 +241,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = *(pList.begin());
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.friendly_is_cc.repeatMin,event.friendly_is_cc.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.friendly_is_cc.repeatMin,event.friendly_is_cc.repeatMax);
break;
}
case EVENT_T_FRIENDLY_MISSING_BUFF:
@@ -257,7 +257,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = *(pList.begin());
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.friendly_buff.repeatMin,event.friendly_buff.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.friendly_buff.repeatMin,event.friendly_buff.repeatMax);
break;
}
case EVENT_T_SUMMONED_UNIT:
@@ -271,21 +271,21 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.summon_unit.repeatMin,event.summon_unit.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.summon_unit.repeatMin,event.summon_unit.repeatMax);
break;
}
case EVENT_T_TARGET_MANA:
{
- if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxPower(POWER_MANA))
+ if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA))
return false;
- uint32 perc = (m_creature->getVictim()->GetPower(POWER_MANA)*100) / m_creature->getVictim()->GetMaxPower(POWER_MANA);
+ uint32 perc = (me->getVictim()->GetPower(POWER_MANA)*100) / me->getVictim()->GetMaxPower(POWER_MANA);
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
break;
}
case EVENT_T_REACHED_HOME:
@@ -295,12 +295,12 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
{
//Note: checked only aura for effect 0, if need check aura for effect 1/2 then
// possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx)
- Aura const * aura = m_creature->GetAura(event.buffed.spellId);
+ Aura const * aura = me->GetAura(event.buffed.spellId);
if (!aura || aura->GetStackAmount() < event.buffed.amount)
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax);
break;
}
case EVENT_T_TARGET_BUFFED:
@@ -316,11 +316,11 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
- pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
+ pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax);
break;
}
default:
- sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
break;
}
@@ -374,7 +374,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner;
}
}
- else if ((target = m_creature->getVictim()))
+ else if ((target = me->getVictim()))
{
if (target->GetTypeId() != TYPEID_PLAYER)
if (Unit* owner = target->GetOwner())
@@ -382,21 +382,21 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner;
}
- DoScriptText(temp, m_creature, target);
+ DoScriptText(temp, me, target);
}
break;
}
case ACTION_T_SET_FACTION:
{
if (action.set_faction.factionId)
- m_creature->setFaction(action.set_faction.factionId);
+ me->setFaction(action.set_faction.factionId);
else
{
- if (CreatureInfo const* ci = GetCreatureTemplateStore(m_creature->GetEntry()))
+ if (CreatureInfo const* ci = GetCreatureTemplateStore(me->GetEntry()))
{
//if no id provided, assume reset and then use default
- if (m_creature->getFaction() != ci->faction_A)
- m_creature->setFaction(ci->faction_A);
+ if (me->getFaction() != ci->faction_A)
+ me->setFaction(ci->faction_A);
}
}
break;
@@ -411,41 +411,41 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
{
uint32 display_id = objmgr.ChooseDisplayId(0,ci);
- m_creature->SetDisplayId(display_id);
+ me->SetDisplayId(display_id);
}
}
//if no param1, then use value from param2 (modelId)
else
- m_creature->SetDisplayId(action.morph.modelId);
+ me->SetDisplayId(action.morph.modelId);
}
else
- m_creature->DeMorph();
+ me->DeMorph();
break;
}
case ACTION_T_SOUND:
- m_creature->PlayDirectSound(action.sound.soundId);
+ me->PlayDirectSound(action.sound.soundId);
break;
case ACTION_T_EMOTE:
- m_creature->HandleEmoteCommand(action.emote.emoteId);
+ me->HandleEmoteCommand(action.emote.emoteId);
break;
case ACTION_T_RANDOM_SOUND:
{
int32 temp = GetRandActionParam(rnd, action.random_sound.soundId1, action.random_sound.soundId2, action.random_sound.soundId3);
if (temp >= 0)
- m_creature->PlayDirectSound(temp);
+ me->PlayDirectSound(temp);
break;
}
case ACTION_T_RANDOM_EMOTE:
{
int32 temp = GetRandActionParam(rnd, action.random_emote.emoteId1, action.random_emote.emoteId2, action.random_emote.emoteId3);
if (temp >= 0)
- m_creature->HandleEmoteCommand(temp);
+ me->HandleEmoteCommand(temp);
break;
}
case ACTION_T_CAST:
{
Unit* target = GetTargetByType(action.cast.target, pActionInvoker);
- Unit* caster = m_creature;
+ Unit* caster = me;
if (!target)
return;
@@ -477,12 +477,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
//Melee current victim if flag not set
if (!(action.cast.castFlags & CAST_NO_MELEE_IF_OOM))
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
{
AttackDistance = 0.0f;
AttackAngle = 0.0f;
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ me->GetMotionMaster()->MoveChase(me->getVictim(), AttackDistance, AttackAngle);
}
}
@@ -498,7 +498,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
else
- sLog.outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), action.cast.spellId);
+ sLog.outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", EventId, me->GetEntry(), action.cast.spellId);
}
break;
}
@@ -509,26 +509,26 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Creature* pCreature = NULL;
if (action.summon.duration)
- pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration);
+ pCreature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration);
else
- pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+ pCreature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!pCreature)
- sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, EventId, me->GetEntry());
else if (action.summon.target != TARGET_T_SELF && target)
pCreature->AI()->AttackStart(target);
break;
}
case ACTION_T_THREAT_SINGLE_PCT:
if (Unit* target = GetTargetByType(action.threat_single_pct.target, pActionInvoker))
- m_creature->getThreatManager().modifyThreatPercent(target, action.threat_single_pct.percent);
+ me->getThreatManager().modifyThreatPercent(target, action.threat_single_pct.percent);
break;
case ACTION_T_THREAT_ALL_PCT:
{
- std::list<HostileReference*>& threatList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
- if (Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()))
- m_creature->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent);
+ if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid()))
+ me->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent);
break;
}
case ACTION_T_QUEST_EVENT:
@@ -539,7 +539,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_CAST_EVENT:
if (Unit* target = GetTargetByType(action.cast_event.target, pActionInvoker))
if (target->GetTypeId() == TYPEID_PLAYER)
- target->ToPlayer()->CastedCreatureOrGO(action.cast_event.creatureId, m_creature->GetGUID(), action.cast_event.spellId);
+ target->ToPlayer()->CastedCreatureOrGO(action.cast_event.creatureId, me->GetGUID(), action.cast_event.spellId);
break;
case ACTION_T_SET_UNIT_FIELD:
{
@@ -575,30 +575,30 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
//Allow movement (create new targeted movement gen only if idle)
if (CombatMovementEnabled)
{
- Unit* victim = m_creature->getVictim();
- if (m_creature->isInCombat() && victim)
+ Unit* victim = me->getVictim();
+ if (me->isInCombat() && victim)
{
if (action.combat_movement.melee)
{
- m_creature->addUnitState(UNIT_STAT_MELEE_ATTACKING);
- m_creature->SendMeleeAttackStart(victim);
+ me->addUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->SendMeleeAttackStart(victim);
}
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
- m_creature->GetMotionMaster()->MoveChase(victim, AttackDistance, AttackAngle); // Targeted movement generator will start melee automatically, no need to send it explicitly
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
+ me->GetMotionMaster()->MoveChase(victim, AttackDistance, AttackAngle); // Targeted movement generator will start melee automatically, no need to send it explicitly
}
}
else
{
- if (m_creature->isInCombat())
+ if (me->isInCombat())
{
- Unit* victim = m_creature->getVictim();
+ Unit* victim = me->getVictim();
if (action.combat_movement.melee && victim)
{
- m_creature->clearUnitState(UNIT_STAT_MELEE_ATTACKING);
- m_creature->SendMeleeAttackStop(victim);
+ me->clearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->SendMeleeAttackStop(victim);
}
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- m_creature->GetMotionMaster()->MoveIdle();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MoveIdle();
}
}
break;
@@ -610,12 +610,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
int32 new_phase = int32(Phase)+action.set_inc_phase.step;
if (new_phase < 0)
{
- sLog.outErrorDb("CreatureEventAI: Event %d decrease Phase under 0. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d decrease Phase under 0. CreatureEntry = %d", EventId, me->GetEntry());
Phase = 0;
}
else if (new_phase >= MAX_PHASE)
{
- sLog.outErrorDb("CreatureEventAI: Event %d incremented Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", EventId, MAX_PHASE-1, MAX_PHASE-1, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d incremented Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", EventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry());
Phase = MAX_PHASE-1;
}
else
@@ -627,23 +627,23 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
EnterEvadeMode();
break;
case ACTION_T_FLEE_FOR_ASSIST:
- m_creature->DoFleeToGetAssistance();
+ me->DoFleeToGetAssistance();
break;
case ACTION_T_QUEST_EVENT_ALL:
if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER)
{
- if (Unit* Temp = Unit::GetUnit(*m_creature,pActionInvoker->GetGUID()))
+ if (Unit* Temp = Unit::GetUnit(*me,pActionInvoker->GetGUID()))
if (Temp->GetTypeId() == TYPEID_PLAYER)
- Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId,m_creature);
+ Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId,me);
}
break;
case ACTION_T_CAST_EVENT_ALL:
{
- std::list<HostileReference*>& threatList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
- if (Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()))
+ if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid()))
if (Temp->GetTypeId() == TYPEID_PLAYER)
- Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, m_creature->GetGUID(), action.cast_event_all.spellId);
+ Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId);
break;
}
case ACTION_T_REMOVEAURASFROMSPELL:
@@ -656,7 +656,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
if (CombatMovementEnabled)
{
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ me->GetMotionMaster()->MoveChase(me->getVictim(), AttackDistance, AttackAngle);
}
break;
case ACTION_T_RANDOM_PHASE:
@@ -666,7 +666,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax)
Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
else
- sLog.outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", EventId, me->GetEntry());
break;
case ACTION_T_SUMMON_ID:
{
@@ -675,18 +675,18 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
CreatureEventAI_Summon_Map::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == CreatureEAI_Mgr.GetCreatureEventAISummonMap().end())
{
- sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, me->GetEntry());
return;
}
Creature* pCreature = NULL;
if ((*i).second.SpawnTimeSecs)
- pCreature = m_creature->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
+ pCreature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
else
- pCreature = m_creature->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+ pCreature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!pCreature)
- sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, EventId, me->GetEntry());
else if (action.summon_id.target != TARGET_T_SELF && target)
pCreature->AI()->AttackStart(target);
@@ -694,22 +694,22 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
case ACTION_T_KILLED_MONSTER:
//first attempt player who tapped creature
- if (Player* pPlayer = m_creature->GetLootRecipient())
- pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature);
+ if (Player* pPlayer = me->GetLootRecipient())
+ pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, me);
else
{
//if not available, use pActionInvoker
if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker))
if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
- pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature);
+ pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, me);
}
break;
case ACTION_T_SET_INST_DATA:
{
- InstanceData* pInst = (InstanceData*)m_creature->GetInstanceData();
+ InstanceData* pInst = (InstanceData*)me->GetInstanceData();
if (!pInst)
{
- sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, me->GetEntry());
return;
}
@@ -721,14 +721,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Unit* target = GetTargetByType(action.set_inst_data64.target, pActionInvoker);
if (!target)
{
- sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, me->GetEntry());
return;
}
- InstanceData* pInst = (InstanceData*)m_creature->GetInstanceData();
+ InstanceData* pInst = (InstanceData*)me->GetInstanceData();
if (!pInst)
{
- sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, me->GetEntry());
return;
}
@@ -736,32 +736,32 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
}
case ACTION_T_UPDATE_TEMPLATE:
- if (m_creature->GetEntry() == action.update_template.creatureId)
+ if (me->GetEntry() == action.update_template.creatureId)
{
- sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, me->GetEntry());
return;
}
- m_creature->UpdateEntry(action.update_template.creatureId, action.update_template.team ? HORDE : ALLIANCE);
+ me->UpdateEntry(action.update_template.creatureId, action.update_template.team ? HORDE : ALLIANCE);
break;
case ACTION_T_DIE:
- if (m_creature->isDead())
+ if (me->isDead())
{
- sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
+ sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, me->GetEntry());
return;
}
- m_creature->Kill(m_creature);
+ me->Kill(me);
break;
case ACTION_T_ZONE_COMBAT_PULSE:
{
- m_creature->SetInCombatWithZone();
+ me->SetInCombatWithZone();
break;
}
case ACTION_T_CALL_FOR_HELP:
{
- m_creature->CallForHelp(action.call_for_help.radius);
+ me->CallForHelp(action.call_for_help.radius);
break;
}
break;
@@ -797,29 +797,29 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
GameObject* pObject = NULL;
float x,y,z;
- m_creature->GetPosition(x,y,z);
- pObject = m_creature->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2);
+ me->GetPosition(x,y,z);
+ pObject = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2);
if (!pObject)
{
- sLog.outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, EventId, m_creature->GetEntry());
+ sLog.outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, EventId, me->GetEntry());
}
break;
}
case ACTION_T_SET_SHEATH:
{
- m_creature->SetSheath(SheathState(action.set_sheath.sheath));
+ me->SetSheath(SheathState(action.set_sheath.sheath));
break;
}
case ACTION_T_FORCE_DESPAWN:
{
- m_creature->ForcedDespawn(action.forced_despawn.msDelay);
+ me->ForcedDespawn(action.forced_despawn.msDelay);
break;
}
case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
{
if (action.invincibility_hp_level.is_percent)
- InvinceabilityHpLevel = m_creature->GetMaxHealth()*action.invincibility_hp_level.hp_level/100;
+ InvinceabilityHpLevel = me->GetMaxHealth()*action.invincibility_hp_level.hp_level/100;
else
InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
break;
@@ -865,7 +865,7 @@ void CreatureEventAI::Reset()
//Reset all out of combat timers
case EVENT_T_TIMER_OOC:
{
- if ((*i).UpdateRepeatTimer(m_creature,event.timer.initialMin,event.timer.initialMax))
+ if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax))
(*i).Enabled = true;
break;
}
@@ -880,7 +880,7 @@ void CreatureEventAI::Reset()
void CreatureEventAI::JustReachedHome()
{
- m_creature->LoadCreaturesAddon();
+ me->LoadCreaturesAddon();
if (!bEmptyList)
{
@@ -967,7 +967,7 @@ void CreatureEventAI::EnterCombat(Unit *enemy)
break;
//Reset all in combat timers
case EVENT_T_TIMER:
- if ((*i).UpdateRepeatTimer(m_creature,event.timer.initialMin,event.timer.initialMax))
+ if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax))
(*i).Enabled = true;
break;
//All normal events need to be re-enabled and their time set to 0
@@ -988,15 +988,15 @@ void CreatureEventAI::AttackStart(Unit *who)
if (!who)
return;
- if (m_creature->Attack(who, MeleeEnabled))
+ if (me->Attack(who, MeleeEnabled))
{
if (CombatMovementEnabled)
{
- m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
+ me->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
}
else
{
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
}
}
}
@@ -1017,11 +1017,11 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who)
float fMaxAllowedRange = (*itr).Event.ooc_los.maxRange;
//if range is ok and we are actually in LOS
- if (m_creature->IsWithinDistInMap(who, fMaxAllowedRange) && m_creature->IsWithinLOSInMap(who))
+ if (me->IsWithinDistInMap(who, fMaxAllowedRange) && me->IsWithinLOSInMap(who))
{
//if friendly event&&who is not hostile OR hostile event&&who is hostile
- if (((*itr).Event.ooc_los.noHostile && !m_creature->IsHostileTo(who)) ||
- ((!(*itr).Event.ooc_los.noHostile) && m_creature->IsHostileTo(who)))
+ if (((*itr).Event.ooc_los.noHostile && !me->IsHostileTo(who)) ||
+ ((!(*itr).Event.ooc_los.noHostile) && me->IsHostileTo(who)))
ProcessEvent(*itr, who);
}
}
@@ -1092,8 +1092,8 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
break;
case EVENT_T_RANGE:
if (me->getVictim())
- if (m_creature->IsInMap(m_creature->getVictim()))
- if (m_creature->IsInRange(m_creature->getVictim(),(float)(*i).Event.range.minDist,(float)(*i).Event.range.maxDist))
+ if (me->IsInMap(me->getVictim()))
+ if (me->IsInRange(me->getVictim(),(float)(*i).Event.range.minDist,(float)(*i).Event.range.maxDist))
ProcessEvent(*i);
break;
}
@@ -1141,9 +1141,9 @@ inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoke
switch (Target)
{
case TARGET_T_SELF:
- return m_creature;
+ return me;
case TARGET_T_HOSTILE:
- return m_creature->getVictim();
+ return me->getVictim();
case TARGET_T_HOSTILE_SECOND_AGGRO:
return SelectTarget(SELECT_TARGET_TOPAGGRO,1);
case TARGET_T_HOSTILE_LAST_AGGRO:
@@ -1161,15 +1161,15 @@ inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoke
Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
{
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Unit* pUnit = NULL;
- Trinity::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
- Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
+ Trinity::MostHPMissingInRange u_check(me, range, MinHPDiff);
+ Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, pUnit, u_check);
/*
typedef TYPELIST_4(GameObject, Creature*except pets*, DynamicObject, Corpse*Bones*) AllGridObjectTypes;
@@ -1177,38 +1177,38 @@ Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
*/
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange>, GridTypeMapContainer > grid_unit_searcher(searcher);
- cell.Visit(p, grid_unit_searcher, *m_creature->GetMap(), *m_creature, range);
+ cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, range);
return pUnit;
}
void CreatureEventAI::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
{
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::FriendlyCCedInRange u_check(m_creature, range);
- Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(m_creature, _list, u_check);
+ Trinity::FriendlyCCedInRange u_check(me, range);
+ Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, _list, u_check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
- cell.Visit(p, grid_creature_searcher, *m_creature->GetMap());
+ cell.Visit(p, grid_creature_searcher, *me->GetMap());
}
void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid)
{
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
- Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(m_creature, _list, u_check);
+ Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid);
+ Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, _list, u_check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
- cell.Visit(p, grid_creature_searcher, *m_creature->GetMap());
+ cell.Visit(p, grid_creature_searcher, *me->GetMap());
}
//*********************************
@@ -1311,7 +1311,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge
return false;
//Unit is out of range of this spell
- if (!m_creature->IsInRange(Target,TempRange->minRangeHostile,TempRange->maxRangeHostile))
+ if (!me->IsInRange(Target,TempRange->minRangeHostile,TempRange->maxRangeHostile))
return false;
return true;
@@ -1341,12 +1341,12 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
void CreatureEventAI::DamageTaken(Unit* done_by, uint32& damage)
{
- if (InvinceabilityHpLevel > 0 && m_creature->GetHealth() < InvinceabilityHpLevel+damage)
+ if (InvinceabilityHpLevel > 0 && me->GetHealth() < InvinceabilityHpLevel+damage)
{
- if (m_creature->GetHealth() <= InvinceabilityHpLevel)
+ if (me->GetHealth() <= InvinceabilityHpLevel)
damage = 0;
else
- damage = m_creature->GetHealth() - InvinceabilityHpLevel;
+ damage = me->GetHealth() - InvinceabilityHpLevel;
}
}
@@ -1362,12 +1362,12 @@ bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& e
return true;
case SPAWNED_EVENT_MAP:
// map ID check
- return m_creature->GetMapId() == event.spawned.conditionValue1;
+ return me->GetMapId() == event.spawned.conditionValue1;
case SPAWNED_EVENT_ZONE:
{
// zone ID check
uint32 zone, area;
- m_creature->GetZoneAndAreaId(zone,area);
+ me->GetZoneAndAreaId(zone,area);
return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1;
}
default:
diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h
index 96845524131..921d0facc12 100644
--- a/src/game/CreatureEventAI.h
+++ b/src/game/CreatureEventAI.h
@@ -123,7 +123,7 @@ enum EventAI_ActionType
enum Target
{
- //Self (m_creature)
+ //Self (me)
TARGET_T_SELF = 0, //Self cast
//Hostile targets (if pet then returns pet owner)
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index 9143f14d0dd..7b860af1d1e 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -943,7 +943,7 @@ namespace Trinity
class NearestHostileUnitInAttackDistanceCheck
{
public:
- explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : m_creature(creature)
+ explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : me(creature)
{
m_range = (dist == 0 ? 9999 : dist);
m_force = (dist == 0 ? false : true);
@@ -951,26 +951,26 @@ namespace Trinity
bool operator()(Unit* u)
{
// TODO: addthreat for every enemy in range?
- if (!m_creature->IsWithinDistInMap(u, m_range))
+ if (!me->IsWithinDistInMap(u, m_range))
return false;
if (m_force)
{
- if (!m_creature->canAttack(u))
+ if (!me->canAttack(u))
return false;
}
else
{
- if (!m_creature->canStartAttack(u, false))
+ if (!me->canStartAttack(u, false))
return false;
}
- m_range = m_creature->GetDistance(u);
+ m_range = me->GetDistance(u);
return true;
}
float GetLastRange() const { return m_range; }
private:
- Creature const *m_creature;
+ Creature const *me;
float m_range;
bool m_force;
NearestHostileUnitInAttackDistanceCheck(NearestHostileUnitInAttackDistanceCheck const&);
diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp
index dbabea7a6af..108e15b607a 100644
--- a/src/game/GuardAI.cpp
+++ b/src/game/GuardAI.cpp
@@ -40,15 +40,15 @@ GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(STATE_NO
void GuardAI::MoveInLineOfSight(Unit *u)
{
// Ignore Z for flying creatures
- if (!m_creature->canFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE)
return;
- if (!m_creature->getVictim() && m_creature->canAttack(u) &&
- (u->IsHostileToPlayers() || m_creature->IsHostileTo(u) /*|| u->getVictim() && m_creature->IsFriendlyTo(u->getVictim())*/) &&
- u->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && me->canAttack(u) &&
+ (u->IsHostileToPlayers() || me->IsHostileTo(u) /*|| u->getVictim() && me->IsFriendlyTo(u->getVictim())*/) &&
+ u->isInAccessiblePlaceFor(me))
{
- float attackRadius = m_creature->GetAttackDistance(u);
- if (m_creature->IsWithinDistInMap(u,attackRadius))
+ float attackRadius = me->GetAttackDistance(u);
+ if (me->IsWithinDistInMap(u,attackRadius))
{
//Need add code to let guard support player
AttackStart(u);
@@ -59,80 +59,80 @@ void GuardAI::MoveInLineOfSight(Unit *u)
void GuardAI::EnterEvadeMode()
{
- if (!m_creature->isAlive())
+ if (!me->isAlive())
{
- DEBUG_LOG("Creature stopped attacking because he's dead [guid=%u]", m_creature->GetGUIDLow());
- m_creature->GetMotionMaster()->MoveIdle();
+ DEBUG_LOG("Creature stopped attacking because he's dead [guid=%u]", me->GetGUIDLow());
+ me->GetMotionMaster()->MoveIdle();
i_state = STATE_NORMAL;
i_victimGuid = 0;
- m_creature->CombatStop(true);
- m_creature->DeleteThreatList();
+ me->CombatStop(true);
+ me->DeleteThreatList();
return;
}
- Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid);
+ Unit* victim = ObjectAccessor::GetUnit(*me, i_victimGuid);
if (!victim)
{
- DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", me->GetGUIDLow());
}
else if (!victim ->isAlive())
{
- DEBUG_LOG("Creature stopped attacking because victim is dead [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow());
}
else if (victim ->HasStealthAura())
{
- DEBUG_LOG("Creature stopped attacking because victim is using stealth [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow());
}
else if (victim ->isInFlight())
{
- DEBUG_LOG("Creature stopped attacking because victim is flying away [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow());
}
else
{
- DEBUG_LOG("Creature stopped attacking because victim outran him [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow());
}
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
i_victimGuid = 0;
- m_creature->CombatStop(true);
+ me->CombatStop(true);
i_state = STATE_NORMAL;
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MoveTargetedHome();
}
void GuardAI::UpdateAI(const uint32 /*diff*/)
{
- // update i_victimGuid if m_creature->getVictim() !=0 and changed
+ // update i_victimGuid if me->getVictim() !=0 and changed
if (!UpdateVictim())
return;
- i_victimGuid = m_creature->getVictim()->GetGUID();
+ i_victimGuid = me->getVictim()->GetGUID();
- if (m_creature->isAttackReady())
+ if (me->isAttackReady())
{
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
bool GuardAI::IsVisible(Unit *pl) const
{
- return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER))
- && pl->isVisibleForOrDetect(m_creature,true);
+ return me->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER))
+ && pl->isVisibleForOrDetect(me,true);
}
void GuardAI::JustDied(Unit *killer)
{
if (Player* pkiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
- m_creature->SendZoneUnderAttackMessage(pkiller);
+ me->SendZoneUnderAttackMessage(pkiller);
}
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index e8b21e807cf..09ec8fae53f 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -51,36 +51,36 @@ void PetAI::EnterEvadeMode()
bool PetAI::_needToStop() const
{
// This is needed for charmed creatures, as once their target was reset other effects can trigger threat
- if (m_creature->isCharmed() && m_creature->getVictim() == m_creature->GetCharmer())
+ if (me->isCharmed() && me->getVictim() == me->GetCharmer())
return true;
- return !m_creature->canAttack(m_creature->getVictim());
+ return !me->canAttack(me->getVictim());
}
void PetAI::_stopAttack()
{
- if (!m_creature->isAlive())
+ if (!me->isAlive())
{
- DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", m_creature->GetGUIDLow());
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->CombatStop();
- m_creature->getHostileRefManager().deleteReferences();
+ DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->CombatStop();
+ me->getHostileRefManager().deleteReferences();
return;
}
- m_creature->AttackStop();
+ me->AttackStop();
me->GetCharmInfo()->SetIsCommandAttack(false);
HandleReturnMovement();
}
void PetAI::UpdateAI(const uint32 diff)
{
- if (!m_creature->isAlive())
+ if (!me->isAlive())
return;
- Unit* owner = m_creature->GetCharmerOrOwner();
+ Unit* owner = me->GetCharmerOrOwner();
if (m_updateAlliesTimer <= diff)
// UpdateAllies self set update timer
@@ -88,19 +88,19 @@ void PetAI::UpdateAI(const uint32 diff)
else
m_updateAlliesTimer -= diff;
- // m_creature->getVictim() can't be used for check in case stop fighting, m_creature->getVictim() clear at Unit death etc.
- if (m_creature->getVictim())
+ // me->getVictim() can't be used for check in case stop fighting, me->getVictim() clear at Unit death etc.
+ if (me->getVictim())
{
if (_needToStop())
{
- DEBUG_LOG("Pet AI stoped attacking [guid=%u]", m_creature->GetGUIDLow());
+ DEBUG_LOG("Pet AI stoped attacking [guid=%u]", me->GetGUIDLow());
_stopAttack();
return;
}
DoMeleeAttackIfReady();
}
- else if (owner && m_creature->GetCharmInfo()) //no victim
+ else if (owner && me->GetCharmInfo()) //no victim
{
Unit *nextTarget = SelectNextTarget();
@@ -109,21 +109,21 @@ void PetAI::UpdateAI(const uint32 diff)
else
HandleReturnMovement();
}
- else if (owner && !m_creature->hasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
- m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, m_creature->GetFollowAngle());
+ else if (owner && !me->hasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
+ me->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, me->GetFollowAngle());
if (!me->GetCharmInfo())
return;
// Autocast (casted only in combat or persistent spells in any state)
- if (m_creature->GetGlobalCooldown() == 0 && !m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->GetGlobalCooldown() == 0 && !me->hasUnitState(UNIT_STAT_CASTING))
{
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
TargetSpellList targetSpellStore;
- for (uint8 i = 0; i < m_creature->GetPetAutoSpellSize(); ++i)
+ for (uint8 i = 0; i < me->GetPetAutoSpellSize(); ++i)
{
- uint32 spellID = m_creature->GetPetAutoSpellOnPos(i);
+ uint32 spellID = me->GetPetAutoSpellOnPos(i);
if (!spellID)
continue;
@@ -161,12 +161,12 @@ void PetAI::UpdateAI(const uint32 diff)
continue;
}
- Spell *spell = new Spell(m_creature, spellInfo, false, 0);
+ Spell *spell = new Spell(me, spellInfo, false, 0);
// Fix to allow pets on STAY to autocast
if (me->getVictim() && _CanAttack(me->getVictim()) && spell->CanAutoCast(me->getVictim()))
{
- targetSpellStore.push_back(std::make_pair<Unit*, Spell*>(m_creature->getVictim(), spell));
+ targetSpellStore.push_back(std::make_pair<Unit*, Spell*>(me->getVictim(), spell));
continue;
}
else
@@ -174,7 +174,7 @@ void PetAI::UpdateAI(const uint32 diff)
bool spellUsed = false;
for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
{
- Unit* Target = ObjectAccessor::GetUnit(*m_creature,*tar);
+ Unit* Target = ObjectAccessor::GetUnit(*me,*tar);
//only buff targets that are in combat, unless the spell can only be cast while out of combat
if (!Target)
@@ -205,17 +205,17 @@ void PetAI::UpdateAI(const uint32 diff)
SpellCastTargets targets;
targets.setUnitTarget(target);
- if (!m_creature->HasInArc(M_PI, target))
+ if (!me->HasInArc(M_PI, target))
{
- m_creature->SetInFront(target);
+ me->SetInFront(target);
if (target && target->GetTypeId() == TYPEID_PLAYER)
- m_creature->SendUpdateToPlayer(target->ToPlayer());
+ me->SendUpdateToPlayer(target->ToPlayer());
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- m_creature->SendUpdateToPlayer(owner->ToPlayer());
+ me->SendUpdateToPlayer(owner->ToPlayer());
}
- m_creature->AddCreatureSpellCooldown(spell->m_spellInfo->Id);
+ me->AddCreatureSpellCooldown(spell->m_spellInfo->Id);
spell->prepare(&targets);
}
@@ -228,7 +228,7 @@ void PetAI::UpdateAI(const uint32 diff)
void PetAI::UpdateAllies()
{
- Unit* owner = m_creature->GetCharmerOrOwner();
+ Unit* owner = me->GetCharmerOrOwner();
Group *pGroup = NULL;
m_updateAlliesTimer = 10*IN_MILISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance
@@ -246,7 +246,7 @@ void PetAI::UpdateAllies()
return;
m_AllySet.clear();
- m_AllySet.insert(m_creature->GetGUID());
+ m_AllySet.insert(me->GetGUID());
if (pGroup) //add group
{
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp
index 661d9ff3cb7..fdca6314747 100644
--- a/src/game/ReactorAI.cpp
+++ b/src/game/ReactorAI.cpp
@@ -44,16 +44,16 @@ ReactorAI::MoveInLineOfSight(Unit *)
void
ReactorAI::UpdateAI(const uint32 /*time_diff*/)
{
- // update i_victimGuid if m_creature->getVictim() !=0 and changed
+ // update i_victimGuid if me->getVictim() !=0 and changed
if (!UpdateVictim())
return;
- if (m_creature->isAttackReady())
+ if (me->isAttackReady())
{
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
diff --git a/src/game/ScriptedCreature.cpp b/src/game/ScriptedCreature.cpp
index 9e5bdb4c3f6..48f17463824 100644
--- a/src/game/ScriptedCreature.cpp
+++ b/src/game/ScriptedCreature.cpp
@@ -22,7 +22,7 @@ void SummonList::DoZoneInCombat(uint32 entry)
{
for (iterator i = begin(); i != end();)
{
- Creature *summon = Unit::GetCreature(*m_creature, *i);
+ Creature *summon = Unit::GetCreature(*me, *i);
++i;
if (summon && summon->IsAIEnabled
&& (!entry || summon->GetEntry() == entry))
@@ -34,7 +34,7 @@ void SummonList::DoAction(uint32 entry, uint32 info)
{
for (iterator i = begin(); i != end();)
{
- Creature *summon = Unit::GetCreature(*m_creature, *i);
+ Creature *summon = Unit::GetCreature(*me, *i);
++i;
if (summon && summon->IsAIEnabled
&& (!entry || summon->GetEntry() == entry))
@@ -46,7 +46,7 @@ void SummonList::DespawnEntry(uint32 entry)
{
for (iterator i = begin(); i != end();)
{
- Creature *summon = Unit::GetCreature(*m_creature, *i);
+ Creature *summon = Unit::GetCreature(*me, *i);
if (!summon)
erase(i++);
else if (summon->GetEntry() == entry)
@@ -64,7 +64,7 @@ void SummonList::DespawnAll()
{
while (!empty())
{
- Creature *summon = Unit::GetCreature(*m_creature, *begin());
+ Creature *summon = Unit::GetCreature(*me, *begin());
if (!summon)
erase(begin());
else
@@ -82,13 +82,13 @@ void SummonList::DespawnAll()
}
ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),
- m_creature(pCreature),
+ me(pCreature),
IsFleeing(false),
m_bCombatMovement(true),
m_uiEvadeCheckCooldown(2500)
{
- m_heroicMode = m_creature->GetMap()->IsHeroic();
- m_difficulty = Difficulty(m_creature->GetMap()->GetSpawnMode());
+ m_heroicMode = me->GetMap()->IsHeroic();
+ m_difficulty = Difficulty(me->GetMap()->GetSpawnMode());
}
void ScriptedAI::AttackStartNoMove(Unit* pWho)
@@ -96,7 +96,7 @@ void ScriptedAI::AttackStartNoMove(Unit* pWho)
if (!pWho)
return;
- if (m_creature->Attack(pWho, false))
+ if (me->Attack(pWho, false))
DoStartNoMovement(pWho);
}
@@ -106,13 +106,13 @@ void ScriptedAI::UpdateAI(const uint32 uiDiff)
if (!UpdateVictim())
return;
- if (m_creature->isAttackReady())
+ if (me->isAttackReady())
{
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
@@ -120,7 +120,7 @@ void ScriptedAI::UpdateAI(const uint32 uiDiff)
void ScriptedAI::DoStartMovement(Unit* pVictim, float fDistance, float fAngle)
{
if (pVictim)
- m_creature->GetMotionMaster()->MoveChase(pVictim, fDistance, fAngle);
+ me->GetMotionMaster()->MoveChase(pVictim, fDistance, fAngle);
}
void ScriptedAI::DoStartNoMovement(Unit* pVictim)
@@ -128,22 +128,22 @@ void ScriptedAI::DoStartNoMovement(Unit* pVictim)
if (!pVictim)
return;
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
}
void ScriptedAI::DoStopAttack()
{
- if (m_creature->getVictim())
- m_creature->AttackStop();
+ if (me->getVictim())
+ me->AttackStop();
}
void ScriptedAI::DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered)
{
- if (!pTarget || m_creature->IsNonMeleeSpellCasted(false))
+ if (!pTarget || me->IsNonMeleeSpellCasted(false))
return;
- m_creature->StopMoving();
- m_creature->CastSpell(pTarget, pSpellInfo, bTriggered);
+ me->StopMoving();
+ me->CastSpell(pTarget, pSpellInfo, bTriggered);
}
void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId)
@@ -162,13 +162,13 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId)
Creature* ScriptedAI::DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime)
{
- return m_creature->SummonCreature(uiId, m_creature->GetPositionX()+fX, m_creature->GetPositionY()+fY, m_creature->GetPositionZ()+fZ, fAngle, (TempSummonType)uiType, uiDespawntime);
+ return me->SummonCreature(uiId, me->GetPositionX()+fX, me->GetPositionY()+fY, me->GetPositionZ()+fZ, fAngle, (TempSummonType)uiType, uiDespawntime);
}
Unit* ScriptedAI::SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition)
{
//ThreatList m_threatlist;
- std::list<HostileReference*>& threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::iterator itr = threatlist.begin();
std::list<HostileReference*>::reverse_iterator ritr = threatlist.rbegin();
@@ -179,17 +179,17 @@ Unit* ScriptedAI::SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition)
{
case SELECT_TARGET_RANDOM:
advance (itr , uiPosition + (rand() % (threatlist.size() - uiPosition)));
- return Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
+ return Unit::GetUnit((*me),(*itr)->getUnitGuid());
break;
case SELECT_TARGET_TOPAGGRO:
advance (itr , uiPosition);
- return Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
+ return Unit::GetUnit((*me),(*itr)->getUnitGuid());
break;
case SELECT_TARGET_BOTTOMAGGRO:
advance (ritr , uiPosition);
- return Unit::GetUnit((*m_creature),(*ritr)->getUnitGuid());
+ return Unit::GetUnit((*me),(*ritr)->getUnitGuid());
break;
default:
@@ -206,7 +206,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u
return false;
//Silenced so we can't cast
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return false;
//Using the extended script system we first create a list of viable spells
@@ -221,7 +221,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u
//Check if each spell is viable(set it to null if not)
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
{
- pTempSpell = GetSpellStore()->LookupEntry(m_creature->m_spells[i]);
+ pTempSpell = GetSpellStore()->LookupEntry(me->m_spells[i]);
//This spell doesn't exist
if (!pTempSpell)
@@ -229,11 +229,11 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u
// Targets and Effects checked first as most used restrictions
//Check the spell targets if specified
- if (selectTargets && !(SpellSummary[m_creature->m_spells[i]].Targets & (1 << (selectTargets-1))))
+ if (selectTargets && !(SpellSummary[me->m_spells[i]].Targets & (1 << (selectTargets-1))))
continue;
//Check the type of spell if we are looking for a specific spell type
- if (selectEffects && !(SpellSummary[m_creature->m_spells[i]].Effects & (1 << (selectEffects-1))))
+ if (selectEffects && !(SpellSummary[me->m_spells[i]].Effects & (1 << (selectEffects-1))))
continue;
//Check for school if specified
@@ -252,7 +252,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u
continue;
//Continue if we don't have the mana to actually cast this spell
- if (pTempSpell->manaCost > m_creature->GetPower((Powers)pTempSpell->powerType))
+ if (pTempSpell->manaCost > me->GetPower((Powers)pTempSpell->powerType))
continue;
//Get the Range
@@ -263,13 +263,13 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u
continue;
//Check if the spell meets our range requirements
- if (fRangeMin && m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange) < fRangeMin)
+ if (fRangeMin && me->GetSpellMinRangeForTarget(pTarget, pTempRange) < fRangeMin)
continue;
- if (fRangeMax && m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange) > fRangeMax)
+ if (fRangeMax && me->GetSpellMaxRangeForTarget(pTarget, pTempRange) > fRangeMax)
continue;
//Check if our target is in range
- if (m_creature->IsWithinDistInMap(pTarget, m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !m_creature->IsWithinDistInMap(pTarget, m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
+ if (me->IsWithinDistInMap(pTarget, me->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !me->IsWithinDistInMap(pTarget, me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
continue;
//All good so lets add it to the spell list
@@ -305,7 +305,7 @@ bool ScriptedAI::CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggere
return false;
//Unit is out of range of this spell
- if (me->IsInRange(pTarget, m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange), m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
+ if (me->IsInRange(pTarget, me->GetSpellMinRangeForTarget(pTarget, pTempRange), me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
return false;
return true;
@@ -398,17 +398,17 @@ void FillSpellSummary()
void ScriptedAI::DoResetThreat()
{
- if (!m_creature->CanHaveThreatList() || m_creature->getThreatManager().isThreatListEmpty())
+ if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
{
- error_log("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (m_creature entry = %d)", m_creature->GetEntry());
+ error_log("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
return;
}
- std::list<HostileReference*>& threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && DoGetThreat(pUnit))
DoModifyThreatPercent(pUnit, -100);
@@ -418,19 +418,19 @@ void ScriptedAI::DoResetThreat()
float ScriptedAI::DoGetThreat(Unit* pUnit)
{
if (!pUnit) return 0.0f;
- return m_creature->getThreatManager().getThreat(pUnit);
+ return me->getThreatManager().getThreat(pUnit);
}
void ScriptedAI::DoModifyThreatPercent(Unit* pUnit, int32 pct)
{
if (!pUnit) return;
- m_creature->getThreatManager().modifyThreatPercent(pUnit, pct);
+ me->getThreatManager().modifyThreatPercent(pUnit, pct);
}
void ScriptedAI::DoTeleportTo(float fX, float fY, float fZ, uint32 uiTime)
{
- m_creature->Relocate(fX, fY, fZ);
- m_creature->SendMonsterMove(fX, fY, fZ, uiTime);
+ me->Relocate(fX, fY, fZ);
+ me->SendMonsterMove(fX, fY, fZ, uiTime);
}
void ScriptedAI::DoTeleportTo(const float fPos[4])
@@ -443,7 +443,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo
if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER)
{
if (pUnit)
- error_log("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", m_creature->GetGUID(), m_creature->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO);
+ error_log("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO);
return;
}
@@ -452,7 +452,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo
void ScriptedAI::DoTeleportAll(float fX, float fY, float fZ, float fO)
{
- Map *map = m_creature->GetMap();
+ Map *map = me->GetMap();
if (!map->IsDungeon())
return;
@@ -460,15 +460,15 @@ void ScriptedAI::DoTeleportAll(float fX, float fY, float fZ, float fO)
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
if (i_pl->isAlive())
- i_pl->TeleportTo(m_creature->GetMapId(), fX, fY, fZ, fO, TELE_TO_NOT_LEAVE_COMBAT);
+ i_pl->TeleportTo(me->GetMapId(), fX, fY, fZ, fO, TELE_TO_NOT_LEAVE_COMBAT);
}
Unit* ScriptedAI::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff)
{
Unit* pUnit = NULL;
- Trinity::MostHPMissingInRange u_check(m_creature, fRange, uiMinHPDiff);
- Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
- m_creature->VisitNearbyObject(fRange, searcher);
+ Trinity::MostHPMissingInRange u_check(me, fRange, uiMinHPDiff);
+ Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, pUnit, u_check);
+ me->VisitNearbyObject(fRange, searcher);
return pUnit;
}
@@ -476,18 +476,18 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff)
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float fRange)
{
std::list<Creature*> pList;
- Trinity::FriendlyCCedInRange u_check(m_creature, fRange);
- Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(m_creature, pList, u_check);
- m_creature->VisitNearbyObject(fRange, searcher);
+ Trinity::FriendlyCCedInRange u_check(me, fRange);
+ Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, pList, u_check);
+ me->VisitNearbyObject(fRange, searcher);
return pList;
}
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellid)
{
std::list<Creature*> pList;
- Trinity::FriendlyMissingBuffInRange u_check(m_creature, fRange, uiSpellid);
- Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(m_creature, pList, u_check);
- m_creature->VisitNearbyObject(fRange, searcher);
+ Trinity::FriendlyMissingBuffInRange u_check(me, fRange, uiSpellid);
+ Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, pList, u_check);
+ me->VisitNearbyObject(fRange, searcher);
return pList;
}
@@ -495,16 +495,16 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange)
{
Player* pPlayer = NULL;
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::PlayerAtMinimumRangeAway check(m_creature, fMinimumRange);
- Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway> searcher(m_creature, pPlayer, check);
+ Trinity::PlayerAtMinimumRangeAway check(me, fMinimumRange);
+ Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway> searcher(me, pPlayer, check);
TypeContainerVisitor<Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
- cell.Visit(pair, visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, visitor, *(me->GetMap()));
return pPlayer;
}
@@ -513,20 +513,20 @@ void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 ui
{
if (bLoadDefault)
{
- if (CreatureInfo const* pInfo = GetCreatureTemplateStore(m_creature->GetEntry()))
- m_creature->LoadEquipment(pInfo->equipmentId,true);
+ if (CreatureInfo const* pInfo = GetCreatureTemplateStore(me->GetEntry()))
+ me->LoadEquipment(pInfo->equipmentId,true);
return;
}
if (uiMainHand >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
if (uiOffHand >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
if (uiRanged >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
}
void ScriptedAI::SetCombatMovement(bool bCombatMove)
@@ -554,21 +554,21 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
return false;
}
- if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
+ if (me->IsInEvadeMode() || !me->getVictim())
return false;
- float fX = m_creature->GetPositionX();
- float fY = m_creature->GetPositionY();
- float fZ = m_creature->GetPositionZ();
+ float fX = me->GetPositionX();
+ float fY = me->GetPositionY();
+ float fZ = me->GetPositionZ();
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case NPC_BROODLORD: // broodlord (not move down stairs)
if (fZ > 448.60f)
return false;
break;
case NPC_VOID_REAVER: // void reaver (calculate from center of room)
- if (m_creature->GetDistance2d(432.59f, 371.93f) < 105.0f)
+ if (me->GetDistance2d(432.59f, 371.93f) < 105.0f)
return false;
break;
case NPC_JAN_ALAI: // jan'alai (calculate by Z)
@@ -580,7 +580,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
return false;
break;
default:
- error_log("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", m_creature->GetEntry());
+ error_log("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", me->GetEntry());
return false;
}
@@ -593,7 +593,7 @@ void Scripted_NoMovementAI::AttackStart(Unit* pWho)
if (!pWho)
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
DoStartNoMovement(pWho);
}
diff --git a/src/game/ScriptedCreature.h b/src/game/ScriptedCreature.h
index 605bc7c3bc3..b416b9f3781 100644
--- a/src/game/ScriptedCreature.h
+++ b/src/game/ScriptedCreature.h
@@ -29,7 +29,7 @@ class ScriptedInstance;
class SummonList : public std::list<uint64>
{
public:
- explicit SummonList(Creature* creature) : m_creature(creature) {}
+ explicit SummonList(Creature* creature) : me(creature) {}
void Summon(Creature *summon) { push_back(summon->GetGUID()); }
void Despawn(Creature *summon) { remove(summon->GetGUID()); }
void DespawnEntry(uint32 entry);
@@ -37,7 +37,7 @@ class SummonList : public std::list<uint64>
void DoAction(uint32 entry, uint32 info);
void DoZoneInCombat(uint32 entry = 0);
private:
- Creature *m_creature;
+ Creature *me;
};
struct ScriptedAI : public CreatureAI
@@ -86,7 +86,7 @@ struct ScriptedAI : public CreatureAI
//*************
//Pointer to creature we are manipulating
- Creature* m_creature;
+ Creature* me;
//For fleeing
bool IsFleeing;
@@ -144,16 +144,16 @@ struct ScriptedAI : public CreatureAI
//Returns a list of all friendly units missing a specific buff within range
std::list<Creature*> DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId);
- //Return a player with at least minimumRange from m_creature
+ //Return a player with at least minimumRange from me
Player* GetPlayerAtMinimumRange(float fMinimumRange);
- //Spawns a creature relative to m_creature
+ //Spawns a creature relative to me
Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime);
//Selects a unit from the creature's current aggro list
Unit* SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition);
- bool HealthBelowPct(uint32 pct) const { return me->GetHealth() * 100 < m_creature->GetMaxHealth() * pct; }
+ bool HealthBelowPct(uint32 pct) const { return me->GetHealth() * 100 < me->GetMaxHealth() * pct; }
//Returns spells that meet the specified criteria from the creatures spell list
SpellEntry const* SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect);
@@ -238,7 +238,7 @@ struct Scripted_NoMovementAI : public ScriptedAI
Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {}
virtual ~Scripted_NoMovementAI() {}
- //Called at each attack of m_creature by any victim
+ //Called at each attack of me by any victim
void AttackStart(Unit* who);
};
diff --git a/src/game/ScriptedEscortAI.cpp b/src/game/ScriptedEscortAI.cpp
index 445974eedfd..1ad1cf18d74 100644
--- a/src/game/ScriptedEscortAI.cpp
+++ b/src/game/ScriptedEscortAI.cpp
@@ -39,13 +39,13 @@ void npc_escortAI::AttackStart(Unit* pWho)
if (!pWho)
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
- m_creature->GetMotionMaster()->MovementExpired();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
if (IsCombatMovement())
- m_creature->GetMotionMaster()->MoveChase(pWho);
+ me->GetMotionMaster()->MoveChase(pWho);
}
}
@@ -56,7 +56,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
return false;
//experimental (unknown) flag not present
- if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
+ if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
return false;
//not a player
@@ -64,22 +64,22 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
return false;
//never attack friendly
- if (m_creature->IsFriendlyTo(pWho))
+ if (me->IsFriendlyTo(pWho))
return false;
//too far away and no free sight?
- if (m_creature->IsWithinDistInMap(pWho, GetMaxPlayerDistance()) && m_creature->IsWithinLOSInMap(pWho))
+ if (me->IsWithinDistInMap(pWho, GetMaxPlayerDistance()) && me->IsWithinLOSInMap(pWho))
{
//already fighting someone?
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
AttackStart(pWho);
return true;
}
else
{
- pWho->SetInCombatWith(m_creature);
- m_creature->AddThreat(pWho, 0.0f);
+ pWho->SetInCombatWith(me);
+ me->AddThreat(pWho, 0.0f);
return true;
}
}
@@ -89,28 +89,28 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
void npc_escortAI::MoveInLineOfSight(Unit* pWho)
{
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(m_creature))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho))
return;
- if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
- if (m_creature->IsHostileTo(pWho))
+ if (me->IsHostileTo(pWho))
{
- float fAttackRadius = m_creature->GetAttackDistance(pWho);
- if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho))
+ float fAttackRadius = me->GetAttackDistance(pWho);
+ if (me->IsWithinDistInMap(pWho, fAttackRadius) && me->IsWithinLOSInMap(pWho))
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
- else if (m_creature->GetMap()->IsDungeon())
+ else if (me->GetMap()->IsDungeon())
{
- pWho->SetInCombatWith(m_creature);
- m_creature->AddThreat(pWho, 0.0f);
+ pWho->SetInCombatWith(me);
+ me->AddThreat(pWho, 0.0f);
}
}
}
@@ -153,7 +153,7 @@ void npc_escortAI::JustRespawned()
//add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 2500;
- if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A)
+ if (me->getFaction() != me->GetCreatureInfo()->faction_A)
me->RestoreFaction();
Reset();
@@ -162,16 +162,16 @@ void npc_escortAI::JustRespawned()
void npc_escortAI::ReturnToLastPoint()
{
float x, y, z, o;
- m_creature->GetHomePosition(x, y, z, o);
- m_creature->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z);
+ me->GetHomePosition(x, y, z, o);
+ me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z);
}
void npc_escortAI::EnterEvadeMode()
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- m_creature->SetLootRecipient(NULL);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->SetLootRecipient(NULL);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
@@ -181,7 +181,7 @@ void npc_escortAI::EnterEvadeMode()
}
else
{
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
Reset();
}
}
@@ -196,7 +196,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
{
Player* pMember = pRef->getSource();
- if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance()))
+ if (pMember && me->IsWithinDistInMap(pMember, GetMaxPlayerDistance()))
{
return true;
break;
@@ -205,7 +205,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
}
else
{
- if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance()))
+ if (me->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance()))
return true;
}
}
@@ -215,7 +215,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
void npc_escortAI::UpdateAI(const uint32 uiDiff)
{
//Waypoint Updating
- if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_creature->getVictim() && m_uiWPWaitTimer && !HasEscortState(STATE_ESCORT_RETURNING))
+ if (HasEscortState(STATE_ESCORT_ESCORTING) && !me->getVictim() && m_uiWPWaitTimer && !HasEscortState(STATE_ESCORT_RETURNING))
{
if (m_uiWPWaitTimer <= uiDiff)
{
@@ -229,9 +229,9 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (m_bCanReturnToStart)
{
float fRetX, fRetY, fRetZ;
- m_creature->GetRespawnCoord(fRetX, fRetY, fRetZ);
+ me->GetRespawnCoord(fRetX, fRetY, fRetZ);
- m_creature->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ);
+ me->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ);
m_uiWPWaitTimer = 0;
@@ -241,11 +241,11 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (m_bCanInstantRespawn)
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->Respawn();
+ me->setDeathState(JUST_DIED);
+ me->Respawn();
}
else
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -259,7 +259,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (!HasEscortState(STATE_ESCORT_PAUSED))
{
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ me->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
WaypointStart(CurrentWP->id);
@@ -272,7 +272,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
}
//Check if player or any member of his group is within range
- if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !m_creature->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
+ if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
{
if (m_uiPlayerCheckTimer <= uiDiff)
{
@@ -282,11 +282,11 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (m_bCanInstantRespawn)
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->Respawn();
+ me->setDeathState(JUST_DIED);
+ me->Respawn();
}
else
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -318,10 +318,10 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
{
debug_log("TSCR: EscortAI has returned to original position before combat");
- if (m_bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else if (!m_bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else if (!m_bIsRunning && !me->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
RemoveEscortState(STATE_ESCORT_RETURNING);
@@ -340,7 +340,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
//Make sure that we are still on the right waypoint
if (CurrentWP->id != uiPointId)
{
- error_log("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, m_creature->GetEntry());
+ error_log("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, me->GetEntry());
return;
}
@@ -363,12 +363,12 @@ void npc_escortAI::OnPossess(bool apply)
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (apply)
- m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
+ me->GetPosition(LastPos.x, LastPos.y, LastPos.z);
else
{
Returning = true;
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
}
}
}
@@ -394,7 +394,7 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait
void npc_escortAI::FillPointMovementListForCreature()
{
- std::vector<ScriptPointMove> const &pPointsEntries = pSystemMgr.GetPointMoveList(m_creature->GetEntry());
+ std::vector<ScriptPointMove> const &pPointsEntries = pSystemMgr.GetPointMoveList(me->GetEntry());
if (pPointsEntries.empty())
return;
@@ -413,14 +413,14 @@ void npc_escortAI::SetRun(bool bRun)
if (bRun)
{
if (!m_bIsRunning)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
debug_log("TSCR: EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking.");
}
@@ -430,7 +430,7 @@ void npc_escortAI::SetRun(bool bRun)
//TODO: get rid of this many variables passed in function.
void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, const Quest* pQuest, bool bInstantRespawn, bool bCanLoopPath)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
{
error_log("TSCR ERROR: EscortAI attempt to Start while in combat.");
return;
@@ -471,15 +471,15 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID,
if (m_bCanReturnToStart && m_bCanInstantRespawn)
debug_log("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->MoveIdle();
debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
}
//disable npcflags
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
debug_log("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %u", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
@@ -487,9 +487,9 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID,
//Set initial speed
if (m_bIsRunning)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
AddEscortState(STATE_ESCORT_ESCORTING);
}
diff --git a/src/game/ScriptedEscortAI.h b/src/game/ScriptedEscortAI.h
index 8901d4da40c..8b8064007d4 100644
--- a/src/game/ScriptedEscortAI.h
+++ b/src/game/ScriptedEscortAI.h
@@ -83,7 +83,7 @@ struct npc_escortAI : public ScriptedAI
uint64 GetEventStarterGUID() { return m_uiPlayerGUID; }
protected:
- Player* GetPlayerForEscort() { return (Player*)Unit::GetUnit(*m_creature, m_uiPlayerGUID); }
+ Player* GetPlayerForEscort() { return (Player*)Unit::GetUnit(*me, m_uiPlayerGUID); }
private:
bool AssistPlayerInCombat(Unit* pWho);
diff --git a/src/game/ScriptedFollowerAI.cpp b/src/game/ScriptedFollowerAI.cpp
index b47f534556f..657b344469c 100644
--- a/src/game/ScriptedFollowerAI.cpp
+++ b/src/game/ScriptedFollowerAI.cpp
@@ -31,22 +31,22 @@ void FollowerAI::AttackStart(Unit* pWho)
if (!pWho)
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
- if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
- m_creature->clearUnitState(UNIT_STAT_FOLLOW);
+ if (me->hasUnitState(UNIT_STAT_FOLLOW))
+ me->clearUnitState(UNIT_STAT_FOLLOW);
if (IsCombatMovement())
- m_creature->GetMotionMaster()->MoveChase(pWho);
+ me->GetMotionMaster()->MoveChase(pWho);
}
}
//This part provides assistance to a player that are attacked by pWho, even if out of normal aggro range
-//It will cause m_creature to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi)
+//It will cause me to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi)
//The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate.
bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
{
@@ -54,7 +54,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
return false;
//experimental (unknown) flag not present
- if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
+ if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
return false;
//not a player
@@ -62,22 +62,22 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
return false;
//never attack friendly
- if (m_creature->IsFriendlyTo(pWho))
+ if (me->IsFriendlyTo(pWho))
return false;
//too far away and no free sight?
- if (m_creature->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && m_creature->IsWithinLOSInMap(pWho))
+ if (me->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && me->IsWithinLOSInMap(pWho))
{
//already fighting someone?
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
AttackStart(pWho);
return true;
}
else
{
- pWho->SetInCombatWith(m_creature);
- m_creature->AddThreat(pWho, 0.0f);
+ pWho->SetInCombatWith(me);
+ me->AddThreat(pWho, 0.0f);
return true;
}
}
@@ -87,28 +87,28 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
void FollowerAI::MoveInLineOfSight(Unit* pWho)
{
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(m_creature))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho))
return;
- if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
- if (m_creature->IsHostileTo(pWho))
+ if (me->IsHostileTo(pWho))
{
- float fAttackRadius = m_creature->GetAttackDistance(pWho);
- if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho))
+ float fAttackRadius = me->GetAttackDistance(pWho);
+ if (me->IsWithinDistInMap(pWho, fAttackRadius) && me->IsWithinLOSInMap(pWho))
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
- else if (m_creature->GetMap()->IsDungeon())
+ else if (me->GetMap()->IsDungeon())
{
- pWho->SetInCombatWith(m_creature);
- m_creature->AddThreat(pWho, 0.0f);
+ pWho->SetInCombatWith(me);
+ me->AddThreat(pWho, 0.0f);
}
}
}
@@ -149,34 +149,34 @@ void FollowerAI::JustRespawned()
if (!IsCombatMovement())
SetCombatMovement(true);
- if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A)
- m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A);
+ if (me->getFaction() != me->GetCreatureInfo()->faction_A)
+ me->setFaction(me->GetCreatureInfo()->faction_A);
Reset();
}
void FollowerAI::EnterEvadeMode()
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- m_creature->SetLootRecipient(NULL);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->SetLootRecipient(NULL);
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
debug_log("TSCR: FollowerAI left combat, returning to CombatStartPosition.");
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
{
float fPosX, fPosY, fPosZ;
- m_creature->GetPosition(fPosX, fPosY, fPosZ);
- m_creature->GetMotionMaster()->MovePoint(POINT_COMBAT_START, fPosX, fPosY, fPosZ);
+ me->GetPosition(fPosX, fPosY, fPosZ);
+ me->GetMotionMaster()->MovePoint(POINT_COMBAT_START, fPosX, fPosY, fPosZ);
}
}
else
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MoveTargetedHome();
}
Reset();
@@ -184,14 +184,14 @@ void FollowerAI::EnterEvadeMode()
void FollowerAI::UpdateAI(const uint32 uiDiff)
{
- if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !m_creature->getVictim())
+ if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !me->getVictim())
{
if (m_uiUpdateFollowTimer <= uiDiff)
{
if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
{
debug_log("TSCR: FollowerAI is set completed, despawns.");
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -204,7 +204,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
debug_log("TSCR: FollowerAI is returning to leader.");
RemoveFollowState(STATE_FOLLOW_RETURNING);
- m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
return;
}
@@ -214,7 +214,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
{
Player* pMember = pRef->getSource();
- if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
+ if (pMember && me->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
{
bIsMaxRangeExceeded = false;
break;
@@ -223,7 +223,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
}
else
{
- if (m_creature->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE))
+ if (me->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE))
bIsMaxRangeExceeded = false;
}
}
@@ -231,7 +231,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
if (bIsMaxRangeExceeded)
{
debug_log("TSCR: FollowerAI failed because player/group was to far away or not found");
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -265,13 +265,13 @@ void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId)
AddFollowState(STATE_FOLLOW_RETURNING);
}
else
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
}
void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const Quest* pQuest)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
{
debug_log("TSCR: FollowerAI attempt to StartFollow while in combat.");
return;
@@ -287,22 +287,22 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const
m_uiLeaderGUID = pLeader->GetGUID();
if (uiFactionForFollower)
- m_creature->setFaction(uiFactionForFollower);
+ me->setFaction(uiFactionForFollower);
m_pQuestForFollow = pQuest;
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
debug_log("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
}
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
AddFollowState(STATE_FOLLOW_INPROGRESS);
- m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
debug_log("TSCR: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID);
}
@@ -321,7 +321,7 @@ Player* FollowerAI::GetLeaderForFollower()
{
Player* pMember = pRef->getSource();
- if (pMember && pMember->isAlive() && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
+ if (pMember && pMember->isAlive() && me->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
{
debug_log("TSCR: FollowerAI GetLeader changed and returned new leader.");
m_uiLeaderGUID = pMember->GetGUID();
@@ -339,13 +339,13 @@ Player* FollowerAI::GetLeaderForFollower()
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
{
- if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
+ if (me->hasUnitState(UNIT_STAT_FOLLOW))
{
- m_creature->clearUnitState(UNIT_STAT_FOLLOW);
+ me->clearUnitState(UNIT_STAT_FOLLOW);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
}
if (bWithEndEvent)
@@ -368,13 +368,13 @@ void FollowerAI::SetFollowPaused(bool bPaused)
{
AddFollowState(STATE_FOLLOW_PAUSED);
- if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
+ if (me->hasUnitState(UNIT_STAT_FOLLOW))
{
- m_creature->clearUnitState(UNIT_STAT_FOLLOW);
+ me->clearUnitState(UNIT_STAT_FOLLOW);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
}
}
else
@@ -382,6 +382,6 @@ void FollowerAI::SetFollowPaused(bool bPaused)
RemoveFollowState(STATE_FOLLOW_PAUSED);
if (Player* pLeader = GetLeaderForFollower())
- m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
}
diff --git a/src/game/ScriptedGuardAI.cpp b/src/game/ScriptedGuardAI.cpp
index 83cc8c20479..2fbf8bff1cb 100644
--- a/src/game/ScriptedGuardAI.cpp
+++ b/src/game/ScriptedGuardAI.cpp
@@ -45,10 +45,10 @@ void guardAI::Reset()
void guardAI::EnterCombat(Unit *who)
{
- if (m_creature->GetEntry() == 15184)
- DoScriptText(RAND(SAY_GUARD_SIL_AGGRO1,SAY_GUARD_SIL_AGGRO2,SAY_GUARD_SIL_AGGRO3), m_creature, who);
+ if (me->GetEntry() == 15184)
+ DoScriptText(RAND(SAY_GUARD_SIL_AGGRO1,SAY_GUARD_SIL_AGGRO2,SAY_GUARD_SIL_AGGRO3), me, who);
- if (SpellEntry const *spell = m_creature->reachWithSpellAttack(who))
+ if (SpellEntry const *spell = me->reachWithSpellAttack(who))
DoCastSpell(who, spell);
}
@@ -56,7 +56,7 @@ void guardAI::JustDied(Unit *Killer)
{
//Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
if (Player* pKiller = Killer->GetCharmerOrOwnerPlayerOrPlayerItself())
- m_creature->SendZoneUnderAttackMessage(pKiller);
+ me->SendZoneUnderAttackMessage(pKiller);
}
void guardAI::UpdateAI(const uint32 diff)
@@ -67,16 +67,16 @@ 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() && !m_creature->isInCombat())
+ if (me->isAlive() && !me->isInCombat())
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
- SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
+ SpellEntry const *info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
- DoCastSpell(m_creature, info);
+ DoCastSpell(me, info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
@@ -92,77 +92,77 @@ void guardAI::UpdateAI(const uint32 diff)
return;
// Make sure our attack is ready and we arn't currently casting
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 30)
+ info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
+ else info = SelectSpell(me->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//20% chance to replace our white hit with a spell
if (info && rand() % 5 == 0 && !GlobalCooldown)
{
//Cast the spell
- if (Healing)DoCastSpell(m_creature, info);
- else DoCastSpell(m_creature->getVictim(), info);
+ if (Healing)DoCastSpell(me, info);
+ else DoCastSpell(me->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
+ else me->AttackerStateUpdate(me->getVictim());
- m_creature->resetAttackTimer();
+ me->resetAttackTimer();
}
}
else
{
//Only run this code if we arn't already casting
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp ONLY 33% of the time
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 30 && rand() % 3 == 0)
+ info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
+ else info = SelectSpell(me->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
{
//If we are currently moving stop us and set the movement generator
- if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
+ if ((*me).GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
{
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveIdle();
+ (*me).GetMotionMaster()->Clear(false);
+ (*me).GetMotionMaster()->MoveIdle();
}
//Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->getVictim(),info);
+ if (Healing) DoCastSpell(me,info);
+ else DoCastSpell(me->getVictim(),info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
} //If no spells available and we arn't moving run to target
- else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ else if ((*me).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
{
//Cancel our current spell and then mutate new movement generator
- m_creature->InterruptNonMeleeSpells(false);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->InterruptNonMeleeSpells(false);
+ (*me).GetMotionMaster()->Clear(false);
+ (*me).GetMotionMaster()->MoveChase(me->getVictim());
}
}
}
@@ -172,12 +172,12 @@ void guardAI::DoReplyToTextEmote(uint32 em)
{
switch(em)
{
- case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
- case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case TEXTEMOTE_SALUTE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
- case TEXTEMOTE_SHY: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
+ case TEXTEMOTE_KISS: me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_WAVE: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_SALUTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
+ case TEXTEMOTE_SHY: me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
case TEXTEMOTE_RUDE:
- case TEXTEMOTE_CHICKEN: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
+ case TEXTEMOTE_CHICKEN: me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
}
}
diff --git a/src/game/ScriptedSimpleAI.cpp b/src/game/ScriptedSimpleAI.cpp
index 805cd0e866b..08797515837 100644
--- a/src/game/ScriptedSimpleAI.cpp
+++ b/src/game/ScriptedSimpleAI.cpp
@@ -99,11 +99,11 @@ void SimpleAI::EnterCombat(Unit *who)
//Random text
if (Aggro_TextId[random_text])
- DoScriptText(Aggro_TextId[random_text], m_creature, who);
+ DoScriptText(Aggro_TextId[random_text], me, who);
//Random sound
if (Aggro_Sound[random_text])
- DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
+ DoPlaySoundToSet(me, Aggro_Sound[random_text]);
}
void SimpleAI::KilledUnit(Unit *victim)
@@ -112,11 +112,11 @@ void SimpleAI::KilledUnit(Unit *victim)
//Random yell
if (Kill_TextId[random_text])
- DoScriptText(Kill_TextId[random_text], m_creature, victim);
+ DoScriptText(Kill_TextId[random_text], me, victim);
//Random sound
if (Kill_Sound[random_text])
- DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
+ DoPlaySoundToSet(me, Kill_Sound[random_text]);
if (!Kill_Spell)
return;
@@ -126,10 +126,10 @@ void SimpleAI::KilledUnit(Unit *victim)
switch (Kill_Target_Type)
{
case CAST_SELF:
- pTarget = m_creature;
+ pTarget = me;
break;
case CAST_HOSTILE_TARGET:
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
@@ -153,18 +153,18 @@ void SimpleAI::KilledUnit(Unit *victim)
void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
{
//Return if damage taken won't kill us
- if (m_creature->GetHealth() > damage)
+ if (me->GetHealth() > damage)
return;
uint8 random_text = urand(0,2);
//Random yell
if (Death_TextId[random_text])
- DoScriptText(Death_TextId[random_text], m_creature, killer);
+ DoScriptText(Death_TextId[random_text], me, killer);
//Random sound
if (Death_Sound[random_text])
- DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
+ DoPlaySoundToSet(me, Death_Sound[random_text]);
if (!Death_Spell)
return;
@@ -174,10 +174,10 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
switch (Death_Target_Type)
{
case CAST_SELF:
- pTarget = m_creature;
+ pTarget = me;
break;
case CAST_HOSTILE_TARGET:
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
@@ -214,21 +214,21 @@ void SimpleAI::UpdateAI(const uint32 diff)
if (Spell_Timer[i] <= diff)
{
//Check if this is a percentage based
- if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > -Spell[i].First_Cast)
+ if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && me->GetHealth()*100 / me->GetMaxHealth() > -Spell[i].First_Cast)
continue;
//Check Current spell
- if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
+ if (!(Spell[i].InterruptPreviousCast && me->IsNonMeleeSpellCasted(false)))
{
Unit *pTarget = NULL;
switch (Spell[i].Cast_Target_Type)
{
case CAST_SELF:
- pTarget = m_creature;
+ pTarget = me;
break;
case CAST_HOSTILE_TARGET:
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
@@ -244,8 +244,8 @@ void SimpleAI::UpdateAI(const uint32 diff)
//Target is ok, cast a spell on it and then do our random yell
if (pTarget)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
DoCast(pTarget, Spell[i].Spell_Id);
@@ -255,11 +255,11 @@ void SimpleAI::UpdateAI(const uint32 diff)
//Random yell
if (Spell[i].TextId[random_text])
- DoScriptText(Spell[i].TextId[random_text], m_creature, pTarget);
+ DoScriptText(Spell[i].TextId[random_text], me, pTarget);
//Random sound
if (Spell[i].Text_Sound[random_text])
- DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
+ DoPlaySoundToSet(me, Spell[i].Text_Sound[random_text]);
}
}
diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp
index 6102d2ee4d2..a6464f189e8 100644
--- a/src/game/TotemAI.cpp
+++ b/src/game/TotemAI.cpp
@@ -50,20 +50,20 @@ TotemAI::MoveInLineOfSight(Unit *)
void TotemAI::EnterEvadeMode()
{
- m_creature->CombatStop(true);
+ me->CombatStop(true);
}
void
TotemAI::UpdateAI(const uint32 /*diff*/)
{
- if (m_creature->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
+ if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
return;
- if (!m_creature->isAlive() || m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->isAlive() || me->IsNonMeleeSpellCasted(false))
return;
// Search spell
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_creature->ToTotem()->GetSpell());
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(me->ToTotem()->GetSpell());
if (!spellInfo)
return;
@@ -74,17 +74,17 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
// SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems
// pointer to appropriate target if found any
- Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*m_creature, i_victimGuid) : NULL;
+ Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL;
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
if (!victim ||
- !victim->isTargetableForAttack() || !m_creature->IsWithinDistInMap(victim, max_range) ||
- m_creature->IsFriendlyTo(victim) || !victim->isVisibleForOrDetect(m_creature,false))
+ !victim->isTargetableForAttack() || !me->IsWithinDistInMap(victim, max_range) ||
+ me->IsFriendlyTo(victim) || !victim->isVisibleForOrDetect(me,false))
{
victim = NULL;
- Trinity::NearestAttackableUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
- Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(m_creature, victim, u_check);
- m_creature->VisitNearbyObject(max_range, checker);
+ Trinity::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
+ Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
+ me->VisitNearbyObject(max_range, checker);
}
// If have target
@@ -94,8 +94,8 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
i_victimGuid = victim->GetGUID();
// attack
- m_creature->SetInFront(victim); // client change orientation by self
- m_creature->CastSpell(victim, m_creature->ToTotem()->GetSpell(), false);
+ me->SetInFront(victim); // client change orientation by self
+ me->CastSpell(victim, me->ToTotem()->GetSpell(), false);
}
else
i_victimGuid = 0;
@@ -105,12 +105,12 @@ void
TotemAI::AttackStart(Unit *)
{
// Sentry totem sends ping on attack
- if (m_creature->GetEntry() == SENTRY_TOTEM_ENTRY && m_creature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ if (me->GetEntry() == SENTRY_TOTEM_ENTRY && me->GetOwner()->GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(MSG_MINIMAP_PING, (8+4+4));
- data << m_creature->GetGUID();
- data << m_creature->GetPositionX();
- data << m_creature->GetPositionY();
- ((Player*)m_creature->GetOwner())->GetSession()->SendPacket(&data);
+ data << me->GetGUID();
+ data << me->GetPositionX();
+ data << me->GetPositionY();
+ ((Player*)me->GetOwner())->GetSession()->SendPacket(&data);
}
}
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp b/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp
index c908d0ace49..a61fc21d5ba 100644
--- a/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp
+++ b/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp
@@ -82,31 +82,31 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
{
if (!bHasAura)
{
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case NPC_NORTH_MARSHAL:
- DoCast(m_creature,SPELL_NORTH_MARSHAL);
+ DoCast(me,SPELL_NORTH_MARSHAL);
break;
case NPC_SOUTH_MARSHAL:
- DoCast(m_creature,SPELL_SOUTH_MARSHAL);
+ DoCast(me,SPELL_SOUTH_MARSHAL);
break;
case NPC_STONEHEARTH_MARSHAL:
- DoCast(m_creature,SPELL_STONEHEARTH_MARSHAL);
+ DoCast(me,SPELL_STONEHEARTH_MARSHAL);
break;
case NPC_ICEWING_MARSHAL:
- DoCast(m_creature,SPELL_ICEWING_MARSHAL);
+ DoCast(me,SPELL_ICEWING_MARSHAL);
break;
case NPC_EAST_FROSTWOLF_WARMASTER:
- DoCast(m_creature,SPELL_EAST_FROSTWOLF_WARMASTER);
+ DoCast(me,SPELL_EAST_FROSTWOLF_WARMASTER);
break;
case NPC_WEST_FROSTWOLF_WARMASTER:
- DoCast(m_creature,SPELL_WEST_FROSTWOLF_WARMASTER);
+ DoCast(me,SPELL_WEST_FROSTWOLF_WARMASTER);
break;
case NPC_ICEBLOOD_WARMASTER:
- DoCast(m_creature,SPELL_ICEBLOOD_WARMASTER);
+ DoCast(me,SPELL_ICEBLOOD_WARMASTER);
break;
case NPC_TOWER_POINT_WARMASTER:
- DoCast(m_creature,SPELL_TOWER_POINT_WARMASTER);
+ DoCast(me,SPELL_TOWER_POINT_WARMASTER);
break;
}
@@ -118,37 +118,37 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
if (uiChargeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHARGE);
+ DoCast(me->getVictim(), SPELL_CHARGE);
uiChargeTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiChargeTimer -= diff;
if (uiCleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS);
} else uiCleaveTimer -= diff;
if (uiDemoralizingShoutTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEMORALIZING_SHOUT);
+ DoCast(me->getVictim(), SPELL_DEMORALIZING_SHOUT);
uiDemoralizingShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiDemoralizingShoutTimer -= diff;
if (uiWhirlwind1Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND1);
uiWhirlwind1Timer = urand(6*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiWhirlwind1Timer -= diff;
if (uiWhirlwind2Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiEnrageTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENRAGE);
+ DoCast(me->getVictim(), SPELL_ENRAGE);
uiEnrageTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS);
}else uiEnrageTimer -= diff;
@@ -156,7 +156,7 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
- if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp
index 5da4bacb371..d1187748b22 100644
--- a/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp
+++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp
@@ -61,15 +61,15 @@ struct mob_water_elementalAI : public ScriptedAI
if (uiWaterBoltTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
+ DoCast(me->getVictim(), SPELL_WATERBOLT);
uiWaterBoltTimer = 5*IN_MILISECONDS;
} else uiWaterBoltTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer < diff)
{
- if (Creature *pBalinda = Unit::GetCreature(*m_creature, uiBalindaGUID))
- if (m_creature->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
+ if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID))
+ if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -80,7 +80,7 @@ struct mob_water_elementalAI : public ScriptedAI
struct boss_balindaAI : public ScriptedAI
{
- boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(m_creature) {}
+ boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {}
uint32 uiArcaneExplosionTimer;
uint32 uiConeOfColdTimer;
@@ -105,7 +105,7 @@ struct boss_balindaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(YELL_AGGRO, m_creature);
+ DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
@@ -115,9 +115,9 @@ struct boss_balindaAI : public ScriptedAI
void JustSummoned(Creature* summoned)
{
- ((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = m_creature->GetGUID();
+ ((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = me->GetGUID();
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
- summoned->setFaction(m_creature->getFaction());
+ summoned->setFaction(me->getFaction());
Summons.Summon(summoned);
}
@@ -134,31 +134,31 @@ struct boss_balindaAI : public ScriptedAI
if (uiWaterElementalTimer < diff)
{
if (Summons.empty())
- m_creature->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
+ me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
uiWaterElementalTimer = 50*IN_MILISECONDS;
} else uiWaterElementalTimer -= diff;
if (uiArcaneExplosionTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiArcaneExplosionTimer -= diff;
if (uiConeOfColdTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
+ DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiConeOfColdTimer -= diff;
if (uiFireBoltTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ DoCast(me->getVictim(), SPELL_FIREBALL);
uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS);
} else uiFireBoltTimer -= diff;
if (uiFrostboltTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS);
} else uiFrostboltTimer -= diff;
@@ -166,10 +166,10 @@ struct boss_balindaAI : public ScriptedAI
// check if creature is not outside of building
if (uiResetTimer < diff)
{
- if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, m_creature);
+ DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp
index 5b611666347..58caad75968 100644
--- a/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp
+++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp
@@ -63,13 +63,13 @@ struct boss_drektharAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoScriptText(YELL_AGGRO, m_creature);
+ DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
{
Reset();
- DoScriptText(YELL_RESPAWN, m_creature);
+ DoScriptText(YELL_RESPAWN, me);
}
void UpdateAI(const uint32 diff)
@@ -79,41 +79,41 @@ struct boss_drektharAI : public ScriptedAI
if (uiWhirlwindTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS);
} else uiWhirlwindTimer -= diff;
if (uiWhirlwind2Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiKnockdownTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ DoCast(me->getVictim(), SPELL_KNOCKDOWN);
uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiKnockdownTimer -= diff;
if (uiFrenzyTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FRENZY);
+ DoCast(me->getVictim(), SPELL_FRENZY);
uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiFrenzyTimer -= diff;
if (uiYellTimer <= diff)
{
- DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), m_creature);
+ DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me);
uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
} else uiYellTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
- if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, m_creature);
+ DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp
index ac0f39d6eac..5b490b06319 100644
--- a/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp
+++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp
@@ -56,7 +56,7 @@ struct boss_galvangarAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoScriptText(YELL_AGGRO, m_creature);
+ DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
@@ -71,41 +71,41 @@ struct boss_galvangarAI : public ScriptedAI
if (uiCleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS);
} else uiCleaveTimer -= diff;
if (uiFrighteningShoutTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
+ DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiFrighteningShoutTimer -= diff;
if (uiWhirlwind1Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND1);
uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS);
} else uiWhirlwind1Timer -= diff;
if (uiWhirlwind2Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiMortalStrikeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiMortalStrikeTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
- if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, m_creature);
+ DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp
index 959e548f76f..989b78c8892 100644
--- a/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp
+++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp
@@ -61,13 +61,13 @@ struct boss_vanndarAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoScriptText(YELL_AGGRO, m_creature);
+ DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
{
Reset();
- DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), m_creature);
+ DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me);
}
void UpdateAI(const uint32 diff)
@@ -77,35 +77,35 @@ struct boss_vanndarAI : public ScriptedAI
if (uiAvatarTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AVATAR);
+ DoCast(me->getVictim(), SPELL_AVATAR);
uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiAvatarTimer -= diff;
if (uiThunderclapTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiThunderclapTimer -= diff;
if (uiStormboltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STORMBOLT);
+ DoCast(me->getVictim(), SPELL_STORMBOLT);
uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiStormboltTimer -= diff;
if (uiYellTimer <= diff)
{
- DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), m_creature);
+ DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me);
uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
} else uiYellTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
- if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, m_creature);
+ DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/scripts/eastern_kingdoms/arathi_highlands.cpp
index c33dde72dfd..8e74c3ab601 100644
--- a/src/scripts/eastern_kingdoms/arathi_highlands.cpp
+++ b/src/scripts/eastern_kingdoms/arathi_highlands.cpp
@@ -62,38 +62,38 @@ struct npc_professor_phizzlethorpeAI : public npc_escortAI
switch(uiPointId)
{
- case 4:DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer);break;
- case 5:DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer);break;
- case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break;
+ case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break;
+ case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break;
+ case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
case 9:
{
- m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
- m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
- case 10:DoScriptText(SAY_PROGRESS_5, m_creature, pPlayer);break;
+ case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break;
case 11:
- DoScriptText(SAY_PROGRESS_6, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS_6, me, pPlayer);
SetRun();
break;
- case 19:DoScriptText(SAY_PROGRESS_7, m_creature, pPlayer); break;
+ case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break;
case 20:
- DoScriptText(EMOTE_PROGRESS_8, m_creature);
- DoScriptText(SAY_PROGRESS_9, m_creature, pPlayer);
+ DoScriptText(EMOTE_PROGRESS_8, me);
+ DoScriptText(SAY_PROGRESS_9, me, pPlayer);
if (pPlayer)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
void JustSummoned(Creature* pSummoned)
{
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
index f2e7c97f251..2dbf91c72b6 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
@@ -148,7 +148,7 @@ struct npc_grimstoneAI : public npc_escortAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
EventPhase = 0;
Event_Timer = 1000;
@@ -167,7 +167,7 @@ struct npc_grimstoneAI : public npc_escortAI
//TODO: move them to center
void SummonRingMob()
{
- if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
+ if (Creature* tmp = me->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
RingMobGUID[MobCount] = tmp->GetGUID();
++MobCount;
@@ -179,7 +179,7 @@ struct npc_grimstoneAI : public npc_escortAI
//TODO: move them to center
void SummonRingBoss()
{
- if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
+ if (Creature* tmp = me->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
RingBossGUID = tmp->GetGUID();
MobDeath_Timer = 2500;
@@ -190,12 +190,12 @@ struct npc_grimstoneAI : public npc_escortAI
switch(i)
{
case 0:
- DoScriptText(SCRIPT_TEXT1, m_creature);//2
+ DoScriptText(SCRIPT_TEXT1, me);//2
CanWalk = false;
Event_Timer = 5000;
break;
case 1:
- DoScriptText(SCRIPT_TEXT2, m_creature);//4
+ DoScriptText(SCRIPT_TEXT2, me);//4
CanWalk = false;
Event_Timer = 5000;
break;
@@ -203,10 +203,10 @@ struct npc_grimstoneAI : public npc_escortAI
CanWalk = false;
break;
case 3:
- DoScriptText(SCRIPT_TEXT3, m_creature);//5
+ DoScriptText(SCRIPT_TEXT3, me);//5
break;
case 4:
- DoScriptText(SCRIPT_TEXT4, m_creature);//6
+ DoScriptText(SCRIPT_TEXT4, me);//6
CanWalk = false;
Event_Timer = 5000;
break;
@@ -238,7 +238,7 @@ struct npc_grimstoneAI : public npc_escortAI
if (RingBossGUID)
{
- Creature *boss = Unit::GetCreature(*m_creature,RingBossGUID);
+ Creature *boss = Unit::GetCreature(*me,RingBossGUID);
if (boss && !boss->isAlive() && boss->isDead())
{
RingBossGUID = 0;
@@ -251,7 +251,7 @@ struct npc_grimstoneAI : public npc_escortAI
for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
{
- Creature *mob = Unit::GetCreature(*m_creature,RingMobGUID[i]);
+ Creature *mob = Unit::GetCreature(*me,RingMobGUID[i]);
if (mob && !mob->isAlive() && mob->isDead())
{
RingMobGUID[i] = 0;
@@ -275,7 +275,7 @@ struct npc_grimstoneAI : public npc_escortAI
switch(EventPhase)
{
case 0:
- DoScriptText(SCRIPT_TEXT5, m_creature);//1
+ DoScriptText(SCRIPT_TEXT5, me);//1
HandleGameObject(DATA_ARENA4, false);
Start(false, false);
CanWalk = true;
@@ -294,7 +294,7 @@ struct npc_grimstoneAI : public npc_escortAI
break;
case 4:
CanWalk = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
SummonRingMob();
Event_Timer = 8000;
break;
@@ -308,9 +308,9 @@ struct npc_grimstoneAI : public npc_escortAI
Event_Timer = 0;
break;
case 7:
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
HandleGameObject(DATA_ARENA1, false);
- DoScriptText(SCRIPT_TEXT6, m_creature);//4
+ DoScriptText(SCRIPT_TEXT6, me);//4
CanWalk = true;
Event_Timer = 0;
break;
@@ -319,7 +319,7 @@ struct npc_grimstoneAI : public npc_escortAI
Event_Timer = 5000;
break;
case 9:
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
SummonRingBoss();
Event_Timer = 0;
break;
@@ -381,16 +381,16 @@ struct mob_phalanxAI : public ScriptedAI
//ThunderClap_Timer
if (ThunderClap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
ThunderClap_Timer = 10000;
} else ThunderClap_Timer -= diff;
//FireballVolley_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (FireballVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALLVOLLEY);
+ DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
FireballVolley_Timer = 15000;
} else FireballVolley_Timer -= diff;
}
@@ -398,7 +398,7 @@ struct mob_phalanxAI : public ScriptedAI
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
+ DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
} else MightyBlow_Timer -= diff;
@@ -579,12 +579,12 @@ struct npc_dughal_stormwingAI : public npc_escortAI
{
switch(i)
{
- case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
+ case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 2:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
break;
}
@@ -595,11 +595,11 @@ struct npc_dughal_stormwingAI : public npc_escortAI
void JustDied(Unit* killer)
{
- if (IsBeingEscorted && killer == m_creature)
+ if (IsBeingEscorted && killer == me)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
}
}
@@ -609,15 +609,15 @@ struct npc_dughal_stormwingAI : public npc_escortAI
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -683,41 +683,41 @@ struct npc_marshal_windsorAI : public npc_escortAI
switch(i)
{
case 1:
- m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 10:
- m_creature->setFaction(534);
+ me->setFaction(534);
break;
case 12:
- m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
break;
case 13:
- m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
+ me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break;
case 14:
pInstance->SetData(DATA_GATE_SR,0);
- m_creature->setFaction(11);
+ me->setFaction(11);
break;
case 16:
- m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
break;
case 17:
- m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
+ me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break;
case 18:
pInstance->SetData(DATA_GATE_SC,0);
break;
case 19:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
break;
}
@@ -727,9 +727,9 @@ struct npc_marshal_windsorAI : public npc_escortAI
{
switch (urand(0,2))
{
- case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
- case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
- case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
+ case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
+ case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
+ case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
}
}
@@ -747,25 +747,25 @@ struct npc_marshal_windsorAI : public npc_escortAI
SetEscortPaused(false);
if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED)
{
- m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
}
if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
{
- m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
}
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -848,53 +848,53 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
switch(i)
{
case 0:
- m_creature->setFaction(11);
- m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
+ me->setFaction(11);
+ me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 1:
- m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 8:
- m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 11:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 12:
- m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 13:
- m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 20:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 21:
- m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 23:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 24:
- m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 31:
- m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 32:
- m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
- PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature);
+ me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
+ PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me);
pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
break;
}
@@ -910,7 +910,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
- if (m_creature->IsWithinDistInMap(who, Radius))
+ if (me->IsWithinDistInMap(who, Radius))
{
SetEscortPaused(false);
Start(true, false, who->GetGUID());
@@ -923,9 +923,9 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
{
switch (urand(0,2))
{
- case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
- case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
- case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
+ case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
+ case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
+ case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
}
}
void Reset() {}
@@ -969,7 +969,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
{
pInstance->SetData(DATA_CREATURE_CREST,1);
- m_creature->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
+ me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS);
}
if (pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
@@ -1040,11 +1040,11 @@ struct npc_tobias_seecherAI : public npc_escortAI
void JustDied(Unit* killer)
{
- if (IsBeingEscorted && killer == m_creature)
+ if (IsBeingEscorted && killer == me)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
}
}
@@ -1053,13 +1053,13 @@ struct npc_tobias_seecherAI : public npc_escortAI
{
switch(i)
{
- case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
+ case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 2:
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 4:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
break;
}
@@ -1070,15 +1070,15 @@ struct npc_tobias_seecherAI : public npc_escortAI
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -1174,19 +1174,19 @@ struct npc_rocknotAI : public npc_escortAI
switch(i)
{
case 1:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break;
case 2:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
break;
case 3:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
break;
case 4:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break;
case 5:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
BreakKeg_Timer = 2000;
break;
}
@@ -1215,7 +1215,7 @@ struct npc_rocknotAI : public npc_escortAI
DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future
//spell by trap has effect61, this indicate the bar go hostile
- if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX)))
+ if (Unit *tmp = Unit::GetUnit(*me,pInstance->GetData64(DATA_PHALANX)))
tmp->setFaction(14);
//for later, this event(s) has alot more to it.
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp
index acbef7f482b..be45b092590 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp
@@ -58,17 +58,17 @@ struct boss_ambassador_flamelashAI : public ScriptedAI
//FireBlast_Timer
if (FireBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBLAST);
+ DoCast(me->getVictim(), SPELL_FIREBLAST);
FireBlast_Timer = 7000;
} else FireBlast_Timer -= diff;
//Spirit_Timer
if (Spirit_Timer <= diff)
{
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
+ SummonSpirits(me->getVictim());
+ SummonSpirits(me->getVictim());
+ SummonSpirits(me->getVictim());
+ SummonSpirits(me->getVictim());
Spirit_Timer = 30000;
} else Spirit_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp
index 2d13f4abc52..b15a390a871 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp
@@ -64,7 +64,7 @@ struct boss_anubshiahAI : public ScriptedAI
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 7000;
} else ShadowBolt_Timer -= diff;
@@ -79,14 +79,14 @@ struct boss_anubshiahAI : public ScriptedAI
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS);
+ DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
} else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEMONARMOR);
+ DoCast(me, SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
} else DemonArmor_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
index 8ea01ff5933..98fe4edfc96 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
@@ -52,13 +52,13 @@ struct boss_draganthaurissanAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- m_creature->CallForHelp(VISIBLE_RANGE);
+ DoScriptText(SAY_AGGRO, me);
+ me->CallForHelp(VISIBLE_RANGE);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_SLAY, m_creature);
+ DoScriptText(SAY_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -88,7 +88,7 @@ struct boss_draganthaurissanAI : public ScriptedAI
//AvatarOfFlame_Timer
if (AvatarOfFlame_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AVATAROFFLAME);
+ DoCast(me->getVictim(), SPELL_AVATAROFFLAME);
AvatarOfFlame_Timer = 18000;
} else AvatarOfFlame_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp
index 1ddfa7e959a..d36990933c4 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp
@@ -74,43 +74,43 @@ struct boss_general_angerforgeAI : public ScriptedAI
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
+ DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 18000;
} else MightyBlow_Timer -= diff;
//HamString_Timer
if (HamString_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ DoCast(me->getVictim(), SPELL_HAMSTRING);
HamString_Timer = 15000;
} else HamString_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 9000;
} else Cleave_Timer -= diff;
//Adds_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 21)
{
if (Adds_Timer <= diff)
{
// summon 3 Adds every 25s
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
Adds_Timer = 25000;
} else Adds_Timer -= diff;
}
//Summon Medics
- if (!Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
+ if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21)
{
- SummonMedics(m_creature->getVictim());
- SummonMedics(m_creature->getVictim());
+ SummonMedics(me->getVictim());
+ SummonMedics(me->getVictim());
Medics = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp
index 8a9ad969c72..58db7d88cb8 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp
@@ -55,14 +55,14 @@ struct boss_gorosh_the_dervishAI : public ScriptedAI
//WhirlWind_Timer
if (WhirlWind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
WhirlWind_Timer = 15000;
} else WhirlWind_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp
index 0014fc5fe73..70d258c7e86 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp
@@ -60,17 +60,17 @@ struct boss_grizzleAI : public ScriptedAI
//GroundTremor_Timer
if (GroundTremor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR);
+ DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
GroundTremor_Timer = 8000;
} else GroundTremor_Timer -= diff;
//Frenzy_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (Frenzy_Timer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
Frenzy_Timer = 15000;
} else Frenzy_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp
index 0a7f380138a..4586a418a06 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp
@@ -77,14 +77,14 @@ struct boss_high_interrogator_gerstahnAI : public ScriptedAI
//PsychicScream_Timer
if (PsychicScream_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PSYCHICSCREAM);
+ DoCast(me->getVictim(), SPELL_PSYCHICSCREAM);
PsychicScream_Timer = 30000;
} else PsychicScream_Timer -= diff;
//ShadowShield_Timer
if (ShadowShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOWSHIELD);
+ DoCast(me, SPELL_SHADOWSHIELD);
ShadowShield_Timer = 25000;
} else ShadowShield_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
index fd654c2bdc9..0836a94f49b 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
@@ -60,16 +60,16 @@ struct boss_magmusAI : public ScriptedAI
//FieryBurst_Timer
if (FieryBurst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIERYBURST);
+ DoCast(me->getVictim(), SPELL_FIERYBURST);
FieryBurst_Timer = 6000;
} else FieryBurst_Timer -= diff;
//WarStomp_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (WarStomp_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
+ DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = 8000;
} else WarStomp_Timer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp
index a24d7a4d25d..52b88318868 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp
@@ -63,21 +63,21 @@ struct boss_moira_bronzebeardAI : public ScriptedAI
//MindBlast_Timer
if (MindBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDBLAST);
+ DoCast(me->getVictim(), SPELL_MINDBLAST);
MindBlast_Timer = 14000;
} else MindBlast_Timer -= diff;
//ShadowWordPain_Timer
if (ShadowWordPain_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN);
+ DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 18000;
} else ShadowWordPain_Timer -= diff;
//Smite_Timer
if (Smite_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SMITE);
+ DoCast(me->getVictim(), SPELL_SMITE);
Smite_Timer = 10000;
} else Smite_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp
index 9914d0a282b..9acfa68fc8d 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp
@@ -116,16 +116,16 @@ struct boss_doomrelAI : public ScriptedAI
DemonArmor_Timer = 16000;
Voidwalkers = false;
- m_creature->setFaction(FACTION_FRIEND);
+ me->setFaction(FACTION_FRIEND);
// was set before event start, so set again
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (pInstance)
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
else
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void EnterCombat(Unit *who)
@@ -134,13 +134,13 @@ struct boss_doomrelAI : public ScriptedAI
void EnterEvadeMode()
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- m_creature->LoadCreaturesAddon();
- if (m_creature->isAlive())
- m_creature->GetMotionMaster()->MoveTargetedHome();
- m_creature->SetLootRecipient(NULL);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->LoadCreaturesAddon();
+ if (me->isAlive())
+ me->GetMotionMaster()->MoveTargetedHome();
+ me->SetLootRecipient(NULL);
if (pInstance)
pInstance->SetData64(DATA_EVENSTARTER, 0);
}
@@ -159,7 +159,7 @@ struct boss_doomrelAI : public ScriptedAI
//ShadowVolley_Timer
if (ShadowVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLTVOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
ShadowVolley_Timer = 12000;
} else ShadowVolley_Timer -= diff;
@@ -175,21 +175,21 @@ struct boss_doomrelAI : public ScriptedAI
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS);
+ DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
} else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEMONARMOR);
+ DoCast(me, SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
} else DemonArmor_Timer -= diff;
//Summon Voidwalkers
- if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
+ if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
- DoCast(m_creature->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
+ DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
Voidwalkers = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp
index fab2c73dc4d..72b8f96df96 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp
@@ -58,28 +58,28 @@ struct boss_drakkisathAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 10000;
} else FireNova_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 8000;
} else Cleave_Timer -= diff;
//Confliguration_Timer
if (Confliguration_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CONFLIGURATION);
+ DoCast(me->getVictim(), SPELL_CONFLIGURATION);
Confliguration_Timer = 18000;
} else Confliguration_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 20000;
} else Thunderclap_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp
index 2f3858626b5..5854793f54c 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp
@@ -71,8 +71,8 @@ struct boss_gythAI : public ScriptedAI
Line2Count = 2;
//Invisible for event start
- m_creature->SetDisplayId(11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(11686);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who)
@@ -81,7 +81,7 @@ struct boss_gythAI : public ScriptedAI
void SummonCreatureWithRandomTarget(uint32 creatureId)
{
- Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
+ Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
if (Summoned)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -100,8 +100,8 @@ struct boss_gythAI : public ScriptedAI
if (!RootSelf)
{
- //m_creature->m_canMove = true;
- DoCast(m_creature, 33356);
+ //me->m_canMove = true;
+ DoCast(me, 33356);
RootSelf = true;
}
@@ -111,9 +111,9 @@ struct boss_gythAI : public ScriptedAI
{
bAggro = true;
// Visible now!
- m_creature->SetDisplayId(9723);
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(9723);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} else Aggro_Timer -= diff;
}
@@ -153,34 +153,34 @@ struct boss_gythAI : public ScriptedAI
// CorrosiveAcid_Timer
if (CorrosiveAcid_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
+ DoCast(me->getVictim(), SPELL_CORROSIVEACID);
CorrosiveAcid_Timer = 7000;
} else CorrosiveAcid_Timer -= diff;
// Freeze_Timer
if (Freeze_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FREEZE);
+ DoCast(me->getVictim(), SPELL_FREEZE);
Freeze_Timer = 16000;
} else Freeze_Timer -= diff;
// Flamebreath_Timer
if (Flamebreath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
+ DoCast(me->getVictim(), SPELL_FLAMEBREATH);
Flamebreath_Timer = 10500;
} else Flamebreath_Timer -= diff;
//Summon Rend
- if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11
- && m_creature->GetHealth() > 0)
+ if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11
+ && me->GetHealth() > 0)
{
//summon Rend and Change model to normal Gyth
//Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Gyth model
- m_creature->SetDisplayId(9806);
- m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
+ me->SetDisplayId(9806);
+ me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
SummonedRend = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp
index 62aff7322e8..8d88d0b0b17 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp
@@ -59,21 +59,21 @@ struct boss_halyconAI : public ScriptedAI
//CrowdPummel_Timer
if (CrowdPummel_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CROWDPUMMEL);
+ DoCast(me->getVictim(), SPELL_CROWDPUMMEL);
CrowdPummel_Timer = 14000;
} else CrowdPummel_Timer -= diff;
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
+ DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
} else MightyBlow_Timer -= diff;
//Summon Gizrul
- if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25)
+ if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25)
{
- m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
Summoned = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp
index 9ec1ded5abe..e1c84b607c2 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp
@@ -67,49 +67,49 @@ struct boss_highlordomokkAI : public ScriptedAI
//WarStomp_Timer
if (WarStomp_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
+ DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = 14000;
} else WarStomp_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 8000;
} else Cleave_Timer -= diff;
//Strike_Timer
if (Strike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STRIKE);
+ DoCast(me->getVictim(), SPELL_STRIKE);
Strike_Timer = 10000;
} else Strike_Timer -= diff;
//Rend_Timer
if (Rend_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REND);
+ DoCast(me->getVictim(), SPELL_REND);
Rend_Timer = 18000;
} else Rend_Timer -= diff;
//SunderArmor_Timer
if (SunderArmor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR);
+ DoCast(me->getVictim(), SPELL_SUNDERARMOR);
SunderArmor_Timer = 25000;
} else SunderArmor_Timer -= diff;
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 12000;
} else KnockAway_Timer -= diff;
//Slow_Timer
if (Slow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SLOW);
+ DoCast(me->getVictim(), SPELL_SLOW);
Slow_Timer = 18000;
} else Slow_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp
index 6cfd8b5ca0e..fba666349a1 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp
@@ -44,8 +44,8 @@ struct boss_mothersmolderwebAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (m_creature->GetHealth() <= damage)
- DoCast(m_creature, SPELL_SUMMON_SPIRE_SPIDERLING, true);
+ if (me->GetHealth() <= damage)
+ DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true);
}
void UpdateAI(const uint32 diff)
@@ -57,14 +57,14 @@ struct boss_mothersmolderwebAI : public ScriptedAI
//Crystalize_Timer
if (Crystalize_Timer <= diff)
{
- DoCast(m_creature, SPELL_CRYSTALIZE);
+ DoCast(me, SPELL_CRYSTALIZE);
Crystalize_Timer = 15000;
} else Crystalize_Timer -= diff;
//MothersMilk_Timer
if (MothersMilk_Timer <= diff)
{
- DoCast(m_creature, SPELL_MOTHERSMILK);
+ DoCast(me, SPELL_MOTHERSMILK);
MothersMilk_Timer = urand(5000,12500);
} else MothersMilk_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp
index 548df0e314c..c93be933778 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp
@@ -70,39 +70,39 @@ struct boss_overlordwyrmthalakAI : public ScriptedAI
//BlastWave_Timer
if (BlastWave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
+ DoCast(me->getVictim(), SPELL_BLASTWAVE);
BlastWave_Timer = 20000;
} else BlastWave_Timer -= diff;
//Shout_Timer
if (Shout_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHOUT);
+ DoCast(me->getVictim(), SPELL_SHOUT);
Shout_Timer = 10000;
} else Shout_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Knockaway_Timer
if (Knockaway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY);
Knockaway_Timer = 14000;
} else Knockaway_Timer -= diff;
//Summon two Beserks
- if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
+ if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true);
- if (Creature *SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
+ if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
SummonedCreature->AI()->AttackStart(pTarget);
- if (Creature *SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
+ if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
SummonedCreature->AI()->AttackStart(pTarget);
Summoned = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp
index 25f7a2be61d..94c5385292f 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp
@@ -55,14 +55,14 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 6000;
} else FireNova_Timer -= diff;
//FlameBuffet_Timer
if (FlameBuffet_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET);
+ DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 14000;
} else FlameBuffet_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp
index 5d88df69915..09379c09cd9 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp
@@ -56,14 +56,14 @@ struct boss_quatermasterzigrisAI : public ScriptedAI
//Shoot_Timer
if (Shoot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ DoCast(me->getVictim(), SPELL_SHOOT);
Shoot_Timer = 500;
} else Shoot_Timer -= diff;
//StunBomb_Timer
if (StunBomb_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STUNBOMB);
+ DoCast(me->getVictim(), SPELL_STUNBOMB);
StunBomb_Timer = 14000;
} else StunBomb_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp
index 342c110bdaa..eb158909f61 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp
@@ -55,21 +55,21 @@ struct boss_rend_blackhandAI : public ScriptedAI
//WhirlWind_Timer
if (WhirlWind_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
WhirlWind_Timer = 18000;
} else WhirlWind_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 10000;
} else Cleave_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 16000;
} else Thunderclap_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
index 4a81b4cd5b2..160f883f53f 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
@@ -41,7 +41,7 @@ struct boss_shadowvoshAI : public ScriptedAI
Hex_Timer = 8000;
Cleave_Timer = 14000;
- //DoCast(m_creature, SPELL_ICEARMOR, true);
+ //DoCast(me, SPELL_ICEARMOR, true);
}
void EnterCombat(Unit *who){}
@@ -55,7 +55,7 @@ struct boss_shadowvoshAI : public ScriptedAI
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
+ DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 45000;
} else CurseOfBlood_Timer -= diff;
@@ -70,7 +70,7 @@ struct boss_shadowvoshAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp
index bd60eab0404..e6693de3849 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp
@@ -55,7 +55,7 @@ struct boss_thebeastAI : public ScriptedAI
//Flamebreak_Timer
if (Flamebreak_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBREAK);
+ DoCast(me->getVictim(), SPELL_FLAMEBREAK);
Flamebreak_Timer = 10000;
} else Flamebreak_Timer -= diff;
@@ -70,7 +70,7 @@ struct boss_thebeastAI : public ScriptedAI
//TerrifyingRoar_Timer
if (TerrifyingRoar_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TERRIFYINGROAR);
+ DoCast(me->getVictim(), SPELL_TERRIFYINGROAR);
TerrifyingRoar_Timer = 20000;
} else TerrifyingRoar_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp
index b598b40cb8a..3ce81cb1fdb 100644
--- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp
@@ -64,42 +64,42 @@ struct boss_warmastervooneAI : public ScriptedAI
//Snapkick_Timer
if (Snapkick_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SNAPKICK);
+ DoCast(me->getVictim(), SPELL_SNAPKICK);
Snapkick_Timer = 6000;
} else Snapkick_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
} else Cleave_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 14000;
} else Uppercut_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 10000;
} else MortalStrike_Timer -= diff;
//Pummel_Timer
if (Pummel_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PUMMEL);
+ DoCast(me->getVictim(), SPELL_PUMMEL);
Pummel_Timer = 16000;
} else Pummel_Timer -= diff;
//ThrowAxe_Timer
if (ThrowAxe_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THROWAXE);
+ DoCast(me->getVictim(), SPELL_THROWAXE);
ThrowAxe_Timer = 8000;
} else ThrowAxe_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp
index 7706ede2e1f..97f29039014 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp
@@ -50,7 +50,7 @@ struct boss_broodlordAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
}
@@ -62,36 +62,36 @@ struct boss_broodlordAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
// BlastWave
if (BlastWave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
+ DoCast(me->getVictim(), SPELL_BLASTWAVE);
BlastWave_Timer = urand(8000,16000);
} else BlastWave_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = urand(25000,35000);
} else MortalStrike_Timer -= diff;
if (KnockBack_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKBACK);
+ DoCast(me->getVictim(), SPELL_KNOCKBACK);
//Drop 50% aggro
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-50);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-50);
KnockBack_Timer = urand(15000,30000);
} else KnockBack_Timer -= diff;
if (EnterEvadeIfOutOfCombatArea(diff))
- DoScriptText(SAY_LEASH, m_creature);
+ DoScriptText(SAY_LEASH, me);
DoMeleeAttackIfReady();
}
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp
index ccee79d83d5..5cbc819adf5 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp
@@ -199,43 +199,43 @@ struct boss_chromaggusAI : public ScriptedAI
{
//Remove old vulnerabilty spell
if (CurrentVurln_Spell)
- m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
+ me->RemoveAurasDueToSpell(CurrentVurln_Spell);
//Cast new random vulnerabilty on self
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
- DoCast(m_creature, spell);
+ DoCast(me, spell);
CurrentVurln_Spell = spell;
- DoScriptText(EMOTE_SHIMMER, m_creature);
+ DoScriptText(EMOTE_SHIMMER, me);
Shimmer_Timer = 45000;
} else Shimmer_Timer -= diff;
//Breath1_Timer
if (Breath1_Timer <= diff)
{
- DoCast(m_creature->getVictim(), Breath1_Spell);
+ DoCast(me->getVictim(), Breath1_Spell);
Breath1_Timer = 60000;
} else Breath1_Timer -= diff;
//Breath2_Timer
if (Breath2_Timer <= diff)
{
- DoCast(m_creature->getVictim(), Breath2_Spell);
+ DoCast(me->getVictim(), Breath2_Spell);
Breath2_Timer = 60000;
} else Breath2_Timer -= diff;
//Affliction_Timer
if (Affliction_Timer <= diff)
{
- std::list<HostileReference*> threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
{
Unit* pUnit;
if ((*i) && (*i)->getSource())
{
- pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit)
{
//Cast affliction
@@ -270,15 +270,15 @@ struct boss_chromaggusAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(EMOTE_FRENZY, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(EMOTE_FRENZY, me);
Frenzy_Timer = urand(10000,15000);
} else Frenzy_Timer -= diff;
//Enrage if not already enraged and below 20%
- if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp
index 0ccdffbdb90..190c5452c7a 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp
@@ -58,29 +58,29 @@ struct boss_ebonrocAI : public ScriptedAI
//Shadowflame Timer
if (ShadowFlame_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
+ DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = urand(12000,15000);
} else ShadowFlame_Timer -= diff;
//Wing Buffet Timer
if (WingBuffet_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
+ DoCast(me->getVictim(), SPELL_WINGBUFFET);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
//Shadow of Ebonroc Timer
if (ShadowOfEbonroc_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWOFEBONROC);
+ DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
ShadowOfEbonroc_Timer = urand(25000,350000);
} else ShadowOfEbonroc_Timer -= diff;
- if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
+ if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
{
if (Heal_Timer <= diff)
{
- DoCast(m_creature, SPELL_HEAL);
+ DoCast(me, SPELL_HEAL);
Heal_Timer = urand(1000,3000);
} else Heal_Timer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp
index 7bcbf72d144..9362b1e2680 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp
@@ -55,16 +55,16 @@ struct boss_firemawAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
+ DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = urand(15000,18000);
} else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-75);
+ DoCast(me->getVictim(), SPELL_WINGBUFFET);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-75);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
@@ -72,7 +72,7 @@ struct boss_firemawAI : public ScriptedAI
//FlameBuffet_Timer
if (FlameBuffet_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET);
+ DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 5000;
} else FlameBuffet_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
index 8349d308c4f..09fa06cd966 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
@@ -57,16 +57,16 @@ struct boss_flamegorAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
+ DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = 15000 + rand()%7000;
} else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-75);
+ DoCast(me->getVictim(), SPELL_WINGBUFFET);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-75);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
@@ -74,8 +74,8 @@ struct boss_flamegorAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
- DoScriptText(EMOTE_FRENZY, m_creature);
- DoCast(m_creature, SPELL_FRENZY);
+ DoScriptText(EMOTE_FRENZY, me);
+ DoCast(me, SPELL_FRENZY);
Frenzy_Timer = urand(8000, 10000);
} else Frenzy_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp
index ae3062ea459..5d9ab125cf8 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp
@@ -90,17 +90,17 @@ struct boss_nefarianAI : public ScriptedAI
if (rand()%5)
return;
- DoScriptText(SAY_SLAY, m_creature, Victim);
+ DoScriptText(SAY_SLAY, me, Victim);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), m_creature);
+ DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
DoZoneInCombat();
@@ -111,7 +111,7 @@ struct boss_nefarianAI : public ScriptedAI
if (DespawnTimer <= diff)
{
if (!UpdateVictim())
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
DespawnTimer = 5000;
} else DespawnTimer -= diff;
@@ -121,28 +121,28 @@ struct boss_nefarianAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
+ DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = 12000;
} else ShadowFlame_Timer -= diff;
//BellowingRoar_Timer
if (BellowingRoar_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
BellowingRoar_Timer = 30000;
} else BellowingRoar_Timer -= diff;
//VeilOfShadow_Timer
if (VeilOfShadow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VEILOFSHADOW);
+ DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
VeilOfShadow_Timer = 15000;
} else VeilOfShadow_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
@@ -150,7 +150,7 @@ struct boss_nefarianAI : public ScriptedAI
if (TailLash_Timer <= diff)
{
//Cast NYI since we need a better check for behind target
- //DoCast(m_creature->getVictim(), SPELL_TAILLASH);
+ //DoCast(me->getVictim(), SPELL_TAILLASH);
TailLash_Timer = 10000;
} else TailLash_Timer -= diff;
@@ -165,40 +165,40 @@ struct boss_nefarianAI : public ScriptedAI
switch (urand(0,8))
{
case 0:
- DoScriptText(SAY_MAGE, m_creature);
- DoCast(m_creature, SPELL_MAGE);
+ DoScriptText(SAY_MAGE, me);
+ DoCast(me, SPELL_MAGE);
break;
case 1:
- DoScriptText(SAY_WARRIOR, m_creature);
- DoCast(m_creature, SPELL_WARRIOR);
+ DoScriptText(SAY_WARRIOR, me);
+ DoCast(me, SPELL_WARRIOR);
break;
case 2:
- DoScriptText(SAY_DRUID, m_creature);
- DoCast(m_creature, SPELL_DRUID);
+ DoScriptText(SAY_DRUID, me);
+ DoCast(me, SPELL_DRUID);
break;
case 3:
- DoScriptText(SAY_PRIEST, m_creature);
- DoCast(m_creature, SPELL_PRIEST);
+ DoScriptText(SAY_PRIEST, me);
+ DoCast(me, SPELL_PRIEST);
break;
case 4:
- DoScriptText(SAY_PALADIN, m_creature);
- DoCast(m_creature, SPELL_PALADIN);
+ DoScriptText(SAY_PALADIN, me);
+ DoCast(me, SPELL_PALADIN);
break;
case 5:
- DoScriptText(SAY_SHAMAN, m_creature);
- DoCast(m_creature, SPELL_SHAMAN);
+ DoScriptText(SAY_SHAMAN, me);
+ DoCast(me, SPELL_SHAMAN);
break;
case 6:
- DoScriptText(SAY_WARLOCK, m_creature);
- DoCast(m_creature, SPELL_WARLOCK);
+ DoScriptText(SAY_WARLOCK, me);
+ DoCast(me, SPELL_WARLOCK);
break;
case 7:
- DoScriptText(SAY_HUNTER, m_creature);
- DoCast(m_creature, SPELL_HUNTER);
+ DoScriptText(SAY_HUNTER, me);
+ DoCast(me, SPELL_HUNTER);
break;
case 8:
- DoScriptText(SAY_ROGUE, m_creature);
- DoCast(m_creature, SPELL_ROGUE);
+ DoScriptText(SAY_ROGUE, me);
+ DoCast(me, SPELL_ROGUE);
break;
}
@@ -206,10 +206,10 @@ struct boss_nefarianAI : public ScriptedAI
} else ClassCall_Timer -= diff;
//Phase3 begins when we are below X health
- if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
{
Phase3 = true;
- DoScriptText(SAY_RAISE_SKELETONS, m_creature);
+ DoScriptText(SAY_RAISE_SKELETONS, me);
}
DoMeleeAttackIfReady();
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp
index 44ec9cb83f3..6bca046a271 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp
@@ -59,7 +59,7 @@ struct boss_razorgoreAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -70,40 +70,40 @@ struct boss_razorgoreAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = urand(7000,10000);
} else Cleave_Timer -= diff;
//WarStomp_Timer
if (WarStomp_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
+ DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = urand(15000,25000);
} else WarStomp_Timer -= diff;
//FireballVolley_Timer
if (FireballVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALLVOLLEY);
+ DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
FireballVolley_Timer = urand(12000,15000);
} else FireballVolley_Timer -= diff;
//Conflagration_Timer
if (Conflagration_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION);
+ DoCast(me->getVictim(), SPELL_CONFLAGRATION);
//We will remove this threat reduction and add an aura check.
- //if (DoGetThreat(m_creature->getVictim()))
- //DoModifyThreatPercent(m_creature->getVictim(),-50);
+ //if (DoGetThreat(me->getVictim()))
+ //DoModifyThreatPercent(me->getVictim(),-50);
Conflagration_Timer = 12000;
} else Conflagration_Timer -= diff;
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
- if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION))
+ if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
- m_creature->TauntApply(pTarget);
+ me->TauntApply(pTarget);
DoMeleeAttackIfReady();
}
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp
index 5fff79ad04c..982520921df 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp
@@ -80,13 +80,13 @@ struct boss_vaelAI : public ScriptedAI
PlayerGUID = pTarget->GetGUID();
//10 seconds
- DoScriptText(SAY_LINE1, m_creature);
+ DoScriptText(SAY_LINE1, me);
SpeechTimer = 10000;
SpeechNum = 0;
DoingSpeech = true;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void KilledUnit(Unit *victim)
@@ -94,14 +94,14 @@ struct boss_vaelAI : public ScriptedAI
if (rand()%5)
return;
- DoScriptText(SAY_KILLTARGET, m_creature, victim);
+ DoScriptText(SAY_KILLTARGET, me, victim);
}
void EnterCombat(Unit *who)
{
- DoCast(m_creature, SPELL_ESSENCEOFTHERED);
+ DoCast(me, SPELL_ESSENCEOFTHERED);
DoZoneInCombat();
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
+ me->SetHealth(int(me->GetMaxHealth()*.3));
}
void UpdateAI(const uint32 diff)
@@ -115,22 +115,22 @@ struct boss_vaelAI : public ScriptedAI
{
case 0:
//16 seconds till next line
- DoScriptText(SAY_LINE2, m_creature);
+ DoScriptText(SAY_LINE2, me);
SpeechTimer = 16000;
++SpeechNum;
break;
case 1:
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
- DoScriptText(SAY_LINE3, m_creature);
+ DoScriptText(SAY_LINE3, me);
SpeechTimer = 10000;
++SpeechNum;
break;
case 2:
- m_creature->setFaction(103);
- if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
+ me->setFaction(103);
+ if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
{
- AttackStart(Unit::GetUnit((*m_creature),PlayerGUID));
- DoCast(m_creature, SPELL_ESSENCEOFTHERED);
+ AttackStart(Unit::GetUnit((*me),PlayerGUID));
+ DoCast(me, SPELL_ESSENCEOFTHERED);
}
SpeechTimer = 0;
DoingSpeech = false;
@@ -144,23 +144,23 @@ struct boss_vaelAI : public ScriptedAI
return;
// Yell if hp lower than 15%
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
{
- DoScriptText(SAY_HALFLIFE, m_creature);
+ DoScriptText(SAY_HALFLIFE, me);
HasYelled = true;
}
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 15000;
} else Cleave_Timer -= diff;
//FlameBreath_Timer
if (FlameBreath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
+ DoCast(me->getVictim(), SPELL_FLAMEBREATH);
FlameBreath_Timer = urand(4000,8000);
} else FlameBreath_Timer -= diff;
@@ -188,7 +188,7 @@ struct boss_vaelAI : public ScriptedAI
{
// have the victim cast the spell on himself otherwise the third effect aura will be applied
// to Vael instead of the player
- m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1);
+ me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
BurningAdrenalineTank_Timer = 45000;
} else BurningAdrenalineTank_Timer -= diff;
@@ -196,7 +196,7 @@ struct boss_vaelAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 5000;
} else FireNova_Timer -= diff;
@@ -204,9 +204,9 @@ struct boss_vaelAI : public ScriptedAI
if (TailSwipe_Timer <= diff)
{
//Only cast if we are behind
- /*if (!m_creature->HasInArc(M_PI, m_creature->getVictim()))
+ /*if (!me->HasInArc(M_PI, me->getVictim()))
{
- DoCast(m_creature->getVictim(), SPELL_TAILSWIPE);
+ DoCast(me->getVictim(), SPELL_TAILSWIPE);
}*/
TailSwipe_Timer = 20000;
diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp
index c6cc0f7ad36..ee0b2c9dfef 100644
--- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp
+++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp
@@ -178,27 +178,27 @@ struct boss_victor_nefariusAI : public ScriptedAI
NefarianGUID = 0;
NefCheckTime = 2000;
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1);
- m_creature->setFaction(35);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS,1);
+ me->setFaction(35);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void BeginEvent(Player *pTarget)
{
- DoScriptText(SAY_GAMESBEGIN_2, m_creature);
+ DoScriptText(SAY_GAMESBEGIN_2, me);
- //Trinity::Singleton<MapManager>::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
+ //Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
/*
- list <Player*>::const_iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
+ list <Player*>::const_iterator i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
- for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i)
+ for (i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
{
AttackStart((*i));
}
*/
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(103);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ me->setFaction(103);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AttackStart(pTarget);
}
@@ -210,10 +210,10 @@ struct boss_victor_nefariusAI : public ScriptedAI
{
//We simply use this function to find players until we can use pMap->GetPlayers()
- if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
+ if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
{
//Add them to our threat list
- m_creature->AddThreat(who, 0.0f);
+ me->AddThreat(who, 0.0f);
}
}
@@ -260,7 +260,7 @@ struct boss_victor_nefariusAI : public ScriptedAI
++SpawnedAdds;
//Spawn Creature and force it to start attacking a random target
- Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
{
@@ -276,7 +276,7 @@ struct boss_victor_nefariusAI : public ScriptedAI
++SpawnedAdds;
- Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
{
@@ -288,23 +288,23 @@ struct boss_victor_nefariusAI : public ScriptedAI
if (SpawnedAdds >= 42)
{
//Teleport Victor Nefarius way out of the map
- //MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0);
+ //MapManager::Instance().GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
//Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Root self
- DoCast(m_creature, 33356);
+ DoCast(me, 33356);
//Make super invis
- DoCast(m_creature, 8149);
+ DoCast(me, 8149);
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
- m_creature->addUnitState(UNIT_STAT_FLEEING);
+ me->addUnitState(UNIT_STAT_FLEEING);
//Spawn nef and have him attack a random target
- Creature* Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
+ Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Nefarian)
{
@@ -322,14 +322,14 @@ struct boss_victor_nefariusAI : public ScriptedAI
{
if (NefCheckTime <= diff)
{
- Unit* Nefarian = Unit::GetCreature((*m_creature),NefarianGUID);
+ Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
//If nef is dead then we die to so the players get out of combat
//and cannot repeat the event
if (!Nefarian || !Nefarian->isAlive())
{
NefarianGUID = 0;
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
NefCheckTime = 2000;
diff --git a/src/scripts/eastern_kingdoms/boss_kruul.cpp b/src/scripts/eastern_kingdoms/boss_kruul.cpp
index 94ec16b7256..b9cde621c14 100644
--- a/src/scripts/eastern_kingdoms/boss_kruul.cpp
+++ b/src/scripts/eastern_kingdoms/boss_kruul.cpp
@@ -61,7 +61,7 @@ struct boss_kruulAI : public ScriptedAI
void KilledUnit()
{
// When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
- DoCast(m_creature, SPELL_CAPTURESOUL);
+ DoCast(me, SPELL_CAPTURESOUL);
}
void SummonHounds(Unit* pVictim)
@@ -80,7 +80,7 @@ struct boss_kruulAI : public ScriptedAI
if (ShadowVolley_Timer <= diff)
{
if (urand(0,99) < 45)
- DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
ShadowVolley_Timer = 5000;
} else ShadowVolley_Timer -= diff;
@@ -89,7 +89,7 @@ struct boss_kruulAI : public ScriptedAI
if (Cleave_Timer <= diff)
{
if (urand(0,1))
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 10000;
} else Cleave_Timer -= diff;
@@ -98,7 +98,7 @@ struct boss_kruulAI : public ScriptedAI
if (ThunderClap_Timer <= diff)
{
if (urand(0,9) < 2)
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
ThunderClap_Timer = 12000;
} else ThunderClap_Timer -= diff;
@@ -106,7 +106,7 @@ struct boss_kruulAI : public ScriptedAI
//TwistedReflection_Timer
if (TwistedReflection_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TWISTEDREFLECTION);
+ DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION);
TwistedReflection_Timer = 30000;
} else TwistedReflection_Timer -= diff;
@@ -114,7 +114,7 @@ struct boss_kruulAI : public ScriptedAI
if (VoidBolt_Timer <= diff)
{
if (urand(0,9) < 4)
- DoCast(m_creature->getVictim(), SPELL_VOIDBOLT);
+ DoCast(me->getVictim(), SPELL_VOIDBOLT);
VoidBolt_Timer = 18000;
} else VoidBolt_Timer -= diff;
@@ -122,16 +122,16 @@ struct boss_kruulAI : public ScriptedAI
//Rage_Timer
if (Rage_Timer <= diff)
{
- DoCast(m_creature, SPELL_RAGE);
+ DoCast(me, SPELL_RAGE);
Rage_Timer = 70000;
} else Rage_Timer -= diff;
//Hound_Timer
if (Hound_Timer <= diff)
{
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
+ SummonHounds(me->getVictim());
+ SummonHounds(me->getVictim());
+ SummonHounds(me->getVictim());
Hound_Timer = 45000;
} else Hound_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/burning_steppes.cpp b/src/scripts/eastern_kingdoms/burning_steppes.cpp
index a4e481dea83..378aa280ccc 100644
--- a/src/scripts/eastern_kingdoms/burning_steppes.cpp
+++ b/src/scripts/eastern_kingdoms/burning_steppes.cpp
@@ -54,7 +54,7 @@ struct npc_ragged_johnAI : public ScriptedAI
{
if (who->HasAura(16468))
{
- if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature))
+ if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
{
DoCast(who, 16472);
CAST_PLR(who)->AreaExploredOrEventHappens(4866);
diff --git a/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp b/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp
index 78baa137d14..88155820b83 100644
--- a/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp
+++ b/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp
@@ -72,7 +72,7 @@ struct boss_mr_smiteAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
bool bCheckChances()
@@ -93,35 +93,35 @@ struct boss_mr_smiteAI : public ScriptedAI
if (uiTrashTimer <= uiDiff)
{
if (bCheckChances())
- DoCast(m_creature, SPELL_TRASH);
+ DoCast(me, SPELL_TRASH);
uiTrashTimer = urand(6000,15500);
} else uiTrashTimer -= uiDiff;
if (uiSlamTimer <= uiDiff)
{
if (bCheckChances())
- DoCast(m_creature->getVictim(), SPELL_SMITE_SLAM);
+ DoCast(me->getVictim(), SPELL_SMITE_SLAM);
uiSlamTimer = 11000;
} else uiSlamTimer -= uiDiff;
if (uiNimbleReflexesTimer <= uiDiff)
{
if (bCheckChances())
- DoCast(m_creature, SPELL_NIMBLE_REFLEXES);
+ DoCast(me, SPELL_NIMBLE_REFLEXES);
uiNimbleReflexesTimer = urand(27300,60100);
} else uiNimbleReflexesTimer -= uiDiff;
/*END ACID-AI*/
- if (uiHealth == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66 || uiHealth == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33)
+ if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33)
{
++uiHealth;
DoCastAOE(SPELL_SMITE_STOMP,false);
SetCombatMovement(false);
if (pInstance)
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_SMITE_CHEST)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST)))
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
}
}
@@ -132,7 +132,7 @@ struct boss_mr_smiteAI : public ScriptedAI
switch(uiPhase)
{
case 1:
- m_creature->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
+ me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
uiTimer = 1000;
uiPhase = 2;
break;
@@ -146,7 +146,7 @@ struct boss_mr_smiteAI : public ScriptedAI
break;
case 3:
SetCombatMovement(true);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), me->m_CombatDistance);
+ me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance);
uiPhase = 0;
break;
diff --git a/src/scripts/eastern_kingdoms/dun_morogh.cpp b/src/scripts/eastern_kingdoms/dun_morogh.cpp
index bdaedb4212c..734b7be0245 100644
--- a/src/scripts/eastern_kingdoms/dun_morogh.cpp
+++ b/src/scripts/eastern_kingdoms/dun_morogh.cpp
@@ -44,8 +44,8 @@ struct npc_narm_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
spellHit = false;
}
@@ -60,7 +60,7 @@ struct npc_narm_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (m_creature->IsStandState())
+ if (me->IsStandState())
{
if (lifeTimer <= diff)
{
@@ -76,11 +76,11 @@ struct npc_narm_faulkAI : public ScriptedAI
{
if (Spellkind->Id == 8593 && !spellHit)
{
- DoCast(m_creature, 32343);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoScriptText(SAY_HEAL, m_creature);
+ DoCast(me, 32343);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //me->RemoveAllAuras();
+ DoScriptText(SAY_HEAL, me);
spellHit = true;
}
}
diff --git a/src/scripts/eastern_kingdoms/duskwood.cpp b/src/scripts/eastern_kingdoms/duskwood.cpp
index 77cd1a3bc08..45cb8dbc858 100644
--- a/src/scripts/eastern_kingdoms/duskwood.cpp
+++ b/src/scripts/eastern_kingdoms/duskwood.cpp
@@ -70,7 +70,7 @@ struct boss_twilight_corrupterAI : public ScriptedAI
}
void EnterCombat(Unit* who)
{
- m_creature->MonsterYell("The Nightmare cannot be stopped!",0,m_creature->GetGUID());
+ me->MonsterYell("The Nightmare cannot be stopped!",0,me->GetGUID());
}
void KilledUnit(Unit* victim)
@@ -78,11 +78,11 @@ struct boss_twilight_corrupterAI : public ScriptedAI
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
- m_creature->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
+ me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
if (KillCount == 3)
{
- DoCast(m_creature, SPELL_LEVEL_UP, true);
+ DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
@@ -94,12 +94,12 @@ struct boss_twilight_corrupterAI : public ScriptedAI
return;
if (SoulCorruption_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_CORRUPTION);
+ DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION);
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
} else SoulCorruption_Timer-=diff;
if (CreatureOfNightmare_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
+ DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
} else CreatureOfNightmare_Timer-=diff;
DoMeleeAttackIfReady();
diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp
index 83fe34bb572..fbd1f42a3dc 100644
--- a/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp
+++ b/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp
@@ -45,7 +45,7 @@ struct mobs_ghoul_flayerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
- m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
+ me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
}
};
@@ -89,8 +89,8 @@ struct npc_darrowshire_spiritAI : public ScriptedAI
void Reset()
{
- DoCast(m_creature, SPELL_SPIRIT_SPAWNIN);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_SPIRIT_SPAWNIN);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who) {}
diff --git a/src/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/scripts/eastern_kingdoms/elwynn_forest.cpp
index c4b764cb2bf..26f46800587 100644
--- a/src/scripts/eastern_kingdoms/elwynn_forest.cpp
+++ b/src/scripts/eastern_kingdoms/elwynn_forest.cpp
@@ -43,8 +43,8 @@ struct npc_henze_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
spellHit = false;
}
@@ -59,7 +59,7 @@ struct npc_henze_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (m_creature->IsStandState())
+ if (me->IsStandState())
{
if (lifeTimer <= diff)
{
@@ -75,11 +75,11 @@ struct npc_henze_faulkAI : public ScriptedAI
{
if (Spellkind->Id == 8593 && !spellHit)
{
- DoCast(m_creature, 32343);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoScriptText(SAY_HEAL, m_creature);
+ DoCast(me, 32343);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //me->RemoveAllAuras();
+ DoScriptText(SAY_HEAL, me);
spellHit = true;
}
}
diff --git a/src/scripts/eastern_kingdoms/eversong_woods.cpp b/src/scripts/eastern_kingdoms/eversong_woods.cpp
index 5ba6084a97d..0a5fa3fd920 100644
--- a/src/scripts/eastern_kingdoms/eversong_woods.cpp
+++ b/src/scripts/eastern_kingdoms/eversong_woods.cpp
@@ -61,9 +61,9 @@ struct npc_prospector_anvilwardAI : public npc_escortAI
switch (i)
{
- case 0: DoScriptText(SAY_ANVIL1, m_creature, pPlayer); break;
- case 5: DoScriptText(SAY_ANVIL2, m_creature, pPlayer); break;
- case 6: m_creature->setFaction(24); break;
+ case 0: DoScriptText(SAY_ANVIL1, me, pPlayer); break;
+ case 5: DoScriptText(SAY_ANVIL2, me, pPlayer); break;
+ case 6: me->setFaction(24); break;
}
}
@@ -191,15 +191,15 @@ struct npc_secondTrialAI : public ScriptedAI
questPhase = 0;
summonerGuid = 0;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
- m_creature->setFaction(FACTION_FRIENDLY);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
+ me->setFaction(FACTION_FRIENDLY);
spellFlashLight = false;
spellJustice = false;
spellJudLight = false;
spellCommand = false;
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case CHAMPION_BLOODWRATH:
spellFlashLight = true;
@@ -231,13 +231,13 @@ struct npc_secondTrialAI : public ScriptedAI
if (questPhase == 1)
if (timer <= diff)
{
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
- m_creature->setFaction(FACTION_HOSTILE);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
+ me->setFaction(FACTION_HOSTILE);
questPhase = 0;
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- m_creature->AddThreat(pTarget, 5000000.0f);
+ me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
}
}
@@ -249,10 +249,10 @@ struct npc_secondTrialAI : public ScriptedAI
// healer
if (spellFlashLight)
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 70)
if (timerFlashLight <= diff)
{
- DoCast(m_creature, SPELL_FLASH_OF_LIGHT);
+ DoCast(me, SPELL_FLASH_OF_LIGHT);
timerFlashLight = TIMER_FLASH_OF_LIGHT + rand()%TIMER_FLASH_OF_LIGHT;
}
else
@@ -261,7 +261,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJustice)
if (timerJustice <= diff)
{
- DoCast(m_creature, SPELL_SEAL_OF_JUSTICE);
+ DoCast(me, SPELL_SEAL_OF_JUSTICE);
timerJustice = TIMER_SEAL_OF_JUSTICE + rand()%TIMER_SEAL_OF_JUSTICE;
}
else
@@ -270,7 +270,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJudLight)
if (timerJudLight <= diff)
{
- DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT);
+ DoCast(me, SPELL_JUDGEMENT_OF_LIGHT);
timerJudLight = TIMER_JUDGEMENT_OF_LIGHT + rand()%TIMER_JUDGEMENT_OF_LIGHT;
}
else
@@ -279,7 +279,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellCommand)
if (timerCommand <= diff)
{
- DoCast(m_creature, TIMER_SEAL_OF_COMMAND);
+ DoCast(me, TIMER_SEAL_OF_COMMAND);
timerCommand = TIMER_SEAL_OF_COMMAND + rand()%TIMER_SEAL_OF_COMMAND;
}
else
@@ -333,23 +333,23 @@ struct master_kelerun_bloodmournAI : public ScriptedAI
{
if (timer <= diff)
{
- if (Creature* paladinSpawn = Unit::GetCreature((*m_creature), paladinGuid[paladinPhase]))
+ if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase]))
{
- CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID());
+ CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID());
switch(paladinPhase)
{
case 0:
- DoScriptText(TEXT_SECOND_TRIAL_1,m_creature);
+ DoScriptText(TEXT_SECOND_TRIAL_1,me);
break;
case 1:
- DoScriptText(TEXT_SECOND_TRIAL_2,m_creature);
+ DoScriptText(TEXT_SECOND_TRIAL_2,me);
break;
case 2:
- DoScriptText(TEXT_SECOND_TRIAL_3,m_creature);
+ DoScriptText(TEXT_SECOND_TRIAL_3,me);
break;
case 3:
- DoScriptText(TEXT_SECOND_TRIAL_4,m_creature);
+ DoScriptText(TEXT_SECOND_TRIAL_4,me);
break;
}
}
@@ -431,11 +431,11 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
{
- if (Creature *pSummoner = Unit::GetCreature((*m_creature), summonerGuid))
+ if (Creature *pSummoner = Unit::GetCreature((*me), summonerGuid))
CAST_AI(master_kelerun_bloodmournAI, pSummoner->AI())->SecondTrialKill();
// last kill quest complete for group
- if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER)
+ if (me->GetEntry() == CHAMPION_SUNSTRIKER)
{
if (Group *pGroup = CAST_PLR(Killer)->GetGroup())
{
@@ -444,7 +444,7 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
Player *pGroupGuy = itr->getSource();
// for any leave or dead (with not released body) group member at appropriate distance
- if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
+ if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL);
}
}
@@ -500,7 +500,7 @@ bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO)
struct npc_apprentice_mirvedaAI : public ScriptedAI
{
- npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {}
+ npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {}
uint32 KillCount;
uint64 PlayerGUID;
@@ -519,7 +519,7 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
Summons.Summon(summoned);
}
@@ -544,9 +544,9 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
if (Summon)
{
- m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
- m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
- m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
+ me->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
+ me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
+ me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
Summon = false;
}
}
@@ -613,7 +613,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit* who)
{
- if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
+ if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE)
{
@@ -627,7 +627,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void JustSummoned(Creature *summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -641,14 +641,14 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
{
if (EndTimer < diff && Progress)
{
- DoScriptText(EMOTE, m_creature);
+ DoScriptText(EMOTE, me);
Completed = true;
if (PlayerGUID)
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
CAST_PLR(pPlayer)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
- m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
+ me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
} else EndTimer -= diff;
if (WaveTimer < diff && !Completed && Progress)
@@ -656,9 +656,9 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
uint32 ran1 = rand()%8;
uint32 ran2 = rand()%8;
uint32 ran3 = rand()%8;
- m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
- m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
- m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
+ me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
+ me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
+ me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
WaveTimer = 30000;
} else WaveTimer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/ghostlands.cpp b/src/scripts/eastern_kingdoms/ghostlands.cpp
index 5087ceb8da5..ba4a27625fc 100644
--- a/src/scripts/eastern_kingdoms/ghostlands.cpp
+++ b/src/scripts/eastern_kingdoms/ghostlands.cpp
@@ -166,44 +166,44 @@ struct npc_ranger_lilathaAI : public npc_escortAI
{
case 0:
{
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
- DoScriptText(SAY_START, m_creature, pPlayer);
+ DoScriptText(SAY_START, me, pPlayer);
break;
}
case 5:
- DoScriptText(SAY_PROGRESS1, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS1, me, pPlayer);
case 11:
- DoScriptText(SAY_PROGRESS2, m_creature, pPlayer);
- m_creature->SetOrientation(4.762841);
+ DoScriptText(SAY_PROGRESS2, me, pPlayer);
+ me->SetOrientation(4.762841);
break;
case 18:
{
- DoScriptText(SAY_PROGRESS3, m_creature, pPlayer);
- Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
- Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
+ DoScriptText(SAY_PROGRESS3, me, pPlayer);
+ Creature* Summ1 = me->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Creature* Summ2 = me->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
- Summ1->Attack(m_creature, true);
+ Summ1->Attack(me, true);
Summ2->Attack(pPlayer, true);
}
- m_creature->AI()->AttackStart(Summ1);
+ me->AI()->AttackStart(Summ1);
break;
}
- case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
- case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
+ case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
+ case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 30:
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,me);
break;
case 32:
- m_creature->SetOrientation(2.978281);
- DoScriptText(SAY_END1, m_creature, pPlayer);
+ me->SetOrientation(2.978281);
+ DoScriptText(SAY_END1, me, pPlayer);
break;
case 33:
- m_creature->SetOrientation(5.858011);
- DoScriptText(SAY_END2, m_creature, pPlayer);
+ me->SetOrientation(5.858011);
+ DoScriptText(SAY_END2, me, pPlayer);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer);
diff --git a/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp b/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp
index 465ed5da357..e5a8e286948 100644
--- a/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp
+++ b/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp
@@ -133,7 +133,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
- if (GameObject* pGo = GameObject::GetGameObject(*m_creature, *itr))
+ if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
{
if (pGo)
{
@@ -144,7 +144,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
trigger->CastSpell(trigger,35470,true);
}
pGo->RemoveFromWorld();
- //pGo->CastSpell(m_creature,12158); makes all die?!
+ //pGo->CastSpell(me,12158); makes all die?!
}
}
}
@@ -152,11 +152,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (bBool)
{
if (pInstance)
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,false,pGo);
}else
if (pInstance)
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,false,pGo);
}
@@ -167,11 +167,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (bBool)
{
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
- m_creature->SetFacingToObject(pGo);
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ me->SetFacingToObject(pGo);
}else
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
- m_creature->SetFacingToObject(pGo);
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ me->SetFacingToObject(pGo);
}
void RestoreAll()
@@ -179,23 +179,23 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (!pInstance)
return;
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,false,pGo);
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,false,pGo);
if (!GoSummonList.empty())
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
- if (GameObject* pGo = GameObject::GetGameObject(*m_creature, *itr))
+ if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
pGo->RemoveFromWorld();
}
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
- if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pSummon = Unit::GetCreature(*me, *itr))
{
if (pSummon->isAlive())
pSummon->DisappearAndDie();
@@ -207,7 +207,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
void AggroAllPlayers(Creature* pTemp)
{
- Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
+ Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
@@ -233,8 +233,8 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
//just in case
if (GetPlayerForEscort())
- if (m_creature->getFaction() != GetPlayerForEscort()->getFaction())
- m_creature->setFaction(GetPlayerForEscort()->getFaction());
+ if (me->getFaction() != GetPlayerForEscort()->getFaction())
+ me->setFaction(GetPlayerForEscort()->getFaction());
switch(uiPoint)
{
@@ -266,7 +266,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
break;
case 14:
SetInFace(false);
- DoScriptText(SAY_BLASTMASTER_26,m_creature);
+ DoScriptText(SAY_BLASTMASTER_26,me);
SetEscortPaused(true);
NextStep(5000,false,20);
break;
@@ -279,7 +279,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
case 1:
SetEscortPaused(true);
- DoScriptText(SAY_BLASTMASTER_0,m_creature);
+ DoScriptText(SAY_BLASTMASTER_0,me);
NextStep(1500,true);
break;
case 2:
@@ -305,19 +305,19 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
switch(uiCase)
{
case 1:
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 2:
- if (GameObject* pGo = m_creature->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
+ if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
@@ -325,34 +325,34 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
Summon(3);
break;
case 3:
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- DoScriptText(SAY_BLASTMASTER_19,m_creature);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ DoScriptText(SAY_BLASTMASTER_19,me);
break;
case 4:
- if (GameObject* pGo = m_creature->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
+ if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
}
break;
case 5:
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- DoScriptText(SAY_BLASTMASTER_15,m_creature);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ DoScriptText(SAY_BLASTMASTER_15,me);
break;
case 6:
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
- m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 7:
- if (GameObject* pGo = m_creature->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
+ if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
@@ -360,16 +360,16 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
}
break;
case 8:
- if (GameObject* pGo = m_creature->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
+ if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
}
break;
case 9:
- if (Creature* pGrubbis = m_creature->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
+ if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
DoScriptText(SAY_GRUBBIS,pGrubbis);
- m_creature->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
+ me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
}
}
@@ -383,7 +383,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
switch(uiPhase)
{
case 1:
- DoScriptText(SAY_BLASTMASTER_1,m_creature);
+ DoScriptText(SAY_BLASTMASTER_1,me);
NextStep(1500,true);
break;
case 2:
@@ -391,34 +391,34 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
NextStep(0,false,0);
break;
case 3:
- DoScriptText(SAY_BLASTMASTER_2,m_creature);
+ DoScriptText(SAY_BLASTMASTER_2,me);
SetEscortPaused(false);
NextStep(0,false,0);
break;
case 4:
- DoScriptText(SAY_BLASTMASTER_3,m_creature);
+ DoScriptText(SAY_BLASTMASTER_3,me);
NextStep(3000,true);
break;
case 5:
- DoScriptText(SAY_BLASTMASTER_4,m_creature);
+ DoScriptText(SAY_BLASTMASTER_4,me);
NextStep(3000,true);
break;
case 6:
SetInFace(true);
- DoScriptText(SAY_BLASTMASTER_5,m_creature);
+ DoScriptText(SAY_BLASTMASTER_5,me);
Summon(1);
if (pInstance)
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,true,pGo);
NextStep(3000,true);
break;
case 7:
- DoScriptText(SAY_BLASTMASTER_6,m_creature);
+ DoScriptText(SAY_BLASTMASTER_6,me);
SetEscortPaused(false);
NextStep(0,false,0);
break;
case 8:
- m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
+ me->HandleEmoteCommand(EMOTE_STATE_WORK);
NextStep(25000,true);
break;
case 9:
@@ -430,37 +430,37 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
NextStep(0,false);
break;
case 11:
- DoScriptText(SAY_BLASTMASTER_17,m_creature);
+ DoScriptText(SAY_BLASTMASTER_17,me);
NextStep(5000,true);
break;
case 12:
- DoScriptText(SAY_BLASTMASTER_18,m_creature);
+ DoScriptText(SAY_BLASTMASTER_18,me);
NextStep(5000,true);
break;
case 13:
- DoScriptText(SAY_BLASTMASTER_20,m_creature);
+ DoScriptText(SAY_BLASTMASTER_20,me);
CaveDestruction(true);
NextStep(8000,true);
break;
case 14:
- DoScriptText(SAY_BLASTMASTER_21,m_creature);
+ DoScriptText(SAY_BLASTMASTER_21,me);
NextStep(8500,true);
break;
case 15:
- DoScriptText(SAY_BLASTMASTER_22,m_creature);
+ DoScriptText(SAY_BLASTMASTER_22,me);
NextStep(2000,true);
break;
case 16:
- DoScriptText(SAY_BLASTMASTER_23,m_creature);
+ DoScriptText(SAY_BLASTMASTER_23,me);
SetInFace(false);
if (pInstance)
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,true,pGo);
NextStep(2000,true);
break;
case 17:
SetEscortPaused(false);
- DoScriptText(SAY_BLASTMASTER_24,m_creature);
+ DoScriptText(SAY_BLASTMASTER_24,me);
Summon(6);
NextStep(0,false);
break;
@@ -471,11 +471,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
case 19:
SetInFace(false);
Summon(8);
- DoScriptText(SAY_BLASTMASTER_25,m_creature);
+ DoScriptText(SAY_BLASTMASTER_25,me);
NextStep(0,false);
break;
case 20:
- DoScriptText(SAY_BLASTMASTER_27,m_creature);
+ DoScriptText(SAY_BLASTMASTER_27,me);
NextStep(2000,true);
break;
case 21:
@@ -484,7 +484,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
break;
case 22:
CaveDestruction(false);
- DoScriptText(SAY_BLASTMASTER_20,m_creature);
+ DoScriptText(SAY_BLASTMASTER_20,me);
NextStep(0,false);
break;
}
@@ -545,10 +545,10 @@ struct boss_grubbisAI : public ScriptedAI
void SetDataSummoner()
{
- if (!m_creature->isSummon())
+ if (!me->isSummon())
return;
- if (Unit* pSummon = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2,1);
}
@@ -562,10 +562,10 @@ struct boss_grubbisAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- if (!m_creature->isSummon())
+ if (!me->isSummon())
return;
- if (Unit* pSummon = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2,2);
}
};
diff --git a/src/scripts/eastern_kingdoms/hinterlands.cpp b/src/scripts/eastern_kingdoms/hinterlands.cpp
index 082f8895e3c..a26a10cfdb1 100644
--- a/src/scripts/eastern_kingdoms/hinterlands.cpp
+++ b/src/scripts/eastern_kingdoms/hinterlands.cpp
@@ -61,15 +61,15 @@ struct npc_00x09hlAI : public npc_escortAI
switch(uiPointId)
{
case 26:
- DoScriptText(SAY_OOX_AMBUSH, m_creature);
+ DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 43:
- DoScriptText(SAY_OOX_AMBUSH, m_creature);
+ DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 64:
- DoScriptText(SAY_OOX_END, m_creature);
+ DoScriptText(SAY_OOX_END, me);
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature);
+ pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, me);
break;
}
}
@@ -92,8 +92,8 @@ struct npc_00x09hlAI : public npc_escortAI
{
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
Position dst;
- m_creature->GetRandomPoint(src, 7.0f, dst);
- m_creature->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
+ me->GetRandomPoint(src, 7.0f, dst);
+ me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
}
@@ -105,14 +105,14 @@ struct npc_00x09hlAI : public npc_escortAI
return;
if (rand()%1)
- DoScriptText(SAY_OOX_AGGRO1, m_creature);
+ DoScriptText(SAY_OOX_AGGRO1, me);
else
- DoScriptText(SAY_OOX_AGGRO2, m_creature);
+ DoScriptText(SAY_OOX_AGGRO2, me);
}
void JustSummoned(Creature* pSummoned)
{
- pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ pSummoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
};
@@ -218,7 +218,7 @@ struct npc_rinjiAI : public npc_escortAI
return;
//only if attacked and escorter is not in combat?
- DoScriptText(RAND(SAY_RIN_HELP_1,SAY_RIN_HELP_2), m_creature);
+ DoScriptText(RAND(SAY_RIN_HELP_1,SAY_RIN_HELP_2), me);
}
}
@@ -227,13 +227,13 @@ struct npc_rinjiAI : public npc_escortAI
if (!bFirst)
m_iSpawnId = 1;
- m_creature->SummonCreature(NPC_RANGER,
+ me->SummonCreature(NPC_RANGER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
for (int i = 0; i < 2; ++i)
{
- m_creature->SummonCreature(NPC_OUTRUNNER,
+ me->SummonCreature(NPC_OUTRUNNER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
}
@@ -255,7 +255,7 @@ struct npc_rinjiAI : public npc_escortAI
switch(uiPointId)
{
case 1:
- DoScriptText(SAY_RIN_FREE, m_creature, pPlayer);
+ DoScriptText(SAY_RIN_FREE, me, pPlayer);
break;
case 7:
DoSpawnAmbush(true);
@@ -264,8 +264,8 @@ struct npc_rinjiAI : public npc_escortAI
DoSpawnAmbush(false);
break;
case 17:
- DoScriptText(SAY_RIN_COMPLETE, m_creature, pPlayer);
- pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, m_creature);
+ DoScriptText(SAY_RIN_COMPLETE, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun();
m_uiPostEventCount = 1;
break;
@@ -288,18 +288,18 @@ struct npc_rinjiAI : public npc_escortAI
switch(m_uiPostEventCount)
{
case 1:
- DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer);
+ DoScriptText(SAY_RIN_PROGRESS_1, me, pPlayer);
++m_uiPostEventCount;
break;
case 2:
- DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer);
+ DoScriptText(SAY_RIN_PROGRESS_2, me, pPlayer);
m_uiPostEventCount = 0;
break;
}
}
else
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
}
diff --git a/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp b/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp
index fa36f78f636..8f44eee60d9 100644
--- a/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp
+++ b/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp
@@ -63,13 +63,13 @@ struct npc_converted_sentryAI : public ScriptedAI
{
uint32 i = urand(1,2);
if (i == 1)
- DoScriptText(SAY_CONVERTED_1, m_creature);
+ DoScriptText(SAY_CONVERTED_1, me);
else
- DoScriptText(SAY_CONVERTED_2, m_creature);
+ DoScriptText(SAY_CONVERTED_2, me);
- DoCast(m_creature, SPELL_CONVERT_CREDIT);
- if (m_creature->isPet())
- CAST_PET(m_creature)->SetDuration(7500);
+ DoCast(me, SPELL_CONVERT_CREDIT);
+ if (me->isPet())
+ CAST_PET(me)->SetDuration(7500);
Credit = true;
} else Timer -= diff;
}
@@ -107,20 +107,20 @@ struct npc_greengill_slaveAI : public ScriptedAI
if (!caster)
return;
- if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE))
+ if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !me->HasAura(ENRAGE))
{
PlayerGUID = caster->GetGUID();
if (PlayerGUID)
{
- Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
+ Unit* plr = Unit::GetUnit((*me), PlayerGUID);
if (plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
DoCast(plr, 45110, true);
}
- DoCast(m_creature, ENRAGE);
+ DoCast(me, ENRAGE);
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
if (Myrmidon)
{
- m_creature->AddThreat(Myrmidon, 100000.0f);
+ me->AddThreat(Myrmidon, 100000.0f);
AttackStart(Myrmidon);
}
}
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp
index f27203b8c75..53be3d74d63 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp
@@ -60,22 +60,22 @@ struct boss_curatorAI : public ScriptedAI
Enraged = false;
Evocating = false;
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -89,17 +89,17 @@ struct boss_curatorAI : public ScriptedAI
//if evocate, then break evocate
if (Evocating)
{
- if (m_creature->HasAura(SPELL_EVOCATION))
- m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION);
+ if (me->HasAura(SPELL_EVOCATION))
+ me->RemoveAurasDueToSpell(SPELL_EVOCATION);
Evocating = false;
}
//may not be correct SAY (generic hard enrage)
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoScriptText(SAY_ENRAGE, me);
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_BERSERK);
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_BERSERK);
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
Enraged = true;
@@ -108,7 +108,7 @@ struct boss_curatorAI : public ScriptedAI
if (Evocating)
{
//not supposed to do anything while evocate
- if (m_creature->HasAura(SPELL_EVOCATION))
+ if (me->HasAura(SPELL_EVOCATION))
return;
else
Evocating = false;
@@ -130,17 +130,17 @@ struct boss_curatorAI : public ScriptedAI
}
//Reduce Mana by 10% of max health
- if (int32 mana = m_creature->GetMaxPower(POWER_MANA))
+ if (int32 mana = me->GetMaxPower(POWER_MANA))
{
mana /= 10;
- m_creature->ModifyPower(POWER_MANA, -mana);
+ me->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)
+ if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10)
{
- DoScriptText(SAY_EVOCATE, m_creature);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_EVOCATION);
+ DoScriptText(SAY_EVOCATE, me);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_EVOCATION);
Evocating = true;
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
return;
@@ -149,7 +149,7 @@ struct boss_curatorAI : public ScriptedAI
{
if (urand(0,1) == 0)
{
- DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
}
}
}
@@ -157,11 +157,11 @@ struct boss_curatorAI : public ScriptedAI
AddTimer = 10000;
} else AddTimer -= diff;
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15)
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 15)
{
Enraged = true;
- DoCast(m_creature, SPELL_ENRAGE);
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(me, SPELL_ENRAGE);
+ DoScriptText(SAY_ENRAGE, me);
}
}
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp
index d4b0e9c7806..e00a527f68d 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp
@@ -63,17 +63,17 @@ struct boss_maiden_of_virtueAI : public ScriptedAI
void KilledUnit(Unit* Victim)
{
if (urand(0,1) == 0)
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -83,20 +83,20 @@ struct boss_maiden_of_virtueAI : public ScriptedAI
if (Enrage_Timer < diff && !Enraged)
{
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoCast(me, SPELL_BERSERK, true);
Enraged = true;
} else Enrage_Timer -= diff;
if (Holyground_Timer <= diff)
{
- DoCast(m_creature, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
+ DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
Holyground_Timer = 3000;
} else Holyground_Timer -= diff;
if (Repentance_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REPENTANCE);
- DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), m_creature);
+ DoCast(me->getVictim(), SPELL_REPENTANCE);
+ DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me);
Repentance_Timer = urand(25000,35000); //A little randomness on that spell
} else Repentance_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp
index 4acbe9eaae2..af700bf1208 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp
@@ -58,8 +58,8 @@ struct boss_midnightAI : public ScriptedAI
Attumen = 0;
Mount_Timer = 0;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
}
void EnterCombat(Unit* who) {}
@@ -68,7 +68,7 @@ struct boss_midnightAI : public ScriptedAI
{
if (Phase == 2)
{
- if (Unit *pUnit = Unit::GetUnit(*m_creature, Attumen))
+ if (Unit *pUnit = Unit::GetUnit(*me, Attumen))
DoScriptText(SAY_MIDNIGHT_KILL, pUnit);
}
}
@@ -78,20 +78,20 @@ struct boss_midnightAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
+ if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95)
{
Phase = 2;
- if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
+ if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
{
Attumen = pAttumen->GetGUID();
- pAttumen->AI()->AttackStart(m_creature->getVictim());
- SetMidnight(pAttumen, m_creature->GetGUID());
+ pAttumen->AI()->AttackStart(me->getVictim());
+ SetMidnight(pAttumen, me->GetGUID());
DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen);
}
}
- else if (Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
+ else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25)
{
- if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen))
+ if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
Mount(pAttumen);
}
else if (Phase == 3)
@@ -101,9 +101,9 @@ struct boss_midnightAI : public ScriptedAI
if (Mount_Timer <= diff)
{
Mount_Timer = 0;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->GetMotionMaster()->MoveIdle();
- if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen))
+ me->SetVisibility(VISIBILITY_OFF);
+ me->GetMotionMaster()->MoveIdle();
+ if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
{
pAttumen->SetDisplayId(MOUNTED_DISPLAYID);
pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -126,20 +126,20 @@ struct boss_midnightAI : public ScriptedAI
{
DoScriptText(SAY_MOUNT, pAttumen);
Phase = 3;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- float angle = m_creature->GetAngle(pAttumen);
- float distance = m_creature->GetDistance2d(pAttumen);
- float newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
- float newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
+ float angle = me->GetAngle(pAttumen);
+ float distance = me->GetDistance2d(pAttumen);
+ float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
+ float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
float newZ = 50;
- //m_creature->Relocate(newX,newY,newZ,angle);
- //m_creature->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
+ //me->Relocate(newX,newY,newZ,angle);
+ //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
distance += 10;
- newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
- newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
+ newX = me->GetPositionX() + cos(angle)*(distance/2) ;
+ newY = me->GetPositionY() + sin(angle)*(distance/2) ;
pAttumen->GetMotionMaster()->Clear();
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//pAttumen->Relocate(newX,newY,newZ,-angle);
@@ -185,13 +185,13 @@ struct boss_attumenAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
- if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight))
+ DoScriptText(SAY_DEATH, me);
+ if (Unit *pMidnight = Unit::GetUnit(*me, Midnight))
pMidnight->Kill(pMidnight);
}
@@ -202,15 +202,15 @@ struct boss_attumenAI : public ScriptedAI
if (ResetTimer <= diff)
{
ResetTimer = 0;
- Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight);
+ Unit *pMidnight = Unit::GetUnit(*me, Midnight);
if (pMidnight)
{
pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pMidnight->SetVisibility(VISIBILITY_ON);
}
Midnight = 0;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->Kill(m_creature);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->Kill(me);
}
} else ResetTimer -= diff;
@@ -218,38 +218,38 @@ struct boss_attumenAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
return;
if (CleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE);
+ DoCast(me->getVictim(), SPELL_SHADOWCLEAVE);
CleaveTimer = urand(10000,15000);
} else CleaveTimer -= diff;
if (CurseTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
+ DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
CurseTimer = 30000;
} else CurseTimer -= diff;
if (RandomYellTimer <= diff)
{
- DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), m_creature);
+ DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me);
RandomYellTimer = urand(30000,60000);
} else RandomYellTimer -= diff;
- if (m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
+ if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
{
if (ChargeTimer <= diff)
{
Unit *pTarget;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if (pTarget && !pTarget->IsWithinDist(m_creature, ATTACK_DISTANCE, false))
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (pTarget && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false))
target_list.push_back(pTarget);
pTarget = NULL;
}
@@ -262,13 +262,13 @@ struct boss_attumenAI : public ScriptedAI
}
else
{
- if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
+ if ((me->GetHealth()*100)/me->GetMaxHealth() < 25)
{
- Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight);
+ Creature *pMidnight = Unit::GetCreature(*me, Midnight);
if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
{
- CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(m_creature);
- m_creature->SetHealth(pMidnight->GetHealth());
+ CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(me);
+ me->SetHealth(pMidnight->GetHealth());
DoResetThreat();
}
}
@@ -280,7 +280,7 @@ struct boss_attumenAI : public ScriptedAI
void SpellHit(Unit *source, const SpellEntry *spell)
{
if (spell->Mechanic == MECHANIC_DISARM)
- DoScriptText(SAY_DISARMED, m_creature);
+ DoScriptText(SAY_DISARMED, me);
}
};
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp
index 90fbfc95d9c..6024fd5580f 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp
@@ -93,7 +93,7 @@ struct boss_moroesAI : public ScriptedAI
Enrage = false;
InVanish = false;
- if (m_creature->GetHealth() > 0)
+ if (me->GetHealth() > 0)
{
SpawnAdds();
}
@@ -114,19 +114,19 @@ struct boss_moroesAI : public ScriptedAI
{
StartEvent();
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
AddsAttack();
DoZoneInCombat();
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
}
void JustDied(Unit* victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_MOROES, DONE);
@@ -157,7 +157,7 @@ struct boss_moroesAI : public ScriptedAI
{
uint32 entry = *itr;
- pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ pCreature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
{
AddGUID[i] = pCreature->GetGUID();
@@ -169,7 +169,7 @@ struct boss_moroesAI : public ScriptedAI
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature *pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ Creature *pCreature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
{
AddGUID[i] = pCreature->GetGUID();
@@ -195,7 +195,7 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
+ Temp = Creature::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
Temp->DisappearAndDie();
}
@@ -209,10 +209,10 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
+ Temp = Creature::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
{
- Temp->AI()->AttackStart(m_creature->getVictim());
+ Temp->AI()->AttackStart(me->getVictim());
DoZoneInCombat(Temp);
} else
EnterEvadeMode();
@@ -231,9 +231,9 @@ struct boss_moroesAI : public ScriptedAI
return;
}
- if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() < 30)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
Enrage = true;
}
@@ -244,10 +244,10 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Unit::GetCreature((*m_creature),AddGUID[i]);
+ Temp = Unit::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
if (!Temp->getVictim())
- Temp->AI()->AttackStart(m_creature->getVictim());
+ Temp->AI()->AttackStart(me->getVictim());
}
}
CheckAdds_Timer = 5000;
@@ -258,7 +258,7 @@ struct boss_moroesAI : public ScriptedAI
//Cast Vanish, then Garrote random victim
if (Vanish_Timer <= diff)
{
- DoCast(m_creature, SPELL_VANISH);
+ DoCast(me, SPELL_VANISH);
InVanish = true;
Vanish_Timer = 30000;
Wait_Timer = 5000;
@@ -273,9 +273,9 @@ struct boss_moroesAI : public ScriptedAI
if (Blind_Timer <= diff)
{
std::list<Unit*> pTargets;
- SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, m_creature->GetMeleeReach()*5, true);
+ SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
- if (!m_creature->IsWithinMeleeRange(*i))
+ if (!me->IsWithinMeleeRange(*i))
{
DoCast(*i, SPELL_BLIND);
break;
@@ -288,7 +288,7 @@ struct boss_moroesAI : public ScriptedAI
{
if (Wait_Timer <= diff)
{
- DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), m_creature);
+ DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget, SPELL_GARROTE,true);
@@ -328,7 +328,7 @@ struct boss_moroes_guestAI : public ScriptedAI
return;
uint64 MoroesGUID = pInstance->GetData64(DATA_MOROES);
- Creature* Moroes = (Unit::GetCreature((*m_creature), MoroesGUID));
+ Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID));
if (Moroes)
{
for (uint8 i = 0; i < 4; ++i)
@@ -345,12 +345,12 @@ struct boss_moroes_guestAI : public ScriptedAI
uint64 TempGUID = GuestGUID[rand()%4];
if (TempGUID)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID);
+ Unit* pUnit = Unit::GetUnit((*me), TempGUID);
if (pUnit && pUnit->isAlive())
return pUnit;
}
- return m_creature;
+ return me;
}
void UpdateAI(const uint32 diff)
@@ -382,7 +382,7 @@ struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
MindFlay_Timer = 1000;
ShadowWordPain_Timer = 6000;
- DoCast(m_creature, SPELL_SHADOWFORM, true);
+ DoCast(me, SPELL_SHADOWFORM, true);
boss_moroes_guestAI::Reset();
}
@@ -396,7 +396,7 @@ struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
if (MindFlay_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDFLY);
+ DoCast(me->getVictim(), SPELL_MINDFLY);
MindFlay_Timer = 12000; // 3 sec channeled
} else MindFlay_Timer -= diff;
@@ -450,20 +450,20 @@ struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
if (SealOfCommand_Timer <= diff)
{
- DoCast(m_creature, SPELL_SEALOFCOMMAND);
+ DoCast(me, SPELL_SEALOFCOMMAND);
SealOfCommand_Timer = 32000;
JudgementOfCommand_Timer = 29000;
} else SealOfCommand_Timer -= diff;
if (JudgementOfCommand_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_JUDGEMENTOFCOMMAND);
+ DoCast(me->getVictim(), SPELL_JUDGEMENTOFCOMMAND);
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
} else JudgementOfCommand_Timer -= diff;
if (HammerOfJustice_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMMEROFJUSTICE);
+ DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
HammerOfJustice_Timer = 12000;
} else HammerOfJustice_Timer -= diff;
}
@@ -505,7 +505,7 @@ struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
if (PowerWordShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_PWSHIELD);
+ DoCast(me, SPELL_PWSHIELD);
PowerWordShield_Timer = 15000;
} else PowerWordShield_Timer -= diff;
@@ -519,7 +519,7 @@ struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
if (HolyFire_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HOLYFIRE);
+ DoCast(me->getVictim(), SPELL_HOLYFIRE);
HolyFire_Timer = 22000;
} else HolyFire_Timer -= diff;
@@ -569,7 +569,7 @@ struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
if (DivineShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_DIVINESHIELD);
+ DoCast(me, SPELL_DIVINESHIELD);
DivineShield_Timer = 31000;
} else DivineShield_Timer -= diff;
@@ -632,19 +632,19 @@ struct boss_lord_robin_darisAI : public boss_moroes_guestAI
if (Hamstring_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ DoCast(me->getVictim(), SPELL_HAMSTRING);
Hamstring_Timer = 12000;
} else Hamstring_Timer -= diff;
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 18000;
} else MortalStrike_Timer -= diff;
if (WhirlWind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
WhirlWind_Timer = 21000;
} else WhirlWind_Timer -= diff;
}
@@ -684,25 +684,25 @@ struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
if (Disarm_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DISARM);
+ DoCast(me->getVictim(), SPELL_DISARM);
Disarm_Timer = 12000;
} else Disarm_Timer -= diff;
if (HeroicStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HEROICSTRIKE);
+ DoCast(me->getVictim(), SPELL_HEROICSTRIKE);
HeroicStrike_Timer = 10000;
} else HeroicStrike_Timer -= diff;
if (ShieldBash_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHIELDBASH);
+ DoCast(me->getVictim(), SPELL_SHIELDBASH);
ShieldBash_Timer = 13000;
} else ShieldBash_Timer -= diff;
if (ShieldWall_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHIELDWALL);
+ DoCast(me, SPELL_SHIELDWALL);
ShieldWall_Timer = 21000;
} else ShieldWall_Timer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp
index 888d222712a..ebb51fc74cc 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp
@@ -135,7 +135,7 @@ struct boss_netherspiteAI : public ScriptedAI
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
for (int i=0; i<3; ++i)
- if (Creature *portal = m_creature->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
+ if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
{
PortalGUID[i] = portal->GetGUID();
portal->AddAura(PortalVisual[i], portal);
@@ -146,9 +146,9 @@ struct boss_netherspiteAI : public ScriptedAI
{
for (int i=0; i<3; ++i)
{
- if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[i]))
+ if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i]))
portal->DisappearAndDie();
- if (Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i]))
+ if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i]))
portal->DisappearAndDie();
PortalGUID[i] = 0;
BeamTarget[i] = 0;
@@ -158,14 +158,14 @@ struct boss_netherspiteAI : public ScriptedAI
void UpdatePortals() // Here we handle the beams' behavior
{
for (int j=0; j<3; ++j) // j = color
- if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[j]))
+ if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j]))
{
// the one who's been casted upon before
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
- Unit *pTarget = m_creature;
+ Unit *pTarget = me;
- if (Map* map = m_creature->GetMap())
+ if (Map* map = me->GetMap())
{
Map::PlayerList const& players = map->GetPlayers();
@@ -178,7 +178,7 @@ struct boss_netherspiteAI : public ScriptedAI
&& !p->HasAura(PlayerDebuff[j],0) // not exhausted
&& !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam
&& !p->HasAura(PlayerBuff[(j+2)%3],0)
- && IsBetween(m_creature, p, portal)) // on the beam
+ && IsBetween(me, p, portal)) // on the beam
pTarget = p;
}
}
@@ -207,41 +207,41 @@ struct boss_netherspiteAI : public ScriptedAI
}
}
// aggro target if Red Beam
- if (j == RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- m_creature->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(m_creature->getVictim()));
+ if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
+ me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim()));
}
}
void SwitchToPortalPhase()
{
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
+ me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
+ me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
SummonPortals();
PhaseTimer = 60000;
PortalPhase = true;
PortalTimer = 10000;
EmpowermentTimer = 10000;
- DoScriptText(EMOTE_PHASE_PORTAL,m_creature);
+ DoScriptText(EMOTE_PHASE_PORTAL,me);
}
void SwitchToBanishPhase()
{
- m_creature->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
- m_creature->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
- DoCast(m_creature, SPELL_BANISH_VISUAL, true);
- DoCast(m_creature, SPELL_BANISH_ROOT, true);
+ me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
+ me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
+ DoCast(me, SPELL_BANISH_VISUAL, true);
+ DoCast(me, SPELL_BANISH_ROOT, true);
DestroyPortals();
PhaseTimer = 30000;
PortalPhase = false;
- DoScriptText(EMOTE_PHASE_BANISH,m_creature);
+ DoScriptText(EMOTE_PHASE_BANISH,me);
for (int i=0; i<3; ++i)
- m_creature->RemoveAurasDueToSpell(NetherBuff[i]);
+ me->RemoveAurasDueToSpell(NetherBuff[i]);
}
void HandleDoors(bool open) // Massive Door switcher
{
- if (GameObject *Door = GameObject::GetGameObject(*m_creature, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
+ if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
@@ -272,8 +272,8 @@ struct boss_netherspiteAI : public ScriptedAI
// NetherInfusion Berserk
if (!Berserk && NetherInfusionTimer <= diff)
{
- m_creature->AddAura(SPELL_NETHER_INFUSION, m_creature);
- DoCast(m_creature, SPELL_NETHERSPITE_ROAR);
+ me->AddAura(SPELL_NETHER_INFUSION, me);
+ DoCast(me, SPELL_NETHERSPITE_ROAR);
Berserk = true;
} else NetherInfusionTimer -= diff;
@@ -289,14 +289,14 @@ struct boss_netherspiteAI : public ScriptedAI
// Empowerment & Nether Burn
if (EmpowermentTimer <= diff)
{
- DoCast(m_creature, SPELL_EMPOWERMENT);
- m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature);
+ DoCast(me, SPELL_EMPOWERMENT);
+ me->AddAura(SPELL_NETHERBURN_AURA, me);
EmpowermentTimer = 90000;
} else EmpowermentTimer -= diff;
if (PhaseTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
SwitchToBanishPhase();
return;
@@ -315,7 +315,7 @@ struct boss_netherspiteAI : public ScriptedAI
if (PhaseTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
SwitchToPortalPhase();
return;
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp
index 5554e6d700c..e9adbd7d758 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp
@@ -108,15 +108,15 @@ struct boss_nightbaneAI : public ScriptedAI
FlyCount = 0;
MovePhase = 0;
- m_creature->SetSpeed(MOVE_RUN, 2.0f);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->setActive(true);
+ me->SetSpeed(MOVE_RUN, 2.0f);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->setActive(true);
if (pInstance)
{
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
}
@@ -128,8 +128,8 @@ struct boss_nightbaneAI : public ScriptedAI
if (!Intro)
{
- m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
+ me->GetMotionMaster()->MoveTargetedHome();
}
}
@@ -148,7 +148,7 @@ struct boss_nightbaneAI : public ScriptedAI
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
HandleTerraceDoors(false);
- m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
}
void AttackStart(Unit* who)
@@ -181,7 +181,7 @@ struct boss_nightbaneAI : public ScriptedAI
if (id >= 8)
{
Intro = false;
- m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
+ me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
return;
}
@@ -192,7 +192,7 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (id == 0)
{
- m_creature->MonsterTextEmote(EMOTE_BREATH, 0, true);
+ me->MonsterTextEmote(EMOTE_BREATH, 0, true);
Flying = false;
Phase = 2;
return;
@@ -219,18 +219,18 @@ struct boss_nightbaneAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
- summoned->AI()->AttackStart(m_creature->getVictim());
+ summoned->AI()->AttackStart(me->getVictim());
}
void TakeOff()
{
- m_creature->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
+ me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ (*me).GetMotionMaster()->Clear(false);
+ (*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
Flying = true;
@@ -251,13 +251,13 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (MovePhase >= 7)
{
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
{
- m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
+ me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
@@ -265,13 +265,13 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (MovePhase >= 7)
{
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
{
- m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
+ me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
@@ -291,19 +291,19 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (Movement)
{
- DoStartMovement(m_creature->getVictim());
+ DoStartMovement(me->getVictim());
Movement = false;
}
if (BellowingRoarTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR);
+ DoCast(me->getVictim(), SPELL_BELLOWING_ROAR);
BellowingRoarTimer = urand(30000,40000);
} else BellowingRoarTimer -= diff;
if (SmolderingBreathTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SMOLDERING_BREATH);
+ DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH);
SmolderingBreathTimer = 20000;
} else SmolderingBreathTimer -= diff;
@@ -317,7 +317,7 @@ struct boss_nightbaneAI : public ScriptedAI
if (TailSweepTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- if (!m_creature->HasInArc(M_PI, pTarget))
+ if (!me->HasInArc(M_PI, pTarget))
DoCast(pTarget, SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;
} else TailSweepTimer -= diff;
@@ -330,7 +330,7 @@ struct boss_nightbaneAI : public ScriptedAI
} else SearingCindersTimer -= diff;
uint32 Prozent;
- Prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
+ Prozent = (me->GetHealth()*100) / me->GetMaxHealth();
if (Prozent < 75 && FlyCount == 0) // first take off 75%
TakeOff();
@@ -353,14 +353,14 @@ struct boss_nightbaneAI : public ScriptedAI
{
for (uint8 i = 0; i <= 3; ++i)
{
- DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON);
+ DoCast(me->getVictim(), SPELL_SUMMON_SKELETON);
Skeletons = true;
}
}
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
{
- DoCast(m_creature->getVictim(), SPELL_RAIN_OF_BONES);
+ DoCast(me->getVictim(), SPELL_RAIN_OF_BONES);
RainBones = true;
SmokingBlastTimer = 20000;
} else RainofBonesTimer -= diff;
@@ -377,7 +377,7 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (SmokingBlastTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SMOKING_BLAST);
+ DoCast(me->getVictim(), SPELL_SMOKING_BLAST);
SmokingBlastTimer = 1500; //timer wrong
} else SmokingBlastTimer -= diff;
}
@@ -391,10 +391,10 @@ struct boss_nightbaneAI : public ScriptedAI
if (FlyTimer <= diff) //landing
{
- m_creature->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
+ me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
Flying = true;
} else FlyTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp
index edca9658e5e..1ce5d61b7ba 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp
@@ -113,7 +113,7 @@ struct netherspite_infernalAI : public ScriptedAI
if (HellfireTimer)
if (HellfireTimer <= diff)
{
- DoCast(m_creature, SPELL_HELLFIRE);
+ DoCast(me, SPELL_HELLFIRE);
HellfireTimer = 0;
}
else HellfireTimer -= diff;
@@ -128,7 +128,7 @@ struct netherspite_infernalAI : public ScriptedAI
void KilledUnit(Unit *who)
{
- Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
+ Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
if (pMalchezaar)
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
}
@@ -137,8 +137,8 @@ struct netherspite_infernalAI : public ScriptedAI
{
if (spell->Id == SPELL_INFERNAL_RELAY)
{
- m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
HellfireTimer = 4000;
CleanupTimer = 170000;
}
@@ -212,12 +212,12 @@ struct boss_malchezaarAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
AxesCleanup();
ClearWeapons();
@@ -233,7 +233,7 @@ struct boss_malchezaarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
@@ -243,7 +243,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
//Infernal Cleanup
for (std::vector<uint64>::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
- if (Unit *pInfernal = Unit::GetUnit(*m_creature, *itr))
+ if (Unit *pInfernal = Unit::GetUnit(*me, *itr))
if (pInfernal->isAlive())
{
pInfernal->SetVisibility(VISIBILITY_OFF);
@@ -257,7 +257,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
- Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
+ Unit *axe = Unit::GetUnit(*me, axes[i]);
if (axe && axe->isAlive())
axe->Kill(axe);
axes[i] = 0;
@@ -269,10 +269,10 @@ struct boss_malchezaarAI : public ScriptedAI
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
//damage
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
+ me->UpdateDamagePhysical(BASE_ATTACK);
}
void EnfeebleHealthEffect()
@@ -281,7 +281,7 @@ struct boss_malchezaarAI : public ScriptedAI
if (!info)
return;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> targets;
if (!t_list.size())
@@ -291,7 +291,7 @@ struct boss_malchezaarAI : public ScriptedAI
std::list<HostileReference *>::const_iterator itr = t_list.begin();
std::advance(itr, 1);
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
- if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
@@ -306,7 +306,7 @@ struct boss_malchezaarAI : public ScriptedAI
enfeeble_targets[i] = pTarget->GetGUID();
enfeeble_health[i] = pTarget->GetHealth();
- pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
+ pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
pTarget->SetHealth(1);
}
}
@@ -315,7 +315,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 5; ++i)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
+ Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]);
if (pTarget && pTarget->isAlive())
pTarget->SetHealth(enfeeble_health[i]);
enfeeble_targets[i] = 0;
@@ -327,7 +327,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
InfernalPoint *point = NULL;
Position pos;
- if ((m_creature->GetMapId() != 532) || positions.empty())
+ if ((me->GetMapId() != 532) || positions.empty())
me->GetRandomNearPosition(pos, 60);
else
{
@@ -337,21 +337,21 @@ struct boss_malchezaarAI : public ScriptedAI
pos.Relocate(point->x, point->y, INFERNAL_Z);
}
- Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
+ Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
if (Infernal)
{
Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
- Infernal->setFaction(m_creature->getFaction());
+ Infernal->setFaction(me->getFaction());
if (point)
CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point;
- CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID();
+ CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID();
infernals.push_back(Infernal->GetGUID());
DoCast(Infernal, SPELL_INFERNAL_RELAY);
}
- DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
}
void UpdateAI(const uint32 diff)
@@ -365,50 +365,50 @@ struct boss_malchezaarAI : public ScriptedAI
EnfeebleResetTimer = 0;
} else EnfeebleResetTimer -= diff;
- if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
+ if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
return;
- if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET) != m_creature->getVictim()->GetGUID())
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID());
+ if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
+ me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID());
if (phase == 1)
{
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 60)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
phase = 2;
//animation
- DoCast(m_creature, SPELL_EQUIP_AXES);
+ DoCast(me, SPELL_EQUIP_AXES);
//text
- DoScriptText(SAY_AXE_TOSS1, m_creature);
+ DoScriptText(SAY_AXE_TOSS1, me);
//passive thrash aura
- DoCast(m_creature, SPELL_THRASH_AURA, true);
+ DoCast(me, SPELL_THRASH_AURA, true);
//models
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
//damage
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
+ me->UpdateDamagePhysical(BASE_ATTACK);
- m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
- m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
+ me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
+ me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
//Sigh, updating only works on main attack, do it manually ....
- m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
- m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
+ me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
+ me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
- m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100);
+ me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100);
}
}
else if (phase == 2)
{
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
{
InfernalTimer = 15000;
@@ -417,18 +417,18 @@ struct boss_malchezaarAI : public ScriptedAI
ClearWeapons();
//remove thrash
- m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
+ me->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
- DoScriptText(SAY_AXE_TOSS2, m_creature);
+ DoScriptText(SAY_AXE_TOSS2, me);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
for (uint8 i = 0; i < 2; ++i)
{
- Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
+ Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (axe)
{
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- axe->setFaction(m_creature->getFaction());
+ axe->setFaction(me->getFaction());
axes[i] = axe->GetGUID();
if (pTarget)
{
@@ -448,14 +448,14 @@ struct boss_malchezaarAI : public ScriptedAI
if (SunderArmorTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
+ DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
SunderArmorTimer = urand(10000,18000);
} else SunderArmorTimer -= diff;
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = urand(6000,12000);
} else Cleave_Timer -= diff;
@@ -470,7 +470,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
- if (Unit *axe = Unit::GetUnit(*m_creature, axes[i]))
+ if (Unit *axe = Unit::GetUnit(*me, axes[i]))
{
if (axe->getVictim())
DoModifyThreatPercent(axe->getVictim(), -100);
@@ -500,7 +500,7 @@ struct boss_malchezaarAI : public ScriptedAI
if (ShadowNovaTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
+ DoCast(me->getVictim(), SPELL_SHADOWNOVA);
ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
} else ShadowNovaTimer -= diff;
@@ -510,7 +510,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
Unit *pTarget = NULL;
if (phase == 1)
- pTarget = m_creature->getVictim(); // the tank
+ pTarget = me->getVictim(); // the tank
else // anyone but the tank
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
@@ -540,19 +540,19 @@ struct boss_malchezaarAI : public ScriptedAI
void DoMeleeAttacksIfReady()
{
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()) && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false))
{
//Check for base attack
- if (m_creature->isAttackReady() && m_creature->getVictim())
+ if (me->isAttackReady() && me->getVictim())
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
//Check for offhand attack
- if (m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim())
+ if (me->isAttackReady(OFF_ATTACK) && me->getVictim())
{
- m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
- m_creature->resetAttackTimer(OFF_ATTACK);
+ me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK);
+ me->resetAttackTimer(OFF_ATTACK);
}
}
}
@@ -572,10 +572,10 @@ struct boss_malchezaarAI : public ScriptedAI
void netherspite_infernalAI::Cleanup()
{
- Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
+ Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
if (pMalchezaar && pMalchezaar->isAlive())
- CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, point);
+ CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
}
CreatureAI* GetAI_netherspite_infernal(Creature* pCreature)
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp
index 03b8efc1903..d5d65007398 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp
@@ -147,12 +147,12 @@ struct boss_aranAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -163,7 +163,7 @@ struct boss_aranAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
if (pInstance)
{
@@ -175,7 +175,7 @@ struct boss_aranAI : public ScriptedAI
void FlameWreathEffect()
{
std::vector<Unit*> targets;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
if (!t_list.size())
return;
@@ -183,7 +183,7 @@ struct boss_aranAI : public ScriptedAI
//store the threat list in a different container
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//only on alive players
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
@@ -246,19 +246,19 @@ struct boss_aranAI : public ScriptedAI
else FrostCooldown = 0;
}
- if (!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20)
+ if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
{
Drinking = true;
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
- DoScriptText(SAY_DRINK, m_creature);
+ DoScriptText(SAY_DRINK, me);
if (!DrinkInturrupted)
{
- DoCast(m_creature, SPELL_MASS_POLY, true);
- DoCast(m_creature, SPELL_CONJURE, false);
- DoCast(m_creature, SPELL_DRINK, false);
- m_creature->SetStandState(UNIT_STAND_STATE_SIT);
+ DoCast(me, SPELL_MASS_POLY, true);
+ DoCast(me, SPELL_CONJURE, false);
+ DoCast(me, SPELL_DRINK, false);
+ me->SetStandState(UNIT_STAND_STATE_SIT);
DrinkInturruptTimer = 10000;
}
}
@@ -267,10 +267,10 @@ struct boss_aranAI : public ScriptedAI
if (Drinking && DrinkInturrupted)
{
Drinking = false;
- m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
- DoCast(m_creature, SPELL_POTION, false);
+ me->RemoveAurasDueToSpell(SPELL_DRINK);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000);
+ DoCast(me, SPELL_POTION, false);
}
//Drink Inturrupt Timer
@@ -279,9 +279,9 @@ struct boss_aranAI : public ScriptedAI
DrinkInturruptTimer -= diff;
else
{
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_POTION, true);
- DoCast(m_creature, SPELL_AOE_PYROBLAST, false);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_POTION, true);
+ DoCast(me, SPELL_AOE_PYROBLAST, false);
DrinkInturrupted = true;
Drinking = false;
}
@@ -293,7 +293,7 @@ struct boss_aranAI : public ScriptedAI
//Normal casts
if (NormalCastTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget)
@@ -334,7 +334,7 @@ struct boss_aranAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- DoCast(m_creature, SPELL_AOE_CS);
+ DoCast(me, SPELL_AOE_CS);
break;
case 1:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
@@ -369,16 +369,16 @@ struct boss_aranAI : public ScriptedAI
switch (LastSuperSpell)
{
case SUPER_AE:
- DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), m_creature);
+ DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me);
- DoCast(m_creature, SPELL_BLINK_CENTER, true);
- DoCast(m_creature, SPELL_PLAYERPULL, true);
- DoCast(m_creature, SPELL_MASSSLOW, true);
- DoCast(m_creature, SPELL_AEXPLOSION, false);
+ DoCast(me, SPELL_BLINK_CENTER, true);
+ DoCast(me, SPELL_PLAYERPULL, true);
+ DoCast(me, SPELL_MASSSLOW, true);
+ DoCast(me, SPELL_AEXPLOSION, false);
break;
case SUPER_FLAME:
- DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), m_creature);
+ DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me);
FlameWreathTimer = 20000;
FlameWreathCheckTime = 500;
@@ -391,11 +391,11 @@ struct boss_aranAI : public ScriptedAI
break;
case SUPER_BLIZZARD:
- DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), m_creature);
+ DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me);
- if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
+ if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
{
- pSpawn->setFaction(m_creature->getFaction());
+ pSpawn->setFaction(me->getFaction());
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
}
break;
@@ -404,34 +404,34 @@ struct boss_aranAI : public ScriptedAI
SuperCastTimer = urand(35000,40000);
} else SuperCastTimer -= diff;
- if (!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
+ if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40)
{
ElementalsSpawned = true;
for (uint32 i = 0; i < 4; ++i)
{
- if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
+ if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
- pUnit->Attack(m_creature->getVictim(), true);
- pUnit->setFaction(m_creature->getFaction());
+ pUnit->Attack(me->getVictim(), true);
+ pUnit->setFaction(me->getFaction());
}
}
- DoScriptText(SAY_ELEMENTALS, m_creature);
+ DoScriptText(SAY_ELEMENTALS, me);
}
if (BerserkTimer <= diff)
{
for (uint32 i = 0; i < 5; ++i)
{
- if (Creature* pUnit = m_creature->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
+ if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
- pUnit->Attack(m_creature->getVictim(), true);
- pUnit->setFaction(m_creature->getFaction());
+ pUnit->Attack(me->getVictim(), true);
+ pUnit->setFaction(me->getFaction());
}
}
- DoScriptText(SAY_TIMEOVER, m_creature);
+ DoScriptText(SAY_TIMEOVER, me);
BerserkTimer = 60000;
} else BerserkTimer -= diff;
@@ -450,10 +450,10 @@ struct boss_aranAI : public ScriptedAI
if (!FlameWreathTarget[i])
continue;
- Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]);
+ Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]);
if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
{
- pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID());
pUnit->CastSpell(pUnit, 11027, true);
FlameWreathTarget[i] = 0;
}
@@ -477,11 +477,11 @@ struct boss_aranAI : public ScriptedAI
//We only care about inturrupt effects and only if they are durring a spell currently being casted
if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
- Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false))
+ Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
return;
//Inturrupt effect
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Normally we would set the cooldown equal to the spell duration
//but we do not have access to the DurationStore
@@ -515,7 +515,7 @@ struct water_elementalAI : public ScriptedAI
if (CastTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
+ DoCast(me->getVictim(), SPELL_WATERBOLT);
CastTimer = urand(2000,5000);
} else CastTimer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp
index df7a5b8b2d5..ef266e4462b 100644
--- a/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp
@@ -77,7 +77,7 @@ struct mob_kilrekAI : public ScriptedAI
{
if (!pInstance)
{
- ERROR_INST_DATA(m_creature);
+ ERROR_INST_DATA(me);
return;
}
}
@@ -89,11 +89,11 @@ struct mob_kilrekAI : public ScriptedAI
uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
if (TerestianGUID)
{
- Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID);
+ Unit* Terestian = Unit::GetUnit((*me), TerestianGUID);
if (Terestian && Terestian->isAlive())
DoCast(Terestian, SPELL_BROKEN_PACT, true);
}
- } else ERROR_INST_DATA(m_creature);
+ } else ERROR_INST_DATA(me);
}
void UpdateAI(const uint32 diff)
@@ -104,8 +104,8 @@ struct mob_kilrekAI : public ScriptedAI
if (AmplifyTimer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_AMPLIFY_FLAMES);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES);
AmplifyTimer = urand(10000,20000);
} else AmplifyTimer -= diff;
@@ -133,7 +133,7 @@ struct mob_demon_chainAI : public ScriptedAI
{
if (SacrificeGUID)
{
- Unit* Sacrifice = Unit::GetUnit((*m_creature),SacrificeGUID);
+ Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID);
if (Sacrifice)
Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
}
@@ -142,7 +142,7 @@ struct mob_demon_chainAI : public ScriptedAI
struct mob_fiendish_portalAI : public PassiveAI
{
- mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(m_creature){}
+ mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){}
SummonList summons;
@@ -191,7 +191,7 @@ struct boss_terestianAI : public ScriptedAI
{
if (PortalGUID[i])
{
- if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[i]))
+ if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i]))
{
CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
pPortal->ForcedDespawn();
@@ -213,22 +213,22 @@ struct boss_terestianAI : public ScriptedAI
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
- m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
+ me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
- if (Minion* Kilrek = m_creature->GetFirstMinion())
+ if (Minion* Kilrek = me->GetFirstMinion())
{
if (!Kilrek->isAlive())
{
Kilrek->UnSummon();
- DoCast(m_creature, SPELL_SUMMON_IMP, true);
+ DoCast(me, SPELL_SUMMON_IMP, true);
}
}
- else DoCast(m_creature, SPELL_SUMMON_IMP, true);
+ else DoCast(me, SPELL_SUMMON_IMP, true);
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustSummoned(Creature* pSummoned)
@@ -240,7 +240,7 @@ struct boss_terestianAI : public ScriptedAI
if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1)
{
- DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
SummonedPortals = true;
}
}
@@ -248,7 +248,7 @@ struct boss_terestianAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *killer)
@@ -257,14 +257,14 @@ struct boss_terestianAI : public ScriptedAI
{
if (PortalGUID[i])
{
- if (Creature* pPortal = Unit::GetCreature((*m_creature), PortalGUID[i]))
+ if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i]))
pPortal->ForcedDespawn();
PortalGUID[i] = 0;
}
}
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, DONE);
@@ -283,11 +283,11 @@ struct boss_terestianAI : public ScriptedAI
DoCast(pTarget, SPELL_SACRIFICE, true);
DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true);
- if (Creature* Chains = m_creature->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
+ if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
{
CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID();
Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
- DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), m_creature);
+ DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me);
SacrificeTimer = 30000;
}
}
@@ -302,15 +302,15 @@ struct boss_terestianAI : public ScriptedAI
if (SummonTimer <= diff)
{
if (!PortalGUID[0])
- DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL, false);
+ DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false);
if (!PortalGUID[1])
- DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
+ DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
if (PortalGUID[0] && PortalGUID[1])
{
- if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[urand(0,1)]))
- pPortal->CastSpell(m_creature->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
+ if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)]))
+ pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
SummonTimer = 5000;
}
} else SummonTimer -= diff;
@@ -319,7 +319,7 @@ struct boss_terestianAI : public ScriptedAI
{
if (BerserkTimer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK);
+ DoCast(me, SPELL_BERSERK);
Berserk = true;
} else BerserkTimer -= diff;
}
@@ -340,7 +340,7 @@ struct mob_fiendish_impAI : public ScriptedAI
{
FireboltTimer = 2000;
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
void EnterCombat(Unit *who) {}
@@ -353,7 +353,7 @@ struct mob_fiendish_impAI : public ScriptedAI
if (FireboltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
+ DoCast(me->getVictim(), SPELL_FIREBOLT);
FireboltTimer = 2200;
} else FireboltTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp b/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp
index a1322895e35..fd3442ec832 100644
--- a/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp
@@ -132,27 +132,27 @@ struct boss_dorotheeAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_DOROTHEE_AGGRO, m_creature);
+ DoScriptText(SAY_DOROTHEE_AGGRO, me);
}
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void SummonTito(); // See below
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DOROTHEE_DEATH, m_creature);
+ DoScriptText(SAY_DOROTHEE_DEATH, me);
if (pInstance)
- SummonCroneIfReady(pInstance, m_creature);
+ SummonCroneIfReady(pInstance, me);
}
void AttackStart(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -160,7 +160,7 @@ struct boss_dorotheeAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -172,7 +172,7 @@ struct boss_dorotheeAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -188,7 +188,7 @@ struct boss_dorotheeAI : public ScriptedAI
if (FearTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SCREAM);
+ DoCast(me->getVictim(), SPELL_SCREAM);
FearTimer = 30000;
} else FearTimer -= diff;
@@ -222,7 +222,7 @@ struct mob_titoAI : public ScriptedAI
{
if (DorotheeGUID)
{
- Creature* Dorothee = (Unit::GetCreature((*m_creature), DorotheeGUID));
+ Creature* Dorothee = (Unit::GetCreature((*me), DorotheeGUID));
if (Dorothee && Dorothee->isAlive())
{
CAST_AI(boss_dorotheeAI, Dorothee->AI())->TitoDied = true;
@@ -238,7 +238,7 @@ struct mob_titoAI : public ScriptedAI
if (YipTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_YIPPING);
+ DoCast(me->getVictim(), SPELL_YIPPING);
YipTimer = 10000;
} else YipTimer -= diff;
@@ -248,11 +248,11 @@ struct mob_titoAI : public ScriptedAI
void boss_dorotheeAI::SummonTito()
{
- if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
+ if (Creature* pTito = me->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
- DoScriptText(SAY_DOROTHEE_SUMMON, m_creature);
- CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = m_creature->GetGUID();
- pTito->AI()->AttackStart(m_creature->getVictim());
+ DoScriptText(SAY_DOROTHEE_SUMMON, me);
+ CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = me->GetGUID();
+ pTito->AI()->AttackStart(me->getVictim());
SummonedTito = true;
TitoDied = false;
}
@@ -280,7 +280,7 @@ struct boss_strawmanAI : public ScriptedAI
void AttackStart(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -288,7 +288,7 @@ struct boss_strawmanAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -296,12 +296,12 @@ struct boss_strawmanAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_STRAWMAN_AGGRO, m_creature);
+ DoScriptText(SAY_STRAWMAN_AGGRO, me);
}
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void SpellHit(Unit* caster, const SpellEntry *Spell)
@@ -313,21 +313,21 @@ struct boss_strawmanAI : public ScriptedAI
return;
*/
- DoCast(m_creature, SPELL_BURNING_STRAW, true);
+ DoCast(me, SPELL_BURNING_STRAW, true);
}
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_STRAWMAN_DEATH, m_creature);
+ DoScriptText(SAY_STRAWMAN_DEATH, me);
if (pInstance)
- SummonCroneIfReady(pInstance, m_creature);
+ SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_STRAWMAN_SLAY, m_creature);
+ DoScriptText(SAY_STRAWMAN_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -336,7 +336,7 @@ struct boss_strawmanAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -346,7 +346,7 @@ struct boss_strawmanAI : public ScriptedAI
if (BrainBashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH);
+ DoCast(me->getVictim(), SPELL_BRAIN_BASH);
BrainBashTimer = 15000;
} else BrainBashTimer -= diff;
@@ -387,17 +387,17 @@ struct boss_tinheadAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_TINHEAD_AGGRO, m_creature);
+ DoScriptText(SAY_TINHEAD_AGGRO, me);
}
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void AttackStart(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -405,7 +405,7 @@ struct boss_tinheadAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -413,15 +413,15 @@ struct boss_tinheadAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_TINHEAD_DEATH, m_creature);
+ DoScriptText(SAY_TINHEAD_DEATH, me);
if (pInstance)
- SummonCroneIfReady(pInstance, m_creature);
+ SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_TINHEAD_SLAY, m_creature);
+ DoScriptText(SAY_TINHEAD_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -430,7 +430,7 @@ struct boss_tinheadAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -440,7 +440,7 @@ struct boss_tinheadAI : public ScriptedAI
if (CleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 5000;
} else CleaveTimer -= diff;
@@ -449,8 +449,8 @@ struct boss_tinheadAI : public ScriptedAI
if (RustTimer <= diff)
{
++RustCount;
- DoScriptText(EMOTE_RUST, m_creature);
- DoCast(m_creature, SPELL_RUST);
+ DoScriptText(EMOTE_RUST, me);
+ DoCast(me, SPELL_RUST);
RustTimer = 6000;
} else RustTimer -= diff;
}
@@ -483,7 +483,7 @@ struct boss_roarAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -491,7 +491,7 @@ struct boss_roarAI : public ScriptedAI
void AttackStart(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -499,25 +499,25 @@ struct boss_roarAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_ROAR_AGGRO, m_creature);
+ DoScriptText(SAY_ROAR_AGGRO, me);
}
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_ROAR_DEATH, m_creature);
+ DoScriptText(SAY_ROAR_DEATH, me);
if (pInstance)
- SummonCroneIfReady(pInstance, m_creature);
+ SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_ROAR_SLAY, m_creature);
+ DoScriptText(SAY_ROAR_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -526,7 +526,7 @@ struct boss_roarAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -536,19 +536,19 @@ struct boss_roarAI : public ScriptedAI
if (MangleTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MANGLE);
+ DoCast(me->getVictim(), SPELL_MANGLE);
MangleTimer = urand(5000,8000);
} else MangleTimer -= diff;
if (ShredTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHRED);
+ DoCast(me->getVictim(), SPELL_SHRED);
ShredTimer = urand(10000,15000);
} else ShredTimer -= diff;
if (ScreamTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM);
+ DoCast(me->getVictim(), SPELL_FRIGHTENED_SCREAM);
ScreamTimer = urand(20000,30000);
} else ScreamTimer -= diff;
@@ -576,19 +576,19 @@ struct boss_croneAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void EnterCombat(Unit* who)
{
- DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), m_creature);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), me);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_CRONE_DEATH, m_creature);
+ DoScriptText(SAY_CRONE_DEATH, me);
if (pInstance)
{
@@ -606,8 +606,8 @@ struct boss_croneAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (CycloneTimer <= diff)
{
@@ -618,7 +618,7 @@ struct boss_croneAI : public ScriptedAI
if (ChainLightningTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 15000;
} else ChainLightningTimer -= diff;
@@ -645,14 +645,14 @@ struct mob_cycloneAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->HasAura(SPELL_KNOCKBACK))
- DoCast(m_creature, SPELL_KNOCKBACK, true);
+ if (!me->HasAura(SPELL_KNOCKBACK))
+ DoCast(me, SPELL_KNOCKBACK, true);
if (MoveTimer <= diff)
{
Position pos;
- m_creature->GetRandomNearPosition(pos, 10);
- m_creature->GetMotionMaster()->MovePoint(0, pos);
+ me->GetRandomNearPosition(pos, 10);
+ me->GetMotionMaster()->MovePoint(0, pos);
MoveTimer = urand(5000,8000);
} else MoveTimer -= diff;
}
@@ -766,17 +766,17 @@ struct boss_bigbadwolfAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_WOLF_AGGRO, m_creature);
+ DoScriptText(SAY_WOLF_AGGRO, me);
}
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void JustDied(Unit* killer)
{
- DoPlaySoundToSet(m_creature, SOUND_WOLF_DEATH);
+ DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
if (pInstance)
{
@@ -802,13 +802,13 @@ struct boss_bigbadwolfAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- DoScriptText(SAY_WOLF_HOOD, m_creature);
+ DoScriptText(SAY_WOLF_HOOD, me);
DoCast(pTarget, SPELL_LITTLE_RED_RIDING_HOOD, true);
TempThreat = DoGetThreat(pTarget);
if (TempThreat)
DoModifyThreatPercent(pTarget, -100);
HoodGUID = pTarget->GetGUID();
- m_creature->AddThreat(pTarget, 1000000.0f);
+ me->AddThreat(pTarget, 1000000.0f);
ChaseTimer = 20000;
IsChasing = true;
}
@@ -817,12 +817,12 @@ struct boss_bigbadwolfAI : public ScriptedAI
{
IsChasing = false;
- if (Unit *pTarget = Unit::GetUnit((*m_creature), HoodGUID))
+ if (Unit *pTarget = Unit::GetUnit((*me), HoodGUID))
{
HoodGUID = 0;
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
- m_creature->AddThreat(pTarget, TempThreat);
+ me->AddThreat(pTarget, TempThreat);
TempThreat = 0;
}
@@ -835,13 +835,13 @@ struct boss_bigbadwolfAI : public ScriptedAI
if (FearTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL);
+ DoCast(me->getVictim(), SPELL_TERRIFYING_HOWL);
FearTimer = urand(25000,35000);
} else FearTimer -= diff;
if (SwipeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE);
+ DoCast(me->getVictim(), SPELL_WIDE_SWIPE);
SwipeTimer = urand(25000,30000);
} else SwipeTimer -= diff;
@@ -973,7 +973,7 @@ struct boss_julianneAI : public ScriptedAI
if (IsFakingDeath)
{
- Resurrect(m_creature);
+ Resurrect(me);
IsFakingDeath = false;
}
@@ -985,7 +985,7 @@ struct boss_julianneAI : public ScriptedAI
void AttackStart(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -993,7 +993,7 @@ struct boss_julianneAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1001,14 +1001,14 @@ struct boss_julianneAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void SpellHit(Unit* caster, const SpellEntry *Spell)
{
if (Spell->Id == SPELL_DRINK_POISON)
{
- DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
+ DoScriptText(SAY_JULIANNE_DEATH01, me);
DrinkPoisonTimer = 2500;
}
}
@@ -1017,7 +1017,7 @@ struct boss_julianneAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_JULIANNE_DEATH02, m_creature);
+ DoScriptText(SAY_JULIANNE_DEATH02, me);
if (pInstance)
{
@@ -1031,7 +1031,7 @@ struct boss_julianneAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_JULIANNE_SLAY, m_creature);
+ DoScriptText(SAY_JULIANNE_SLAY, me);
}
void UpdateAI(const uint32 diff);
@@ -1079,20 +1079,20 @@ struct boss_romuloAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void DamageTaken(Unit* done_by, uint32 &damage);
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_ROMULO_AGGRO, m_creature);
+ DoScriptText(SAY_ROMULO_AGGRO, me);
if (JulianneGUID)
{
- Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
+ Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
if (Julianne && Julianne->getVictim())
{
- m_creature->AddThreat(Julianne->getVictim(), 1.0f);
+ me->AddThreat(Julianne->getVictim(), 1.0f);
AttackStart(Julianne->getVictim());
}
}
@@ -1100,7 +1100,7 @@ struct boss_romuloAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1108,7 +1108,7 @@ struct boss_romuloAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_ROMULO_DEATH, m_creature);
+ DoScriptText(SAY_ROMULO_DEATH, me);
if (pInstance)
{
@@ -1123,7 +1123,7 @@ struct boss_romuloAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_ROMULO_SLAY, m_creature);
+ DoScriptText(SAY_ROMULO_SLAY, me);
}
void UpdateAI(const uint32 diff);
@@ -1131,7 +1131,7 @@ struct boss_romuloAI : public ScriptedAI
void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
{
- if (damage < m_creature->GetHealth())
+ if (damage < me->GetHealth())
return;
//anything below only used if incoming damage will kill
@@ -1144,11 +1144,11 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
if (IsFakingDeath)
return;
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_DRINK_POISON);
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_DRINK_POISON);
IsFakingDeath = true;
- //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
+ //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
return;
}
@@ -1164,7 +1164,7 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
//if this is true then we have to kill romulo too
if (RomuloDead)
{
- if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
+ if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)))
{
Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Romulo->GetMotionMaster()->Clear();
@@ -1178,9 +1178,9 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
}
//if not already returned, then romulo is alive and we can pretend die
- if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
+ if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)))
{
- PretendToDie(m_creature);
+ PretendToDie(me);
IsFakingDeath = true;
CAST_AI(boss_romuloAI, Romulo->AI())->ResurrectTimer = 10000;
CAST_AI(boss_romuloAI, Romulo->AI())->JulianneDead = true;
@@ -1193,19 +1193,19 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
{
- if (damage < m_creature->GetHealth())
+ if (damage < me->GetHealth())
return;
//anything below only used if incoming damage will kill
if (Phase == PHASE_ROMULO)
{
- DoScriptText(SAY_ROMULO_DEATH, m_creature);
- PretendToDie(m_creature);
+ DoScriptText(SAY_ROMULO_DEATH, me);
+ PretendToDie(me);
IsFakingDeath = true;
Phase = PHASE_BOTH;
- if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
+ if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true;
CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000;
@@ -1219,7 +1219,7 @@ void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
{
if (JulianneDead)
{
- if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
+ if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Julianne->GetMotionMaster()->Clear();
@@ -1231,9 +1231,9 @@ void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
return;
}
- if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
+ if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
- PretendToDie(m_creature);
+ PretendToDie(me);
IsFakingDeath = true;
CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000;
CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true;
@@ -1251,7 +1251,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (EntryYellTimer <= diff)
{
- DoScriptText(SAY_JULIANNE_ENTER, m_creature);
+ DoScriptText(SAY_JULIANNE_ENTER, me);
EntryYellTimer = 0;
} else EntryYellTimer -= diff;
}
@@ -1260,9 +1260,9 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (AggroYellTimer <= diff)
{
- DoScriptText(SAY_JULIANNE_AGGRO, m_creature);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->setFaction(16);
+ DoScriptText(SAY_JULIANNE_AGGRO, me);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->setFaction(16);
AggroYellTimer = 0;
} else AggroYellTimer -= diff;
}
@@ -1272,7 +1272,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
//will do this 2secs after spell hit. this is time to display visual as expected
if (DrinkPoisonTimer <= diff)
{
- PretendToDie(m_creature);
+ PretendToDie(me);
Phase = PHASE_ROMULO;
SummonRomuloTimer = 10000;
DrinkPoisonTimer = 0;
@@ -1283,10 +1283,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (SummonRomuloTimer <= diff)
{
- if (Creature* pRomulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
+ if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
{
RomuloGUID = pRomulo->GetGUID();
- CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = m_creature->GetGUID();
+ CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID();
CAST_AI(boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO;
DoZoneInCombat(pRomulo);
@@ -1300,12 +1300,12 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (ResurrectSelfTimer <= diff)
{
- Resurrect(m_creature);
+ Resurrect(me);
Phase = PHASE_BOTH;
IsFakingDeath = false;
- if (m_creature->getVictim())
- AttackStart(m_creature->getVictim());
+ if (me->getVictim())
+ AttackStart(me->getVictim());
ResurrectSelfTimer = 0;
ResurrectTimer = 1000;
@@ -1319,10 +1319,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (ResurrectTimer <= diff)
{
- Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
+ Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID));
if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath)
{
- DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
+ DoScriptText(SAY_JULIANNE_RESURRECT, me);
Resurrect(Romulo);
CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false;
RomuloDead = false;
@@ -1340,7 +1340,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
if (DevotionTimer <= diff)
{
- DoCast(m_creature, SPELL_DEVOTION);
+ DoCast(me, SPELL_DEVOTION);
DevotionTimer = urand(15000,45000);
} else DevotionTimer -= diff;
@@ -1354,10 +1354,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (urand(0,1) && SummonedRomulo)
{
- Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
+ Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID));
if (Romulo && Romulo->isAlive() && !RomuloDead)
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
- } else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
+ } else DoCast(me, SPELL_ETERNAL_AFFECTION);
EternalAffectionTimer = urand(45000,60000);
} else EternalAffectionTimer -= diff;
@@ -1374,10 +1374,10 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
{
if (ResurrectTimer <= diff)
{
- Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
+ Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath)
{
- DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
+ DoScriptText(SAY_ROMULO_RESURRECT, me);
Resurrect(Julianne);
CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false;
JulianneDead = false;
@@ -1389,7 +1389,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (BackwardLungeTimer <= diff)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
- if (pTarget && !m_creature->HasInArc(M_PI, pTarget))
+ if (pTarget && !me->HasInArc(M_PI, pTarget))
{
DoCast(pTarget, SPELL_BACKWARD_LUNGE);
BackwardLungeTimer = urand(15000,30000);
@@ -1398,7 +1398,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (DaringTimer <= diff)
{
- DoCast(m_creature, SPELL_DARING);
+ DoCast(me, SPELL_DARING);
DaringTimer = urand(20000,40000);
} else DaringTimer -= diff;
@@ -1411,7 +1411,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (PoisonThrustTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISON_THRUST);
+ DoCast(me->getVictim(), SPELL_POISON_THRUST);
PoisonThrustTimer = urand(10000,20000);
} else PoisonThrustTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp b/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp
index 754e206d778..3b0bd88d840 100644
--- a/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp
+++ b/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp
@@ -159,15 +159,15 @@ struct npc_barnesAI : public npc_escortAI
switch(i)
{
case 0:
- DoCast(m_creature, SPELL_TUXEDO, false);
+ DoCast(me, SPELL_TUXEDO, false);
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
break;
case 4:
TalkCount = 0;
SetEscortPaused(true);
- if (Creature* pSpotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT,
- m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f,
+ if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT,
+ me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
{
pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -215,7 +215,7 @@ struct npc_barnesAI : public npc_escortAI
}
if (text)
- DoScriptText(text, m_creature);
+ DoScriptText(text, me);
}
void PrepareEncounter()
@@ -245,7 +245,7 @@ struct npc_barnesAI : public npc_escortAI
uint32 entry = ((uint32)Spawns[index][0]);
float PosX = Spawns[index][1];
- if (Creature* pCreature = m_creature->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
+ if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
{
// In case database has bad flags
pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
@@ -266,7 +266,7 @@ struct npc_barnesAI : public npc_escortAI
{
if (TalkCount > 3)
{
- if (Creature* pSpotlight = Unit::GetCreature(*m_creature, m_uiSpotlightGUID))
+ if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID))
pSpotlight->ForcedDespawn();
SetEscortPaused(false);
@@ -284,7 +284,7 @@ struct npc_barnesAI : public npc_escortAI
{
if (WipeTimer <= diff)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap->IsDungeon())
return;
@@ -468,13 +468,13 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
{
- pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, m_creature->GetGUID());
- (*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
+ pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
+ (*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
Step = 0;
}else
{
- m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
+ me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
}
}
void EnterCombat(Unit* who){}
@@ -486,8 +486,8 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (id == 1)
{
StartEvent();
- m_creature->SetOrientation(MedivPos[3]);
- m_creature->SetOrientation(MedivPos[3]);
+ me->SetOrientation(MedivPos[3]);
+ me->SetOrientation(MedivPos[3]);
}
}
@@ -495,40 +495,40 @@ struct npc_image_of_medivhAI : public ScriptedAI
{
Step = 1;
EventStarted = true;
- Creature* Arcanagos = m_creature->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
if (!Arcanagos)
return;
ArcanagosGUID = Arcanagos->GetGUID();
Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
(*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
Arcanagos->SetOrientation(ArcanagosPos[3]);
- m_creature->SetOrientation(MedivPos[3]);
+ me->SetOrientation(MedivPos[3]);
YellTimer = 10000;
}
uint32 NextStep(uint32 Step)
{
- Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
- Map* pMap = m_creature->GetMap();
+ Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
+ Map* pMap = me->GetMap();
switch(Step)
{
case 0: return 9999999;
case 1:
- m_creature->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
return 10000;
case 2:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
return 20000;
case 3:
- m_creature->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
return 10000;
case 4:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
return 20000;
case 5:
- m_creature->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
return 20000;
case 6:
if (arca)
@@ -539,10 +539,10 @@ struct npc_image_of_medivhAI : public ScriptedAI
return 5000;
case 8:
FireMedivhTimer = 500;
- DoCast(m_creature, SPELL_MANA_SHIELD);
+ DoCast(me, SPELL_MANA_SHIELD);
return 10000;
case 9:
- m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
+ me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
return 10000;
case 10:
if (arca)
@@ -559,11 +559,11 @@ struct npc_image_of_medivhAI : public ScriptedAI
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
return 10000;
case 13:
- m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
return 10000;
case 14:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->ClearInCombat();
+ me->SetVisibility(VISIBILITY_OFF);
+ me->ClearInCombat();
if (pMap->IsDungeon())
{
@@ -597,12 +597,12 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (Step >= 7 && Step <= 12)
{
- Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
+ Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
if (FireArcanagosTimer <= diff)
{
if (arca)
- arca->CastSpell(m_creature, SPELL_FIRE_BALL, false);
+ arca->CastSpell(me, SPELL_FIRE_BALL, false);
FireArcanagosTimer = 6000;
} else FireArcanagosTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp
index eefc2b91355..005136249e7 100644
--- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp
+++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp
@@ -137,7 +137,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void JustDied(Unit *killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -148,7 +148,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void DamageTaken(Unit* done_by, uint32 &damage)
{
- if (damage > m_creature->GetHealth())
+ if (damage > me->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}
@@ -163,9 +163,9 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0))
+ if (!HasTaunted && me->IsWithinDistInMap(who, 40.0))
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
HasTaunted = true;
}
@@ -177,14 +177,14 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
if (!SummonedUnit)
return;
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && pUnit->isAlive())
{
- float threat = m_creature->getThreatManager().getThreat(pUnit);
+ float threat = me->getThreatManager().getThreat(pUnit);
SummonedUnit->AddThreat(pUnit, threat);
}
}
@@ -194,40 +194,40 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
float x = KaelLocations[0][0];
float y = KaelLocations[0][1];
- m_creature->GetMap()->CreatureRelocation(m_creature, x, y, LOCATION_Z, 0.0f);
- //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f);
+ //me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
}
- DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
+ DoCast(me, SPELL_TELEPORT_CENTER, true);
}
void CastGravityLapseKnockUp()
{
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
// Knockback into the air
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID());
}
}
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
{
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
// Also needs an exception in spell system.
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
// Use packet hack
WorldPacket data(12);
data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
@@ -240,10 +240,10 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void RemoveGravityLapse()
{
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
@@ -273,17 +273,17 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
if (PyroblastTimer <= diff)
{
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoCast(m_creature, SPELL_SHOCK_BARRIER, true);
- DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoCast(me, SPELL_SHOCK_BARRIER, true);
+ DoCast(me->getVictim(), SPELL_PYROBLAST);
PyroblastTimer = 60000;
} else PyroblastTimer -= diff;
}
if (FireballTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALL_NORMAL);
+ DoCast(me->getVictim(), SPELL_FIREBALL_NORMAL);
FireballTimer = urand(2000,6000);
} else FireballTimer -= diff;
@@ -296,7 +296,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
float x = KaelLocations[random][0];
float y = KaelLocations[random][1];
- Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ Creature* Phoenix = me->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);
@@ -304,7 +304,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
Phoenix->AI()->AttackStart(pTarget);
}
- DoScriptText(SAY_PHOENIX, m_creature);
+ DoScriptText(SAY_PHOENIX, me);
PhoenixTimer = 60000;
} else PhoenixTimer -= diff;
@@ -313,21 +313,21 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(pTarget, SPELL_FLAMESTRIKE3, true);
- DoScriptText(SAY_FLAMESTRIKE, m_creature);
+ DoScriptText(SAY_FLAMESTRIKE, me);
}
FlameStrikeTimer = urand(15000,25000);
} else FlameStrikeTimer -= diff;
// Below 50%
- if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
+ if (me->GetMaxHealth() * 0.5 > me->GetHealth())
{
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
GravityLapseTimer = 0;
GravityLapsePhase = 0;
Phase = 1;
@@ -346,7 +346,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
case 0:
if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
- DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
+ DoScriptText(SAY_GRAVITY_LAPSE, me);
FirstGravityLapse = false;
if (pInstance)
@@ -356,10 +356,10 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
}
}else
{
- DoScriptText(SAY_RECAST_GRAVITY, m_creature);
+ DoScriptText(SAY_RECAST_GRAVITY, me);
}
- DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
+ DoCast(me, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
break;
@@ -396,13 +396,13 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
}
- DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
+ DoCast(me, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
- m_creature->InterruptNonMeleeSpells(false);
- DoScriptText(SAY_TIRED, m_creature);
- DoCast(m_creature, SPELL_POWER_FEEDBACK);
+ me->InterruptNonMeleeSpells(false);
+ DoScriptText(SAY_TIRED, me);
+ DoCast(me, SPELL_POWER_FEEDBACK);
RemoveGravityLapse();
GravityLapseTimer = 10000;
GravityLapsePhase = 0;
@@ -427,10 +427,10 @@ struct mob_felkael_flamestrikeAI : public ScriptedAI
{
FlameStrikeTimer = 5000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
- DoCast(m_creature, SPELL_FLAMESTRIKE2, true);
+ DoCast(me, SPELL_FLAMESTRIKE2, true);
}
void EnterCombat(Unit *who) {}
@@ -439,8 +439,8 @@ struct mob_felkael_flamestrikeAI : public ScriptedAI
{
if (FlameStrikeTimer <= diff)
{
- DoCast(m_creature, SPELL_FLAMESTRIKE1_NORMAL, true);
- m_creature->Kill(m_creature);
+ DoCast(me, SPELL_FLAMESTRIKE1_NORMAL, true);
+ me->Kill(me);
} else FlameStrikeTimer -= diff;
}
};
@@ -460,9 +460,9 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void Reset()
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- DoCast(m_creature, SPELL_PHOENIX_BURN, true);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ DoCast(me, SPELL_PHOENIX_BURN, true);
BurnTimer = 2000;
Death_Timer = 3000;
Rebirth = false;
@@ -473,7 +473,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage < m_creature->GetHealth())
+ if (damage < me->GetHealth())
return;
//Prevent glitch if in fake death
@@ -490,19 +490,19 @@ struct mob_felkael_phoenixAI : public ScriptedAI
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);
+ me->InterruptNonMeleeSpells(false);
+ me->SetHealth(0);
+ me->StopMoving();
+ me->ClearComboPointHolders();
+ me->RemoveAllAurasOnDeath();
+ me->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
+ me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->ClearAllReactives();
+ me->SetUInt64Value(UNIT_FIELD_TARGET,0);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
}
@@ -510,7 +510,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void JustDied(Unit* slayer)
{
- m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
void UpdateAI(const uint32 diff)
@@ -521,7 +521,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
{
if (!Rebirth)
{
- DoCast(m_creature, SPELL_REBIRTH_DMG);
+ DoCast(me, SPELL_REBIRTH_DMG);
Rebirth = true;
}
@@ -530,8 +530,8 @@ struct mob_felkael_phoenixAI : public ScriptedAI
if (Death_Timer <= diff)
{
- m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
- m_creature->DisappearAndDie();
+ me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ me->DisappearAndDie();
Rebirth = false;
} else Death_Timer -= diff;
}
@@ -545,7 +545,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
{
//spell Burn should possible do this, but it doesn't, so do this for now.
uint16 dmg = urand(1650,2050);
- m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
+ me->DealDamage(me, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
BurnTimer += 2000;
} BurnTimer -= diff;
@@ -571,8 +571,8 @@ struct mob_felkael_phoenix_eggAI : public ScriptedAI
{
if (HatchTimer <= diff)
{
- m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- m_creature->Kill(m_creature);
+ me->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ me->Kill(me);
} else HatchTimer -= diff;
}
@@ -590,10 +590,10 @@ struct mob_arcane_sphereAI : public ScriptedAI
DespawnTimer = 30000;
ChangeTargetTimer = urand(6000,12000);
- 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);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->setFaction(14);
+ DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
void EnterCombat(Unit* who) {}
@@ -601,7 +601,7 @@ struct mob_arcane_sphereAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (DespawnTimer <= diff)
- m_creature->Kill(m_creature);
+ me->Kill(me);
else
DespawnTimer -= diff;
@@ -613,8 +613,8 @@ struct mob_arcane_sphereAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- m_creature->AddThreat(pTarget, 1.0f);
- m_creature->TauntApply(pTarget);
+ me->AddThreat(pTarget, 1.0f);
+ me->TauntApply(pTarget);
AttackStart(pTarget);
}
diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp
index fb78a7c7be6..6f880840a51 100644
--- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp
+++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp
@@ -131,11 +131,11 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i]))
{
if (!pAdd->getVictim())
{
@@ -152,7 +152,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void InitializeLackeys()
{
//can be called if Creature are dead, so avoid
- if (!m_creature->isAlive())
+ if (!me->isAlive())
return;
uint8 j = 0;
@@ -174,7 +174,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
//summon all the remaining in vector
for (std::vector<uint32>::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
{
- if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
m_auiLackeyGUID[j] = pAdd->GetGUID();
++j;
@@ -184,12 +184,12 @@ struct boss_priestess_delrissaAI : public ScriptedAI
{
for (std::vector<uint32>::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
{
- Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[j]);
+ Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[j]);
//object already removed, not exist
if (!pAdd)
{
- if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
m_auiLackeyGUID[j] = pAdd->GetGUID();
}
++j;
@@ -202,7 +202,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
- DoScriptText(PlayerDeath[PlayersKilled].id, m_creature);
+ DoScriptText(PlayerDeath[PlayersKilled].id, me);
if (PlayersKilled < 4)
++PlayersKilled;
@@ -210,7 +210,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -219,8 +219,8 @@ struct boss_priestess_delrissaAI : public ScriptedAI
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
else
{
- if (m_creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
}
@@ -232,8 +232,8 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (ResetTimer <= diff)
{
float x, y, z, o;
- m_creature->GetHomePosition(x, y, z, o);
- if (m_creature->GetPositionZ() >= z+10)
+ me->GetHomePosition(x, y, z, o);
+ if (me->GetPositionZ() >= z+10)
{
EnterEvadeMode();
return;
@@ -243,11 +243,11 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (HealTimer <= diff)
{
- uint32 health = m_creature->GetHealth();
- Unit *pTarget = m_creature;
+ uint32 health = me->GetHealth();
+ Unit *pTarget = me;
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i]))
{
if (pAdd->isAlive() && pAdd->GetHealth() < health)
pTarget = pAdd;
@@ -260,10 +260,10 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (RenewTimer <= diff)
{
- Unit *pTarget = m_creature;
+ Unit *pTarget = me;
if (urand(0,1))
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
@@ -273,10 +273,10 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (ShieldTimer <= diff)
{
- Unit *pTarget = m_creature;
+ Unit *pTarget = me;
if (urand(0,1))
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD))
pTarget = pAdd;
@@ -296,9 +296,9 @@ struct boss_priestess_delrissaAI : public ScriptedAI
friendly = true;
if (urand(0,1))
- pTarget = m_creature;
+ pTarget = me;
else
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
}
@@ -359,7 +359,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
ResetThreatTimer = urand(5000,20000);
// in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her)
- if (Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
+ if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
{
if (!pDelrissa->isAlive())
pDelrissa->Respawn();
@@ -375,9 +375,9 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUIDs[i]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
{
- if (!pAdd->getVictim() && pAdd != m_creature)
+ if (!pAdd->getVictim() && pAdd != me)
{
pWho->SetInCombatWith(pAdd);
pAdd->AddThreat(pWho, 0.0f);
@@ -385,7 +385,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
}
}
- if (Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)))
+ if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
{
if (pDelrissa->isAlive() && !pDelrissa->getVictim())
{
@@ -401,7 +401,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
- Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA));
+ Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA));
uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT);
if (!pDelrissa)
@@ -433,7 +433,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
- if (Creature* Delrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)))
+ if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
Delrissa->AI()->KilledUnit(victim);
}
@@ -442,7 +442,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
- if (Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))))
+ if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))))
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i];
@@ -451,9 +451,9 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!UsedPotion && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
+ if (!UsedPotion && (me->GetHealth()*100 / me->GetMaxHealth()) < 25)
{
- DoCast(m_creature, SPELL_HEALING_POTION);
+ DoCast(me, SPELL_HEALING_POTION);
UsedPotion = true;
}
@@ -495,7 +495,7 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
Eviscerate_Timer = 6000;
Wait_Timer = 5000;
InVanish = false;
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
boss_priestess_lackey_commonAI::Reset();
}
@@ -509,14 +509,14 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
if (Vanish_Timer <= diff)
{
- DoCast(m_creature, SPELL_VANISH);
+ DoCast(me, SPELL_VANISH);
Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoResetThreat();
if (pUnit)
- m_creature->AddThreat(pUnit, 1000.0f);
+ me->AddThreat(pUnit, 1000.0f);
InVanish = true;
Vanish_Timer = 30000;
@@ -527,28 +527,28 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
{
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
+ DoCast(me->getVictim(), SPELL_BACKSTAB, true);
+ DoCast(me->getVictim(), SPELL_KIDNEY_SHOT, true);
+ me->SetVisibility(VISIBILITY_ON); // ...? Hacklike
InVanish = false;
} else Wait_Timer -= diff;
}
if (Gouge_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ DoCast(me->getVictim(), SPELL_GOUGE);
Gouge_Timer = 5500;
} else Gouge_Timer -= diff;
if (Kick_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KICK);
+ DoCast(me->getVictim(), SPELL_KICK);
Kick_Timer = 7000;
} else Kick_Timer -= diff;
if (Eviscerate_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_EVISCERATE);
+ DoCast(me->getVictim(), SPELL_EVISCERATE);
Eviscerate_Timer = 4000;
} else Eviscerate_Timer -= diff;
@@ -597,7 +597,7 @@ struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
void Aggro(Unit* pWho)
{
- DoCast(m_creature, SPELL_SUMMON_IMP);
+ DoCast(me, SPELL_SUMMON_IMP);
}
void UpdateAI(const uint32 diff)
@@ -609,13 +609,13 @@ struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
if (Immolate_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_IMMOLATE);
+ DoCast(me->getVictim(), SPELL_IMMOLATE);
Immolate_Timer = 6000;
} else Immolate_Timer -= diff;
if (Shadow_Bolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
Shadow_Bolt_Timer = 5000;
} else Shadow_Bolt_Timer -= diff;
@@ -683,13 +683,13 @@ struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI
if (Knockdown_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 6000;
} else Knockdown_Timer -= diff;
if (Snap_Kick_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SNAP_KICK);
+ DoCast(me->getVictim(), SPELL_SNAP_KICK);
Snap_Kick_Timer = 4500;
} else Snap_Kick_Timer -= diff;
@@ -761,9 +761,9 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
}
} else Polymorph_Timer -= diff;
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
+ if (((me->GetHealth()*100 / me->GetMaxHealth()) < 35) && !HasIceBlocked)
{
- DoCast(m_creature, SPELL_ICE_BLOCK);
+ DoCast(me, SPELL_ICE_BLOCK);
HasIceBlocked = true;
}
@@ -777,32 +777,32 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
if (Ice_Lance_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ICE_LANCE);
+ DoCast(me->getVictim(), SPELL_ICE_LANCE);
Ice_Lance_Timer = 12000;
} else Ice_Lance_Timer -= diff;
if (Cone_of_Cold_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
+ DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
Cone_of_Cold_Timer = 10000;
} else Cone_of_Cold_Timer -= diff;
if (Frostbolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 8000;
} else Frostbolt_Timer -= diff;
if (Blink_Timer <= diff)
{
bool InMeleeRange = false;
- std::list<HostileReference*>& t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
- if (pTarget->IsWithinDistInMap(m_creature, 5))
+ if (pTarget->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
break;
@@ -812,7 +812,7 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
//if anybody is in melee range than escape by blink
if (InMeleeRange)
- DoCast(m_creature, SPELL_BLINK);
+ DoCast(me, SPELL_BLINK);
Blink_Timer = 8000;
} else Blink_Timer -= diff;
@@ -863,7 +863,7 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
void EnterCombat(Unit* who)
{
- DoCast(m_creature, SPELL_BATTLE_SHOUT);
+ DoCast(me, SPELL_BATTLE_SHOUT);
}
void UpdateAI(const uint32 diff)
@@ -876,13 +876,13 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
if (Intercept_Stun_Timer <= diff)
{
bool InMeleeRange = false;
- std::list<HostileReference*>& t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
- if (pTarget->IsWithinDistInMap(m_creature, ATTACK_DISTANCE))
+ if (pTarget->IsWithinDistInMap(me, ATTACK_DISTANCE))
{
InMeleeRange = true;
break;
@@ -902,31 +902,31 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
if (Disarm_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DISARM);
+ DoCast(me->getVictim(), SPELL_DISARM);
Disarm_Timer = 6000;
} else Disarm_Timer -= diff;
if (Hamstring_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ DoCast(me->getVictim(), SPELL_HAMSTRING);
Hamstring_Timer = 4500;
} else Hamstring_Timer -= diff;
if (Mortal_Strike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
Mortal_Strike_Timer = 4500;
} else Mortal_Strike_Timer -= diff;
if (Piercing_Howl_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL);
+ DoCast(me->getVictim(), SPELL_PIERCING_HOWL);
Piercing_Howl_Timer = 10000;
} else Piercing_Howl_Timer -= diff;
if (Frightening_Shout_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
+ DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Frightening_Shout_Timer = 18000;
} else Frightening_Shout_Timer -= diff;
@@ -974,9 +974,9 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
Wing_Clip_Timer = 4000;
Freezing_Trap_Timer = 15000;
- Unit* pPet = Unit::GetUnit(*m_creature,m_uiPetGUID);
+ Unit* pPet = Unit::GetUnit(*me,m_uiPetGUID);
if (!pPet)
- m_creature->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
boss_priestess_lackey_commonAI::Reset();
}
@@ -993,18 +993,18 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
boss_priestess_lackey_commonAI::UpdateAI(diff);
- if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ if (me->IsWithinDistInMap(me->getVictim(), ATTACK_DISTANCE))
{
if (Wing_Clip_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WING_CLIP);
+ DoCast(me->getVictim(), SPELL_WING_CLIP);
Wing_Clip_Timer = 4000;
} else Wing_Clip_Timer -= diff;
if (Freezing_Trap_Timer <= diff)
{
- //attempt find go summoned from spell (casted by m_creature)
- GameObject* pGo = m_creature->GetGameObject(SPELL_FREEZING_TRAP);
+ //attempt find go summoned from spell (casted by me)
+ GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP);
//if we have a pGo, we need to wait (only one trap at a time)
if (pGo)
@@ -1012,7 +1012,7 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
else
{
//if pGo does not exist, then we can cast
- DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
+ DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
Freezing_Trap_Timer = 15000;
}
} else Freezing_Trap_Timer -= diff;
@@ -1023,25 +1023,25 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
{
if (Concussive_Shot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT);
+ DoCast(me->getVictim(), SPELL_CONCUSSIVE_SHOT);
Concussive_Shot_Timer = 8000;
} else Concussive_Shot_Timer -= diff;
if (Multi_Shot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
+ DoCast(me->getVictim(), SPELL_MULTI_SHOT);
Multi_Shot_Timer = 10000;
} else Multi_Shot_Timer -= diff;
if (Aimed_Shot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT);
+ DoCast(me->getVictim(), SPELL_AIMED_SHOT);
Aimed_Shot_Timer = 6000;
} else Aimed_Shot_Timer -= diff;
if (Shoot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ DoCast(me->getVictim(), SPELL_SHOOT);
Shoot_Timer = 2500;
} else Shoot_Timer -= diff;
}
@@ -1097,14 +1097,14 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
if (Totem_Timer <= diff)
{
- DoCast(m_creature, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM));
+ DoCast(me, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM));
++Totem_Amount;
Totem_Timer = Totem_Amount*2000;
} else Totem_Timer -= diff;
if (War_Stomp_Timer <= diff)
{
- DoCast(m_creature, SPELL_WAR_STOMP);
+ DoCast(me, SPELL_WAR_STOMP);
War_Stomp_Timer = 10000;
} else War_Stomp_Timer -= diff;
@@ -1118,7 +1118,7 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
if (Frost_Shock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
Frost_Shock_Timer = 7000;
} else Frost_Shock_Timer -= diff;
@@ -1128,10 +1128,10 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
// uint64 guid = (*itr)->guid;
// if (guid)
// {
- // Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
+ // Unit* pAdd = Unit::GetUnit(*me, (*itr)->guid);
// if (pAdd && pAdd->isAlive())
// {
- DoCast(m_creature, SPELL_LESSER_HEALING_WAVE);
+ DoCast(me, SPELL_LESSER_HEALING_WAVE);
Healing_Wave_Timer = 5000;
// }
// }
@@ -1187,19 +1187,19 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
if (Goblin_Dragon_Gun_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
+ DoCast(me->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
Goblin_Dragon_Gun_Timer = 10000;
} else Goblin_Dragon_Gun_Timer -= diff;
if (Rocket_Launch_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH);
+ DoCast(me->getVictim(), SPELL_ROCKET_LAUNCH);
Rocket_Launch_Timer = 9000;
} else Rocket_Launch_Timer -= diff;
if (Fel_Iron_Bomb_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB);
+ DoCast(me->getVictim(), SPELL_FEL_IRON_BOMB);
Fel_Iron_Bomb_Timer = 15000;
} else Fel_Iron_Bomb_Timer -= diff;
@@ -1207,7 +1207,7 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
- if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUIDs[i]))
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
{
if (pAdd->IsPolymorphed())
{
@@ -1221,7 +1221,7 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
if (High_Explosive_Sheep_Timer <= diff)
{
- DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP);
+ DoCast(me, SPELL_HIGH_EXPLOSIVE_SHEEP);
High_Explosive_Sheep_Timer = 65000;
} else High_Explosive_Sheep_Timer -= diff;
@@ -1253,7 +1253,7 @@ CreatureAI* GetAI_zelfan(Creature* pCreature)
// {
// if (Explosion_Timer <= diff)
// {
-// DoCast(m_creature->getVictim(), SPELL_SHEEP_EXPLOSION);
+// DoCast(me->getVictim(), SPELL_SHEEP_EXPLOSION);
// }else
// Explosion_Timer -= diff;
// }
diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp
index 567a16fadae..002db4804fc 100644
--- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp
+++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp
@@ -91,8 +91,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
- //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
- Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
+ //Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]);
+ Unit* pUnit = Unit::GetUnit(*me, *itr);
if (pUnit)
{
if (!pUnit->isAlive())
@@ -135,12 +135,12 @@ struct boss_selin_fireheartAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
pCrystal = NULL;
- //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
- pCrystal = Unit::GetUnit(*m_creature, *itr);
+ //pCrystal = Unit::GetUnit(*me, FelCrystals[i]);
+ pCrystal = Unit::GetUnit(*me, *itr);
if (pCrystal && pCrystal->isAlive())
{
// select nearest
- if (!CrystalChosen || m_creature->GetDistanceOrder(pCrystal, CrystalChosen, false))
+ if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false))
{
CrystalGUID = pCrystal->GetGUID();
CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell.
@@ -149,16 +149,16 @@ struct boss_selin_fireheartAI : public ScriptedAI
}
if (CrystalChosen)
{
- DoScriptText(SAY_ENERGY, m_creature);
- DoScriptText(EMOTE_CRYSTAL, m_creature);
+ DoScriptText(SAY_ENERGY, me);
+ DoScriptText(EMOTE_CRYSTAL, me);
CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true);
float x, y, z; // coords that we move to, close to the crystal.
- CrystalChosen->GetClosePoint(x, y, z, m_creature->GetObjectSize(), CONTACT_DISTANCE);
+ CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->MovePoint(1, x, y, z);
DrainingCrystal = true;
}
}
@@ -171,8 +171,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
- //Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i]));
- Creature* pCrystal = Unit::GetCreature(*m_creature, *itr);
+ //Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i]));
+ Creature* pCrystal = Unit::GetCreature(*me, *itr);
if (pCrystal && pCrystal->isAlive())
pCrystal->Kill(pCrystal);
}
@@ -180,7 +180,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
@@ -189,20 +189,20 @@ struct boss_selin_fireheartAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void MovementInform(uint32 type, uint32 id)
{
if (type == POINT_MOTION_TYPE && id == 1)
{
- Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
+ Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
if (CrystalChosen && CrystalChosen->isAlive())
{
// Make the crystal attackable
// We also remove NON_ATTACKABLE in case the database has it set.
CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- CrystalChosen->CastSpell(m_creature, SPELL_MANA_RAGE, true);
+ CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true);
IsDraining = true;
}
else
@@ -216,7 +216,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -234,8 +234,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
if (!DrainingCrystal)
{
- uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
- if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
+ uint32 maxPowerMana = me->GetMaxPower(POWER_MANA);
+ if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
if (DrainLifeTimer <= diff)
{
@@ -256,16 +256,16 @@ struct boss_selin_fireheartAI : public ScriptedAI
if (FelExplosionTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_FEL_EXPLOSION);
+ DoCast(me, SPELL_FEL_EXPLOSION);
FelExplosionTimer = 2000;
}
} else FelExplosionTimer -= diff;
// If below 10% mana, start recharging
- maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
- if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
+ maxPowerMana = me->GetMaxPower(POWER_MANA);
+ if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
if (DrainCrystalTimer <= diff)
{
@@ -286,17 +286,17 @@ struct boss_selin_fireheartAI : public ScriptedAI
IsDraining = false;
DrainingCrystal = false;
- DoScriptText(SAY_EMPOWERED, m_creature);
+ DoScriptText(SAY_EMPOWERED, me);
- Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
+ Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
if (CrystalChosen && CrystalChosen->isAlive())
// Use Deal Damage to kill it, not setDeathState.
CrystalChosen->Kill(CrystalChosen);
CrystalGUID = 0;
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
} else EmpowerTimer -= diff;
}
}
@@ -322,12 +322,12 @@ struct mob_fel_crystalAI : public ScriptedAI
void JustDied(Unit* killer)
{
- if (ScriptedInstance* pInstance = m_creature->GetInstanceData())
+ if (ScriptedInstance* pInstance = me->GetInstanceData())
{
- Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN)));
+ Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
if (Selin && Selin->isAlive())
{
- if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == m_creature->GetGUID())
+ if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
{
// Set this to false if we are the Creature that Selin is draining so his AI flows properly
CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false;
diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp
index f2fba569b5b..42329f567e5 100644
--- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp
+++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp
@@ -86,7 +86,7 @@ struct boss_vexallusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustDied(Unit *victim)
@@ -97,7 +97,7 @@ struct boss_vexallusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
@@ -109,7 +109,7 @@ struct boss_vexallusAI : public ScriptedAI
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());
+ summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID());
}
void UpdateAI(const uint32 diff)
@@ -120,7 +120,7 @@ struct boss_vexallusAI : public ScriptedAI
if (!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
{
//increase amount, unless we're at 10%, then we switch and return
if (IntervalHealthAmount == INTERVAL_SWITCH)
@@ -131,22 +131,22 @@ struct boss_vexallusAI : public ScriptedAI
else
++IntervalHealthAmount;
- DoScriptText(SAY_ENERGY, m_creature);
- DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
+ DoScriptText(SAY_ENERGY, me);
+ DoScriptText(EMOTE_DISCHARGE_ENERGY, me);
if (IsHeroic())
{
- DoCast(m_creature, H_SPELL_SUMMON_PURE_ENERGY1, false);
- DoCast(m_creature, H_SPELL_SUMMON_PURE_ENERGY2, false);
+ DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false);
+ DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false);
}
else
- DoCast(m_creature, SPELL_SUMMON_PURE_ENERGY, false);
+ DoCast(me, SPELL_SUMMON_PURE_ENERGY, false);
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core
- m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (IsHeroic())
- m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
}
if (ChainLightningTimer <= diff)
@@ -170,7 +170,7 @@ struct boss_vexallusAI : public ScriptedAI
{
if (OverloadTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_OVERLOAD);
+ DoCast(me->getVictim(), SPELL_OVERLOAD);
OverloadTimer = 2000;
} else OverloadTimer -= diff;
@@ -193,7 +193,7 @@ struct mob_pure_energyAI : public ScriptedAI
void JustDied(Unit* slayer)
{
- if (Unit *temp = m_creature->GetOwner())
+ if (Unit *temp = me->GetOwner())
{
if (temp && temp->isAlive())
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp
index 96837858535..cc3959e4f29 100644
--- a/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp
+++ b/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp
@@ -60,8 +60,8 @@ struct npc_kalecgosAI : public ScriptedAI
m_uiTransformTimer = 0;
// we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
- if (m_creature->GetEntry() != NPC_KAEL)
- m_creature->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
+ if (me->GetEntry() != NPC_KAEL)
+ me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
@@ -76,7 +76,7 @@ struct npc_kalecgosAI : public ScriptedAI
// some targeting issues with the spell, so use this workaround as temporary solution
void DoWorkaroundForQuestCredit()
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap || pMap->IsHeroic())
return;
@@ -104,12 +104,12 @@ struct npc_kalecgosAI : public ScriptedAI
{
if (m_uiTransformTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_ORB_KILL_CREDIT, false);
+ DoCast(me, SPELL_ORB_KILL_CREDIT, false);
DoWorkaroundForQuestCredit();
// Transform and update entry, now ready for quest/read gossip
- DoCast(m_creature, SPELL_TRANSFORM_TO_KAEL, false);
- m_creature->UpdateEntry(NPC_KAEL);
+ DoCast(me, SPELL_TRANSFORM_TO_KAEL, false);
+ me->UpdateEntry(NPC_KAEL);
m_uiTransformTimer = 0;
} else m_uiTransformTimer -= uiDiff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp
index ca20931fc47..c44ab5067a3 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp
@@ -55,18 +55,18 @@ struct boss_baron_geddonAI : public ScriptedAI
return;
//If we are <2% hp cast Armageddom
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2)
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 2)
{
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_ARMAGEDDOM);
- DoScriptText(EMOTE_SERVICE, m_creature);
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_ARMAGEDDOM);
+ DoScriptText(EMOTE_SERVICE, me);
return;
}
//Inferno_Timer
if (Inferno_Timer <= diff)
{
- DoCast(m_creature, SPELL_INFERNO);
+ DoCast(me, SPELL_INFERNO);
Inferno_Timer = 45000;
} else Inferno_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp
index 447ebc19c98..15d2ccfb53d 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp
@@ -61,14 +61,14 @@ struct boss_garrAI : public ScriptedAI
//AntiMagicPulse_Timer
if (AntiMagicPulse_Timer <= diff)
{
- DoCast(m_creature, SPELL_ANTIMAGICPULSE);
+ DoCast(me, SPELL_ANTIMAGICPULSE);
AntiMagicPulse_Timer = 10000 + rand()%5000;
} else AntiMagicPulse_Timer -= diff;
//MagmaShackles_Timer
if (MagmaShackles_Timer <= diff)
{
- DoCast(m_creature, SPELL_MAGMASHACKLES);
+ DoCast(me, SPELL_MAGMASHACKLES);
MagmaShackles_Timer = 8000 + rand()%4000;
} else MagmaShackles_Timer -= diff;
@@ -106,11 +106,11 @@ struct mob_fireswornAI : public ScriptedAI
} else Immolate_Timer -= diff;
//Cast Erruption and let them die
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10)
+ if (me->GetHealth() <= me->GetMaxHealth() * 0.10)
{
- DoCast(m_creature->getVictim(), SPELL_ERUPTION);
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ DoCast(me->getVictim(), SPELL_ERUPTION);
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
}
DoMeleeAttackIfReady();
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp
index 5dd34a54b00..3610586cc05 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp
@@ -70,7 +70,7 @@ struct boss_gehennasAI : public ScriptedAI
//GehennasCurse_Timer
if (GehennasCurse_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GEHENNASCURSE);
+ DoCast(me->getVictim(), SPELL_GEHENNASCURSE);
GehennasCurse_Timer = urand(22000,30000);
} else GehennasCurse_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp
index 4ea1f5514c6..c63e49e70a6 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp
@@ -58,7 +58,7 @@ struct boss_golemaggAI : public ScriptedAI
m_uiBuffTimer = 2.5*IN_MILISECONDS;
m_bEnraged = false;
- DoCast(m_creature, SPELL_MAGMASPLASH, true);
+ DoCast(me, SPELL_MAGMASPLASH, true);
}
void JustDied(Unit* pKiller)
@@ -84,9 +84,9 @@ struct boss_golemaggAI : public ScriptedAI
m_uiPyroblastTimer -= uiDiff;
// Enrage
- if (!m_bEnraged && m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*10)
+ if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
m_bEnraged = true;
}
@@ -95,7 +95,7 @@ struct boss_golemaggAI : public ScriptedAI
{
if (m_uiEarthquakeTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
+ DoCast(me->getVictim(), SPELL_EARTHQUAKE);
m_uiEarthquakeTimer = 3*IN_MILISECONDS;
}
else
@@ -106,7 +106,7 @@ struct boss_golemaggAI : public ScriptedAI
// Golemagg's Trust
if (m_uiBuffTimer <= uidiff)
{
- DoCast(m_creature, SPELL_GOLEMAGG_TRUST);
+ DoCast(me, SPELL_GOLEMAGG_TRUST);
m_uiBuffTimer = 2.5*IN_MILISECONDS;
}
else
@@ -135,7 +135,7 @@ struct mob_core_ragerAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
- if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*50)
+ if (me->GetHealth()*100 < me->GetMaxHealth()*50)
{
if (m_pInstance)
{
@@ -143,11 +143,11 @@ struct mob_core_ragerAI : public ScriptedAI
{
if (pGolemagg->isAlive())
{
- DoScriptText(EMOTE_LOWHP, m_creature);
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ DoScriptText(EMOTE_LOWHP, me);
+ me->SetHealth(me->GetMaxHealth());
}
else
- uiDamage = m_creature->GetHealth();
+ uiDamage = me->GetHealth();
}
}
}
@@ -161,7 +161,7 @@ struct mob_core_ragerAI : public ScriptedAI
// Mangle
if (m_uiMangleTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MANGLE);
+ DoCast(me->getVictim(), SPELL_MANGLE);
m_uiMangleTimer = 10*IN_MILISECONDS;
}
else
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp
index cf46b06f052..1835026f5f0 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp
@@ -54,21 +54,21 @@ struct boss_lucifronAI : public ScriptedAI
//Impending doom timer
if (ImpendingDoom_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_IMPENDINGDOOM);
+ DoCast(me->getVictim(), SPELL_IMPENDINGDOOM);
ImpendingDoom_Timer = 20000;
} else ImpendingDoom_Timer -= diff;
//Lucifron's curse timer
if (LucifronCurse_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LUCIFRONCURSE);
+ DoCast(me->getVictim(), SPELL_LUCIFRONCURSE);
LucifronCurse_Timer = 15000;
} else LucifronCurse_Timer -= diff;
//Shadowshock
if (ShadowShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
+ DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
ShadowShock_Timer = 6000;
} else ShadowShock_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp
index f2a23746d10..e74e6d08c9b 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp
@@ -45,7 +45,7 @@ struct boss_magmadarAI : public ScriptedAI
Panic_Timer = 20000;
Lavabomb_Timer = 12000;
- DoCast(m_creature, SPELL_MAGMASPIT, true);
+ DoCast(me, SPELL_MAGMASPIT, true);
}
void EnterCombat(Unit *who)
@@ -60,15 +60,15 @@ struct boss_magmadarAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
- DoScriptText(EMOTE_FRENZY, m_creature);
- DoCast(m_creature, SPELL_FRENZY);
+ DoScriptText(EMOTE_FRENZY, me);
+ DoCast(me, SPELL_FRENZY);
Frenzy_Timer = 15000;
} else Frenzy_Timer -= diff;
//Panic_Timer
if (Panic_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PANIC);
+ DoCast(me->getVictim(), SPELL_PANIC);
Panic_Timer = 35000;
} else Panic_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp
index 35fd2dbffe6..1e014e26ef1 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp
@@ -71,12 +71,12 @@ struct boss_majordomoAI : public ScriptedAI
if (rand()%5)
return;
- DoScriptText(SAY_SLAY, m_creature);
+ DoScriptText(SAY_SLAY, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -85,15 +85,15 @@ struct boss_majordomoAI : public ScriptedAI
return;
//Cast Ageis if less than 50% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
- DoCast(m_creature, SPELL_AEGIS);
+ DoCast(me, SPELL_AEGIS);
}
//MagicReflection_Timer
// if (MagicReflection_Timer <= diff)
// {
- // DoCast(m_creature, SPELL_MAGICREFLECTION);
+ // DoCast(me, SPELL_MAGICREFLECTION);
//60 seconds until we should cast this agian
// MagicReflection_Timer = 30000;
@@ -102,7 +102,7 @@ struct boss_majordomoAI : public ScriptedAI
//DamageReflection_Timer
// if (DamageReflection_Timer <= diff)
// {
- // DoCast(m_creature, SPELL_DAMAGEREFLECTION);
+ // DoCast(me, SPELL_DAMAGEREFLECTION);
//60 seconds until we should cast this agian
// DamageReflection_Timer = 30000;
@@ -111,7 +111,7 @@ struct boss_majordomoAI : public ScriptedAI
//Blastwave_Timer
if (Blastwave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
+ DoCast(me->getVictim(), SPELL_BLASTWAVE);
Blastwave_Timer = 10000;
} else Blastwave_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp
index ba2673290b5..ce541198cad 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp
@@ -118,7 +118,7 @@ struct boss_ragnarosAI : public ScriptedAI
HasSubmergedOnce = false;
WasBanished = false;
- DoCast(m_creature, SPELL_MELTWEAPON, true);
+ DoCast(me, SPELL_MELTWEAPON, true);
HasAura = true;
}
@@ -127,7 +127,7 @@ struct boss_ragnarosAI : public ScriptedAI
if (rand()%5)
return;
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void EnterCombat(Unit *who)
@@ -139,9 +139,9 @@ struct boss_ragnarosAI : public ScriptedAI
if (WasBanished && Attack_Timer <= diff)
{
//Become unbanished again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_RAGEMERGE);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_RAGEMERGE);
WasBanished = false;
} else if (WasBanished)
{
@@ -157,10 +157,10 @@ struct boss_ragnarosAI : public ScriptedAI
//WrathOfRagnaros_Timer
if (WrathOfRagnaros_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WRATHOFRAGNAROS);
+ DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS);
if (urand(0,1))
- DoScriptText(SAY_WRATH, m_creature);
+ DoScriptText(SAY_WRATH, me);
WrathOfRagnaros_Timer = 30000;
} else WrathOfRagnaros_Timer -= diff;
@@ -168,10 +168,10 @@ struct boss_ragnarosAI : public ScriptedAI
//HandOfRagnaros_Timer
if (HandOfRagnaros_Timer <= diff)
{
- DoCast(m_creature, SPELL_HANDOFRAGNAROS);
+ DoCast(me, SPELL_HANDOFRAGNAROS);
if (urand(0,1))
- DoScriptText(SAY_HAND, m_creature);
+ DoScriptText(SAY_HAND, me);
HandOfRagnaros_Timer = 25000;
} else HandOfRagnaros_Timer -= diff;
@@ -179,21 +179,21 @@ struct boss_ragnarosAI : public ScriptedAI
//LavaBurst_Timer
if (LavaBurst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LAVABURST);
+ DoCast(me->getVictim(), SPELL_LAVABURST);
LavaBurst_Timer = 10000;
} else LavaBurst_Timer -= diff;
//Erruption_Timer
if (LavaBurst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ERRUPTION);
+ DoCast(me->getVictim(), SPELL_ERRUPTION);
Erruption_Timer = urand(20000,45000);
} else Erruption_Timer -= diff;
//ElementalFire_Timer
if (ElementalFire_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ELEMENTALFIRE);
+ DoCast(me->getVictim(), SPELL_ELEMENTALFIRE);
ElementalFire_Timer = urand(10000,14000);
} else ElementalFire_Timer -= diff;
@@ -204,48 +204,48 @@ struct boss_ragnarosAI : public ScriptedAI
//is not very well supported in the core
//so added normaly spawning and banish workaround and attack again after 90 secs.
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Root self
- DoCast(m_creature, 23973);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
+ DoCast(me, 23973);
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
if (!HasSubmergedOnce)
{
- DoScriptText(SAY_REINFORCEMENTS1, m_creature);
+ DoScriptText(SAY_REINFORCEMENTS1, me);
// summon 10 elementals
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
+ if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
pSummoned->AI()->AttackStart(pTarget);
}
}
HasSubmergedOnce = true;
WasBanished = true;
- DoCast(m_creature, SPELL_RAGSUBMERGE);
+ DoCast(me, SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
else
{
- DoScriptText(SAY_REINFORCEMENTS2, m_creature);
+ DoScriptText(SAY_REINFORCEMENTS2, me);
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
+ if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
pSummoned->AI()->AttackStart(pTarget);
}
}
WasBanished = true;
- DoCast(m_creature, SPELL_RAGSUBMERGE);
+ DoCast(me, SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
@@ -253,13 +253,13 @@ struct boss_ragnarosAI : public ScriptedAI
} else Submerge_Timer -= diff;
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
else
@@ -267,12 +267,12 @@ struct boss_ragnarosAI : public ScriptedAI
//MagmaBurst_Timer
if (MagmaBurst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MAGMABURST);
+ DoCast(me->getVictim(), SPELL_MAGMABURST);
if (!HasYelledMagmaBurst)
{
//Say our dialog
- DoScriptText(SAY_MAGMABURST, m_creature);
+ DoScriptText(SAY_MAGMABURST, me);
HasYelledMagmaBurst = true;
}
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp
index 471bffa635f..5fb99e3a1ba 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp
@@ -59,7 +59,7 @@ struct boss_shazzrahAI : public ScriptedAI
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANEEXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 5000 + rand()%4000;
} else ArcaneExplosion_Timer -= diff;
@@ -76,14 +76,14 @@ struct boss_shazzrahAI : public ScriptedAI
//DeadenMagic_Timer
if (DeadenMagic_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEADENMAGIC);
+ DoCast(me, SPELL_DEADENMAGIC);
DeadenMagic_Timer = 35000;
} else DeadenMagic_Timer -= diff;
//Countspell_Timer
if (Countspell_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_COUNTERSPELL);
+ DoCast(me->getVictim(), SPELL_COUNTERSPELL);
Countspell_Timer = 16000 + rand()%4000;
} else Countspell_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp
index 1948a3d57e6..302624ba170 100644
--- a/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp
+++ b/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp
@@ -66,7 +66,7 @@ struct boss_sulfuronAI : public ScriptedAI
//DemoralizingShout_Timer
if (DemoralizingShout_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEMORALIZINGSHOUT);
+ DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
DemoralizingShout_Timer = 15000 + rand()%5000;
} else DemoralizingShout_Timer -= diff;
@@ -85,7 +85,7 @@ struct boss_sulfuronAI : public ScriptedAI
if (pTarget)
DoCast(pTarget, SPELL_INSPIRE);
- DoCast(m_creature, SPELL_INSPIRE);
+ DoCast(me, SPELL_INSPIRE);
Inspire_Timer = 20000 + rand()%6000;
} else Inspire_Timer -= diff;
@@ -93,7 +93,7 @@ struct boss_sulfuronAI : public ScriptedAI
//Knockdown_Timer
if (Knockdown_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 12000 + rand()%3000;
} else Knockdown_Timer -= diff;
@@ -110,7 +110,7 @@ struct boss_sulfuronAI : public ScriptedAI
//DarkStrike_Timer
if (Darkstrike_Timer <= diff)
{
- DoCast(m_creature, SPELL_DARKSTRIKE);
+ DoCast(me, SPELL_DARKSTRIKE);
Darkstrike_Timer = 15000 + rand()%3000;
} else Darkstrike_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/redridge_mountains.cpp b/src/scripts/eastern_kingdoms/redridge_mountains.cpp
index 46378353282..2f0b5821e86 100644
--- a/src/scripts/eastern_kingdoms/redridge_mountains.cpp
+++ b/src/scripts/eastern_kingdoms/redridge_mountains.cpp
@@ -62,8 +62,8 @@ struct npc_corporal_keeshanAI : public npc_escortAI
if (!pPlayer)
return;
- if (uiI >= 65 && m_creature->GetUnitMovementFlags() == MOVEMENTFLAG_WALK_MODE)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALK_MODE)
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
switch(uiI)
{
@@ -73,7 +73,7 @@ struct npc_corporal_keeshanAI : public npc_escortAI
uiPhase = 1;
break;
case 65:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 115:
pPlayer->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION);
@@ -97,28 +97,28 @@ struct npc_corporal_keeshanAI : public npc_escortAI
switch(uiPhase)
{
case 1:
- m_creature->SetStandState(UNIT_STAND_STATE_SIT);
+ me->SetStandState(UNIT_STAND_STATE_SIT);
uiTimer = 1000;
uiPhase = 2;
break;
case 2:
- DoScriptText(SAY_CORPORAL_2,m_creature);
+ DoScriptText(SAY_CORPORAL_2,me);
uiTimer = 15000;
uiPhase = 3;
break;
case 3:
- DoScriptText(SAY_CORPORAL_3,m_creature);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_CORPORAL_3,me);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
SetEscortPaused(false);
uiTimer = 0;
uiPhase = 0;
break;
case 4:
- DoScriptText(SAY_CORPORAL_4, m_creature);
+ DoScriptText(SAY_CORPORAL_4, me);
uiTimer = 2500;
uiPhase = 5;
case 5:
- DoScriptText(SAY_CORPORAL_5, m_creature);
+ DoScriptText(SAY_CORPORAL_5, me);
uiTimer = 0;
uiPhase = 0;
}
@@ -130,13 +130,13 @@ struct npc_corporal_keeshanAI : public npc_escortAI
if (uiMockingBlowTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
+ DoCast(me->getVictim(),SPELL_MOCKING_BLOW);
uiMockingBlowTimer = 5000;
} else uiMockingBlowTimer -= uiDiff;
if (uiShieldBashTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
+ DoCast(me->getVictim(),SPELL_MOCKING_BLOW);
uiShieldBashTimer = 8000;
} else uiShieldBashTimer -= uiDiff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp
index a49ade8758f..0fc3bee28c4 100644
--- a/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp
@@ -355,7 +355,7 @@ struct npc_death_knight_initiateAI : public CombatAI
me->RestoreFaction();
CombatAI::Reset();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
m_uiDuelerGUID = 0;
m_uiDuelTimer = 5000;
@@ -377,7 +377,7 @@ struct npc_death_knight_initiateAI : public CombatAI
{
if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help
uiDamage = 0;
- else if (uiDamage >= m_creature->GetHealth())
+ else if (uiDamage >= me->GetHealth())
{
uiDamage = 0;
@@ -402,9 +402,9 @@ struct npc_death_knight_initiateAI : public CombatAI
{
if (m_uiDuelTimer <= uiDiff)
{
- m_creature->setFaction(FACTION_HOSTILE);
+ me->setFaction(FACTION_HOSTILE);
- if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiDuelerGUID))
+ if (Unit* pUnit = Unit::GetUnit(*me, m_uiDuelerGUID))
AttackStart(pUnit);
}
else
@@ -519,23 +519,23 @@ struct npc_dark_rider_of_acherusAI : public ScriptedAI
switch(Phase)
{
case 0:
- m_creature->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
+ me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
- if (Unit *pTarget = Unit::GetUnit(*m_creature, TargetGUID))
+ if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
break;
default:
break;
@@ -550,10 +550,10 @@ struct npc_dark_rider_of_acherusAI : public ScriptedAI
return;
TargetGUID = who->GetGUID();
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetSpeed(MOVE_RUN, 0.4f);
- m_creature->GetMotionMaster()->MoveChase(who);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->SetSpeed(MOVE_RUN, 0.4f);
+ me->GetMotionMaster()->MoveChase(who);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID);
Intro = true;
}
@@ -593,7 +593,7 @@ struct npc_salanar_the_horsemanAI : public ScriptedAI
caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
caster->setFaction(35);
DoCast(caster, CALL_DARK_RIDER, true);
- if (Creature* Dark_Rider = m_creature->FindNearestCreature(28654, 15))
+ if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15))
CAST_AI(npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster);
}
}
@@ -723,9 +723,9 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
{
// Ghouls should display their Birth Animation
// Crawling out of the ground
- //DoCast(m_creature, 35177, true);
- //m_creature->MonsterSay("Mommy?",LANG_UNIVERSAL,0);
- m_creature->SetReactState(REACT_DEFENSIVE);
+ //DoCast(me, 35177, true);
+ //me->MonsterSay("Mommy?",LANG_UNIVERSAL,0);
+ me->SetReactState(REACT_DEFENSIVE);
}
void FindMinions(Unit *owner)
@@ -737,7 +737,7 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
{
for (std::list<Creature*>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr)
{
- if (CAST_CRE(*itr)->GetOwner()->GetGUID() == m_creature->GetOwner()->GetGUID())
+ if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID())
{
if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper())
{
@@ -750,9 +750,9 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
- if (Unit *owner = m_creature->GetOwner())
+ if (Unit *owner = me->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat())
{
@@ -773,15 +773,15 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
//ScriptedAI::UpdateAI(diff);
//Check if we have a current target
- if (m_creature->getVictim()->GetEntry() == GHOSTS)
+ if (me->getVictim()->GetEntry() == GHOSTS)
{
- if (m_creature->isAttackReady())
+ if (me->isAttackReady())
{
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
diff --git a/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp
index c59e73d6dc1..cdfd69234fb 100644
--- a/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp
@@ -35,16 +35,16 @@ struct npc_valkyr_battle_maidenAI : public PassiveAI
void Reset()
{
me->setActive(true);
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlying(true);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlying(true);
FlyBackTimer = 500;
phase = 0;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
z += 4; x -= 3.5; y -= 5;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
}
void UpdateAI(const uint32 diff)
@@ -63,24 +63,24 @@ struct npc_valkyr_battle_maidenAI : public PassiveAI
switch(phase)
{
case 0:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
FlyBackTimer = 500;
break;
case 1:
- plr->GetClosePoint(x,y,z, m_creature->GetObjectSize());
+ plr->GetClosePoint(x,y,z, me->GetObjectSize());
z += 2.5; x -= 2; y -= 1.5;
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
+ me->SetVisibility(VISIBILITY_ON);
FlyBackTimer = 4500;
break;
case 2:
if (!plr->isRessurectRequested())
{
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
DoCast(plr, SPELL_REVIVE, true);
- m_creature->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
+ me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
}
FlyBackTimer = 5000;
break;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp
index 2b357367797..e51dda77ba9 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp
@@ -56,7 +56,7 @@ struct boss_arcanist_doanAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -66,22 +66,22 @@ struct boss_arcanist_doanAI : public ScriptedAI
if (bShielded && bCanDetonate)
{
- DoCast(m_creature, SPELL_FIREAOE);
+ DoCast(me, SPELL_FIREAOE);
bCanDetonate = false;
}
- if (m_creature->HasAura(SPELL_ARCANEBUBBLE))
+ if (me->HasAura(SPELL_ARCANEBUBBLE))
return;
//If we are <50% hp cast Arcane Bubble
- if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
+ if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
{
//wait if we already casting
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
- DoScriptText(SAY_SPECIALAE, m_creature);
- DoCast(m_creature, SPELL_ARCANEBUBBLE);
+ DoScriptText(SAY_SPECIALAE, me);
+ DoCast(me, SPELL_ARCANEBUBBLE);
bCanDetonate = true;
bShielded = true;
@@ -98,14 +98,14 @@ struct boss_arcanist_doanAI : public ScriptedAI
//AoESilence_Timer
if (AoESilence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AOESILENCE);
+ DoCast(me->getVictim(), SPELL_AOESILENCE);
AoESilence_Timer = 15000 + rand()%5000;
} else AoESilence_Timer -= diff;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANEEXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 8000;
} else ArcaneExplosion_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp
index e8236dd7ce0..e59120d3768 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp
@@ -52,12 +52,12 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
return;
//If we are <50% hp cast Soul Siphon rank 1
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false))
{
//SoulSiphon_Timer
if (SoulSiphon_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOULSIPHON);
+ DoCast(me->getVictim(), SPELL_SOULSIPHON);
return;
SoulSiphon_Timer = 20000;
@@ -67,14 +67,14 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
//CallOfTheGrave_Timer
if (CallOftheGrave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CALLOFTHEGRAVE);
+ DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
CallOftheGrave_Timer = 30000;
} else CallOftheGrave_Timer -= diff;
//Terrify_Timer
if (Terrify_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TERRIFY);
+ DoCast(me->getVictim(), SPELL_TERRIFY);
Terrify_Timer = 20000;
} else Terrify_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp
index 6b1be49136b..13dcfdf88dc 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp
@@ -56,12 +56,12 @@ struct boss_bloodmage_thalnosAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* Victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -70,37 +70,37 @@ struct boss_bloodmage_thalnosAI : public ScriptedAI
return;
//If we are <35% hp
- if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35))
+ if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35))
{
- DoScriptText(SAY_HEALTH, m_creature);
+ DoScriptText(SAY_HEALTH, me);
HpYell = true;
}
//FlameShock_Timer
if (FlameShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMESHOCK);
+ DoCast(me->getVictim(), SPELL_FLAMESHOCK);
FlameShock_Timer = 10000 + rand()%5000;
} else FlameShock_Timer -= diff;
//FlameSpike_Timer
if (FlameSpike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMESPIKE);
+ DoCast(me->getVictim(), SPELL_FLAMESPIKE);
FlameSpike_Timer = 30000;
} else FlameSpike_Timer -= diff;
//FireNova_Timer
if (FireNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 40000;
} else FireNova_Timer -= diff;
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
} else ShadowBolt_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp
index 56b012dc79c..c1d17203f77 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp
@@ -173,13 +173,13 @@ struct mob_wisp_invisAI : public ScriptedAI
break;
}
if (spell)
- DoCast(m_creature, spell);
+ DoCast(me, spell);
}
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4)
- m_creature->SetDisplayId(2027);
+ me->SetDisplayId(2027);
}
void MoveInLineOfSight(Unit *who)
@@ -187,7 +187,7 @@ struct mob_wisp_invisAI : public ScriptedAI
if (!who || Creaturetype != 1 || !who->isTargetableForAttack())
return;
- if (m_creature->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL))
+ if (me->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL))
DoCast(who, SPELL_SQUASH_SOUL);
}
@@ -197,9 +197,9 @@ struct mob_wisp_invisAI : public ScriptedAI
{
if (delay <= diff)
{
- m_creature->RemoveAurasDueToSpell(SPELL_SMOKE);
+ me->RemoveAurasDueToSpell(SPELL_SMOKE);
if (spell2)
- DoCast(m_creature, spell2);
+ DoCast(me, spell2);
delay = 0;
} else delay -= diff;
}
@@ -232,8 +232,8 @@ struct mob_headAI : public ScriptedAI
void EnterCombat(Unit *who) {}
void SaySound(int32 textEntry, Unit *pTarget = 0)
{
- DoScriptText(textEntry, m_creature, pTarget);
- //DoCast(m_creature, SPELL_HEAD_SPEAKS, true);
+ DoScriptText(textEntry, me, pTarget);
+ //DoCast(me, SPELL_HEAD_SPEAKS, true);
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if (speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
@@ -248,24 +248,24 @@ struct mob_headAI : public ScriptedAI
switch(Phase)
{
case 1:
- if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67)
+ if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 67)
Disappear();
break;
case 2:
- if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34)
+ if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 34)
Disappear();
break;
case 3:
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
die = true;
withbody = true;
wait = 300;
- damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->StopMoving();
- //m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature, SPELL_HEAD_IS_DEAD);
+ damage = me->GetHealth() - me->GetMaxHealth()/100;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->StopMoving();
+ //me->GetMotionMaster()->MoveIdle();
+ DoCast(me, SPELL_HEAD_IS_DEAD);
}
break;
}
@@ -283,13 +283,13 @@ struct mob_headAI : public ScriptedAI
withbody = false;
if (!bodyGUID)
bodyGUID = caster->GetGUID();
- m_creature->RemoveAllAuras();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_HEAD_LANDS, true);
- DoCast(m_creature, SPELL_HEAD, false);
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_HEAD_LANDS, true);
+ DoCast(me, SPELL_HEAD, false);
SaySound(SAY_LOST_HEAD);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveFleeing(caster->getVictim());
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveFleeing(caster->getVictim());
}
}
void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below
@@ -300,20 +300,20 @@ struct mob_headAI : public ScriptedAI
if (wait <= diff)
{
wait = 1000;
- if (!m_creature->getVictim()) return;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim());
+ if (!me->getVictim()) return;
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveFleeing(me->getVictim());
} else wait -= diff;
if (laugh <= diff)
{
laugh = urand(15000,30000);
- DoPlaySoundToSet(m_creature, RandomLaugh[urand(0,2)]);
- //DoCast(m_creature, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head"
+ DoPlaySoundToSet(me, RandomLaugh[urand(0,2)]);
+ //DoCast(me, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head"
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if (speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
- m_creature->MonsterTextEmote(EMOTE_LAUGHS,NULL);
+ me->MonsterTextEmote(EMOTE_LAUGHS,NULL);
} else laugh -= diff;
}
else
@@ -323,9 +323,9 @@ struct mob_headAI : public ScriptedAI
if (wait <= diff)
{
die = false;
- if (Unit *body = Unit::GetUnit((*m_creature), bodyGUID))
+ if (Unit *body = Unit::GetUnit((*me), bodyGUID))
body->Kill(body);
- m_creature->Kill(m_creature);
+ me->Kill(me);
} else wait -= diff;
}
}
@@ -397,10 +397,10 @@ struct boss_headless_horsemanAI : public ScriptedAI
returned = true;
burned = false;
IsFlying = false;
- DoCast(m_creature, SPELL_HEAD);
+ DoCast(me, SPELL_HEAD);
if (headGUID)
{
- if (Creature* Head = Unit::GetCreature((*m_creature), headGUID))
+ if (Creature* Head = Unit::GetCreature((*me), headGUID))
Head->DisappearAndDie();
headGUID = 0;
@@ -412,10 +412,10 @@ struct boss_headless_horsemanAI : public ScriptedAI
void FlyMode()
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
- m_creature->SetSpeed(MOVE_WALK,5.0f,true);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
+ me->SetSpeed(MOVE_WALK,5.0f,true);
wp_reached = false;
count = 0;
say_timer = 3000;
@@ -433,13 +433,13 @@ struct boss_headless_horsemanAI : public ScriptedAI
switch (id)
{
case 0:
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
break;
case 1:
{
- if (Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000))
+ if (Creature *smoke = me->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000))
CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3);
- DoCast(m_creature, SPELL_RHYME_BIG);
+ DoCast(me, SPELL_RHYME_BIG);
break;
}
case 6:
@@ -447,16 +447,16 @@ struct boss_headless_horsemanAI : public ScriptedAI
pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
break;
case 20:
{
Phase = 1;
IsFlying = false;
wp_reached = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
SaySound(SAY_ENTRANCE);
- if (Unit *plr = Unit::GetUnit((*m_creature),PlayerGUID))
+ if (Unit *plr = Unit::GetUnit((*me),PlayerGUID))
DoStartMovement(plr);
break;
}
@@ -483,20 +483,20 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (withhead)
SaySound(SAY_PLAYER_DEATH);
//maybe possible when player dies from conflagration
- else if (Creature *Head = Unit::GetCreature((*m_creature), headGUID))
+ else if (Creature *Head = Unit::GetCreature((*me), headGUID))
CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH);
}
}
void SaySound(int32 textEntry, Unit *pTarget = 0)
{
- DoScriptText(textEntry, m_creature, pTarget);
+ DoScriptText(textEntry, me, pTarget);
laugh += 4000;
}
Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap->IsDungeon()) return NULL;
Map::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -507,8 +507,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
std::list<Player*>::const_iterator j;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if ((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() &&
- m_creature->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive())
+ if ((me->IsWithinLOSInMap(i->getSource()) || !checkLoS) && me->getVictim() != i->getSource() &&
+ me->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive())
temp.push_back(i->getSource());
if (temp.size())
@@ -528,8 +528,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
void JustDied(Unit* killer)
{
- m_creature->StopMoving();
- //m_creature->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
+ //me->GetMotionMaster()->MoveIdle();
SaySound(SAY_DEATH);
if (Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000))
flame->CastSpell(flame,SPELL_BODY_FLAME,false);
@@ -551,47 +551,47 @@ struct boss_headless_horsemanAI : public ScriptedAI
else
Phase = 3;
withhead = true;
- m_creature->RemoveAllAuras();
- m_creature->SetName("Headless Horseman");
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ me->RemoveAllAuras();
+ me->SetName("Headless Horseman");
+ me->SetHealth(me->GetMaxHealth());
SaySound(SAY_REJOINED);
- DoCast(m_creature, SPELL_HEAD);
+ DoCast(me, SPELL_HEAD);
caster->GetMotionMaster()->Clear(false);
- caster->GetMotionMaster()->MoveFollow(m_creature,6,urand(0,5));
+ caster->GetMotionMaster()->MoveFollow(me,6,urand(0,5));
//DoResetThreat();//not sure if need
std::list<HostileReference*>::const_iterator itr;
for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive() && pUnit != caster)
- m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit));
+ me->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit));
}
}
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && withhead)
+ if (damage >= me->GetHealth() && withhead)
{
withhead = false;
returned = false;
- damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100;
- m_creature->RemoveAllAuras();
- m_creature->SetName("Headless Horseman, Unhorsed");
+ damage = me->GetHealth() - me->GetMaxHealth()/100;
+ me->RemoveAllAuras();
+ me->SetName("Headless Horseman, Unhorsed");
if (!headGUID)
headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID();
- Unit* Head = Unit::GetUnit((*m_creature), headGUID);
+ Unit* Head = Unit::GetUnit((*me), headGUID);
if (Head && Head->isAlive())
{
Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//Head->CastSpell(Head,SPELL_HEAD_INVIS,false);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_IMMUNE, true);
- DoCast(m_creature, SPELL_BODY_REGEN, true);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_IMMUNE, true);
+ DoCast(me, SPELL_BODY_REGEN, true);
DoCast(Head, SPELL_FLYING_HEAD, true);
- DoCast(m_creature, SPELL_CONFUSE, false); //test
- done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0);
+ DoCast(me, SPELL_CONFUSE, false); //test
+ done_by->ProcDamageAndSpell(me,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0);
whirlwind = urand(4000,8000);
regen = 0;
}
@@ -619,7 +619,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
}
else
{
- DoCast(m_creature, SPELL_RHYME_BIG);
+ DoCast(me, SPELL_RHYME_BIG);
if (plr)
{
plr->Say(Text[count].text,0);
@@ -638,8 +638,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (wp_reached)
{
wp_reached = false;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z);
}
}
}
@@ -649,7 +649,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
break;
if (burn <= diff)
{
- if (Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000))
+ if (Creature *flame = me->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000))
CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2);
burned = true;
} else burn -= diff;
@@ -665,8 +665,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
case 3:
if (summonadds <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_SUMMON_PUMPKIN);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_SUMMON_PUMPKIN);
SaySound(SAY_SPROUTING_PUMPKINS);
summonadds = urand(25000,35000);
} else summonadds -= diff;
@@ -676,8 +676,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (laugh <= diff)
{
laugh = urand(11000,22000);
- m_creature->MonsterTextEmote(EMOTE_LAUGHS,NULL);
- DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]);
+ me->MonsterTextEmote(EMOTE_LAUGHS,NULL);
+ DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
} else laugh -= diff;
if (UpdateVictim())
@@ -685,7 +685,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
DoMeleeAttackIfReady();
if (cleave <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
cleave = urand(2000,6000); //1 cleave per 2.0-6.0sec
} else cleave -= diff;
}
@@ -695,13 +695,13 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (regen <= diff)
{
regen = 1000; //"body calls head"
- if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned)
+ if (me->GetHealth()/me->GetMaxHealth() == 1 && !returned)
{
if (Phase > 1)
--Phase;
else
Phase = 1;
- Creature* Head = Unit::GetCreature((*m_creature), headGUID);
+ Creature* Head = Unit::GetCreature((*me), headGUID);
if (Head && Head->isAlive())
{
CAST_AI(mob_headAI, Head->AI())->Phase = Phase;
@@ -717,11 +717,11 @@ struct boss_headless_horsemanAI : public ScriptedAI
whirlwind = urand(4000,8000);
if (urand(0,1))
{
- m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE);
- DoCast(m_creature, SPELL_WHIRLWIND, true);
- DoCast(m_creature, SPELL_CONFUSE);
+ me->RemoveAurasDueToSpell(SPELL_CONFUSE);
+ DoCast(me, SPELL_WHIRLWIND, true);
+ DoCast(me, SPELL_CONFUSE);
} else
- m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
+ me->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
} else whirlwind -= diff;
}
}
@@ -733,17 +733,17 @@ void mob_headAI::Disappear()
return;
if (bodyGUID)
{
- Creature *body = Unit::GetCreature((*m_creature), bodyGUID);
+ Creature *body = Unit::GetCreature((*me), bodyGUID);
if (body && body->isAlive())
{
withbody = true;
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura
DoCast(body, SPELL_FLYING_HEAD);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->SetHealth(me->GetMaxHealth());
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->MoveIdle();
CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true;
}
}
@@ -759,21 +759,21 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
void Reset()
{
float x, y, z;
- m_creature->GetPosition(x, y, z); //this visual aura some under ground
- m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z + 0.35f, 0.0f);
+ me->GetPosition(x, y, z); //this visual aura some under ground
+ me->GetMap()->CreatureRelocation(me, x,y,z + 0.35f, 0.0f);
Despawn();
Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500);
if (debuff)
{
- debuff->SetDisplayId(m_creature->GetDisplayId());
+ debuff->SetDisplayId(me->GetDisplayId());
debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false);
CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1);
debuffGUID = debuff->GetGUID();
}
sprouted = false;
- DoCast(m_creature, SPELL_PUMPKIN_AURA, true);
- DoCast(m_creature, SPELL_SPROUTING);
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
+ DoCast(me, SPELL_PUMPKIN_AURA, true);
+ DoCast(me, SPELL_SPROUTING);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
}
void EnterCombat(Unit *who){}
@@ -783,18 +783,18 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
if (spell->Id == SPELL_SPROUTING)
{
sprouted = true;
- m_creature->RemoveAllAuras();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
- DoCast(m_creature, SPELL_SPROUT_BODY, true);
- m_creature->UpdateEntry(PUMPKIN_FIEND);
- DoStartMovement(m_creature->getVictim());
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
+ DoCast(me, SPELL_SPROUT_BODY, true);
+ me->UpdateEntry(PUMPKIN_FIEND);
+ DoStartMovement(me->getVictim());
}
}
void Despawn()
{
if (!debuffGUID) return;
- Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID);
+ Unit *debuff = Unit::GetUnit((*me),debuffGUID);
if (debuff)
debuff->SetVisibility(VISIBILITY_OFF);
debuffGUID = 0;
@@ -804,10 +804,10 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim())
+ if (!who || !who->isTargetableForAttack() || !me->IsHostileTo(who) || me->getVictim())
return;
- m_creature->AddThreat(who,0.0f);
+ me->AddThreat(who,0.0f);
if (sprouted)
DoStartMovement(who);
}
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp
index 9df10bd2b13..00e27d36ddb 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp
@@ -56,19 +56,19 @@ struct boss_herodAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_RUSHINGCHARGE);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_RUSHINGCHARGE);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* killer)
{
for (uint8 i = 0; i < 20; ++i)
- m_creature->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -77,26 +77,26 @@ struct boss_herodAI : public ScriptedAI
return;
//If we are <30% hp goes Enraged
- if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
{
- DoScriptText(EMOTE_ENRAGE, m_creature);
- DoScriptText(SAY_ENRAGE, m_creature);
- DoCast(m_creature, SPELL_FRENZY);
+ DoScriptText(EMOTE_ENRAGE, me);
+ DoScriptText(SAY_ENRAGE, me);
+ DoCast(me, SPELL_FRENZY);
Enrage = true;
}
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
} else Cleave_Timer -= diff;
// Whirlwind_Timer
if (Whirlwind_Timer <= diff)
{
- DoScriptText(SAY_WHIRLWIND, m_creature);
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ DoScriptText(SAY_WHIRLWIND, me);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 30000;
} else Whirlwind_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
index 572831eca3a..40be214d5ab 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
@@ -66,9 +66,9 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
return;
//If we are <25% hp cast Heal
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && !m_creature->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 25 && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
{
- DoCast(m_creature, SPELL_HEAL);
+ DoCast(me, SPELL_HEAL);
Heal_Timer = 30000;
} else Heal_Timer -= diff;
@@ -91,9 +91,9 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
} else Sleep_Timer -= diff;
//PowerWordShield_Timer
- if (!PowerWordShield && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25)
+ if (!PowerWordShield && me->GetHealth()*100 / me->GetMaxHealth() <= 25)
{
- DoCast(m_creature, SPELL_POWERWORDSHIELD);
+ DoCast(me, SPELL_POWERWORDSHIELD);
PowerWordShield = true;
}
@@ -109,7 +109,7 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
+ DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 25000;
} else CurseOfBlood_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp
index 0579f007255..731e64cc7bd 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp
@@ -43,7 +43,7 @@ struct boss_houndmaster_lokseyAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -53,7 +53,7 @@ struct boss_houndmaster_lokseyAI : public ScriptedAI
if (BloodLust_Timer <= diff)
{
- DoCast(m_creature, SPELL_BLOODLUST);
+ DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000;
} else BloodLust_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp
index e614341ed04..d0a34d461c7 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp
@@ -39,7 +39,7 @@ struct boss_interrogator_vishasAI : public ScriptedAI
{
boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -55,12 +55,12 @@ struct boss_interrogator_vishasAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* Victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* Killer)
@@ -69,7 +69,7 @@ struct boss_interrogator_vishasAI : public ScriptedAI
return;
//Any other actions to do with vorrel? setStandState?
- if (Unit *vorrel = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_VORREL)))
+ if (Unit *vorrel = Unit::GetUnit(*me,pInstance->GetData64(DATA_VORREL)))
DoScriptText(SAY_TRIGGER_VORREL, vorrel);
}
@@ -79,22 +79,22 @@ struct boss_interrogator_vishasAI : public ScriptedAI
return;
//If we are low on hp Do sayings
- if (!Yell60 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60))
+ if (!Yell60 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 60))
{
- DoScriptText(SAY_HEALTH1, m_creature);
+ DoScriptText(SAY_HEALTH1, me);
Yell60 = true;
}
- if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30))
+ if (!Yell30 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 30))
{
- DoScriptText(SAY_HEALTH2, m_creature);
+ DoScriptText(SAY_HEALTH2, me);
Yell30 = true;
}
//ShadowWordPain_Timer
if (ShadowWordPain_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN);
+ DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 5000 + rand()%10000;
} else ShadowWordPain_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp
index 08ddc37a12a..a03611d1077 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp
@@ -73,12 +73,12 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
m_uiHammerOfJustice_Timer = 10000;
//Incase wipe during phase that mograine fake death
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
if (m_pInstance)
- if (m_creature->isAlive())
+ if (me->isAlive())
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT,NOT_STARTED);
m_bHasDied = false;
@@ -97,46 +97,46 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_MO_AGGRO, m_creature);
- DoCast(m_creature, SPELL_RETRIBUTIONAURA);
+ DoScriptText(SAY_MO_AGGRO, me);
+ DoCast(me, SPELL_RETRIBUTIONAURA);
- m_creature->CallForHelp(VISIBLE_RANGE);
+ me->CallForHelp(VISIBLE_RANGE);
}
void KilledUnit(Unit* pVictim)
{
- DoScriptText(SAY_MO_KILL, m_creature);
+ DoScriptText(SAY_MO_KILL, me);
}
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage < m_creature->GetHealth() || m_bHasDied || m_bFakeDeath)
+ if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath)
return;
if (!m_pInstance)
return;
//On first death, fake death and open door, as well as initiate whitemane if exist
- if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE)))
+ if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
{
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
Whitemane->GetMotionMaster()->MovePoint(1,1163.113370,1398.856812,32.527786);
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->MoveIdle();
- m_creature->SetHealth(0);
+ me->SetHealth(0);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- m_creature->ClearComboPointHolders();
- m_creature->RemoveAllAuras();
- m_creature->ClearAllReactives();
+ me->ClearComboPointHolders();
+ me->RemoveAllAuras();
+ me->ClearAllReactives();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
m_bHasDied = true;
m_bFakeDeath = true;
@@ -150,7 +150,7 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
//When hit with ressurection say text
if (pSpell->Id == SPELL_SCARLETRESURRECTION)
{
- DoScriptText(SAY_MO_RESSURECTED, m_creature);
+ DoScriptText(SAY_MO_RESSURECTED, me);
m_bFakeDeath = false;
if (m_pInstance)
@@ -166,17 +166,17 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
{
//On ressurection, stop fake death and heal whitemane and resume fight
- if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE)))
+ if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(Whitemane, SPELL_LAYONHANDS);
m_uiCrusaderStrike_Timer = 10000;
m_uiHammerOfJustice_Timer = 10000;
- if (m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ if (me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
m_bHeal = true;
}
@@ -189,14 +189,14 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
//m_uiCrusaderStrike_Timer
if (m_uiCrusaderStrike_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CRUSADERSTRIKE);
+ DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE);
m_uiCrusaderStrike_Timer = 10000;
} else m_uiCrusaderStrike_Timer -= uiDiff;
//m_uiHammerOfJustice_Timer
if (m_uiHammerOfJustice_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMMEROFJUSTICE);
+ DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
m_uiHammerOfJustice_Timer = 60000;
} else m_uiHammerOfJustice_Timer -= uiDiff;
@@ -232,7 +232,7 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
m_bCanResurrect = false;
if (m_pInstance)
- if (m_creature->isAlive())
+ if (me->isAlive())
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
}
@@ -246,12 +246,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_WH_INTRO, m_creature);
+ DoScriptText(SAY_WH_INTRO, me);
}
void KilledUnit(Unit* pVictim)
{
- DoScriptText(SAY_WH_KILL, m_creature);
+ DoScriptText(SAY_WH_KILL, me);
}
void UpdateAI(const uint32 uiDiff)
@@ -264,10 +264,10 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
if (m_pInstance && m_uiWait_Timer <= uiDiff)
{
- if (Unit* Mograine = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE)))
+ if (Unit* Mograine = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
{
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
- DoScriptText(SAY_WH_RESSURECT, m_creature);
+ DoScriptText(SAY_WH_RESSURECT, me);
m_bCanResurrect = false;
}
}
@@ -275,12 +275,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
}
//Cast Deep sleep when health is less than 50%
- if (!m_bCanResurrectCheck && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
+ if (!m_bCanResurrectCheck && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_DEEPSLEEP);
+ DoCast(me->getVictim(), SPELL_DEEPSLEEP);
m_bCanResurrectCheck = true;
m_bCanResurrect = true;
return;
@@ -295,12 +295,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
{
Creature* pTarget = NULL;
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth()*0.75f)
- pTarget = m_creature;
+ if (me->GetHealth() <= me->GetMaxHealth()*0.75f)
+ pTarget = me;
if (m_pInstance)
{
- if (Creature* pMograine = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE)))
+ if (Creature* pMograine = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
{
// checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
if (m_bCanResurrectCheck && pMograine->isAlive() && pMograine->GetHealth() <= pMograine->GetMaxHealth()*0.75f)
@@ -317,14 +317,14 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
//m_uiPowerWordShield_Timer
if (m_uiPowerWordShield_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_POWERWORDSHIELD);
+ DoCast(me, SPELL_POWERWORDSHIELD);
m_uiPowerWordShield_Timer = 15000;
} else m_uiPowerWordShield_Timer -= uiDiff;
//m_uiHolySmite_Timer
if (m_uiHolySmite_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_HOLYSMITE);
+ DoCast(me->getVictim(), SPELL_HOLYSMITE);
m_uiHolySmite_Timer = 6000;
} else m_uiHolySmite_Timer -= uiDiff;
diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp
index 88adb538129..a8295cbaedd 100644
--- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp
+++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp
@@ -57,28 +57,28 @@ struct boss_scornAI : public ScriptedAI
//LichSlap_Timer
if (LichSlap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LICHSLAP);
+ DoCast(me->getVictim(), SPELL_LICHSLAP);
LichSlap_Timer = 45000;
} else LichSlap_Timer -= diff;
//FrostboltVolley_Timer
if (FrostboltVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLTVOLLEY);
+ DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY);
FrostboltVolley_Timer = 20000;
} else FrostboltVolley_Timer -= diff;
//MindFlay_Timer
if (MindFlay_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDFLAY);
+ DoCast(me->getVictim(), SPELL_MINDFLAY);
MindFlay_Timer = 20000;
} else MindFlay_Timer -= diff;
//FrostNova_Timer
if (FrostNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTNOVA);
+ DoCast(me->getVictim(), SPELL_FROSTNOVA);
FrostNova_Timer = 15000;
} else FrostNova_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp
index 11578a07a83..14195c9280b 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp
@@ -52,7 +52,7 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
{
boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -88,27 +88,27 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
//ArcaneMissiles_Timer
if (ArcaneMissiles_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANEMISSILES);
+ DoCast(me->getVictim(), SPELL_ARCANEMISSILES);
ArcaneMissiles_Timer = 8000;
} else ArcaneMissiles_Timer -= diff;
//ShadowShield_Timer
if (ShadowShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOWSHIELD);
+ DoCast(me, SPELL_SHADOWSHIELD);
ShadowShield_Timer = 14000 + rand()%14000;
} else ShadowShield_Timer -= diff;
//Curse_Timer
if (Curse_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSE);
+ DoCast(me->getVictim(), SPELL_CURSE);
Curse_Timer = 15000 + rand()%12000;
} else Curse_Timer -= diff;
//Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer.
//We will only telport if gandling has more than 3% of hp so teleported gamers can always loot.
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3)
+ if (me->GetHealth()*100 / me->GetMaxHealth() > 3)
{
if (Teleport_Timer <= diff)
{
@@ -124,79 +124,79 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
{
case 0:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 1:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 2:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 3:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 4:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 5:
DoTeleportPlayer(pTarget, 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);
+ Summoned = me->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
- Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ Summoned = me->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp
index d0158244bba..b3ce15a80fd 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp
@@ -33,8 +33,8 @@ struct boss_death_knight_darkreaverAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (m_creature->GetHealth() <= damage)
- DoCast(m_creature, 23261, true); //Summon Darkreaver's Fallen Charger
+ if (me->GetHealth() <= damage)
+ DoCast(me, 23261, true); //Summon Darkreaver's Fallen Charger
}
void EnterCombat(Unit *who)
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp
index 232ba904a4e..067093f9e8a 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp
@@ -50,13 +50,13 @@ struct boss_theolenkrastinovAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- ScriptedInstance* pInstance = m_creature->GetInstanceData();
+ ScriptedInstance* pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -68,7 +68,7 @@ struct boss_theolenkrastinovAI : public ScriptedAI
//Rend_Timer
if (m_uiRend_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_REND);
+ DoCast(me->getVictim(), SPELL_REND);
m_uiRend_Timer = 10000;
}
else
@@ -77,19 +77,19 @@ struct boss_theolenkrastinovAI : public ScriptedAI
//Backhand_Timer
if (m_uiBackhand_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_BACKHAND);
+ DoCast(me->getVictim(), SPELL_BACKHAND);
m_uiBackhand_Timer = 10000;
}
else
m_uiBackhand_Timer -= uiDiff;
//Frenzy_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 26)
{
if (m_uiFrenzy_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
m_uiFrenzy_Timer = 120000;
}
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp
index 23df3ad2c59..6cfa26619ae 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp
@@ -48,13 +48,13 @@ struct boss_illuciabarovAI : public ScriptedAI
void JustDied(Unit *killer)
{
- ScriptedInstance *pInstance = m_creature->GetInstanceData();
+ ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -70,7 +70,7 @@ struct boss_illuciabarovAI : public ScriptedAI
//CurseOfAgony_Timer
if (CurseOfAgony_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFAGONY);
+ DoCast(me->getVictim(), SPELL_CURSEOFAGONY);
CurseOfAgony_Timer = 30000;
} else CurseOfAgony_Timer -= diff;
@@ -87,14 +87,14 @@ struct boss_illuciabarovAI : public ScriptedAI
//Silence_Timer
if (Silence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 14000;
} else Silence_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 30000;
} else Fear_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp
index 8c49730e919..ee151a72413 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp
@@ -55,13 +55,13 @@ struct boss_instructormaliciaAI : public ScriptedAI
void JustDied(Unit *killer)
{
- ScriptedInstance *pInstance = m_creature->GetInstanceData();
+ ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -77,7 +77,7 @@ struct boss_instructormaliciaAI : public ScriptedAI
//CallOfGraves_Timer
if (CallOfGraves_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CALLOFGRAVES);
+ DoCast(me->getVictim(), SPELL_CALLOFGRAVES);
CallOfGraves_Timer = 65000;
} else CallOfGraves_Timer -= diff;
@@ -94,14 +94,14 @@ struct boss_instructormaliciaAI : public ScriptedAI
//Renew_Timer
if (Renew_Timer <= diff)
{
- DoCast(m_creature, SPELL_RENEW);
+ DoCast(me, SPELL_RENEW);
Renew_Timer = 10000;
} else Renew_Timer -= diff;
//FlashHeal_Timer
if (FlashHeal_Timer <= diff)
{
- DoCast(m_creature, SPELL_FLASHHEAL);
+ DoCast(me, SPELL_FLASHHEAL);
//5 Flashheals will be casted
if (FlashCounter < 2)
@@ -119,7 +119,7 @@ struct boss_instructormaliciaAI : public ScriptedAI
//HealingTouch_Timer
if (HealingTouch_Timer <= diff)
{
- DoCast(m_creature, SPELL_HEALINGTOUCH);
+ DoCast(me, SPELL_HEALINGTOUCH);
//3 Healingtouchs will be casted
if (HealingTouch_Timer < 2)
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp
index 7f45e9f1f0a..0f12567ea11 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp
@@ -62,9 +62,9 @@ struct boss_jandicebarovAI : public ScriptedAI
if (Invisible && Invisible_Timer <= diff)
{
//Become visible again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(11073); //Jandice Model
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(11073); //Jandice Model
Invisible = false;
} else if (Invisible)
{
@@ -81,7 +81,7 @@ struct boss_jandicebarovAI : public ScriptedAI
if (CurseOfBlood_Timer <= diff)
{
//Cast
- DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
+ DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
//45 seconds
CurseOfBlood_Timer = 30000;
@@ -92,11 +92,11 @@ struct boss_jandicebarovAI : public ScriptedAI
{
//Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(11686); // Invisible Model
- DoModifyThreatPercent(m_creature->getVictim(),-99);
+ me->InterruptNonMeleeSpells(false);
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(11686); // Invisible Model
+ DoModifyThreatPercent(me->getVictim(),-99);
//Summon 10 Illusions attacking random gamers
Unit *pTarget = NULL;
@@ -117,7 +117,7 @@ struct boss_jandicebarovAI : public ScriptedAI
// if (Illusion_Timer <= diff)
// {
// //Cast
- // DoCast(m_creature->getVictim(), SPELL_ILLUSION);
+ // DoCast(me->getVictim(), SPELL_ILLUSION);
//
// //3 Illusion will be summoned
// if (Illusioncounter < 3)
@@ -148,7 +148,7 @@ struct mob_illusionofjandicebarovAI : public ScriptedAI
void Reset()
{
Cleave_Timer = 2000 + rand()%6000;
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void EnterCombat(Unit *who)
@@ -165,7 +165,7 @@ struct mob_illusionofjandicebarovAI : public ScriptedAI
if (Cleave_Timer <= diff)
{
//Cast
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
//5-8 seconds
Cleave_Timer = 5000 + rand()%3000;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp
index d4c677e6b78..763fc0cf9e6 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp
@@ -69,14 +69,14 @@ struct boss_kormokAI : public ScriptedAI
//ShadowVolley_Timer
if (ShadowVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLTVOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
ShadowVolley_Timer = 15000;
} else ShadowVolley_Timer -= diff;
//BoneShield_Timer
if (BoneShield_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BONESHIELD);
+ DoCast(me->getVictim(), SPELL_BONESHIELD);
BoneShield_Timer = 45000;
} else BoneShield_Timer -= diff;
@@ -84,20 +84,20 @@ struct boss_kormokAI : public ScriptedAI
if (Minion_Timer <= diff)
{
//Cast
- SummonMinions(m_creature->getVictim());
- SummonMinions(m_creature->getVictim());
- SummonMinions(m_creature->getVictim());
- SummonMinions(m_creature->getVictim());
+ SummonMinions(me->getVictim());
+ SummonMinions(me->getVictim());
+ SummonMinions(me->getVictim());
+ SummonMinions(me->getVictim());
Minion_Timer = 12000;
} else Minion_Timer -= diff;
//Summon 2 Bone Mages
- if (!Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26)
+ if (!Mages && me->GetHealth()*100 / me->GetMaxHealth() < 26)
{
//Cast
- SummonMages(m_creature->getVictim());
- SummonMages(m_creature->getVictim());
+ SummonMages(me->getVictim());
+ SummonMages(me->getVictim());
Mages = true;
}
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp
index b3b51a48f65..fcc5b4a692e 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp
@@ -39,18 +39,18 @@ struct boss_lordalexeibarovAI : public ScriptedAI
Immolate_Timer = 7000;
VeilofShadow_Timer = 15000;
- m_creature->LoadCreaturesAddon();
+ me->LoadCreaturesAddon();
}
void JustDied(Unit *killer)
{
- ScriptedInstance *pInstance = m_creature->GetInstanceData();
+ ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -76,7 +76,7 @@ struct boss_lordalexeibarovAI : public ScriptedAI
//VeilofShadow_Timer
if (VeilofShadow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VEILOFSHADOW);
+ DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
VeilofShadow_Timer = 20000;
} else VeilofShadow_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp
index 94cdbe300f5..f8b1ea60423 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp
@@ -48,13 +48,13 @@ struct boss_lorekeeperpolkeltAI : public ScriptedAI
void JustDied(Unit *killer)
{
- ScriptedInstance *pInstance = m_creature->GetInstanceData();
+ ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -70,28 +70,28 @@ struct boss_lorekeeperpolkeltAI : public ScriptedAI
//VolatileInfection_Timer
if (VolatileInfection_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VOLATILEINFECTION);
+ DoCast(me->getVictim(), SPELL_VOLATILEINFECTION);
VolatileInfection_Timer = 32000;
} else VolatileInfection_Timer -= diff;
//Darkplague_Timer
if (Darkplague_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DARKPLAGUE);
+ DoCast(me->getVictim(), SPELL_DARKPLAGUE);
Darkplague_Timer = 8000;
} else Darkplague_Timer -= diff;
//CorrosiveAcid_Timer
if (CorrosiveAcid_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
+ DoCast(me->getVictim(), SPELL_CORROSIVEACID);
CorrosiveAcid_Timer = 25000;
} else CorrosiveAcid_Timer -= diff;
//NoxiousCatalyst_Timer
if (NoxiousCatalyst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_NOXIOUSCATALYST);
+ DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST);
NoxiousCatalyst_Timer = 38000;
} else NoxiousCatalyst_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp
index a4a796f71d8..618d6f7dbde 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp
@@ -50,7 +50,7 @@ struct boss_rasfrostAI : public ScriptedAI
FrostVolley_Timer = 24000;
Fear_Timer = 45000;
- DoCast(m_creature, SPELL_ICEARMOR, true);
+ DoCast(me, SPELL_ICEARMOR, true);
}
void EnterCombat(Unit *who){}
@@ -63,7 +63,7 @@ struct boss_rasfrostAI : public ScriptedAI
//IceArmor_Timer
if (IceArmor_Timer <= diff)
{
- DoCast(m_creature, SPELL_ICEARMOR);
+ DoCast(me, SPELL_ICEARMOR);
IceArmor_Timer = 180000;
} else IceArmor_Timer -= diff;
@@ -79,28 +79,28 @@ struct boss_rasfrostAI : public ScriptedAI
//Freeze_Timer
if (Freeze_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FREEZE);
+ DoCast(me->getVictim(), SPELL_FREEZE);
Freeze_Timer = 24000;
} else Freeze_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 30000;
} else Fear_Timer -= diff;
//ChillNova_Timer
if (ChillNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHILLNOVA);
+ DoCast(me->getVictim(), SPELL_CHILLNOVA);
ChillNova_Timer = 14000;
} else ChillNova_Timer -= diff;
//FrostVolley_Timer
if (FrostVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTVOLLEY);
+ DoCast(me->getVictim(), SPELL_FROSTVOLLEY);
FrostVolley_Timer = 15000;
} else FrostVolley_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp
index 2e0066487de..9502900b0eb 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp
@@ -50,13 +50,13 @@ struct boss_theravenianAI : public ScriptedAI
void JustDied(Unit *killer)
{
- ScriptedInstance *pInstance = m_creature->GetInstanceData();
+ ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -72,28 +72,28 @@ struct boss_theravenianAI : public ScriptedAI
//Trample_Timer
if (Trample_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
+ DoCast(me->getVictim(), SPELL_TRAMPLE);
Trample_Timer = 10000;
} else Trample_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//SunderingCleave_Timer
if (SunderingCleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDERINCLEAVE);
+ DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE);
SunderingCleave_Timer = 20000;
} else SunderingCleave_Timer -= diff;
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 12000;
} else KnockAway_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp
index cb0535bd0b3..a38369faab0 100644
--- a/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp
+++ b/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp
@@ -56,7 +56,7 @@ struct boss_vectusAI : public ScriptedAI
//FireShield_Timer
if (m_uiFireShield_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_FIRESHIELD);
+ DoCast(me, SPELL_FIRESHIELD);
m_uiFireShield_Timer = 90000;
}
else
@@ -65,19 +65,19 @@ struct boss_vectusAI : public ScriptedAI
//BlastWave_Timer
if (m_uiBlastWave_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE);
+ DoCast(me->getVictim(), SPELL_BLAST_WAVE);
m_uiBlastWave_Timer = 12000;
}
else
m_uiBlastWave_Timer -= uiDiff;
//Frenzy_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 25)
{
if (m_uiFrenzy_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
m_uiFrenzy_Timer = 24000;
}
diff --git a/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp
index 27d5002e9c1..c41a53cf779 100644
--- a/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp
+++ b/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp
@@ -68,32 +68,32 @@ struct npc_shadowfang_prisonerAI : public npc_escortAI
{
case 0:
if (uiNpcEntry == NPC_ASH)
- DoScriptText(SAY_FREE_AS, m_creature);
+ DoScriptText(SAY_FREE_AS, me);
else
- DoScriptText(SAY_FREE_AD, m_creature);
+ DoScriptText(SAY_FREE_AD, me);
break;
case 10:
if (uiNpcEntry == NPC_ASH)
- DoScriptText(SAY_OPEN_DOOR_AS, m_creature);
+ DoScriptText(SAY_OPEN_DOOR_AS, me);
else
- DoScriptText(SAY_OPEN_DOOR_AD, m_creature);
+ DoScriptText(SAY_OPEN_DOOR_AD, me);
break;
case 11:
if (uiNpcEntry == NPC_ASH)
- DoCast(m_creature, SPELL_UNLOCK);
+ DoCast(me, SPELL_UNLOCK);
break;
case 12:
if (uiNpcEntry == NPC_ASH)
- DoScriptText(SAY_POST_DOOR_AS, m_creature);
+ DoScriptText(SAY_POST_DOOR_AS, me);
else
- DoScriptText(SAY_POST1_DOOR_AD, m_creature);
+ DoScriptText(SAY_POST1_DOOR_AD, me);
if (pInstance)
pInstance->SetData(TYPE_FREE_NPC, DONE);
break;
case 13:
if (uiNpcEntry != NPC_ASH)
- DoScriptText(SAY_POST2_DOOR_AD, m_creature);
+ DoScriptText(SAY_POST2_DOOR_AD, me);
break;
}
}
@@ -154,13 +154,13 @@ struct npc_arugal_voidwalkerAI : public ScriptedAI
if (uiDarkOffering <= uiDiff)
{
- if (Creature* pFriend = m_creature->FindNearestCreature(m_creature->GetEntry(),25.0f,true))
+ if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(),25.0f,true))
{
if (pFriend)
DoCast(pFriend,SPELL_DARK_OFFERING);
}
else
- DoCast(m_creature,SPELL_DARK_OFFERING);
+ DoCast(me,SPELL_DARK_OFFERING);
uiDarkOffering = urand(4400,12500);
} else uiDarkOffering -= uiDiff;
diff --git a/src/scripts/eastern_kingdoms/silvermoon_city.cpp b/src/scripts/eastern_kingdoms/silvermoon_city.cpp
index 1c81d701fb0..29edc1b72a3 100644
--- a/src/scripts/eastern_kingdoms/silvermoon_city.cpp
+++ b/src/scripts/eastern_kingdoms/silvermoon_city.cpp
@@ -47,8 +47,8 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
spellHit = false;
}
@@ -63,10 +63,10 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (m_creature->IsStandState())
+ if (me->IsStandState())
{
if (lifeTimer <= diff)
- m_creature->AI()->EnterEvadeMode();
+ me->AI()->EnterEvadeMode();
else
lifeTimer -= diff;
}
@@ -78,11 +78,11 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI
(Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
{
CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
- DoCast(m_creature, SPELL_REVIVE_SELF);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoScriptText(SAY_HEAL, m_creature);
+ DoCast(me, SPELL_REVIVE_SELF);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //me->RemoveAllAuras();
+ DoScriptText(SAY_HEAL, me);
spellHit = true;
}
}
diff --git a/src/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/scripts/eastern_kingdoms/silverpine_forest.cpp
index 3294ffb223b..2213c5fab48 100644
--- a/src/scripts/eastern_kingdoms/silverpine_forest.cpp
+++ b/src/scripts/eastern_kingdoms/silverpine_forest.cpp
@@ -43,7 +43,7 @@ struct npc_astor_hadrenAI : public ScriptedAI
void Reset()
{
- m_creature->setFaction(68);
+ me->setFaction(68);
}
void EnterCombat(Unit* who)
@@ -52,7 +52,7 @@ struct npc_astor_hadrenAI : public ScriptedAI
void JustDied(Unit *who)
{
- m_creature->setFaction(68);
+ me->setFaction(68);
}
};
@@ -128,25 +128,25 @@ struct npc_deathstalker_erlandAI : public npc_escortAI
switch(i)
{
- case 1: DoScriptText(SAY_START, m_creature, pPlayer);break;
+ case 1: DoScriptText(SAY_START, me, pPlayer);break;
case 13:
- DoScriptText(SAY_LAST, m_creature, pPlayer);
- pPlayer->GroupEventHappens(QUEST_ESCORTING, m_creature); break;
- case 14: DoScriptText(SAY_THANKS, m_creature, pPlayer); break;
+ DoScriptText(SAY_LAST, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_ESCORTING, me); break;
+ case 14: DoScriptText(SAY_THANKS, me, pPlayer); break;
case 15: {
Unit* Rane = me->FindNearestCreature(NPC_RANE, 20);
if (Rane)
DoScriptText(SAY_RANE, Rane);
break;}
- case 16: DoScriptText(SAY_ANSWER, m_creature); break;
- case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break;
- case 24: DoScriptText(SAY_GREETINGS, m_creature); break;
+ case 16: DoScriptText(SAY_ANSWER, me); break;
+ case 17: DoScriptText(SAY_MOVE_QUINN, me); break;
+ case 24: DoScriptText(SAY_GREETINGS, me); break;
case 25: {
Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20);
if (Quinn)
DoScriptText(SAY_QUINN, Quinn);
break;}
- case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL); break;
+ case 26: DoScriptText(SAY_ON_BYE, me, NULL); break;
}
}
@@ -155,7 +155,7 @@ struct npc_deathstalker_erlandAI : public npc_escortAI
void EnterCombat(Unit* who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature, who);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me, who);
}
};
@@ -205,7 +205,7 @@ static float PyrewoodSpawnPoints[3][4] =
struct pyrewood_ambushAI : public ScriptedAI
{
- pyrewood_ambushAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
+ pyrewood_ambushAI(Creature *c) : ScriptedAI(c), Summons(me)
{
QuestInProgress = false;
}
@@ -247,7 +247,7 @@ struct pyrewood_ambushAI : public ScriptedAI
void SummonCreatureWithRandomTarget(uint32 creatureId, int position)
{
- if (Creature *pSummoned = m_creature->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
+ if (Creature *pSummoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
{
Player *pPlayer = NULL;
Unit *pTarget = NULL;
@@ -255,9 +255,9 @@ struct pyrewood_ambushAI : public ScriptedAI
{
pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
- pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer);
+ pTarget = RAND((Unit*)me, (Unit*)pPlayer);
} else
- pTarget = m_creature;
+ pTarget = me;
if (pTarget)
{
@@ -296,7 +296,7 @@ struct pyrewood_ambushAI : public ScriptedAI
{
case 0:
if (WaitTimer == WAIT_SECS)
- m_creature->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike
+ me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike
if (WaitTimer <= diff)
{
@@ -326,8 +326,8 @@ struct pyrewood_ambushAI : public ScriptedAI
{
if (Player *pPlayer = Unit::GetPlayer(PlayerGUID))
{
- m_creature->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike
- pPlayer->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, m_creature);
+ me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike
+ pPlayer->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me);
}
}
QuestInProgress = false;
diff --git a/src/scripts/eastern_kingdoms/stormwind_city.cpp b/src/scripts/eastern_kingdoms/stormwind_city.cpp
index 80f73d2b9ba..3cfc99b67e1 100644
--- a/src/scripts/eastern_kingdoms/stormwind_city.cpp
+++ b/src/scripts/eastern_kingdoms/stormwind_city.cpp
@@ -86,16 +86,16 @@ struct npc_bartlebyAI : public ScriptedAI
void Reset()
{
- if (m_creature->getFaction() != m_uiNormalFaction)
- m_creature->setFaction(m_uiNormalFaction);
+ if (me->getFaction() != m_uiNormalFaction)
+ me->setFaction(m_uiNormalFaction);
}
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
return;
- if (m_creature->IsFriendlyTo(pAttacker))
+ if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -103,7 +103,7 @@ struct npc_bartlebyAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15))
+ if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15))
{
//Take 0 damage
uiDamage = 0;
@@ -151,16 +151,16 @@ struct npc_dashel_stonefistAI : public ScriptedAI
void Reset()
{
- if (m_creature->getFaction() != m_uiNormalFaction)
- m_creature->setFaction(m_uiNormalFaction);
+ if (me->getFaction() != m_uiNormalFaction)
+ me->setFaction(m_uiNormalFaction);
}
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
return;
- if (m_creature->IsFriendlyTo(pAttacker))
+ if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -168,7 +168,7 @@ struct npc_dashel_stonefistAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15))
+ if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15))
{
uiDamage = 0;
@@ -284,9 +284,9 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
void EnterEvadeMode()
{
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
- if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID))
+ if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID))
{
if (pMarzon->isAlive())
pMarzon->DisappearAndDie();
@@ -295,7 +295,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
void EnterCombat(Unit* pWho)
{
- if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID))
+ if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID))
{
if (pMarzon->isAlive() && !pMarzon->isInCombat())
pMarzon->AI()->AttackStart(pWho);
@@ -308,13 +308,13 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
{
case 14:
SetEscortPaused(true);
- DoScriptText(SAY_LESCOVAR_2, m_creature);
+ DoScriptText(SAY_LESCOVAR_2, me);
uiTimer = 3000;
uiPhase = 1;
break;
case 16:
SetEscortPaused(true);
- if (Creature *pMarzon = m_creature->SummonCreature(NPC_MARZON_BLADE,-8411.360352, 480.069733, 123.760895, 4.941504, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
+ if (Creature *pMarzon = me->SummonCreature(NPC_MARZON_BLADE,-8411.360352, 480.069733, 123.760895, 4.941504, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
{
pMarzon->GetMotionMaster()->MovePoint(0,-8408.000977, 468.611450, 123.759903);
MarzonGUID = pMarzon->GetGUID();
@@ -328,7 +328,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
void DoGuardsDisappearAndDie()
{
std::list<Creature*> GuardList;
- m_creature->GetCreatureListWithEntryInGrid(GuardList,NPC_STORMWIND_ROYAL,8.0f);
+ me->GetCreatureListWithEntryInGrid(GuardList,NPC_STORMWIND_ROYAL,8.0f);
if (!GuardList.empty())
{
for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
@@ -348,7 +348,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
switch(uiPhase)
{
case 1:
- if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true))
+ if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true))
DoScriptText(SAY_GUARD_2, pGuard);
uiTimer = 3000;
uiPhase = 2;
@@ -364,29 +364,29 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI
uiPhase = 0;
break;
case 4:
- DoScriptText(SAY_LESCOVAR_3, m_creature);
+ DoScriptText(SAY_LESCOVAR_3, me);
uiTimer = 0;
uiPhase = 0;
break;
case 5:
- if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID))
+ if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID))
DoScriptText(SAY_MARZON_1, pMarzon);
uiTimer = 3000;
uiPhase = 6;
break;
case 6:
- DoScriptText(SAY_LESCOVAR_4, m_creature);
+ DoScriptText(SAY_LESCOVAR_4, me);
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->AreaExploredOrEventHappens(QUEST_THE_ATTACK);
uiTimer = 2000;
uiPhase = 7;
break;
case 7:
- if (Creature* pTyrion = m_creature->FindNearestCreature(NPC_TYRION, 20.0f, true))
+ if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true))
DoScriptText(SAY_TYRION_2, pTyrion);
- if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID))
+ if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID))
pMarzon->setFaction(14);
- m_creature->setFaction(14);
+ me->setFaction(14);
uiTimer = 0;
uiPhase = 0;
break;
@@ -415,21 +415,21 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI
{
npc_marzon_silent_bladeAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
}
void Reset()
{
- m_creature->RestoreFaction();
+ me->RestoreFaction();
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_MARZON_2, m_creature);
+ DoScriptText(SAY_MARZON_2, me);
- if (m_creature->isSummon())
+ if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
@@ -439,11 +439,11 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI
void EnterEvadeMode()
{
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
- if (m_creature->isSummon())
+ if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive())
CAST_CRE(pSummoner)->DisappearAndDie();
@@ -456,13 +456,13 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- if (m_creature->isSummon())
+ if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiTimer = 2000;
CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiPhase = 5;
- //m_creature->ChangeOrient(0.0f, pSummoner);
+ //me->ChangeOrient(0.0f, pSummoner);
}
}
}
@@ -524,13 +524,13 @@ struct npc_tyrion_spybotAI : public npc_escortAI
break;
case 5:
SetEscortPaused(true);
- DoScriptText(SAY_SPYBOT_1, m_creature);
+ DoScriptText(SAY_SPYBOT_1, me);
uiTimer = 2000;
uiPhase = 5;
break;
case 17:
SetEscortPaused(true);
- DoScriptText(SAY_SPYBOT_3, m_creature);
+ DoScriptText(SAY_SPYBOT_3, me);
uiTimer = 3000;
uiPhase = 8;
break;
@@ -546,7 +546,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI
switch(uiPhase)
{
case 1:
- DoScriptText(SAY_QUEST_ACCEPT_ATTACK, m_creature);
+ DoScriptText(SAY_QUEST_ACCEPT_ATTACK, me);
uiTimer = 3000;
uiPhase = 2;
break;
@@ -560,7 +560,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI
uiPhase = 3;
break;
case 3:
- m_creature->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE);
+ me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE);
uiTimer = 2000;
uiPhase = 4;
break;
@@ -570,13 +570,13 @@ struct npc_tyrion_spybotAI : public npc_escortAI
uiTimer = 0;
break;
case 5:
- if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true))
+ if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true))
DoScriptText(SAY_GUARD_1, pGuard);
uiTimer = 3000;
uiPhase = 6;
break;
case 6:
- DoScriptText(SAY_SPYBOT_2, m_creature);
+ DoScriptText(SAY_SPYBOT_2, me);
uiTimer = 3000;
uiPhase = 7;
break;
@@ -595,7 +595,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI
uiPhase = 9;
break;
case 9:
- DoScriptText(SAY_SPYBOT_4, m_creature);
+ DoScriptText(SAY_SPYBOT_4, me);
uiTimer = 3000;
uiPhase = 10;
break;
@@ -609,7 +609,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI
CAST_AI(npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
}
*/
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
uiTimer = 0;
uiPhase = 0;
break;
diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp
index 08893ea977f..6f1112c2ca1 100644
--- a/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp
+++ b/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp
@@ -44,7 +44,7 @@ struct mob_yennikuAI : public ScriptedAI
void Reset()
{
Reset_Timer = 0;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
@@ -54,10 +54,10 @@ struct mob_yennikuAI : public ScriptedAI
//Yenniku's Release
if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
{
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
- m_creature->CombatStop(); //stop combat
- m_creature->DeleteThreatList(); //unsure of this
- m_creature->setFaction(83); //horde generic
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+ me->CombatStop(); //stop combat
+ me->DeleteThreatList(); //unsure of this
+ me->setFaction(83); //horde generic
bReset = true;
Reset_Timer = 60000;
@@ -76,20 +76,20 @@ struct mob_yennikuAI : public ScriptedAI
{
EnterEvadeMode();
bReset = false;
- m_creature->setFaction(28); //troll, bloodscalp
+ me->setFaction(28); //troll, bloodscalp
return;
}
else Reset_Timer -= diff;
- if (m_creature->isInCombat() && m_creature->getVictim())
+ if (me->isInCombat() && me->getVictim())
{
- if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)
+ if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
{
- Unit *victim = m_creature->getVictim();
+ Unit *victim = me->getVictim();
if (CAST_PLR(victim)->GetTeam() == HORDE)
{
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
+ me->CombatStop();
+ me->DeleteThreatList();
}
}
}
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp
index dd83e3cbc5f..f32864fccf7 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp
@@ -79,7 +79,7 @@ struct boss_baron_rivendareAI : public ScriptedAI
{
boss_baron_rivendareAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -129,7 +129,7 @@ struct boss_baron_rivendareAI : public ScriptedAI
if (ShadowBolt_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 10000;
} else ShadowBolt_Timer -= diff;
@@ -137,7 +137,7 @@ struct boss_baron_rivendareAI : public ScriptedAI
//Cleave
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
//13 seconds until we should cast this again
Cleave_Timer = 7000 + (rand()%10000);
} else Cleave_Timer -= diff;
@@ -145,26 +145,26 @@ struct boss_baron_rivendareAI : public ScriptedAI
//MortalStrike
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 10000 + (rand()%15000);
} else MortalStrike_Timer -= diff;
//RaiseDead
// if (RaiseDead_Timer <= diff)
// {
- // DoCast(m_creature, SPELL_RAISEDEAD);
+ // DoCast(me, SPELL_RAISEDEAD);
// RaiseDead_Timer = 45000;
// } else RaiseDead_Timer -= diff;
//SummonSkeletons
if (SummonSkeletons_Timer <= diff)
{
- m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000);
- m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000);
- m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000);
- m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000);
- m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000);
- m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ me->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000);
//34 seconds until we should cast this again
SummonSkeletons_Timer = 40000;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp
index 2ae770ec5b8..e51ee03cc80 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp
@@ -33,7 +33,7 @@ struct boss_baroness_anastariAI : public ScriptedAI
{
boss_baroness_anastariAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -70,7 +70,7 @@ struct boss_baroness_anastariAI : public ScriptedAI
if (BansheeWail_Timer <= diff)
{
if (rand()%100 < 95)
- DoCast(m_creature->getVictim(), SPELL_BANSHEEWAIL);
+ DoCast(me->getVictim(), SPELL_BANSHEEWAIL);
//4 seconds until we should cast this again
BansheeWail_Timer = 4000;
} else BansheeWail_Timer -= diff;
@@ -79,7 +79,7 @@ struct boss_baroness_anastariAI : public ScriptedAI
if (BansheeCurse_Timer <= diff)
{
if (rand()%100 < 75)
- DoCast(m_creature->getVictim(), SPELL_BANSHEECURSE);
+ DoCast(me->getVictim(), SPELL_BANSHEECURSE);
//18 seconds until we should cast this again
BansheeCurse_Timer = 18000;
} else BansheeCurse_Timer -= diff;
@@ -88,7 +88,7 @@ struct boss_baroness_anastariAI : public ScriptedAI
if (Silence_Timer <= diff)
{
if (rand()%100 < 80)
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
//13 seconds until we should cast this again
Silence_Timer = 13000;
} else Silence_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp
index f1a0a57e85c..edb64c6b917 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp
@@ -93,13 +93,13 @@ struct boss_cannon_master_willeyAI : public ScriptedAI
void JustDied(Unit* Victim)
{
- m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
}
void EnterCombat(Unit *who)
@@ -118,7 +118,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI
//Cast
if (rand()%100 < 90) //90% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_PUMMEL);
+ DoCast(me->getVictim(), SPELL_PUMMEL);
}
//12 seconds until we should cast this again
Pummel_Timer = 12000;
@@ -130,7 +130,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI
//Cast
if (rand()%100 < 80) //80% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY);
}
//14 seconds until we should cast this again
KnockAway_Timer = 14000;
@@ -140,7 +140,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI
if (Shoot_Timer <= diff)
{
//Cast
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ DoCast(me->getVictim(), SPELL_SHOOT);
//1 seconds until we should cast this again
Shoot_Timer = 1000;
} else Shoot_Timer -= diff;
@@ -152,49 +152,49 @@ struct boss_cannon_master_willeyAI : public ScriptedAI
switch (rand()%9)
{
case 0:
- m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 1:
- m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 2:
- m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 3:
- m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 4:
- m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 5:
- m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 6:
- m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 7:
- m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
case 8:
- m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
break;
}
//30 seconds until we should cast this again
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp
index 83684cb4fe9..0fd547d393e 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp
@@ -89,8 +89,8 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI
m_uiMindControl_Timer = 10000;
m_bTransformed = false;
- if (m_creature->GetEntry() == NPC_BALNAZZAR)
- m_creature->UpdateEntry(NPC_DATHROHAN);
+ if (me->GetEntry() == NPC_BALNAZZAR)
+ me->UpdateEntry(NPC_DATHROHAN);
}
void JustDied(Unit* Victim)
@@ -98,7 +98,7 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI
static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef);
for (uint8 i=0; i<uiCount; ++i)
- m_creature->SummonCreature(NPC_ZOMBIE,
+ me->SummonCreature(NPC_ZOMBIE,
m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient,
TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILISECONDS);
}
@@ -118,40 +118,40 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI
//MindBlast
if (m_uiMindBlast_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDBLAST);
+ DoCast(me->getVictim(), SPELL_MINDBLAST);
m_uiMindBlast_Timer = 15000 + rand()%5000;
} else m_uiMindBlast_Timer -= uiDiff;
//CrusadersHammer
if (m_uiCrusadersHammer_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CRUSADERSHAMMER);
+ DoCast(me->getVictim(), SPELL_CRUSADERSHAMMER);
m_uiCrusadersHammer_Timer = 12000;
} else m_uiCrusadersHammer_Timer -= uiDiff;
//CrusaderStrike
if (m_uiCrusaderStrike_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CRUSADERSTRIKE);
+ DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE);
m_uiCrusaderStrike_Timer = 15000;
} else m_uiCrusaderStrike_Timer -= uiDiff;
//HolyStrike
if (m_uiHolyStrike_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_HOLYSTRIKE);
+ DoCast(me->getVictim(), SPELL_HOLYSTRIKE);
m_uiHolyStrike_Timer = 15000;
} else m_uiHolyStrike_Timer -= uiDiff;
//BalnazzarTransform
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 40)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
//restore hp, mana and stun
- DoCast(m_creature, SPELL_BALNAZZARTRANSFORM);
- m_creature->UpdateEntry(NPC_BALNAZZAR);
+ DoCast(me, SPELL_BALNAZZARTRANSFORM);
+ me->UpdateEntry(NPC_BALNAZZAR);
m_bTransformed = true;
}
}
@@ -160,14 +160,14 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI
//MindBlast
if (m_uiMindBlast_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDBLAST);
+ DoCast(me->getVictim(), SPELL_MINDBLAST);
m_uiMindBlast_Timer = 15000 + rand()%5000;
} else m_uiMindBlast_Timer -= uiDiff;
//ShadowShock
if (m_uiShadowShock_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
+ DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
m_uiShadowShock_Timer = 11000;
} else m_uiShadowShock_Timer -= uiDiff;
@@ -192,7 +192,7 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI
//MindControl
if (m_uiMindControl_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MINDCONTROL);
+ DoCast(me->getVictim(), SPELL_MINDCONTROL);
m_uiMindControl_Timer = 15000;
} else m_uiMindControl_Timer -= uiDiff;
}
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp
index d99e6f36044..88f8b7571d1 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp
@@ -50,10 +50,10 @@ struct boss_magistrate_barthilasAI : public ScriptedAI
FuriousAnger_Timer = 5000;
AngerCount = 0;
- if (m_creature->isAlive())
- m_creature->SetDisplayId(MODEL_NORMAL);
+ if (me->isAlive())
+ me->SetDisplayId(MODEL_NORMAL);
else
- m_creature->SetDisplayId(MODEL_HUMAN);
+ me->SetDisplayId(MODEL_HUMAN);
}
void MoveInLineOfSight(Unit *who)
@@ -65,7 +65,7 @@ struct boss_magistrate_barthilasAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- m_creature->SetDisplayId(MODEL_HUMAN);
+ me->SetDisplayId(MODEL_HUMAN);
}
void EnterCombat(Unit *who)
@@ -85,27 +85,27 @@ struct boss_magistrate_barthilasAI : public ScriptedAI
return;
++AngerCount;
- DoCast(m_creature, SPELL_FURIOUS_ANGER, false);
+ DoCast(me, SPELL_FURIOUS_ANGER, false);
} else FuriousAnger_Timer -= diff;
//DrainingBlow
if (DrainingBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DRAININGBLOW);
+ DoCast(me->getVictim(), SPELL_DRAININGBLOW);
DrainingBlow_Timer = 15000;
} else DrainingBlow_Timer -= diff;
//CrowdPummel
if (CrowdPummel_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CROWDPUMMEL);
+ DoCast(me->getVictim(), SPELL_CROWDPUMMEL);
CrowdPummel_Timer = 15000;
} else CrowdPummel_Timer -= diff;
//MightyBlow
if (MightyBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
+ DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 20000;
} else MightyBlow_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp
index 60e7db37da2..046412e24b8 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp
@@ -33,7 +33,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI
{
boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -69,7 +69,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI
if (Frostbolt_Timer <= diff)
{
if (rand()%100 < 90)
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 3500;
} else Frostbolt_Timer -= diff;
@@ -77,7 +77,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI
if (IceTomb_Timer <= diff)
{
if (rand()%100 < 65)
- DoCast(m_creature->getVictim(), SPELL_ICETOMB);
+ DoCast(me->getVictim(), SPELL_ICETOMB);
IceTomb_Timer = 28000;
} else IceTomb_Timer -= diff;
@@ -85,7 +85,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI
if (DrainLife_Timer <= diff)
{
if (rand()%100 < 55)
- DoCast(m_creature->getVictim(), SPELL_DRAINLIFE);
+ DoCast(me->getVictim(), SPELL_DRAINLIFE);
DrainLife_Timer = 31000;
} else DrainLife_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp
index 4f3905e8698..a3af7a702fb 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp
@@ -33,7 +33,7 @@ struct boss_nerubenkanAI : public ScriptedAI
{
boss_nerubenkanAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -76,7 +76,7 @@ struct boss_nerubenkanAI : public ScriptedAI
//EncasingWebs
if (EncasingWebs_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENCASINGWEBS);
+ DoCast(me->getVictim(), SPELL_ENCASINGWEBS);
EncasingWebs_Timer = 30000;
} else EncasingWebs_Timer -= diff;
@@ -84,21 +84,21 @@ struct boss_nerubenkanAI : public ScriptedAI
if (PierceArmor_Timer <= diff)
{
if (urand(0,3) < 2)
- DoCast(m_creature->getVictim(), SPELL_PIERCEARMOR);
+ DoCast(me->getVictim(), SPELL_PIERCEARMOR);
PierceArmor_Timer = 35000;
} else PierceArmor_Timer -= diff;
//CryptScarabs_Timer
if (CryptScarabs_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CRYPT_SCARABS);
+ DoCast(me->getVictim(), SPELL_CRYPT_SCARABS);
CryptScarabs_Timer = 20000;
} else CryptScarabs_Timer -= diff;
//RaiseUndeadScarab
if (RaiseUndeadScarab_Timer <= diff)
{
- RaiseUndeadScarab(m_creature->getVictim());
+ RaiseUndeadScarab(me->getVictim());
RaiseUndeadScarab_Timer = 16000;
} else RaiseUndeadScarab_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp
index 6c20e18bcfb..eab460fbcd2 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp
@@ -60,7 +60,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI
if (pInstance)
{
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case SH_AELMAR:
pInstance->SetData(TYPE_SH_AELMAR, 0);
@@ -89,7 +89,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI
{
if (pInstance)
{
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case SH_AELMAR:
pInstance->SetData(TYPE_SH_AELMAR, 2);
@@ -108,7 +108,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI
break;
}
if (pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,me->GetGUID());
}
}
@@ -120,18 +120,18 @@ struct boss_silver_hand_bossesAI : public ScriptedAI
if (HolyLight_Timer <= diff)
{
- if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth())
+ if (me->GetHealth()*5 < me->GetMaxHealth())
{
- DoCast(m_creature, SPELL_HOLY_LIGHT);
+ DoCast(me, SPELL_HOLY_LIGHT);
HolyLight_Timer = 20000;
}
} else HolyLight_Timer -= diff;
if (DivineShield_Timer <= diff)
{
- if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth())
+ if (me->GetHealth()*20 < me->GetMaxHealth())
{
- DoCast(m_creature, SPELL_DIVINE_SHIELD);
+ DoCast(me, SPELL_DIVINE_SHIELD);
DivineShield_Timer = 40000;
}
} else DivineShield_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp
index 0aea76c10f8..2dc4e1af8b7 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp
@@ -71,7 +71,7 @@ struct boss_postmaster_malownAI : public ScriptedAI
//Cast
if (rand()%100 < 65) //65% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_WAILINGDEAD);
+ DoCast(me->getVictim(), SPELL_WAILINGDEAD);
}
//19 seconds until we should cast this again
WailingDead_Timer = 19000;
@@ -83,7 +83,7 @@ struct boss_postmaster_malownAI : public ScriptedAI
//Cast
if (rand()%100 < 45) //45% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_BACKHAND);
+ DoCast(me->getVictim(), SPELL_BACKHAND);
}
//8 seconds until we should cast this again
Backhand_Timer = 8000;
@@ -95,7 +95,7 @@ struct boss_postmaster_malownAI : public ScriptedAI
//Cast
if (rand()%100 < 3) //3% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS);
+ DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
}
//20 seconds until we should cast this again
CurseOfWeakness_Timer = 20000;
@@ -107,7 +107,7 @@ struct boss_postmaster_malownAI : public ScriptedAI
//Cast
if (rand()%100 < 3) //3% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_CURSEOFTONGUES);
+ DoCast(me->getVictim(), SPELL_CURSEOFTONGUES);
}
//22 seconds until we should cast this again
CurseOfTongues_Timer = 22000;
@@ -119,7 +119,7 @@ struct boss_postmaster_malownAI : public ScriptedAI
//Cast
if (rand()%100 < 5) //5% chance to cast
{
- DoCast(m_creature->getVictim(), SPELL_CALLOFTHEGRAVE);
+ DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
}
//25 seconds until we should cast this again
CallOfTheGrave_Timer = 25000;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp
index 5eaa4775b04..6c7cc8beec8 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp
@@ -33,7 +33,7 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI
{
boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -55,8 +55,8 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI
{
for (uint8 i = 0; i < 30; ++i)
{
- if (Creature* mob = m_creature->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000))
- mob->AI()->AttackStart(m_creature->SelectNearestTarget(500));
+ if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000))
+ mob->AI()->AttackStart(me->SelectNearestTarget(500));
}
if (pInstance)
@@ -72,14 +72,14 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI
//Trample
if (Trample_Timer <= diff)
{
- DoCast(m_creature, SPELL_TRAMPLE);
+ DoCast(me, SPELL_TRAMPLE);
Trample_Timer = 7000;
} else Trample_Timer -= diff;
//Knockout
if (Knockout_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKOUT);
+ DoCast(me->getVictim(), SPELL_KNOCKOUT);
Knockout_Timer = 10000;
} else Knockout_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp
index ccff3b32b77..78e9acb9725 100644
--- a/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp
@@ -44,7 +44,7 @@ struct boss_timmy_the_cruelAI : public ScriptedAI
{
if (!HasYelled)
{
- m_creature->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
+ me->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
HasYelled = true;
}
}
@@ -59,7 +59,7 @@ struct boss_timmy_the_cruelAI : public ScriptedAI
if (RavenousClaw_Timer <= diff)
{
//Cast
- DoCast(m_creature->getVictim(), SPELL_RAVENOUSCLAW);
+ DoCast(me->getVictim(), SPELL_RAVENOUSCLAW);
//15 seconds until we should cast this again
RavenousClaw_Timer = 15000;
} else RavenousClaw_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp b/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp
index 6b6bbe13cbd..86690e5178a 100644
--- a/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp
+++ b/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp
@@ -83,7 +83,7 @@ struct mob_freed_soulAI : public ScriptedAI
void Reset()
{
- DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), m_creature);
+ DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), me);
}
void EnterCombat(Unit* who) {}
@@ -141,7 +141,7 @@ struct mob_restless_soulAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Tagged)
- m_creature->SummonCreature(ENTRY_FREED, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000);
+ me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000);
}
void UpdateAI(const uint32 diff)
@@ -150,10 +150,10 @@ struct mob_restless_soulAI : public ScriptedAI
{
if (Die_Timer <= diff)
{
- if (Unit* pTemp = Unit::GetUnit(*m_creature,Tagger))
+ if (Unit* pTemp = Unit::GetUnit(*me,Tagger))
{
- CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, m_creature->GetGUID());
- m_creature->Kill(m_creature);
+ CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID());
+ me->Kill(me);
}
} else Die_Timer -= diff;
}
@@ -214,7 +214,7 @@ struct mobs_spectral_ghostly_citizenAI : public ScriptedAI
if (Tagged)
{
if (Die_Timer <= diff)
- m_creature->Kill(m_creature);
+ me->Kill(me);
else Die_Timer -= diff;
}
@@ -232,19 +232,19 @@ struct mobs_spectral_ghostly_citizenAI : public ScriptedAI
EnterEvadeMode();
break;
case TEXTEMOTE_RUDE:
- if (m_creature->IsWithinDistInMap(pPlayer, 5))
+ if (me->IsWithinDistInMap(pPlayer, 5))
DoCast(pPlayer, SPELL_SLAP, false);
else
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
break;
case TEXTEMOTE_WAVE:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break;
case TEXTEMOTE_BOW:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
break;
case TEXTEMOTE_KISS:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
break;
}
}
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp
index 48074a45a3e..22a360f7a88 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp
@@ -101,7 +101,7 @@ struct boss_brutallusAI : public ScriptedAI
IsIntro = false;
Enraged = false;
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
+ DoCast(me, SPELL_DUAL_WIELD, true);
if (pInstance)
pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED);
@@ -109,7 +109,7 @@ struct boss_brutallusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(YELL_AGGRO, m_creature);
+ DoScriptText(YELL_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS);
@@ -117,19 +117,19 @@ struct boss_brutallusAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), m_creature);
+ DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(YELL_DEATH, m_creature);
+ DoScriptText(YELL_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE);
float x,y,z;
- m_creature->GetPosition(x,y,z);
- m_creature->SummonCreature(FELMYST, x,y, z+30, m_creature->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
+ me->GetPosition(x,y,z);
+ me->SummonCreature(FELMYST, x,y, z+30, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
}
}
@@ -144,17 +144,17 @@ struct boss_brutallusAI : public ScriptedAI
if (!Intro || IsIntro)
return;
error_log("Start Intro");
- Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
+ Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
if (Madrigosa)
{
Madrigosa->Respawn();
Madrigosa->setActive(true);
IsIntro = true;
- Madrigosa->SetMaxHealth(m_creature->GetMaxHealth());
- Madrigosa->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->Attack(Madrigosa, true);
- Madrigosa->Attack(m_creature, true);
+ Madrigosa->SetMaxHealth(me->GetMaxHealth());
+ Madrigosa->SetHealth(me->GetMaxHealth());
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->Attack(Madrigosa, true);
+ Madrigosa->Attack(me, true);
}else
{
//Madrigosa not found, end intro
@@ -165,7 +165,7 @@ struct boss_brutallusAI : public ScriptedAI
void EndIntro()
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Intro = false;
IsIntro = false;
error_log("End Intro");
@@ -180,7 +180,7 @@ struct boss_brutallusAI : public ScriptedAI
void DoIntro()
{
- Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
+ Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
if (!Madrigosa)
return;
@@ -192,61 +192,61 @@ struct boss_brutallusAI : public ScriptedAI
++IntroPhase;
break;
case 1:
- m_creature->SetInFront(Madrigosa);
- Madrigosa->SetInFront(m_creature);
- DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature);
+ me->SetInFront(Madrigosa);
+ Madrigosa->SetInFront(me);
+ DoScriptText(YELL_MADR_INTRO, Madrigosa, me);
IntroPhaseTimer = 9000;
++IntroPhase;
break;
case 2:
- DoScriptText(YELL_INTRO, m_creature, Madrigosa);
+ DoScriptText(YELL_INTRO, me, Madrigosa);
IntroPhaseTimer = 13000;
++IntroPhase;
break;
case 3:
- DoCast(m_creature, SPELL_INTRO_FROST_BLAST);
+ DoCast(me, SPELL_INTRO_FROST_BLAST);
Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->AttackStop();
+ me->AttackStop();
Madrigosa->AttackStop();
IntroFrostBoltTimer = 3000;
IntroPhaseTimer = 28000;
++IntroPhase;
break;
case 4:
- DoScriptText(YELL_INTRO_BREAK_ICE, m_creature);
+ DoScriptText(YELL_INTRO_BREAK_ICE, me);
IntroPhaseTimer = 6000;
++IntroPhase;
break;
case 5:
- Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false);
+ Madrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE_CHANELLING, false);
DoScriptText(YELL_MADR_TRAP, Madrigosa);
- DoCast(m_creature, SPELL_INTRO_ENCAPSULATE);
+ DoCast(me, SPELL_INTRO_ENCAPSULATE);
IntroPhaseTimer = 11000;
++IntroPhase;
break;
case 6:
- DoScriptText(YELL_INTRO_CHARGE, m_creature);
+ DoScriptText(YELL_INTRO_CHARGE, me);
IntroPhaseTimer = 5000;
++IntroPhase;
break;
case 7:
- m_creature->Kill(Madrigosa);
+ me->Kill(Madrigosa);
DoScriptText(YELL_MADR_DEATH, Madrigosa);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->AttackStop();
+ me->SetHealth(me->GetMaxHealth());
+ me->AttackStop();
IntroPhaseTimer = 4000;
++IntroPhase;
break;
case 8:
- DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature);
- m_creature->SetOrientation(0.14f);
- m_creature->StopMoving();
+ DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me);
+ me->SetOrientation(0.14f);
+ me->StopMoving();
Madrigosa->setDeathState(CORPSE);
IntroPhaseTimer = 8000;
++IntroPhase;
break;
case 9:
- DoScriptText(YELL_INTRO_TAUNT, m_creature);
+ DoScriptText(YELL_INTRO_TAUNT, me);
IntroPhaseTimer = 5000;
++IntroPhase;
break;
@@ -258,7 +258,7 @@ struct boss_brutallusAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!who->isTargetableForAttack() || !m_creature->IsHostileTo(who))
+ if (!who->isTargetableForAttack() || !me->IsHostileTo(who))
return;
if (pInstance && Intro)
pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL);
@@ -281,9 +281,9 @@ struct boss_brutallusAI : public ScriptedAI
{
if (IntroFrostBoltTimer <= diff)
{
- if (Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0))
+ if (Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0))
{
- Madrigosa->CastSpell(m_creature, SPELL_INTRO_FROSTBOLT, true);
+ Madrigosa->CastSpell(me, SPELL_INTRO_FROSTBOLT, true);
IntroFrostBoltTimer = 2000;
}
} else IntroFrostBoltTimer -= diff;
@@ -298,14 +298,14 @@ struct boss_brutallusAI : public ScriptedAI
if (SlashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_METEOR_SLASH);
+ DoCast(me->getVictim(), SPELL_METEOR_SLASH);
SlashTimer = 11000;
} else SlashTimer -= diff;
if (StompTimer <= diff)
{
- DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), m_creature);
- DoCast(m_creature->getVictim(), SPELL_STOMP);
+ DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), me);
+ DoCast(me->getVictim(), SPELL_STOMP);
StompTimer = 30000;
} else StompTimer -= diff;
@@ -324,8 +324,8 @@ struct boss_brutallusAI : public ScriptedAI
if (BerserkTimer < diff && !Enraged)
{
- DoScriptText(YELL_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK);
+ DoScriptText(YELL_BERSERK, me);
+ DoCast(me, SPELL_BERSERK);
Enraged = true;
} else BerserkTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
index cbc1d861ec5..7b03d9ae52c 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
@@ -116,7 +116,7 @@ struct boss_sacrolashAI : public ScriptedAI
if (pInstance)
{
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS));
if (Temp)
if (Temp->isDead())
{
@@ -125,12 +125,12 @@ struct boss_sacrolashAI : public ScriptedAI
{
if (Temp->getVictim())
{
- m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
+ me->getThreatManager().addThreat(Temp->getVictim(),0.0f);
}
}
}
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
ShadowbladesTimer = 10000;
ShadownovaTimer = 30000;
@@ -152,7 +152,7 @@ struct boss_sacrolashAI : public ScriptedAI
if (pInstance)
{
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS));
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
CAST_CRE(Temp)->AI()->AttackStart(who);
}
@@ -164,7 +164,7 @@ struct boss_sacrolashAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (rand()%4 == 0)
- DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), m_creature);
+ DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), me);
}
void JustDied(Unit* Killer)
@@ -172,13 +172,13 @@ struct boss_sacrolashAI : public ScriptedAI
// only if ALY death
if (SisterDeath)
{
- DoScriptText(SAY_SAC_DEAD, m_creature);
+ DoScriptText(SAY_SAC_DEAD, me);
if (pInstance)
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
}
else
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit *pTarget,const SpellEntry* spell)
@@ -231,12 +231,12 @@ struct boss_sacrolashAI : public ScriptedAI
if (pInstance)
{
Unit* Temp = NULL;
- Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS));
if (Temp && Temp->isDead())
{
- DoScriptText(YELL_SISTER_ALYTHESS_DEAD, m_creature);
- DoCast(m_creature, SPELL_EMPOWER);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me);
+ DoCast(me, SPELL_EMPOWER);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
SisterDeath = true;
}
}
@@ -249,9 +249,9 @@ struct boss_sacrolashAI : public ScriptedAI
{
if (ConflagrationTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -264,7 +264,7 @@ struct boss_sacrolashAI : public ScriptedAI
{
if (ShadownovaTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -274,8 +274,8 @@ struct boss_sacrolashAI : public ScriptedAI
if (!SisterDeath)
{
if (pTarget)
- DoScriptText(EMOTE_SHADOW_NOVA, m_creature, pTarget);
- DoScriptText(YELL_SHADOW_NOVA, m_creature);
+ DoScriptText(EMOTE_SHADOW_NOVA, me, pTarget);
+ DoScriptText(YELL_SHADOW_NOVA, me);
}
ShadownovaTimer = 30000+(rand()%5000);
}
@@ -284,7 +284,7 @@ struct boss_sacrolashAI : public ScriptedAI
if (ConfoundingblowTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -313,29 +313,29 @@ struct boss_sacrolashAI : public ScriptedAI
if (ShadowbladesTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_SHADOW_BLADES);
+ DoCast(me, SPELL_SHADOW_BLADES);
ShadowbladesTimer = 10000;
}
} else ShadowbladesTimer -=diff;
if (EnrageTimer < diff && !Enraged)
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoScriptText(YELL_ENRAGE, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoScriptText(YELL_ENRAGE, me);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else EnrageTimer -= diff;
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED);
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ HandleTouchedSpells(me->getVictim(), SPELL_DARK_TOUCHED);
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
@@ -375,7 +375,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (pInstance)
{
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH));
if (Temp)
if (Temp->isDead())
{
@@ -384,12 +384,12 @@ struct boss_alythessAI : public Scripted_NoMovementAI
{
if (Temp->getVictim())
{
- m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
+ me->getThreatManager().addThreat(Temp->getVictim(),0.0f);
}
}
}
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
ConflagrationTimer = 45000;
BlazeTimer = 100;
@@ -412,7 +412,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (pInstance)
{
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH));
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
CAST_CRE(Temp)->AI()->AttackStart(who);
}
@@ -423,7 +423,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
void AttackStart(Unit *who)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
Scripted_NoMovementAI::AttackStart(who);
}
@@ -431,22 +431,22 @@ struct boss_alythessAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *who)
{
- if (!who || m_creature->getVictim())
+ if (!who || me->getVictim())
return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->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))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
DoStartNoMovement(who);
}
}
}
- else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30))
+ else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 30))
{
IntroStepCounter = 0;
}
@@ -456,7 +456,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
{
if (rand()%4 == 0)
{
- DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), m_creature);
+ DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), me);
}
}
@@ -464,13 +464,13 @@ struct boss_alythessAI : public Scripted_NoMovementAI
{
if (SisterDeath)
{
- DoScriptText(YELL_ALY_DEAD, m_creature);
+ DoScriptText(YELL_ALY_DEAD, me);
if (pInstance)
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
}
else
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit *pTarget,const SpellEntry* spell)
@@ -522,7 +522,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
uint32 IntroStep(uint32 step)
{
- Creature* Sacrolash = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0);
+ Creature* Sacrolash = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0);
switch (step)
{
case 0: return 0;
@@ -530,22 +530,22 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (Sacrolash)
DoScriptText(YELL_INTRO_SAC_1, Sacrolash);
return 1000;
- case 2: DoScriptText(YELL_INTRO_ALY_2, m_creature); return 1000;
+ case 2: DoScriptText(YELL_INTRO_ALY_2, me); return 1000;
case 3:
if (Sacrolash)
DoScriptText(YELL_INTRO_SAC_3, Sacrolash);
return 2000;
- case 4: DoScriptText(YELL_INTRO_ALY_4, m_creature); return 1000;
+ case 4: DoScriptText(YELL_INTRO_ALY_4, me); return 1000;
case 5:
if (Sacrolash)
DoScriptText(YELL_INTRO_SAC_5, Sacrolash);
return 2000;
- case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000;
+ case 6: DoScriptText(YELL_INTRO_ALY_6, me); return 1000;
case 7:
if (Sacrolash)
DoScriptText(YELL_INTRO_SAC_7, Sacrolash);
return 3000;
- case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); return 900000;
+ case 8: DoScriptText(YELL_INTRO_ALY_8, me); return 900000;
}
return 10000;
}
@@ -565,26 +565,26 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (pInstance)
{
Unit* Temp = NULL;
- Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH));
if (Temp && Temp->isDead())
{
- DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature);
- DoCast(m_creature, SPELL_EMPOWER);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoScriptText(YELL_SISTER_SACROLASH_DEAD, me);
+ DoCast(me, SPELL_EMPOWER);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
SisterDeath = true;
}
}
}
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
if (pInstance)
{
- Creature* sisiter = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ Creature* sisiter = Unit::GetCreature((*me),pInstance->GetData64(DATA_SACROLASH));
if (sisiter && !sisiter->isDead() && sisiter->getVictim())
{
- m_creature->AddThreat(sisiter->getVictim(),0.0f);
+ me->AddThreat(sisiter->getVictim(),0.0f);
DoStartNoMovement(sisiter->getVictim());
- m_creature->Attack(sisiter->getVictim(),false);
+ me->Attack(sisiter->getVictim(),false);
}
}
}
@@ -596,7 +596,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI
{
if (ShadownovaTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -610,9 +610,9 @@ struct boss_alythessAI : public Scripted_NoMovementAI
{
if (ConflagrationTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -622,8 +622,8 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (!SisterDeath)
{
if (pTarget)
- DoScriptText(EMOTE_CONFLAGRATION, m_creature, pTarget);
- DoScriptText(YELL_CANFLAGRATION, m_creature);
+ DoScriptText(EMOTE_CONFLAGRATION, me, pTarget);
+ DoScriptText(YELL_CANFLAGRATION, me);
}
BlazeTimer = 4000;
@@ -633,36 +633,36 @@ struct boss_alythessAI : public Scripted_NoMovementAI
if (FlamesearTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_FLAME_SEAR);
+ DoCast(me, SPELL_FLAME_SEAR);
FlamesearTimer = 15000;
}
} else FlamesearTimer -=diff;
if (PyrogenicsTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_PYROGENICS, true);
+ DoCast(me, SPELL_PYROGENICS, true);
PyrogenicsTimer = 15000;
}
} else PyrogenicsTimer -= diff;
if (BlazeTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature->getVictim(), SPELL_BLAZE);
+ DoCast(me->getVictim(), SPELL_BLAZE);
BlazeTimer = 3800;
}
} else BlazeTimer -= diff;
if (EnrageTimer < diff && !Enraged)
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoScriptText(YELL_BERSERK, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoScriptText(YELL_BERSERK, me);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else EnrageTimer -= diff;
}
@@ -683,7 +683,7 @@ struct mob_shadow_imageAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
ShadowfuryTimer = 5000 + (rand()%15000);
DarkstrikeTimer = 3000;
KillTimer = 15000;
@@ -712,12 +712,12 @@ struct mob_shadow_imageAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->HasAura(SPELL_IMAGE_VISUAL))
- DoCast(m_creature, SPELL_IMAGE_VISUAL);
+ if (!me->HasAura(SPELL_IMAGE_VISUAL))
+ DoCast(me, SPELL_IMAGE_VISUAL);
if (KillTimer <= diff)
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
KillTimer = 9999999;
} else KillTimer -= diff;
@@ -726,17 +726,17 @@ struct mob_shadow_imageAI : public ScriptedAI
if (ShadowfuryTimer <= diff)
{
- DoCast(m_creature, SPELL_SHADOW_FURY);
+ DoCast(me, SPELL_SHADOW_FURY);
ShadowfuryTimer = 10000;
} else ShadowfuryTimer -=diff;
if (DarkstrikeTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
- DoCast(m_creature->getVictim(), SPELL_DARK_STRIKE);
+ if (me->IsWithinMeleeRange(me->getVictim()))
+ DoCast(me->getVictim(), SPELL_DARK_STRIKE);
}
DarkstrikeTimer = 3000;
} else DarkstrikeTimer -= diff;
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
index 26bdb7984c0..ed06964aef2 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
@@ -159,12 +159,12 @@ struct boss_felmystAI : public ScriptedAI
Timer[EVENT_BERSERK] = 600000;
FlightCount = 0;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
DespawnSummons(MOB_VAPOR_TRAIL);
- m_creature->setActive(false);
+ me->setActive(false);
if (pInstance)
pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED);
@@ -172,10 +172,10 @@ struct boss_felmystAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->setActive(true);
+ me->setActive(true);
DoZoneInCombat();
- DoCast(m_creature, AURA_SUNWELL_RADIANCE, true);
- DoCast(m_creature, AURA_NOXIOUS_FUMES, true);
+ DoCast(me, AURA_SUNWELL_RADIANCE, true);
+ DoCast(me, AURA_NOXIOUS_FUMES, true);
EnterPhase(PHASE_GROUND);
if (pInstance)
@@ -196,17 +196,17 @@ struct boss_felmystAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(YELL_KILL1,YELL_KILL2), m_creature);
+ DoScriptText(RAND(YELL_KILL1,YELL_KILL2), me);
}
void JustRespawned()
{
- DoScriptText(YELL_BIRTH, m_creature);
+ DoScriptText(YELL_BIRTH, me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(YELL_DEATH, m_creature);
+ DoScriptText(YELL_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_FELMYST_EVENT, DONE);
@@ -224,14 +224,14 @@ struct boss_felmystAI : public ScriptedAI
{
float x, y, z;
caster->GetPosition(x, y, z);
- if (Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
+ if (Unit* summon = me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
summon->SetMaxHealth(caster->GetMaxHealth());
summon->SetHealth(caster->GetMaxHealth());
summon->CastSpell(summon, SPELL_FOG_CHARM, true);
summon->CastSpell(summon, SPELL_FOG_CHARM2, true);
}
- m_creature->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -252,7 +252,7 @@ struct boss_felmystAI : public ScriptedAI
void DamageTaken(Unit*, uint32 &damage)
{
- if (Phase != PHASE_GROUND && damage >= m_creature->GetHealth())
+ if (Phase != PHASE_GROUND && damage >= me->GetHealth())
damage = 0;
}
@@ -285,32 +285,32 @@ struct boss_felmystAI : public ScriptedAI
switch(FlightCount)
{
case 0:
- //m_creature->AttackStop();
+ //me->AttackStop();
error_log("prevent fly phase");
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- DoScriptText(YELL_TAKEOFF, m_creature);
+ me->GetMotionMaster()->Clear(false);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ DoScriptText(YELL_TAKEOFF, me);
Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
break;
case 1:
error_log("Move to Fly point");
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10);
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+1, me->GetPositionY(), me->GetPositionZ()+10);
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 2:{
error_log("Summon Vapor case 2");
Unit *pTarget;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
- if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
+ if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (pTarget)
{
- Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
+ Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
if (Vapor)
{
Vapor->AI()->AttackStart(pTarget);
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
}
@@ -325,18 +325,18 @@ struct boss_felmystAI : public ScriptedAI
case 3: {
DespawnSummons(MOB_VAPOR_TRAIL);
error_log("Summon Vapor case3");
- //DoCast(m_creature, SPELL_VAPOR_SELECT); need core support
+ //DoCast(me, SPELL_VAPOR_SELECT); need core support
Unit *pTarget;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
- if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
+ if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (pTarget)
{
//pTarget->CastSpell(pTarget, SPELL_VAPOR_SUMMON, true); need core support
- Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
+ Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
if (Vapor)
{
Vapor->AI()->AttackStart(pTarget);
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
}
@@ -355,14 +355,14 @@ struct boss_felmystAI : public ScriptedAI
case 5:{
Unit *pTarget;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
- if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
+ if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (pTarget)
{
BreathX = pTarget->GetPositionX();
BreathY = pTarget->GetPositionY();
float x, y, z;
- pTarget->GetContactPoint(m_creature, x, y, z, 70);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10);
+ pTarget->GetContactPoint(me, x, y, z, 70);
+ me->GetMotionMaster()->MovePoint(0, x, y, z+10);
}else
{
EnterEvadeMode();
@@ -371,25 +371,25 @@ struct boss_felmystAI : public ScriptedAI
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;}
case 6:
- m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY));
- m_creature->StopMoving();
+ me->SetOrientation(me->GetAngle(BreathX, BreathY));
+ me->StopMoving();
//DoTextEmote("takes a deep breath.", NULL);
Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
break;
case 7:
- DoCast(m_creature, SPELL_FOG_BREATH, true);
+ DoCast(me, SPELL_FOG_BREATH, true);
{
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
x = 2 * BreathX - x;
y = 2 * BreathY - y;
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
}
Timer[EVENT_SUMMON_FOG] = 1;
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 8:
- m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
+ me->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
++BreathCount;
Timer[EVENT_SUMMON_FOG] = 0;
Timer[EVENT_FLIGHT_SEQUENCE] = 1;
@@ -399,8 +399,8 @@ struct boss_felmystAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
{
float x, y, z;
- pTarget->GetContactPoint(m_creature, x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ pTarget->GetContactPoint(me, x, y, z);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
}
else
{
@@ -410,11 +410,11 @@ struct boss_felmystAI : public ScriptedAI
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 10:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
EnterPhase(PHASE_GROUND);
- m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
+ me->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
break;
default:
break;
@@ -426,7 +426,7 @@ struct boss_felmystAI : public ScriptedAI
{
if (!UpdateVictim())
{
- if (Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode())
+ if (Phase == PHASE_FLIGHT && !me->IsInEvadeMode())
EnterEvadeMode();
return;
}
@@ -442,7 +442,7 @@ struct boss_felmystAI : public ScriptedAI
} else Timer[i] -= diff;
}
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
if (Phase == PHASE_GROUND)
@@ -450,20 +450,20 @@ struct boss_felmystAI : public ScriptedAI
switch(Event)
{
case EVENT_BERSERK:
- DoScriptText(YELL_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoScriptText(YELL_BERSERK, me);
+ DoCast(me, SPELL_BERSERK, true);
Timer[EVENT_BERSERK] = 10000;
break;
case EVENT_CLEAVE:
- DoCast(m_creature->getVictim(), SPELL_CLEAVE, false);
+ DoCast(me->getVictim(), SPELL_CLEAVE, false);
Timer[EVENT_CLEAVE] = urand(5000,10000);
break;
case EVENT_CORROSION:
- DoCast(m_creature->getVictim(), SPELL_CORROSION, false);
+ DoCast(me->getVictim(), SPELL_CORROSION, false);
Timer[EVENT_CORROSION] = urand(20000,30000);
break;
case EVENT_GAS_NOVA:
- DoCast(m_creature, SPELL_GAS_NOVA, false);
+ DoCast(me, SPELL_GAS_NOVA, false);
Timer[EVENT_GAS_NOVA] = urand(20000,25000);
break;
case EVENT_ENCAPSULATE:
@@ -487,8 +487,8 @@ struct boss_felmystAI : public ScriptedAI
switch(Event)
{
case EVENT_BERSERK:
- DoScriptText(YELL_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoScriptText(YELL_BERSERK, me);
+ DoCast(me, SPELL_BERSERK, true);
Timer[EVENT_BERSERK] = 0;
break;
case EVENT_FLIGHT_SEQUENCE:
@@ -497,9 +497,9 @@ struct boss_felmystAI : public ScriptedAI
case EVENT_SUMMON_FOG:
{
float x, y, z;
- m_creature->GetPosition(x, y, z);
- m_creature->UpdateGroundPositionZ(x, y, z);
- if (Creature *Fog = m_creature->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
+ me->GetPosition(x, y, z);
+ me->UpdateGroundPositionZ(x, y, z);
+ if (Creature *Fog = me->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
{
Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER);
Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true);
@@ -517,7 +517,7 @@ struct boss_felmystAI : public ScriptedAI
{
std::list<Creature*> templist;
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
{
CellPair pair(Trinity::ComputeCellPair(x, y));
@@ -525,12 +525,12 @@ struct boss_felmystAI : public ScriptedAI
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
+ Trinity::AllCreaturesOfEntryInRange check(me, entry, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()));
}
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
@@ -538,7 +538,7 @@ struct boss_felmystAI : public ScriptedAI
if (entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT)
{
(*i)->GetPosition(x, y, z);
- m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
}
(*i)->SetVisibility(VISIBILITY_OFF);
(*i)->setDeathState(JUST_DIED);
@@ -552,18 +552,18 @@ struct mob_felmyst_vaporAI : public ScriptedAI
{
mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetSpeed(MOVE_RUN, 0.8);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetSpeed(MOVE_RUN, 0.8);
}
void Reset() {}
void EnterCombat(Unit* who)
{
DoZoneInCombat();
- //DoCast(m_creature, SPELL_VAPOR_FORCE, true); core bug
+ //DoCast(me, SPELL_VAPOR_FORCE, true); core bug
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
AttackStart(pTarget);
}
@@ -573,10 +573,10 @@ struct mob_felmyst_trailAI : public ScriptedAI
{
mob_felmyst_trailAI(Creature *c) : ScriptedAI(c)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_TRAIL_TRIGGER, true);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_TRAIL_TRIGGER, true);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug
}
void Reset() {}
void EnterCombat(Unit* who) {}
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
index f1906ce3bbf..f30cb749c37 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
@@ -179,8 +179,8 @@ struct boss_kalecgosAI : public ScriptedAI
void EnterEvadeMode()
{
JustReseted = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
ScriptedAI::EnterEvadeMode();
}
@@ -327,10 +327,10 @@ struct boss_kalecgosAI : public ScriptedAI
{
if (JustReseted)//boss is invisible, don't attack
return;
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)))
{
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius))
{
AttackStart(who);
}
@@ -616,7 +616,7 @@ struct boss_sathrovarrAI : public ScriptedAI
{
for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
{
- if (Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
if (pUnit->GetPositionZ() > me->GetPositionZ()+5)
{
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
index c2fcce96cdc..784a549d031 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
@@ -320,9 +320,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI
FindOrbs();
OrbsEmpowered = 0;
EmpowerCount = 0;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setActive(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setActive(true);
Searched = false;
FindOrbs();
@@ -333,7 +333,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI
void FindOrbs()
{
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
@@ -341,7 +341,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI
AllOrbsInGrid check;
Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(me, orbList, check);
TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher);
- cell.Visit(pair, visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, visitor, *(me->GetMap()));
if (orbList.empty())
return;
@@ -354,9 +354,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI
void ResetOrbs()
{
- m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
for (uint8 i = 0; i < 4; ++i)
- if (GameObject *pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[i]))
+ if (GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i]))
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0);
}
@@ -368,14 +368,14 @@ struct boss_kalecgos_kjAI : public ScriptedAI
uint8 random = urand(0,3);
if (all)
{
- m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
for (uint8 i = 0; i < 4; ++i)
{
- GameObject *pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[i]);
+ GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i]);
if (!pOrb)
return;
- pOrb->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
+ pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35);
pOrb->setActive(true);
pOrb->Refresh();
@@ -388,7 +388,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI
float x,y,z, dx,dy,dz;
Orb[random]->GetPosition(x,y,z);
for (uint8 i = 0; i < 4; ++i){
- DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ DynamicObject* Dyn = me->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
if (Dyn){
Dyn->GetPosition(dx,dy,dz);
if (x == dx && dy == y && dz == z){
@@ -399,9 +399,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI
}*/
if (OrbGUID[random])
{
- if (GameObject* pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[random]))
+ if (GameObject* pOrb = me->GetMap()->GetGameObject(OrbGUID[random]))
{
- pOrb->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
+ pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35);
pOrb->setActive(true);
pOrb->Refresh();
@@ -413,10 +413,10 @@ struct boss_kalecgos_kjAI : public ScriptedAI
switch(EmpowerCount)
{
- case 1: DoScriptText(SAY_KALEC_ORB_READY1, m_creature); break;
- case 2: DoScriptText(SAY_KALEC_ORB_READY2, m_creature); break;
- case 3: DoScriptText(SAY_KALEC_ORB_READY3, m_creature); break;
- case 4: DoScriptText(SAY_KALEC_ORB_READY4, m_creature); break;
+ case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break;
+ case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break;
+ case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break;
+ case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break;
}
}
@@ -441,7 +441,7 @@ CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature)
//AI for Kil'jaeden
struct boss_kiljaedenAI : public Scripted_NoMovementAI
{
- boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature)
+ boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -522,15 +522,15 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}else{
- summoned->SetLevel(m_creature->getLevel());
+ summoned->SetLevel(me->getLevel());
}
- summoned->setFaction(m_creature->getFaction());
+ summoned->setFaction(me->getFaction());
Summons.Summon(summoned);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_KJ_DEATH, m_creature);
+ DoScriptText(SAY_KJ_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE);
@@ -538,7 +538,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), me);
}
void EnterEvadeMode()
@@ -548,20 +548,20 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
// Reset the controller
if (pInstance)
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
+ if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset();
}
void EnterCombat(Unit* who)
{
DoZoneInCombat();
- DoScriptText(SAY_KJ_EMERGE, m_creature);
+ DoScriptText(SAY_KJ_EMERGE, me);
}
void CastSinisterReflection()
{
- DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), m_creature);
- DoCast(m_creature, SPELL_SINISTER_REFLECTION, true);
+ DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), me);
+ DoCast(me, SPELL_SINISTER_REFLECTION, true);
for (uint8 i = 0; i < 4; ++i)
{
float x,y,z;
@@ -572,7 +572,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))break;
}
pTarget->GetPosition(x,y,z);
- Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature* SinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (SinisterReflection)
SinisterReflection->AI()->AttackStart(pTarget);
}
@@ -599,7 +599,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
switch(t)
{
case TIMER_KALEC_JOIN:
- if (Creature *pKalec = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
+ if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
{
DoScriptText(SAY_KALECGOS_JOIN, pKalec);
IsKalecJoined = true;
@@ -607,18 +607,18 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
}
break;
case TIMER_SOUL_FLAY:
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_FLAY, false);
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY_SLOW, true);
+ DoCast(me->getVictim(), SPELL_SOUL_FLAY, false);
+ me->getVictim()->CastSpell(me->getVictim(), SPELL_SOUL_FLAY_SLOW, true);
Timer[TIMER_SOUL_FLAY] = 3500;
}
break;
case TIMER_LEGION_LIGHTNING:
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
Unit *RandomPlayer;
- m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
+ me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
for (uint8 z = 0; z < 6; ++z)
{
RandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
@@ -633,9 +633,9 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
}
break;
case TIMER_FIRE_BLOOM:
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
+ me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
DoCastAOE(SPELL_FIRE_BLOOM, false);
Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE
Timer[TIMER_SOUL_FLAY] = 1000;
@@ -647,13 +647,13 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
float sx, sy;
sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]);
sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]);
- m_creature->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ me->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
Timer[TIMER_SUMMON_SHILEDORB] = urand(30000,60000); // 30-60seconds cooldown
Timer[TIMER_SOUL_FLAY] = 2000;
break;
case TIMER_SHADOW_SPIKE: //Phase 3
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
DoCastAOE(SPELL_SHADOW_SPIKE, false);
Timer[TIMER_SHADOW_SPIKE] = 0;
@@ -666,12 +666,12 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
Timer[TIMER_FLAME_DART] = 3000; //TODO Timer
break;
case TIMER_DARKNESS: //Phase 3
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
// Begins to channel for 8 seconds, then deals 50'000 damage to all raid members.
if (!IsInDarkness)
{
- DoScriptText(EMOTE_KJ_DARKNESS, m_creature);
+ DoScriptText(EMOTE_KJ_DARKNESS, me);
DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false);
ChangeTimers(true, 9000);
Timer[TIMER_DARKNESS] = 8750;
@@ -685,13 +685,13 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? urand(20000,35000) : urand(40000,70000);
IsInDarkness = false;
DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE);
- DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), m_creature);
+ DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), me);
}
Timer[TIMER_SOUL_FLAY] = 9000;
}
break;
case TIMER_ORBS_EMPOWER: //Phase 3
- if (Creature *pKalec = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
+ if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
{
switch (Phase)
{
@@ -718,7 +718,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
{
float x, y, z;
pTarget->GetPosition(x, y, z);
- m_creature->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000);
+ me->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000);
}
Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding
break;
@@ -737,10 +737,10 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
//Phase 3
if (Phase <= PHASE_NORMAL)
{
- if (Phase == PHASE_NORMAL && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 85))
+ if (Phase == PHASE_NORMAL && ((me->GetHealth()*100 / me->GetMaxHealth()) < 85))
{
CastSinisterReflection();
- DoScriptText(SAY_KJ_PHASE3, m_creature);
+ DoScriptText(SAY_KJ_PHASE3, me);
Phase = PHASE_DARKNESS;
OrbActivated = false;
ActiveTimers = 9;
@@ -751,9 +751,9 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
//Phase 4
if (Phase <= PHASE_DARKNESS)
{
- if (Phase == PHASE_DARKNESS && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55))
+ if (Phase == PHASE_DARKNESS && ((me->GetHealth()*100 / me->GetMaxHealth()) < 55))
{
- DoScriptText(SAY_KJ_PHASE4, m_creature);
+ DoScriptText(SAY_KJ_PHASE4, me);
Phase = PHASE_ARMAGEDDON;
OrbActivated = false;
ActiveTimers = 10;
@@ -764,12 +764,12 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
//Phase 5 specific spells all we can
if (Phase <= PHASE_ARMAGEDDON)
{
- if (Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25))
+ if (Phase == PHASE_ARMAGEDDON && ((me->GetHealth()*100 / me->GetMaxHealth()) < 25))
{
Phase = PHASE_SACRIFICE;
if (pInstance)
- if (Creature* Anveena = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ANVEENA)))
- Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false);
+ if (Creature* Anveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA)))
+ Anveena->CastSpell(me, 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
}
@@ -787,7 +787,7 @@ CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature)
//AI for Kil'jaeden Event Controller
struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
{
- mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature)
+ mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -804,9 +804,9 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
void InitializeAI()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->addUnitState(UNIT_STAT_STUNNED);
ScriptedAI::InitializeAI();
}
@@ -814,7 +814,7 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
void Reset()
{
Phase = PHASE_DECEIVERS;
- if (Creature *pKalecKJ = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
+ if (Creature *pKalecKJ = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
DeceiverDeathCount = 0;
SummonedDeceivers = false;
@@ -838,7 +838,7 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
case CREATURE_KILJAEDEN:
summoned->CastSpell(summoned, SPELL_REBIRTH, false);
CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL;
- summoned->AddThreat(m_creature->getVictim(), 1.0f);
+ summoned->AddThreat(me->getVictim(), 1.0f);
break;
}
Summons.Summon(summoned);
@@ -848,23 +848,23 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
{
if (RandomSayTimer < diff && pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED)
{
- DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), m_creature);
+ DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me);
RandomSayTimer = 30000;
} else RandomSayTimer -= diff;
if (!SummonedDeceivers)
{
for (uint8 i = 0; i < 3; ++i)
- m_creature->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0);
DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- DoCast(m_creature, SPELL_ANVEENA_ENERGY_DRAIN);
+ DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN);
SummonedDeceivers = true;
}
if (DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS)
{
- m_creature->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN);
+ me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN);
Phase = PHASE_NORMAL;
DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0);
}
@@ -899,8 +899,8 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
void JustSummoned(Creature* summoned)
{
- summoned->setFaction(m_creature->getFaction());
- summoned->SetLevel(m_creature->getLevel());
+ summoned->setFaction(me->getFaction());
+ summoned->SetLevel(me->getLevel());
}
void EnterCombat(Unit* who)
@@ -908,10 +908,10 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
+ if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
Control->AddThreat(who, 1.0f);
}
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
}
void JustDied(Unit* killer)
@@ -919,25 +919,25 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
if (!pInstance)
return;
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
+ if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
++(CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount);
}
void UpdateAI(const uint32 diff)
{
if (!me->isInCombat())
- DoCast(m_creature, SPELL_SHADOW_CHANNELING);
+ DoCast(me, SPELL_SHADOW_CHANNELING);
if (!UpdateVictim())
return;
// Gain Shadow Infusion at 20% health
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !m_creature->HasAura(SPELL_SHADOW_INFUSION, 0))
- DoCast(m_creature, SPELL_SHADOW_INFUSION, true);
+ if (((me->GetHealth()*100 / me->GetMaxHealth()) < 20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0))
+ DoCast(me, SPELL_SHADOW_INFUSION, true);
// Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage.
if (ShadowBoltVolleyTimer <= diff){
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
ShadowBoltVolleyTimer = 12000;
} else ShadowBoltVolleyTimer -= diff;
@@ -947,9 +947,9 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
if (Portal)
{
std::list<HostileReference*>::const_iterator itr;
- for (itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pUnit)
Portal->AddThreat(pUnit, 1.0f);
}
@@ -976,8 +976,8 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI
void InitializeAI()
{
SpawnFiendTimer = 5000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
ScriptedAI::InitializeAI();
}
@@ -987,8 +987,8 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI
void JustSummoned(Creature* summoned)
{
- summoned->setFaction(m_creature->getFaction());
- summoned->SetLevel(m_creature->getLevel());
+ summoned->setFaction(me->getFaction());
+ summoned->SetLevel(me->getLevel());
}
void UpdateAI(const uint32 diff)
@@ -1028,8 +1028,8 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage > m_creature->GetHealth())
- DoCast(m_creature, SPELL_FELFIRE_FISSION, true);
+ if (damage > me->GetHealth())
+ DoCast(me, SPELL_FELFIRE_FISSION, true);
}
void UpdateAI(const uint32 diff)
@@ -1039,7 +1039,7 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI
if (!LockedTarget)
{
- m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
+ me->AddThreat(me->getVictim(), 10000000.0f);
LockedTarget = true;
}
@@ -1049,10 +1049,10 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI
ExplodeTimer = 0;
else ExplodeTimer -= diff;
}
- else if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) // Explode if it's close enough to it's target
+ else if (me->IsWithinDistInMap(me->getVictim(), 3)) // Explode if it's close enough to it's target
{
- DoCast(m_creature->getVictim(), SPELL_FELFIRE_FISSION);
- m_creature->Kill(m_creature);
+ DoCast(me->getVictim(), SPELL_FELFIRE_FISSION);
+ me->Kill(me);
}
}
};
@@ -1083,22 +1083,22 @@ struct mob_armageddonAI : public Scripted_NoMovementAI
switch(Spell)
{
case 0:
- DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL, true);
+ DoCast(me, SPELL_ARMAGEDDON_VISUAL, true);
++Spell;
break;
case 1:
- DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL2, true);
+ DoCast(me, SPELL_ARMAGEDDON_VISUAL2, true);
Timer = 9000;
++Spell;
break;
case 2:
- DoCast(m_creature, SPELL_ARMAGEDDON_TRIGGER, true);
+ DoCast(me, SPELL_ARMAGEDDON_TRIGGER, true);
++Spell;
Timer = 5000;
break;
case 3:
- m_creature->Kill(m_creature);
- m_creature->RemoveCorpse();
+ me->Kill(me);
+ me->RemoveCorpse();
break;
}
} else Timer -=diff;
@@ -1127,7 +1127,7 @@ struct mob_shield_orbAI : public ScriptedAI
void InitializeAI()
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
PointReached = true;
Timer = urand(500,1000);
CheckTimer = 1000;
@@ -1158,7 +1158,7 @@ struct mob_shield_orbAI : public ScriptedAI
}
PointReached = false;
CheckTimer = 1000;
- m_creature->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z);
+ me->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z);
c += M_PI/32;
if (c > 2*M_PI) c = 0;
}
@@ -1174,7 +1174,7 @@ struct mob_shield_orbAI : public ScriptedAI
if (Timer <= diff)
{
- if (Unit* random = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0))
+ if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0))
DoCast(random, SPELL_SHADOW_BOLT, false);
Timer = urand(500,1000);
} else Timer -= diff;
@@ -1215,7 +1215,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
if (Class == 0)
{
- Class = m_creature->getVictim()->getClass();
+ Class = me->getVictim()->getClass();
switch (Class)
{
case CLASS_DRUID:
@@ -1227,17 +1227,17 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_WARLOCK:
break;
case CLASS_WARRIOR:
- m_creature->SetCanDualWield(true);
+ me->SetCanDualWield(true);
break;
case CLASS_PALADIN:
break;
case CLASS_PRIEST:
break;
case CLASS_SHAMAN:
- m_creature->SetCanDualWield(true);
+ me->SetCanDualWield(true);
break;
case CLASS_ROGUE:
- m_creature->SetCanDualWield(true);
+ me->SetCanDualWield(true);
break;
}
}
@@ -1246,7 +1246,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_DRUID:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_MOONFIRE, false);
+ DoCast(me->getVictim(), SPELL_SR_MOONFIRE, false);
Timer[1] = 3000;
}
DoMeleeAttackIfReady();
@@ -1254,19 +1254,19 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_HUNTER:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false);
+ DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false);
Timer[1] = 9000;
}
if (Timer[2] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_SHOOT, false);
+ DoCast(me->getVictim(), SPELL_SR_SHOOT, false);
Timer[2] = 5000;
}
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim(), 6))
+ if (me->IsWithinMeleeRange(me->getVictim(), 6))
{
if (Timer[3] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false);
+ DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false);
Timer[3] = 7000;
}
DoMeleeAttackIfReady();
@@ -1275,7 +1275,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_MAGE:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_FIREBALL, false);
+ DoCast(me->getVictim(), SPELL_SR_FIREBALL, false);
Timer[1] = 3000;
}
DoMeleeAttackIfReady();
@@ -1283,7 +1283,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_WARLOCK:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_SHADOW_BOLT, false);
+ DoCast(me->getVictim(), SPELL_SR_SHADOW_BOLT, false);
Timer[1] = 4000;
}
if (Timer[2] <= diff)
@@ -1296,7 +1296,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_WARRIOR:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_WHIRLWIND, false);
+ DoCast(me->getVictim(), SPELL_SR_WHIRLWIND, false);
Timer[1] = 10000;
}
DoMeleeAttackIfReady();
@@ -1304,12 +1304,12 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_PALADIN:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false);
+ DoCast(me->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false);
Timer[1] = 7000;
}
if (Timer[2] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SHOCK, false);
+ DoCast(me->getVictim(), SPELL_SR_HOLY_SHOCK, false);
Timer[2] = 3000;
}
DoMeleeAttackIfReady();
@@ -1317,12 +1317,12 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_PRIEST:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SMITE, false);
+ DoCast(me->getVictim(), SPELL_SR_HOLY_SMITE, false);
Timer[1] = 5000;
}
if (Timer[2] <= diff)
{
- DoCast(m_creature, SPELL_SR_RENEW, false);
+ DoCast(me, SPELL_SR_RENEW, false);
Timer[2] = 7000;
}
DoMeleeAttackIfReady();
@@ -1330,7 +1330,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_SHAMAN:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_EARTH_SHOCK, false);
+ DoCast(me->getVictim(), SPELL_SR_EARTH_SHOCK, false);
Timer[1] = 5000;
}
DoMeleeAttackIfReady();
@@ -1338,7 +1338,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
case CLASS_ROGUE:
if (Timer[1] <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SR_HEMORRHAGE, true);
+ DoCast(me->getVictim(), SPELL_SR_HEMORRHAGE, true);
Timer[1] = 5000;
}
DoMeleeAttackIfReady();
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
index d2d3e55b285..2f284e77b09 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
@@ -115,7 +115,7 @@ float Humanoides[6][5] =
uint32 EnrageTimer = 600000;
struct boss_entropiusAI : public ScriptedAI
{
- boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
+ boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -139,7 +139,7 @@ struct boss_entropiusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true);
- DoCast(m_creature, SPELL_ENTROPIUS_SPAWN, false);
+ DoCast(me, SPELL_ENTROPIUS_SPAWN, false);
if (pInstance)
pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
@@ -156,7 +156,7 @@ struct boss_entropiusAI : public ScriptedAI
summoned->addUnitState(UNIT_STAT_STUNNED);
float x,y,z,o;
summoned->GetHomePosition(x,y,z,o);
- m_creature->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
@@ -176,9 +176,9 @@ struct boss_entropiusAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0))
+ if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0))
{
- DoCast(m_creature, SPELL_ENRAGE, false);
+ DoCast(me, SPELL_ENRAGE, false);
} else EnrageTimer -= diff;
if (BlackHoleSummonTimer <= diff)
@@ -208,7 +208,7 @@ CreatureAI* GetAI_boss_entropius(Creature* pCreature)
struct boss_muruAI : public Scripted_NoMovementAI
{
- boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature)
+ boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -232,8 +232,8 @@ struct boss_muruAI : public Scripted_NoMovementAI
Timer[TIMER_PHASE] = 2000;
Timer[TIMER_SENTINEL] = 31500;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
Summons.DespawnAll();
@@ -251,13 +251,13 @@ struct boss_muruAI : public Scripted_NoMovementAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage > m_creature->GetHealth() && Phase == 1)
+ if (damage > me->GetHealth() && Phase == 1)
{
damage = 0;
Phase = 2;
- m_creature->RemoveAllAuras();
- DoCast(m_creature, SPELL_OPEN_ALL_PORTALS, false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAllAuras();
+ DoCast(me, SPELL_OPEN_ALL_PORTALS, false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
if (Phase > 1 && Phase < 4)
damage = 0;
@@ -268,7 +268,7 @@ struct boss_muruAI : public Scripted_NoMovementAI
switch(summoned->GetEntry())
{
case BOSS_ENTROPIUS:
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
break;
case CREATURE_DARK_FIENDS:
summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false);
@@ -296,7 +296,7 @@ struct boss_muruAI : public Scripted_NoMovementAI
break;
case DONE:
Phase = 4;
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
break;
}
Timer[TIMER_PHASE] = 3000;
@@ -304,9 +304,9 @@ struct boss_muruAI : public Scripted_NoMovementAI
return;
}
- if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0))
+ if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0))
{
- DoCast(m_creature, SPELL_ENRAGE, false);
+ DoCast(me, SPELL_ENRAGE, false);
} else EnrageTimer -= diff;
for (uint8 i = 0; i < 4; ++i)
@@ -326,18 +326,18 @@ struct boss_muruAI : public Scripted_NoMovementAI
{
DarkFiend = false;
for (uint8 i = 0; i < 8; ++i)
- m_creature->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
Timer[TIMER_DARKNESS] = 42000;
}
break;
case TIMER_HUMANOIDES:
for (uint8 i = 0; i < 6; ++i)
- m_creature->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0);
Timer[TIMER_HUMANOIDES] = 60000;
break;
case TIMER_PHASE:
- m_creature->RemoveAllAuras();
- DoCast(m_creature, SPELL_SUMMON_ENTROPIUS, false);
+ me->RemoveAllAuras();
+ DoCast(me, SPELL_SUMMON_ENTROPIUS, false);
Timer[TIMER_PHASE] = 3000;
Phase = 3;
return;
@@ -366,7 +366,7 @@ CreatureAI* GetAI_boss_muru(Creature* pCreature)
struct npc_muru_portalAI : public Scripted_NoMovementAI
{
- npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature)
+ npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -387,7 +387,7 @@ struct npc_muru_portalAI : public Scripted_NoMovementAI
InAction = false;
SummonSentinel = false;
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ me->addUnitState(UNIT_STAT_STUNNED);
Summons.DespawnAll();
}
@@ -404,7 +404,7 @@ struct npc_muru_portalAI : public Scripted_NoMovementAI
void SpellHit(Unit* caster, const SpellEntry* Spell)
{
float x,y,z,o;
- m_creature->GetHomePosition(x,y,z,o);
+ me->GetHomePosition(x,y,z,o);
DoTeleportTo(x,y,z);
InAction = true;
switch(Spell->Id)
@@ -453,14 +453,14 @@ struct npc_dark_fiendAI : public ScriptedAI
WaitTimer = 2000;
InAction = false;
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ me->addUnitState(UNIT_STAT_STUNNED);
}
void SpellHit(Unit* caster, const SpellEntry* Spell)
{
for (uint8 i = 0; i < 3; ++i)
if (Spell->Effect[i] == 38)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
void UpdateAI(const uint32 diff)
@@ -472,7 +472,7 @@ struct npc_dark_fiendAI : public ScriptedAI
{
if (!InAction)
{
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_STUNNED);
DoCastAOE(SPELL_DARKFIEND_SKIN, false);
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true));
InAction = true;
@@ -481,10 +481,10 @@ struct npc_dark_fiendAI : public ScriptedAI
else
{
- if (m_creature->IsWithinDist(m_creature->getVictim(), 5))
+ if (me->IsWithinDist(me->getVictim(), 5))
{
DoCastAOE(SPELL_DARKFIEND_AOE, false);
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
WaitTimer = 500;
}
@@ -510,14 +510,14 @@ struct npc_void_sentinelAI : public ScriptedAI
VoidBlastTimer = 45000; //is this a correct timer?
float x,y,z,o;
- m_creature->GetHomePosition(x,y,z,o);
+ me->GetHomePosition(x,y,z,o);
DoTeleportTo(x,y,71);
}
void JustDied(Unit* killer)
{
for (uint8 i = 0; i < 8; ++i)
- m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
+ me->SummonCreature(CREATURE_VOID_SPAWN, me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
}
void UpdateAI(const uint32 diff)
@@ -533,7 +533,7 @@ struct npc_void_sentinelAI : public ScriptedAI
if (VoidBlastTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VOID_BLAST, false);
+ DoCast(me->getVictim(), SPELL_VOID_BLAST, false);
VoidBlastTimer = 45000;
} else VoidBlastTimer -= diff;
@@ -566,7 +566,7 @@ struct npc_blackholeAI : public ScriptedAI
SpellTimer = 5000;
Phase = 0;
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ me->addUnitState(UNIT_STAT_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
}
@@ -574,11 +574,11 @@ struct npc_blackholeAI : public ScriptedAI
{
if (SpellTimer <= diff)
{
- Unit* Victim = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
+ Unit* Victim = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
switch (NeedForAHack)
{
case 0:
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_GROW, false);
if (Victim)
AttackStart(Victim);
@@ -586,19 +586,19 @@ struct npc_blackholeAI : public ScriptedAI
NeedForAHack = 2;
break;
case 1:
- m_creature->AddAura(SPELL_BLACKHOLE_GROW, m_creature);
+ me->AddAura(SPELL_BLACKHOLE_GROW, me);
NeedForAHack = 2;
SpellTimer = 600;
break;
case 2:
SpellTimer = 400;
NeedForAHack = 3;
- m_creature->RemoveAura(SPELL_BLACKHOLE_GROW, 1);
+ me->RemoveAura(SPELL_BLACKHOLE_GROW, 1);
break;
case 3:
SpellTimer = urand(400,900);
NeedForAHack = 1;
- if (Unit* Temp = m_creature->getVictim())
+ if (Unit* Temp = me->getVictim())
{
if (Temp->GetPositionZ() > 73 && Victim)
AttackStart(Victim);
@@ -608,7 +608,7 @@ struct npc_blackholeAI : public ScriptedAI
} else SpellTimer -= diff;
if (DespawnTimer <= diff)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else DespawnTimer -= diff;
}
};
diff --git a/src/scripts/eastern_kingdoms/tirisfal_glades.cpp b/src/scripts/eastern_kingdoms/tirisfal_glades.cpp
index 65acac15c3b..4a5280d7a3a 100644
--- a/src/scripts/eastern_kingdoms/tirisfal_glades.cpp
+++ b/src/scripts/eastern_kingdoms/tirisfal_glades.cpp
@@ -57,15 +57,15 @@ struct npc_calvin_montagueAI : public ScriptedAI
me->RestoreFaction();
- if (!m_creature->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE))
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ if (!me->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
void EnterCombat(Unit* who) { }
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker))
+ if (me->getVictim() || me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -73,13 +73,13 @@ struct npc_calvin_montagueAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15))
+ if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15))
{
uiDamage = 0;
me->RestoreFaction();
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->CombatStop(true);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->CombatStop(true);
m_uiPhase = 1;
@@ -103,14 +103,14 @@ struct npc_calvin_montagueAI : public ScriptedAI
switch(m_uiPhase)
{
case 1:
- DoScriptText(SAY_COMPLETE, m_creature);
+ DoScriptText(SAY_COMPLETE, me);
++m_uiPhase;
break;
case 2:
if (Player *pPlayer = Unit::GetPlayer(m_uiPlayerGUID))
pPlayer->AreaExploredOrEventHappens(QUEST_590);
- DoCast(m_creature, SPELL_DRINK, true);
+ DoCast(me, SPELL_DRINK, true);
++m_uiPhase;
break;
case 3:
diff --git a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp
index 6eeb54f0fa7..ca9f0f3d49f 100644
--- a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp
+++ b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp
@@ -50,7 +50,7 @@ struct boss_archaedasAI : public ScriptedAI
{
boss_archaedasAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
uint32 Tremor_Timer;
@@ -74,15 +74,15 @@ struct boss_archaedasAI : public ScriptedAI
if (pInstance)
pInstance->SetData (NULL, 5); // respawn any dead minions
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
void ActivateMinion (uint64 guid, bool flag)
{
- Unit *minion = Unit::GetUnit(*m_creature, guid);
+ Unit *minion = Unit::GetUnit(*me, guid);
if (minion && minion->isAlive())
{
@@ -93,17 +93,17 @@ struct boss_archaedasAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->setFaction (14);
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
+ me->setFaction (14);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
}
void SpellHit (Unit* caster, const SpellEntry *spell)
{
// Being woken up from the altar, start the awaken sequence
if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) {
- m_creature->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(me,SOUND_AGGRO);
Awaken_Timer = 4000;
wakingUp = true;
}
@@ -111,8 +111,8 @@ struct boss_archaedasAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- m_creature->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL);
+ me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL);
}
void UpdateAI(const uint32 diff)
@@ -125,7 +125,7 @@ struct boss_archaedasAI : public ScriptedAI
return; // dont do anything until we are done
} else if (wakingUp && Awaken_Timer <= 0) {
wakingUp = false;
- AttackStart(Unit::GetUnit(*m_creature, pInstance->GetData64(0)));
+ AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0)));
return; // dont want to continue until we finish the AttackStart method
}
@@ -141,33 +141,33 @@ struct boss_archaedasAI : public ScriptedAI
} else WallMinionTimer -= diff;
//If we are <66 summon the guardians
- if (!guardiansAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66) {
+ if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) {
ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1
ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2
ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3
ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4
ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5
ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6
- m_creature->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON);
+ me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_SUMMON);
guardiansAwake = true;
}
//If we are <33 summon the vault walkers
- if (!vaultWalkersAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33) {
+ if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) {
ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1
ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2
ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3
ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4
- m_creature->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
+ me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_SUMMON2);
vaultWalkersAwake = true;
}
if (Tremor_Timer <= diff)
{
//Cast
- DoCast(m_creature->getVictim(), SPELL_GROUND_TREMOR);
+ DoCast(me->getVictim(), SPELL_GROUND_TREMOR);
//45 seconds until we should cast this agian
Tremor_Timer = 45000;
@@ -204,7 +204,7 @@ struct mob_archaedas_minionsAI : public ScriptedAI
{
mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
uint32 Arcing_Timer;
@@ -222,18 +222,18 @@ struct mob_archaedas_minionsAI : public ScriptedAI
wakingUp = false;
amIAwake = false;
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->RemoveAllAuras();
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveAllAuras();
}
void EnterCombat(Unit *who)
{
- m_creature->setFaction (14);
- m_creature->RemoveAllAuras();
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->setFaction (14);
+ me->RemoveAllAuras();
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
amIAwake = true;
}
@@ -260,7 +260,7 @@ struct mob_archaedas_minionsAI : public ScriptedAI
} else if (wakingUp && Awaken_Timer <= 0) {
wakingUp = false;
amIAwake = true;
- // AttackStart(Unit::GetUnit(*m_creature, pInstance->GetData64(0))); // whoWokeArchaedasGUID
+ // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID
return; // dont want to continue until we finish the AttackStart method
}
@@ -356,24 +356,24 @@ struct mob_stonekeepersAI : public ScriptedAI
{
mob_stonekeepersAI(Creature *c) : ScriptedAI(c)
{
- pInstance = (m_creature->GetInstanceData());
+ pInstance = (me->GetInstanceData());
}
ScriptedInstance* pInstance;
void Reset()
{
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->RemoveAllAuras();
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveAllAuras();
}
void EnterCombat(Unit *who)
{
- m_creature->setFaction (14);
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->setFaction (14);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
void UpdateAI(const uint32 diff)
@@ -388,7 +388,7 @@ struct mob_stonekeepersAI : public ScriptedAI
void JustDied(Unit *attacker)
{
- DoCast (m_creature, SPELL_SELF_DESTRUCT,true);
+ DoCast (me, SPELL_SELF_DESTRUCT,true);
if (pInstance)
pInstance->SetData(NULL, 1); // activate next stonekeeper
}
diff --git a/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp
index 604b3453d45..f0b7cbbba6f 100644
--- a/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp
+++ b/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp
@@ -46,7 +46,7 @@ struct boss_ironayaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -56,18 +56,18 @@ struct boss_ironayaAI : public ScriptedAI
return;
//If we are <50% hp do knockaway ONCE
- if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth())
+ if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth())
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY, true);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
// current aggro target is knocked away pick new target
Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
- if (!Target || Target == m_creature->getVictim())
+ if (!Target || Target == me->getVictim())
Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
if (Target)
- m_creature->TauntApply(Target);
+ me->TauntApply(Target);
//Shouldn't cast this agian
hasCastedKnockaway = true;
@@ -76,13 +76,13 @@ struct boss_ironayaAI : public ScriptedAI
//Arcing_Timer
if (Arcing_Timer <= diff)
{
- DoCast(m_creature, SPELL_ARCINGSMASH);
+ DoCast(me, SPELL_ARCINGSMASH);
Arcing_Timer = 13000;
} else Arcing_Timer -= diff;
- if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth())
+ if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth())
{
- DoCast(m_creature, SPELL_WSTOMP);
+ DoCast(me, SPELL_WSTOMP);
hasCastedWstomp = true;
}
diff --git a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp
index 8a9ac246d52..01862739cb7 100644
--- a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp
+++ b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp
@@ -59,19 +59,19 @@ struct mob_jadespine_basiliskAI : public ScriptedAI
if (Cslumber_Timer <= diff)
{
//Cast
- // DoCast(m_creature->getVictim(), SPELL_CSLUMBER);
- DoCast(m_creature->getVictim(), SPELL_CSLUMBER, true);
+ // DoCast(me->getVictim(), SPELL_CSLUMBER);
+ DoCast(me->getVictim(), SPELL_CSLUMBER, true);
//Stop attacking target thast asleep and pick new target
Cslumber_Timer = 28000;
Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
- if (!Target || Target == m_creature->getVictim())
+ if (!Target || Target == me->getVictim())
Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (Target)
- m_creature->TauntApply(Target);
+ me->TauntApply(Target);
} else Cslumber_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/undercity.cpp b/src/scripts/eastern_kingdoms/undercity.cpp
index 4d18e08f420..da474fe6fd0 100644
--- a/src/scripts/eastern_kingdoms/undercity.cpp
+++ b/src/scripts/eastern_kingdoms/undercity.cpp
@@ -79,7 +79,7 @@ struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI
if (Unit *pTarget = Unit::GetUnit(*summoned,targetGUID))
{
pTarget->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0,0);
- pTarget->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0, 0.0f);
+ pTarget->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0, 0.0f);
summoned->CastSpell(pTarget, SPELL_RIBBON_OF_SOULS, false);
}
@@ -97,10 +97,10 @@ struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI
DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN);
LamentEvent_Timer = 2000;
- if (!m_creature->HasAura(SPELL_SYLVANAS_CAST))
+ if (!me->HasAura(SPELL_SYLVANAS_CAST))
{
- DoScriptText(SAY_LAMENT_END, m_creature);
- DoScriptText(EMOTE_LAMENT_END, m_creature);
+ DoScriptText(SAY_LAMENT_END, me);
+ DoScriptText(EMOTE_LAMENT_END, me);
LamentEvent = false;
}
} else LamentEvent_Timer -= diff;
@@ -161,9 +161,9 @@ struct npc_highborne_lamenterAI : public ScriptedAI
{
if (EventMove_Timer <= diff)
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000);
- m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation());
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SendMonsterMoveWithSpeed(me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000);
+ me->GetMap()->CreatureRelocation(me,me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,me->GetOrientation());
EventMove = false;
} else EventMove_Timer -= diff;
}
@@ -171,7 +171,7 @@ struct npc_highborne_lamenterAI : public ScriptedAI
{
if (EventCast_Timer <= diff)
{
- DoCast(m_creature, SPELL_HIGHBORNE_AURA);
+ DoCast(me, SPELL_HIGHBORNE_AURA);
EventCast = false;
} else EventCast_Timer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/western_plaguelands.cpp b/src/scripts/eastern_kingdoms/western_plaguelands.cpp
index 806c7cb9169..60b158aa042 100644
--- a/src/scripts/eastern_kingdoms/western_plaguelands.cpp
+++ b/src/scripts/eastern_kingdoms/western_plaguelands.cpp
@@ -148,11 +148,11 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI
void DoDie()
{
//summoner dies here
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
//override any database `spawntimesecs` to prevent duplicated summons
- uint32 rTime = m_creature->GetRespawnDelay();
+ uint32 rTime = me->GetRespawnDelay();
if (rTime<600)
- m_creature->SetRespawnDelay(600);
+ me->SetRespawnDelay(600);
}
void MoveInLineOfSight(Unit *who)
@@ -162,13 +162,13 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI
if (who->GetTypeId() == TYPEID_PLAYER)
{
- switch(m_creature->GetAreaId())
+ switch(me->GetAreaId())
{
case 199: //felstone
if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE)
{
- m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
@@ -176,7 +176,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI
if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE)
{
- m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
@@ -184,7 +184,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI
if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE)
{
- m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;
@@ -192,7 +192,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI
if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE)
{
- m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;
@@ -223,8 +223,8 @@ struct npc_andorhal_towerAI : public Scripted_NoMovementAI
if (!pWho || pWho->GetTypeId() != TYPEID_PLAYER)
return;
- if (m_creature->FindNearestGameObject(GO_BEACON_TORCH, 10.0f))
- CAST_PLR(pWho)->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetGUID());
+ if (me->FindNearestGameObject(GO_BEACON_TORCH, 10.0f))
+ CAST_PLR(pWho)->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
}
};
diff --git a/src/scripts/eastern_kingdoms/westfall.cpp b/src/scripts/eastern_kingdoms/westfall.cpp
index 82d49e09851..6f2f439f7fb 100644
--- a/src/scripts/eastern_kingdoms/westfall.cpp
+++ b/src/scripts/eastern_kingdoms/westfall.cpp
@@ -60,9 +60,9 @@ struct npc_daphne_stilwellAI : public npc_escortAI
{
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;
+ case 7: DoScriptText(SAY_DS_DOWN_1, me); break;
+ case 8: DoScriptText(SAY_DS_DOWN_2, me); break;
+ case 9: DoScriptText(SAY_DS_DOWN_3, me); break;
}
}
else
@@ -84,42 +84,42 @@ struct npc_daphne_stilwellAI : public npc_escortAI
{
case 4:
SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE);
- m_creature->SetSheath(SHEATH_STATE_RANGED);
- m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
+ me->SetSheath(SHEATH_STATE_RANGED);
+ me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
break;
case 7:
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 8:
- m_creature->SetSheath(SHEATH_STATE_RANGED);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SetSheath(SHEATH_STATE_RANGED);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 9:
- m_creature->SetSheath(SHEATH_STATE_RANGED);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018, 1570.738, 54.828, 4.220, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SetSheath(SHEATH_STATE_RANGED);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->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);
+ DoScriptText(SAY_DS_PROLOGUE, me);
break;
case 13:
SetEquipmentSlots(true);
- m_creature->SetSheath(SHEATH_STATE_UNARMED);
- m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
+ me->SetSheath(SHEATH_STATE_UNARMED);
+ me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
break;
case 17:
- pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature);
+ pPlayer->GroupEventHappens(QUEST_TOME_VALOR, me);
break;
}
}
@@ -129,19 +129,19 @@ struct npc_daphne_stilwellAI : public npc_escortAI
if (!pWho)
return;
- if (m_creature->Attack(pWho, false))
+ if (me->Attack(pWho, false))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
- m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f);
+ me->GetMotionMaster()->MoveChase(pWho, 30.0f);
}
}
void JustSummoned(Creature* pSummoned)
{
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
void Update(const uint32 diff)
@@ -155,8 +155,8 @@ struct npc_daphne_stilwellAI : public npc_escortAI
{
uiShootTimer = 1500;
- if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE))
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ if (!me->IsWithinDist(me->getVictim(), ATTACK_DISTANCE))
+ DoCast(me->getVictim(), SPELL_SHOOT);
} else uiShootTimer -= diff;
}
};
@@ -208,20 +208,20 @@ struct npc_defias_traitorAI : public npc_escortAI
SetRun(false);
break;
case 36:
- DoScriptText(SAY_PROGRESS, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS, me, pPlayer);
break;
case 44:
- DoScriptText(SAY_END, m_creature, pPlayer);
+ DoScriptText(SAY_END, me, pPlayer);
{
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature);
+ pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,me);
}
break;
}
}
void EnterCombat(Unit* who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature, who);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me, who);
}
void Reset() {}
diff --git a/src/scripts/eastern_kingdoms/wetlands.cpp b/src/scripts/eastern_kingdoms/wetlands.cpp
index a7a4b247da9..21120d31023 100644
--- a/src/scripts/eastern_kingdoms/wetlands.cpp
+++ b/src/scripts/eastern_kingdoms/wetlands.cpp
@@ -60,11 +60,11 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI
switch(uiPointId)
{
case 2:
- if (m_creature->HasStealthAura())
- m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
+ if (me->HasStealthAura())
+ me->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
SetRun();
- m_creature->setFaction(FACTION_ENEMY);
+ me->setFaction(FACTION_ENEMY);
break;
}
}
@@ -76,7 +76,7 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI
if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_bFriendSummoned && pPlayer)
{
for (uint8 i = 0; i < 3; ++i)
- DoCast(m_creature, SPELL_CALL_FRIENDS, true);
+ DoCast(me, SPELL_CALL_FRIENDS, true);
m_bFriendSummoned = true;
}
@@ -90,10 +90,10 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
return;
- if (m_creature->IsFriendlyTo(pAttacker))
+ if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -101,19 +101,19 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
- if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20)
+ if (me->GetHealth()*100 < me->GetMaxHealth()*20)
{
if (Player* pPlayer = GetPlayerForEscort())
{
if (pPlayer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me);
uiDamage = 0;
me->RestoreFaction();
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
SetRun(false);
}
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
index 394e61e7785..74b6a391be2 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
@@ -114,8 +114,8 @@ struct boss_akilzonAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
+ me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONAGGRO);
//DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
@@ -123,8 +123,8 @@ struct boss_akilzonAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- m_creature->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
+ me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(me, SOUND_ONDEATH);
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, DONE);
DespawnSummons();
@@ -135,12 +135,12 @@ struct boss_akilzonAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
+ me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY1);
break;
case 1:
- m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
+ me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY2);
break;
}
}
@@ -149,7 +149,7 @@ struct boss_akilzonAI : public ScriptedAI
{
for (uint8 i = 0; i < 8; ++i)
{
- Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]);
+ Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]);
if (bird && bird->isAlive())
{
bird->SetVisibility(VISIBILITY_OFF);
@@ -160,7 +160,7 @@ struct boss_akilzonAI : public ScriptedAI
void SetWeather(uint32 weather, float grade)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap->IsDungeon())
return;
@@ -179,7 +179,7 @@ struct boss_akilzonAI : public ScriptedAI
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
@@ -187,31 +187,31 @@ struct boss_akilzonAI : public ScriptedAI
std::list<Unit *> tempUnitMap;
{
- Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999);
- Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(m_creature, tempUnitMap, u_check);
+ Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999);
+ Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
- cell.Visit(p, world_unit_searcher, *(m_creature->GetMap()));
- cell.Visit(p, grid_unit_searcher, *(m_creature->GetMap()));
+ cell.Visit(p, world_unit_searcher, *(me->GetMap()));
+ cell.Visit(p, grid_unit_searcher, *(me->GetMap()));
}
//dealdamege
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
{
if (!Cloud->IsWithinDist(*i, 6, false))
{
- Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID());
+ Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID());
}
}
// visual
float x,y,z;
- z = m_creature->GetPositionZ();
+ z = me->GetPositionZ();
for (uint8 i = 0; i < 5+rand()%5; ++i)
{
x = 343+rand()%60;
y = 1380+rand()%60;
- if (Unit *trigger = m_creature->SummonTrigger(x, y, z, 0, 2000))
+ if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000))
{
trigger->setFaction(35);
trigger->SetMaxHealth(100000);
@@ -227,7 +227,7 @@ struct boss_akilzonAI : public ScriptedAI
{
StormCount = 0; // finish
SummonEagles_Timer = 5000;
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
CloudGUID = 0;
if (Cloud)
Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -244,13 +244,13 @@ struct boss_akilzonAI : public ScriptedAI
if (StormCount)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, CloudGUID);
+ Unit *pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->isAlive())
{
EnterEvadeMode();
return;
}
- else if (Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))
+ else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID))
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff)
@@ -263,36 +263,36 @@ struct boss_akilzonAI : public ScriptedAI
if (Enrage_Timer <= diff)
{
- m_creature->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONENRAGE);
- DoCast(m_creature, SPELL_BERSERK, true);
+ me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONENRAGE);
+ DoCast(me, SPELL_BERSERK, true);
Enrage_Timer = 600000;
} else Enrage_Timer -= diff;
if (StaticDisruption_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget) pTarget = m_creature->getVictim();
+ if (!pTarget) pTarget = me->getVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
- m_creature->SetInFront(m_creature->getVictim());
+ me->SetInFront(me->getVictim());
StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
- /*if (float dist = m_creature->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
+ /*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
} else StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget) pTarget = m_creature->getVictim();
+ if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
} else GustOfWind_Timer -= diff;
if (CallLighting_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CALL_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_CALL_LIGHTNING);
CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
} else CallLighting_Timer -= diff;
@@ -316,9 +316,9 @@ struct boss_akilzonAI : public ScriptedAI
if (pTarget)
{
pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- pTarget->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0);
+ pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0);
}
- Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000);
+ Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
@@ -337,15 +337,15 @@ struct boss_akilzonAI : public ScriptedAI
if (SummonEagles_Timer <= diff)
{
- m_creature->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSUMMON);
+ me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSUMMON);
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
for (uint8 i = 0; i < 8; ++i)
{
- Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]);
+ Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]);
if (!bird) //they despawned on die
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
@@ -356,11 +356,11 @@ struct boss_akilzonAI : public ScriptedAI
if (z > 95)
z = 95 - urand(0,5);
}
- Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (pCreature)
{
- pCreature->AddThreat(m_creature->getVictim(), 1.0f);
- pCreature->AI()->AttackStart(m_creature->getVictim());
+ pCreature->AddThreat(me->getVictim(), 1.0f);
+ pCreature->AI()->AttackStart(me->getVictim());
BirdGUIDs[i] = pCreature->GetGUID();
}
}
@@ -385,7 +385,7 @@ struct mob_soaring_eagleAI : public ScriptedAI
EagleSwoop_Timer = 5000 + rand()%5000;
arrived = true;
TargetGUID = 0;
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
}
void EnterCombat(Unit *who) {DoZoneInCombat();}
@@ -397,10 +397,10 @@ struct mob_soaring_eagleAI : public ScriptedAI
arrived = true;
if (TargetGUID)
{
- if (Unit *pTarget = Unit::GetUnit(*m_creature, TargetGUID))
+ if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, SPELL_EAGLE_SWOOP, true);
TargetGUID = 0;
- m_creature->SetSpeed(MOVE_RUN, 1.2f);
+ me->SetSpeed(MOVE_RUN, 1.2f);
EagleSwoop_Timer = 5000 + rand()%5000;
}
}
@@ -427,12 +427,12 @@ struct mob_soaring_eagleAI : public ScriptedAI
}
else
{
- pTarget->GetContactPoint(m_creature, x, y, z);
+ pTarget->GetContactPoint(me, x, y, z);
z += 2;
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ me->SetSpeed(MOVE_RUN, 5.0f);
TargetGUID = pTarget->GetGUID();
}
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
arrived = false;
}
}
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp
index 809de7631d3..1baaf524531 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp
@@ -106,7 +106,7 @@ struct boss_halazziAI : public ScriptedAI
BerserkTimer = 600000;
CheckTimer = 1000;
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
+ DoCast(me, SPELL_DUAL_WIELD, true);
Phase = PHASE_NONE;
EnterPhase(PHASE_LYNX);
@@ -117,22 +117,22 @@ struct boss_halazziAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
- m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_AGGRO);
EnterPhase(PHASE_LYNX);
}
void JustSummoned(Creature* summon)
{
- summon->AI()->AttackStart(m_creature->getVictim());
+ summon->AI()->AttackStart(me->getVictim());
if (summon->GetEntry() == MOB_SPIRIT_LYNX)
LynxGUID = summon->GetGUID();
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && Phase != PHASE_ENRAGE)
+ if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
damage = 0;
}
@@ -155,42 +155,42 @@ struct boss_halazziAI : public ScriptedAI
case PHASE_ENRAGE:
if (Phase == PHASE_MERGE)
{
- DoCast(m_creature, SPELL_TRANSFORM_MERGE, true);
- m_creature->Attack(m_creature->getVictim(), true);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ DoCast(me, SPELL_TRANSFORM_MERGE, true);
+ me->Attack(me->getVictim(), true);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
- if (Creature *Lynx = Unit::GetCreature(*m_creature, LynxGUID))
+ if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID))
Lynx->DisappearAndDie();
- m_creature->SetMaxHealth(600000);
- m_creature->SetHealth(600000 - 150000 * TransformCount);
+ me->SetMaxHealth(600000);
+ me->SetHealth(600000 - 150000 * TransformCount);
FrenzyTimer = 16000;
SaberlashTimer = 20000;
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_SPLIT:
- m_creature->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPLIT);
- DoCast(m_creature, SPELL_TRANSFORM_SPLIT, true);
+ me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_SPLIT);
+ DoCast(me, SPELL_TRANSFORM_SPLIT, true);
break;
case PHASE_HUMAN:
- //DoCast(m_creature, SPELL_SUMMON_LYNX, true);
+ //DoCast(me, SPELL_SUMMON_LYNX, true);
DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- m_creature->SetMaxHealth(400000);
- m_creature->SetHealth(400000);
+ me->SetMaxHealth(400000);
+ me->SetHealth(400000);
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_MERGE:
- if (Unit *pLynx = Unit::GetUnit(*m_creature, LynxGUID))
+ if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID))
{
- m_creature->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_MERGE);
+ me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_MERGE);
pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pLynx->GetMotionMaster()->Clear();
- pLynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveFollow(pLynx, 0, 0);
+ pLynx->GetMotionMaster()->MoveFollow(me, 0, 0);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveFollow(pLynx, 0, 0);
++TransformCount;
}
break;
@@ -207,9 +207,9 @@ struct boss_halazziAI : public ScriptedAI
if (BerserkTimer <= diff)
{
- m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- DoCast(m_creature, SPELL_BERSERK, true);
+ me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_BERSERK);
+ DoCast(me, SPELL_BERSERK, true);
BerserkTimer = 60000;
} else BerserkTimer -= diff;
@@ -218,22 +218,22 @@ struct boss_halazziAI : public ScriptedAI
if (SaberlashTimer <= diff)
{
// A tank with more than 490 defense skills should receive no critical hit
- //DoCast(m_creature, 41296, true);
- DoCast(m_creature->getVictim(), SPELL_SABER_LASH, true);
- //m_creature->RemoveAurasDueToSpell(41296);
+ //DoCast(me, 41296, true);
+ DoCast(me->getVictim(), SPELL_SABER_LASH, true);
+ //me->RemoveAurasDueToSpell(41296);
SaberlashTimer = 30000;
} else SaberlashTimer -= diff;
if (FrenzyTimer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
FrenzyTimer = urand(10000,15000);
} else FrenzyTimer -= diff;
if (Phase == PHASE_LYNX)
if (CheckTimer <= diff)
{
- if (m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount))
+ if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount))
EnterPhase(PHASE_SPLIT);
CheckTimer = 1000;
} else CheckTimer -= diff;
@@ -243,7 +243,7 @@ struct boss_halazziAI : public ScriptedAI
{
if (TotemTimer <= diff)
{
- DoCast(m_creature, SPELL_SUMMON_TOTEM);
+ DoCast(me, SPELL_SUMMON_TOTEM);
TotemTimer = 20000;
} else TotemTimer -= diff;
@@ -262,11 +262,11 @@ struct boss_halazziAI : public ScriptedAI
if (Phase == PHASE_HUMAN)
if (CheckTimer <= diff)
{
- if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/)
+ if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/)
EnterPhase(PHASE_MERGE);
else
{
- Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
+ Unit *Lynx = Unit::GetUnit(*me, LynxGUID);
if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/)
EnterPhase(PHASE_MERGE);
}
@@ -278,12 +278,12 @@ struct boss_halazziAI : public ScriptedAI
{
if (CheckTimer <= diff)
{
- Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
+ Unit *Lynx = Unit::GetUnit(*me, LynxGUID);
if (Lynx)
{
- Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
- m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
- if (m_creature->IsWithinDistInMap(Lynx, 6.0f))
+ Lynx->GetMotionMaster()->MoveFollow(me, 0, 0);
+ me->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
+ if (me->IsWithinDistInMap(Lynx, 6.0f))
{
if (TransformCount < 3)
EnterPhase(PHASE_LYNX);
@@ -303,13 +303,13 @@ struct boss_halazziAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
- m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
}
}
@@ -319,8 +319,8 @@ struct boss_halazziAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, DONE);
- m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_DEATH);
}
};
@@ -341,13 +341,13 @@ struct boss_spiritlynxAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
damage = 0;
}
void AttackStart(Unit *who)
{
- if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
ScriptedAI::AttackStart(who);
}
@@ -360,13 +360,13 @@ struct boss_spiritlynxAI : public ScriptedAI
if (FrenzyTimer <= diff)
{
- DoCast(m_creature, SPELL_LYNX_FRENZY);
+ DoCast(me, SPELL_LYNX_FRENZY);
FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds
} else FrenzyTimer -= diff;
if (shredder_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHRED_ARMOR);
+ DoCast(me->getVictim(), SPELL_SHRED_ARMOR);
shredder_timer = 4000;
} else shredder_timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp
index bfd3ed51d17..73a18a97a50 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp
@@ -238,8 +238,8 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
SpawnAdds();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
void EnterCombat(Unit* who)
@@ -248,14 +248,14 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
DoZoneInCombat();
- m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
for (uint8 i = 0; i < 4; ++i)
{
- Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ Unit* Temp = Unit::GetUnit((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
- CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim());
+ CAST_CRE(Temp)->AI()->AttackStart(me->getVictim());
else
{
EnterEvadeMode();
@@ -269,12 +269,12 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
- m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
}
@@ -284,12 +284,12 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HEXLORDEVENT, DONE);
- m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_DEATH);
for (uint8 i = 0; i < 4 ; ++i)
{
- Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ Unit* Temp = Unit::GetUnit((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
@@ -314,17 +314,17 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature *pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
+ Creature *pCreature = (Unit::GetCreature((*me), AddGUID[i]));
if (!pCreature || !pCreature->isAlive())
{
if (pCreature) pCreature->setDeathState(DEAD);
- pCreature = m_creature->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
+ pCreature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
if (pCreature) AddGUID[i] = pCreature->GetGUID();
}
else
{
pCreature->AI()->EnterEvadeMode();
- pCreature->GetMap()->CreatureRelocation(m_creature, Pos_X[i], POS_Y, POS_Z, ORIENT);
+ pCreature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT);
pCreature->StopMoving();
}
}
@@ -337,7 +337,7 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
if (ResetTimer <= diff)
{
- if (m_creature->IsWithinDist3d(119.223, 1035.45, 29.4481, 10))
+ if (me->IsWithinDist3d(119.223, 1035.45, 29.4481, 10))
{
EnterEvadeMode();
return;
@@ -348,18 +348,18 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
if (CheckAddState_Timer <= diff)
{
for (uint8 i = 0; i < 4; ++i)
- if (Creature *pTemp = Unit::GetCreature(*m_creature, AddGUID[i]))
+ if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i]))
if (pTemp->isAlive() && !pTemp->getVictim())
- pTemp->AI()->AttackStart(m_creature->getVictim());
+ pTemp->AI()->AttackStart(me->getVictim());
CheckAddState_Timer = 5000;
} else CheckAddState_Timer -= diff;
if (DrainPower_Timer <= diff)
{
- DoCast(m_creature, SPELL_DRAIN_POWER, true);
- m_creature->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER);
+ DoCast(me, SPELL_DRAIN_POWER, true);
+ me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
DrainPower_Timer = urand(40000,55000); // must cast in 60 sec, or buff/debuff will disappear
} else DrainPower_Timer -= diff;
@@ -369,9 +369,9 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
SpiritBolts_Timer = 13000; // cast drain power first
else
{
- DoCast(m_creature, SPELL_SPIRIT_BOLTS, false);
- m_creature->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_SPIRIT_BOLTS);
+ DoCast(me, SPELL_SPIRIT_BOLTS, false);
+ me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
SpiritBolts_Timer = 40000;
SiphonSoul_Timer = 10000; // ready to drain
PlayerAbility_Timer = 99999;
@@ -392,11 +392,11 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
trigger->SetDisplayId(11686);
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true);
- trigger->GetMotionMaster()->MoveChase(m_creature);
+ trigger->GetMotionMaster()->MoveChase(me);
//DoCast(pTarget, SPELL_SIPHON_SOUL, true);
- //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID());
- //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
+ //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID());
+ //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
PlayerGUID = pTarget->GetGUID();
PlayerAbility_Timer = urand(8000,10000);
@@ -413,7 +413,7 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
if (PlayerAbility_Timer <= diff)
{
- //Unit *pTarget = Unit::GetUnit(*m_creature, PlayerGUID);
+ //Unit *pTarget = Unit::GetUnit(*me, PlayerGUID);
//if (pTarget && pTarget->isAlive())
//{
UseAbility();
@@ -431,10 +431,10 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI
switch(PlayerAbility[PlayerClass][random].target)
{
case ABILITY_TARGET_SELF:
- pTarget = m_creature;
+ pTarget = me;
break;
case ABILITY_TARGET_VICTIM:
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
break;
case ABILITY_TARGET_ENEMY:
default:
@@ -493,7 +493,7 @@ struct boss_thurgAI : public boss_hexlord_addAI
if (cleave_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE, false);
+ DoCast(me->getVictim(), SPELL_CLEAVE, false);
cleave_timer = 12000; //3 sec cast
} else cleave_timer -= diff;
@@ -529,10 +529,10 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI
if (who->isTargetableForAttack())
{
- if (m_creature->Attack(who, false))
+ if (me->Attack(who, false))
{
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
+ me->GetMotionMaster()->MoveChase(who, 20);
+ me->AddThreat(who, 0.0f);
}
}
}
@@ -547,13 +547,13 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI
Unit *pTarget = DoSelectLowestHpFriendly(99, 30000);
if (pTarget)
{
- if (pTarget->IsWithinDistInMap(m_creature, 50))
+ if (pTarget->IsWithinDistInMap(me, 50))
DoCast(pTarget, SPELL_FLASH_HEAL, false);
else
{
// bugged
- //m_creature->GetMotionMaster()->Clear();
- //m_creature->GetMotionMaster()->MoveChase(pTarget, 20);
+ //me->GetMotionMaster()->Clear();
+ //me->GetMotionMaster()->MoveChase(pTarget, 20);
}
}
else
@@ -578,7 +578,7 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
}
else
- m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
+ me->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
dispelmagic_timer = 12000;
} else dispelmagic_timer -= diff;*/
@@ -608,10 +608,10 @@ struct boss_gazakrothAI : public boss_hexlord_addAI
if (who->isTargetableForAttack())
{
- if (m_creature->Attack(who, false))
+ if (me->Attack(who, false))
{
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
+ me->GetMotionMaster()->MoveChase(who, 20);
+ me->AddThreat(who, 0.0f);
}
}
}
@@ -623,7 +623,7 @@ struct boss_gazakrothAI : public boss_hexlord_addAI
if (firebolt_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBOLT, false);
+ DoCast(me->getVictim(), SPELL_FIREBOLT, false);
firebolt_timer = 700;
} else firebolt_timer -= diff;
@@ -656,13 +656,13 @@ struct boss_lord_raadanAI : public boss_hexlord_addAI
if (thunderclap_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP, false);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP, false);
thunderclap_timer = 12000;
} else thunderclap_timer -= diff;
if (flamebreath_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAME_BREATH, false);
+ DoCast(me->getVictim(), SPELL_FLAME_BREATH, false);
flamebreath_timer = 12000;
} else flamebreath_timer -= diff;
@@ -690,7 +690,7 @@ struct boss_darkheartAI : public boss_hexlord_addAI
if (psychicwail_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PSYCHIC_WAIL, false);
+ DoCast(me->getVictim(), SPELL_PSYCHIC_WAIL, false);
psychicwail_timer = 12000;
} else psychicwail_timer -= diff;
@@ -719,10 +719,10 @@ struct boss_slitherAI : public boss_hexlord_addAI
if (who->isTargetableForAttack())
{
- if (m_creature->Attack(who, false))
+ if (me->Attack(who, false))
{
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
+ me->GetMotionMaster()->MoveChase(who, 20);
+ me->AddThreat(who, 0.0f);
}
}
}
@@ -766,7 +766,7 @@ struct boss_fenstalkerAI : public boss_hexlord_addAI
if (volatileinf_timer <= diff)
{
// core bug
- m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_VOLATILE_INFECTION, false);
+ me->getVictim()->CastSpell(me->getVictim(),SPELL_VOLATILE_INFECTION, false);
volatileinf_timer = 12000;
} else volatileinf_timer -= diff;
@@ -799,7 +799,7 @@ struct boss_koraggAI : public boss_hexlord_addAI
if (mightyblow_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW, false);
+ DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, false);
mightyblow_timer = 12000;
}
if (coldstare_timer <= diff)
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
index d833a884e02..7768c8f05cf 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
@@ -157,7 +157,7 @@ struct boss_janalaiAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_JANALAIEVENT, DONE);
@@ -165,7 +165,7 @@ struct boss_janalaiAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void EnterCombat(Unit *who)
@@ -173,7 +173,7 @@ struct boss_janalaiAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
// DoZoneInCombat();
}
@@ -181,7 +181,7 @@ struct boss_janalaiAI : public ScriptedAI
{
if (isFlameBreathing)
{
- if (!m_creature->HasInArc(M_PI/6, pTarget))
+ if (!me->HasInArc(M_PI/6, pTarget))
damage = 0;
}
}
@@ -200,9 +200,9 @@ struct boss_janalaiAI : public ScriptedAI
for (uint8 j = 0; j < WallNum; j++)
{
if (WallNum == 3)
- wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
+ wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
else
- wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
+ wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
if (wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true);
}
}
@@ -226,7 +226,7 @@ struct boss_janalaiAI : public ScriptedAI
{
std::list<Creature*> templist;
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
{
CellPair pair(Trinity::ComputeCellPair(x, y));
@@ -234,12 +234,12 @@ struct boss_janalaiAI : public ScriptedAI
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
+ Trinity::AllCreaturesOfEntryInRange check(me, MOB_EGG, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()));
}
//error_log("Eggs %d at middle", templist.size());
@@ -260,7 +260,7 @@ struct boss_janalaiAI : public ScriptedAI
{
std::list<Creature*> templist;
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
{
CellPair pair(Trinity::ComputeCellPair(x, y));
@@ -268,12 +268,12 @@ struct boss_janalaiAI : public ScriptedAI
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
+ Trinity::AllCreaturesOfEntryInRange check(me, MOB_FIRE_BOMB, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()));
}
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
@@ -286,7 +286,7 @@ struct boss_janalaiAI : public ScriptedAI
{
if (BombCount < 40)
{
- if (Unit *FireBomb = Unit::GetUnit((*m_creature), FireBombGUIDs[BombCount]))
+ if (Unit *FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount]))
{
FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true);
@@ -303,7 +303,7 @@ struct boss_janalaiAI : public ScriptedAI
Boom();
isBombing = false;
BombTimer = urand(20000,40000);
- m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL);
+ me->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL);
if (EnrageTimer <= 10000)
EnrageTimer = 0;
else
@@ -315,7 +315,7 @@ struct boss_janalaiAI : public ScriptedAI
{
if (isFlameBreathing)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
isFlameBreathing = false;
else
return;
@@ -334,36 +334,36 @@ struct boss_janalaiAI : public ScriptedAI
return;
//enrage if under 25% hp before 5 min.
- if (!enraged && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth())
+ if (!enraged && me->GetHealth() * 4 < me->GetMaxHealth())
EnrageTimer = 0;
if (EnrageTimer <= diff)
{
if (!enraged)
{
- DoCast(m_creature, SPELL_ENRAGE, true);
+ DoCast(me, SPELL_ENRAGE, true);
enraged = true;
EnrageTimer = 300000;
}
else
{
- DoScriptText(SAY_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoScriptText(SAY_BERSERK, me);
+ DoCast(me, SPELL_BERSERK, true);
EnrageTimer = 300000;
}
} else EnrageTimer -= diff;
if (BombTimer <= diff)
{
- DoScriptText(SAY_FIRE_BOMBS, m_creature);
+ DoScriptText(SAY_FIRE_BOMBS, me);
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
+ me->AttackStop();
+ me->GetMotionMaster()->Clear();
DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
- m_creature->StopMoving();
- DoCast(m_creature, SPELL_FIRE_BOMB_CHANNEL, false);
- //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0);
- //DoCast(m_creature, SPELL_TELE_TO_CENTER, true);
+ me->StopMoving();
+ DoCast(me, SPELL_FIRE_BOMB_CHANNEL, false);
+ //DoTeleportPlayer(me, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0);
+ //DoCast(me, SPELL_TELE_TO_CENTER, true);
FireWall();
SpawnBombs();
@@ -371,7 +371,7 @@ struct boss_janalaiAI : public ScriptedAI
BombSequenceTimer = 100;
//Teleport every Player into the middle
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap->IsDungeon()) return;
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -384,15 +384,15 @@ struct boss_janalaiAI : public ScriptedAI
if (!noeggs)
{
- if (100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth())
+ if (100 * me->GetHealth() < 35 * me->GetMaxHealth())
{
- DoScriptText(SAY_ALL_EGGS, m_creature);
+ DoScriptText(SAY_ALL_EGGS, me);
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
+ me->AttackStop();
+ me->GetMotionMaster()->Clear();
DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
- m_creature->StopMoving();
- DoCast(m_creature, SPELL_HATCH_ALL, false);
+ me->StopMoving();
+ DoCast(me, SPELL_HATCH_ALL, false);
HatchAllEggs(2);
noeggs = true;
}
@@ -400,9 +400,9 @@ struct boss_janalaiAI : public ScriptedAI
{
if (HatchAllEggs(0))
{
- DoScriptText(SAY_SUMMON_HATCHER, m_creature);
- m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ DoScriptText(SAY_SUMMON_HATCHER, me);
+ me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
HatcherTimer = 90000;
}
else
@@ -418,10 +418,10 @@ struct boss_janalaiAI : public ScriptedAI
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
+ me->AttackStop();
+ me->GetMotionMaster()->Clear();
DoCast(pTarget, SPELL_FLAME_BREATH, false);
- m_creature->StopMoving();
+ me->StopMoving();
isFlameBreathing = true;
}
FireBreathTimer = 8000;
@@ -443,7 +443,7 @@ struct mob_janalai_firebombAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_FIRE_BOMB_THROW)
- DoCast(m_creature, SPELL_FIRE_BOMB_DUMMY, true);
+ DoCast(me, SPELL_FIRE_BOMB_DUMMY, true);
}
void EnterCombat(Unit* who) {}
@@ -480,7 +480,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
void Reset()
{
me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- side =(m_creature->GetPositionY() < 1150);
+ side =(me->GetPositionY() < 1150);
waypoint = 0;
isHatching = false;
hasChangedSide = false;
@@ -492,7 +492,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
{
std::list<Creature*> templist;
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
{
CellPair pair(Trinity::ComputeCellPair(x, y));
@@ -500,12 +500,12 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
+ Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()));
}
//error_log("Eggs %d at %d", templist.size(), side);
@@ -539,7 +539,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
{
if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
{
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
return;
}
@@ -547,8 +547,8 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
{
if (WaitTimer)
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]);
++waypoint;
WaitTimer = 0;
}
@@ -571,7 +571,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
hasChangedSide = true;
}
else
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
} else WaitTimer -= diff;
}
@@ -596,12 +596,12 @@ struct mob_hatchlingAI : public ScriptedAI
void Reset()
{
BuffetTimer = 7000;
- if (m_creature->GetPositionY() > 1150)
- m_creature->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]);
+ if (me->GetPositionY() > 1150)
+ me->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]);
else
- m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]);
+ me->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
}
void EnterCombat(Unit *who) {/*DoZoneInCombat();*/}
@@ -610,7 +610,7 @@ struct mob_hatchlingAI : public ScriptedAI
{
if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
{
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
return;
}
@@ -619,7 +619,7 @@ struct mob_hatchlingAI : public ScriptedAI
if (BuffetTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET, false);
+ DoCast(me->getVictim(), SPELL_FLAMEBUFFET, false);
BuffetTimer = 10000;
} else BuffetTimer -= diff;
@@ -646,7 +646,7 @@ struct mob_eggAI : public ScriptedAI
if (spell->Id == SPELL_HATCH_EGG)
{
DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- m_creature->SetDisplayId(11686);
+ me->SetDisplayId(11686);
}
}
};
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
index 3c3cecc9fce..64d9adf8e35 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
@@ -120,15 +120,15 @@ struct boss_nalorakkAI : public ScriptedAI
{
if (MoveEvent)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
inMove = false;
waitTimer = 0;
- m_creature->SetSpeed(MOVE_RUN,2);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->SetSpeed(MOVE_RUN,2);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
}else
{
- (*m_creature).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]);
+ (*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]);
}
if (pInstance)
@@ -141,14 +141,14 @@ struct boss_nalorakkAI : public ScriptedAI
Berserk_Timer = 600000;
inBearForm = false;
- // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id
+ // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id
}
void SendAttacker(Unit *pTarget)
{
std::list<Creature*> templist;
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
{
CellPair pair(Trinity::ComputeCellPair(x, y));
@@ -156,12 +156,12 @@ struct boss_nalorakkAI : public ScriptedAI
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AllFriendlyCreaturesInGrid check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(m_creature, templist, check);
+ Trinity::AllFriendlyCreaturesInGrid check(me);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()));
}
if (!templist.size())
@@ -169,7 +169,7 @@ struct boss_nalorakkAI : public ScriptedAI
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
- if ((*i) && m_creature->IsWithinDistInMap((*i),25))
+ if ((*i) && me->IsWithinDistInMap((*i),25))
{
(*i)->SetNoCallAssistance(true);
(*i)->AI()->AttackStart(pTarget);
@@ -191,19 +191,19 @@ struct boss_nalorakkAI : public ScriptedAI
}
else
{
- if (m_creature->IsHostileTo(who))
+ if (me->IsHostileTo(who))
{
if (!inMove)
{
switch(MovePhase)
{
case 0:
- if (m_creature->IsWithinDistInMap(who, 50))
+ if (me->IsWithinDistInMap(who, 50))
{
- m_creature->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE1);
+ me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1);
- (*m_creature).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]);
+ (*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]);
MovePhase ++;
inMove = true;
@@ -211,12 +211,12 @@ struct boss_nalorakkAI : public ScriptedAI
}
break;
case 2:
- if (m_creature->IsWithinDistInMap(who, 40))
+ if (me->IsWithinDistInMap(who, 40))
{
- m_creature->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE2);
+ me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2);
- (*m_creature).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]);
+ (*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]);
MovePhase ++;
inMove = true;
@@ -224,12 +224,12 @@ struct boss_nalorakkAI : public ScriptedAI
}
break;
case 5:
- if (m_creature->IsWithinDistInMap(who, 40))
+ if (me->IsWithinDistInMap(who, 40))
{
- m_creature->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE3);
+ me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3);
- (*m_creature).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]);
+ (*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]);
MovePhase ++;
inMove = true;
@@ -237,15 +237,15 @@ struct boss_nalorakkAI : public ScriptedAI
}
break;
case 7:
- if (m_creature->IsWithinDistInMap(who, 50))
+ if (me->IsWithinDistInMap(who, 50))
{
SendAttacker(who);
- m_creature->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE4);
+ me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
MoveEvent = false;
}
@@ -261,8 +261,8 @@ struct boss_nalorakkAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
- m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
DoZoneInCombat();
}
@@ -271,8 +271,8 @@ struct boss_nalorakkAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, DONE);
- m_creature->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
+ me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_DEATH);
}
void KilledUnit(Unit* victim)
@@ -280,12 +280,12 @@ struct boss_nalorakkAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
- m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
}
@@ -306,7 +306,7 @@ struct boss_nalorakkAI : public ScriptedAI
switch(MovePhase)
{
case 2:
- m_creature->SetOrientation(3.1415*2);
+ me->SetOrientation(3.1415*2);
inMove = false;
return;
case 1:
@@ -318,11 +318,11 @@ struct boss_nalorakkAI : public ScriptedAI
inMove = true;
return;
case 5:
- m_creature->SetOrientation(3.1415*0.5);
+ me->SetOrientation(3.1415*0.5);
inMove = false;
return;
case 7:
- m_creature->SetOrientation(3.1415*0.5);
+ me->SetOrientation(3.1415*0.5);
inMove = false;
return;
}
@@ -337,8 +337,8 @@ struct boss_nalorakkAI : public ScriptedAI
if (inMove)
if (waitTimer <= diff)
{
- (*m_creature).GetMotionMaster()->MovementExpired();
- (*m_creature).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]);
+ (*me).GetMotionMaster()->MovementExpired();
+ (*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]);
waitTimer = 0;
} else waitTimer -= diff;
}
@@ -348,9 +348,9 @@ struct boss_nalorakkAI : public ScriptedAI
if (Berserk_Timer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK, true);
- m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK);
+ DoCast(me, SPELL_BERSERK, true);
+ me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
@@ -358,10 +358,10 @@ struct boss_nalorakkAI : public ScriptedAI
{
if (inBearForm)
{
- // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
- m_creature->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL);
- m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM);
+ // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
+ me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
+ me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = 15000 + rand()%5000;
BrutalSwipe_Timer = 7000 + rand()%5000;
Mangle_Timer = 10000 + rand()%5000;
@@ -370,10 +370,10 @@ struct boss_nalorakkAI : public ScriptedAI
}
else
{
- // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
- m_creature->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR);
- DoCast(m_creature, SPELL_BEARFORM, true);
+ // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
+ me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
+ DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
RendFlesh_Timer = 3000; // dur 5s
DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
@@ -386,15 +386,15 @@ struct boss_nalorakkAI : public ScriptedAI
{
if (BrutalSwipe_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BRUTALSWIPE);
+ DoCast(me->getVictim(), SPELL_BRUTALSWIPE);
BrutalSwipe_Timer = 7000 + rand()%5000;
} else BrutalSwipe_Timer -= diff;
if (Mangle_Timer <= diff)
{
- if (m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT))
+ if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT))
{
- DoCast(m_creature->getVictim(), SPELL_MANGLE);
+ DoCast(me->getVictim(), SPELL_MANGLE);
Mangle_Timer = 1000;
}
else Mangle_Timer = 10000 + rand()%5000;
@@ -402,8 +402,8 @@ struct boss_nalorakkAI : public ScriptedAI
if (Surge_Timer <= diff)
{
- m_creature->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
+ me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_YELL_SURGE);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (pTarget)
DoCast(pTarget, SPELL_SURGE);
@@ -414,19 +414,19 @@ struct boss_nalorakkAI : public ScriptedAI
{
if (LaceratingSlash_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH);
+ DoCast(me->getVictim(), SPELL_LACERATINGSLASH);
LaceratingSlash_Timer = 18000 + rand()%5000;
} else LaceratingSlash_Timer -= diff;
if (RendFlesh_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_RENDFLESH);
+ DoCast(me->getVictim(), SPELL_RENDFLESH);
RendFlesh_Timer = 5000 + rand()%5000;
} else RendFlesh_Timer -= diff;
if (DeafeningRoar_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEAFENINGROAR);
+ DoCast(me->getVictim(), SPELL_DEAFENINGROAR);
DeafeningRoar_Timer = 15000 + rand()%5000;
} else DeafeningRoar_Timer -= diff;
}
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
index 15e7c080968..b787dcc7f9b 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
@@ -140,7 +140,7 @@ static TransformStruct Transform[] =
struct boss_zuljinAI : public ScriptedAI
{
- boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
+ boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -180,7 +180,7 @@ struct boss_zuljinAI : public ScriptedAI
Phase = 0;
- health_20 = m_creature->GetMaxHealth()*0.2;
+ health_20 = me->GetMaxHealth()*0.2;
Intro_Timer = 37000;
Berserk_Timer = 600000;
@@ -205,9 +205,9 @@ struct boss_zuljinAI : public ScriptedAI
Summons.DespawnAll();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174);
- //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
- //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174);
+ //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
+ //me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
void EnterCombat(Unit *who)
@@ -217,8 +217,8 @@ struct boss_zuljinAI : public ScriptedAI
DoZoneInCombat();
- m_creature->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(me, SOUND_INTRO);
SpawnAdds();
EnterPhase(0);
}
@@ -231,12 +231,12 @@ struct boss_zuljinAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
- m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
}
}
@@ -246,11 +246,11 @@ struct boss_zuljinAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, DONE);
- m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_DEATH);
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
- if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3]))
+ if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
@@ -264,21 +264,21 @@ struct boss_zuljinAI : public ScriptedAI
void DoMeleeAttackIfReady()
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
{
if (Phase == 1 && !Overpower_Timer)
{
- uint32 health = m_creature->getVictim()->GetHealth();
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- if (m_creature->getVictim() && health == m_creature->getVictim()->GetHealth())
+ uint32 health = me->getVictim()->GetHealth();
+ me->AttackerStateUpdate(me->getVictim());
+ if (me->getVictim() && health == me->getVictim()->GetHealth())
{
- DoCast(m_creature->getVictim(), SPELL_OVERPOWER, false);
+ DoCast(me->getVictim(), SPELL_OVERPOWER, false);
Overpower_Timer = 5000;
}
- } else m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ } else me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
}
@@ -288,7 +288,7 @@ struct boss_zuljinAI : public ScriptedAI
Creature *pCreature = NULL;
for (uint8 i = 0; i < 4; ++i)
{
- pCreature = m_creature->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
+ pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
if (pCreature)
{
pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true);
@@ -306,7 +306,7 @@ struct boss_zuljinAI : public ScriptedAI
Unit* Temp = NULL;
if (SpiritGUID[i])
{
- if (Temp = Unit::GetUnit(*m_creature, SpiritGUID[i]))
+ if (Temp = Unit::GetUnit(*me, SpiritGUID[i]))
{
Temp->SetVisibility(VISIBILITY_OFF);
Temp->setDeathState(DEAD);
@@ -338,22 +338,22 @@ struct boss_zuljinAI : public ScriptedAI
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
DoResetThreat();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
- m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura);
- DoCast(m_creature, Transform[Phase].spell);
- m_creature->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, Transform[Phase].sound);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ me->RemoveAurasDueToSpell(Transform[Phase].unaura);
+ DoCast(me, Transform[Phase].spell);
+ me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, Transform[Phase].sound);
if (Phase > 0)
{
- if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1]))
+ if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
- if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1]))
- Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp
+ if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1]))
+ Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp
if (NextPhase == 2)
{
- m_creature->GetMotionMaster()->Clear();
- DoCast(m_creature, SPELL_ENERGY_STORM, true); // enemy aura
+ me->GetMotionMaster()->Clear();
+ DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura
for (uint8 i = 0; i < 4; ++i)
{
Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -369,12 +369,12 @@ struct boss_zuljinAI : public ScriptedAI
}
}
else
- m_creature->AI()->AttackStart(m_creature->getVictim());
+ me->AI()->AttackStart(me->getVictim());
if (NextPhase == 3)
{
- m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
+ me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
Summons.DespawnEntry(CREATURE_FEATHER_VORTEX);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
break;
default:
@@ -390,15 +390,15 @@ struct boss_zuljinAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->GetHealth() < health_20 * (4 - Phase))
+ if (me->GetHealth() < health_20 * (4 - Phase))
EnterPhase(Phase + 1);
}
if (Berserk_Timer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK, true);
- m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ DoCast(me, SPELL_BERSERK, true);
+ me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_BERSERK);
Berserk_Timer = 60000;
} else Berserk_Timer -= diff;
@@ -409,15 +409,15 @@ struct boss_zuljinAI : public ScriptedAI
{
if (Intro_Timer <= diff)
{
- m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_AGGRO);
Intro_Timer = 0;
} else Intro_Timer -= diff;
}
if (Whirlwind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 15000 + rand()%5000;
} else Whirlwind_Timer -= diff;
@@ -432,7 +432,7 @@ struct boss_zuljinAI : public ScriptedAI
case 1:
if (Creeping_Paralysis_Timer <= diff)
{
- DoCast(m_creature, SPELL_CREEPING_PARALYSIS);
+ DoCast(me, SPELL_CREEPING_PARALYSIS);
Creeping_Paralysis_Timer = 20000;
} else Creeping_Paralysis_Timer -= diff;
@@ -453,8 +453,8 @@ struct boss_zuljinAI : public ScriptedAI
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- TankGUID = m_creature->getVictim()->GetGUID();
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ TankGUID = me->getVictim()->GetGUID();
+ me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
@@ -465,21 +465,21 @@ struct boss_zuljinAI : public ScriptedAI
{
if (Claw_Loop_Timer <= diff)
{
- Unit *pTarget = m_creature->getVictim();
- if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*m_creature, TankGUID);
+ Unit *pTarget = me->getVictim();
+ if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID);
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{
AttackStart(pTarget);
- if (m_creature->IsWithinMeleeRange(pTarget))
+ if (me->IsWithinMeleeRange(pTarget))
{
DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 12)
{
Claw_Rage_Timer = 15000 + rand()%5000;
- m_creature->SetSpeed(MOVE_RUN, 1.2f);
- AttackStart(Unit::GetUnit(*m_creature, TankGUID));
+ me->SetSpeed(MOVE_RUN, 1.2f);
+ AttackStart(Unit::GetUnit(*me, TankGUID));
TankGUID = 0;
return;
}
@@ -502,8 +502,8 @@ struct boss_zuljinAI : public ScriptedAI
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- TankGUID = m_creature->getVictim()->GetGUID();
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ TankGUID = me->getVictim()->GetGUID();
+ me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
@@ -511,7 +511,7 @@ struct boss_zuljinAI : public ScriptedAI
}
else if (!Lynx_Rush_Timer)
{
- Unit *pTarget = m_creature->getVictim();
+ Unit *pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack())
{
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -519,15 +519,15 @@ struct boss_zuljinAI : public ScriptedAI
}
if (pTarget)
{
- if (m_creature->IsWithinMeleeRange(pTarget))
+ if (me->IsWithinMeleeRange(pTarget))
{
DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 9)
{
Lynx_Rush_Timer = 15000 + rand()%5000;
- m_creature->SetSpeed(MOVE_RUN, 1.2f);
- AttackStart(Unit::GetUnit(*m_creature, TankGUID));
+ me->SetSpeed(MOVE_RUN, 1.2f);
+ AttackStart(Unit::GetUnit(*me, TankGUID));
TankGUID = 0;
}
else
@@ -546,7 +546,7 @@ struct boss_zuljinAI : public ScriptedAI
case 4:
if (Flame_Whirl_Timer <= diff)
{
- DoCast(m_creature, SPELL_FLAME_WHIRL);
+ DoCast(me, SPELL_FLAME_WHIRL);
Flame_Whirl_Timer = 12000;
}Flame_Whirl_Timer -= diff;
@@ -560,8 +560,8 @@ struct boss_zuljinAI : public ScriptedAI
if (Flame_Breath_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->SetInFront(pTarget);
- DoCast(m_creature, SPELL_FLAME_BREATH);
+ me->SetInFront(pTarget);
+ DoCast(me, SPELL_FLAME_BREATH);
Flame_Breath_Timer = 10000;
} else Flame_Breath_Timer -= diff;
break;
@@ -597,7 +597,7 @@ struct feather_vortexAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//if the vortex reach the target, it change his target to another player
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
};
diff --git a/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp b/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp
index c87c2c9a358..7d44fe05670 100644
--- a/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp
@@ -73,7 +73,7 @@ struct npc_forest_frogAI : public ScriptedAI
if (!pInstance->GetData(TYPE_RAND_VENDOR_2))
if (rand()%10 == 1) cEntry = 24409; //Kyren
- if (cEntry) m_creature->UpdateEntry(cEntry);
+ if (cEntry) me->UpdateEntry(cEntry);
if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE);
if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE);
@@ -82,7 +82,7 @@ struct npc_forest_frogAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == ENTRY_FOREST_FROG)
+ if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG)
{
//increase or decrease chance of mojo?
if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true);
@@ -114,12 +114,12 @@ struct npc_zulaman_hostageAI : public ScriptedAI
void JustDied(Unit* who)
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
- if (pPlayer) pPlayer->SendLoot(m_creature->GetGUID(), LOOT_CORPSE);
+ if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE);
}
void UpdateAI(const uint32 diff)
{
if (IsLoot)
- DoCast(m_creature, 7, false);
+ DoCast(me, 7, false);
}
};
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp
index 87946d0cac2..334108d5d95 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp
@@ -99,13 +99,13 @@ struct boss_arlokkAI : public ScriptedAI
MarkedTargetGUID = 0;
- m_creature->SetDisplayId(MODEL_ID_NORMAL);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(MODEL_ID_NORMAL);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustReachedHome()
@@ -114,15 +114,15 @@ struct boss_arlokkAI : public ScriptedAI
m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED);
//we should be summoned, so despawn
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
- m_creature->SetDisplayId(MODEL_ID_NORMAL);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(MODEL_ID_NORMAL);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (m_pInstance)
m_pInstance->SetData(TYPE_ARLOKK, DONE);
@@ -130,16 +130,16 @@ struct boss_arlokkAI : public ScriptedAI
void DoSummonPhanters()
{
- if (Unit *pMarkedTarget = Unit::GetUnit(*m_creature, MarkedTargetGUID))
- DoScriptText(SAY_FEAST_PANTHER, m_creature, pMarkedTarget);
+ if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
+ DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget);
- m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
}
void JustSummoned(Creature* pSummoned)
{
- if (Unit *pMarkedTarget = Unit::GetUnit(*m_creature, MarkedTargetGUID))
+ if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
pSummoned->AI()->AttackStart(pMarkedTarget);
++m_uiSummonCount;
@@ -154,7 +154,7 @@ struct boss_arlokkAI : public ScriptedAI
{
if (m_uiShadowWordPain_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN);
+ DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
m_uiShadowWordPain_Timer = 15000;
}
else
@@ -182,7 +182,7 @@ struct boss_arlokkAI : public ScriptedAI
//Cleave_Timer
if (m_uiCleave_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleave_Timer = 16000;
}
else
@@ -191,9 +191,9 @@ struct boss_arlokkAI : public ScriptedAI
//Gouge_Timer
if (m_uiGouge_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ DoCast(me->getVictim(), SPELL_GOUGE);
- DoModifyThreatPercent(m_creature->getVictim(),-80);
+ DoModifyThreatPercent(me->getVictim(),-80);
m_uiGouge_Timer = 17000+rand()%10000;
}
@@ -215,10 +215,10 @@ struct boss_arlokkAI : public ScriptedAI
if (m_uiVanish_Timer <= uiDiff)
{
//Invisble Model
- m_creature->SetDisplayId(MODEL_ID_BLANK);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(MODEL_ID_BLANK);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->AttackStop();
+ me->AttackStop();
DoResetThreat();
m_bIsVanished = true;
@@ -234,13 +234,13 @@ struct boss_arlokkAI : public ScriptedAI
if (m_uiVisible_Timer <= uiDiff)
{
//The Panther Model
- m_creature->SetDisplayId(MODEL_ID_PANTHER);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(MODEL_ID_PANTHER);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
+ me->UpdateDamagePhysical(BASE_ATTACK);
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
AttackStart(pTarget);
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp
index cd3a6b47560..1e6827d3d3c 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp
@@ -54,14 +54,14 @@ struct boss_gahzrankaAI : public ScriptedAI
//Frostbreath_Timer
if (Frostbreath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBREATH);
+ DoCast(me->getVictim(), SPELL_FROSTBREATH);
Frostbreath_Timer = 7000 + rand()%4000;
} else Frostbreath_Timer -= diff;
//MassiveGeyser_Timer
if (MassiveGeyser_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MASSIVEGEYSER);
+ DoCast(me->getVictim(), SPELL_MASSIVEGEYSER);
DoResetThreat();
MassiveGeyser_Timer = 22000 + rand()%10000;
@@ -70,7 +70,7 @@ struct boss_gahzrankaAI : public ScriptedAI
//Slam_Timer
if (Slam_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SLAM);
+ DoCast(me->getVictim(), SPELL_SLAM);
Slam_Timer = 12000 + rand()%8000;
} else Slam_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp
index e53e05d4682..a2694f5f354 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp
@@ -54,13 +54,13 @@ struct boss_grilekAI : public ScriptedAI
if (Avartar_Timer <= diff)
{
- DoCast(m_creature, SPELL_AVARTAR);
+ DoCast(me, SPELL_AVARTAR);
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-50);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
@@ -70,7 +70,7 @@ struct boss_grilekAI : public ScriptedAI
//GroundTremor_Timer
if (GroundTremor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR);
+ DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
GroundTremor_Timer = 12000 + rand()%4000;
} else GroundTremor_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
index 134a081b95b..b1def2d619e 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
@@ -96,7 +96,7 @@ struct boss_hakkarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -107,14 +107,14 @@ struct boss_hakkarAI : public ScriptedAI
//BloodSiphon_Timer
if (BloodSiphon_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLOODSIPHON);
+ DoCast(me->getVictim(), SPELL_BLOODSIPHON);
BloodSiphon_Timer = 90000;
} else BloodSiphon_Timer -= diff;
//CorruptedBlood_Timer
if (CorruptedBlood_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CORRUPTEDBLOOD);
+ DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD);
CorruptedBlood_Timer = 30000 + rand()%15000;
} else CorruptedBlood_Timer -= diff;
@@ -138,7 +138,7 @@ struct boss_hakkarAI : public ScriptedAI
if (!Enraged && Enrage_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Enrage_Timer -= diff;
@@ -151,7 +151,7 @@ struct boss_hakkarAI : public ScriptedAI
{
if (AspectOfJeklik_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_JEKLIK);
+ DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK);
AspectOfJeklik_Timer = 10000 + rand()%4000;
} else AspectOfJeklik_Timer -= diff;
}
@@ -168,7 +168,7 @@ struct boss_hakkarAI : public ScriptedAI
{
if (AspectOfVenoxis_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_VENOXIS);
+ DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS);
AspectOfVenoxis_Timer = 8000;
} else AspectOfVenoxis_Timer -= diff;
}
@@ -185,7 +185,7 @@ struct boss_hakkarAI : public ScriptedAI
{
if (AspectOfMarli_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_MARLI);
+ DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
AspectOfMarli_Timer = 10000;
} else AspectOfMarli_Timer -= diff;
@@ -203,7 +203,7 @@ struct boss_hakkarAI : public ScriptedAI
{
if (AspectOfThekal_Timer <= diff)
{
- DoCast(m_creature, SPELL_ASPECT_OF_THEKAL);
+ DoCast(me, SPELL_ASPECT_OF_THEKAL);
AspectOfThekal_Timer = 15000;
} else AspectOfThekal_Timer -= diff;
}
@@ -220,7 +220,7 @@ struct boss_hakkarAI : public ScriptedAI
{
if (AspectOfArlokk_Timer <= diff)
{
- DoCast(m_creature, SPELL_ASPECT_OF_ARLOKK);
+ DoCast(me, SPELL_ASPECT_OF_ARLOKK);
DoResetThreat();
AspectOfArlokk_Timer = 10000 + rand()%5000;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp
index e1e0c0788a1..6107607f8f0 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp
@@ -54,14 +54,14 @@ struct boss_hazzarahAI : public ScriptedAI
//ManaBurn_Timer
if (ManaBurn_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MANABURN);
+ DoCast(me->getVictim(), SPELL_MANABURN);
ManaBurn_Timer = 8000 + rand()%8000;
} else ManaBurn_Timer -= diff;
//Sleep_Timer
if (Sleep_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SLEEP);
+ DoCast(me->getVictim(), SPELL_SLEEP);
Sleep_Timer = 12000 + rand()%8000;
} else Sleep_Timer -= diff;
@@ -77,7 +77,7 @@ struct boss_hazzarahAI : public ScriptedAI
if (!pTarget)
return;
- Creature *Illusion = m_creature->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
+ Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
if (Illusion)
Illusion->AI()->AttackStart(pTarget);
}
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp
index 3a0302efebd..25d0679081f 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp
@@ -79,13 +79,13 @@ struct boss_jeklikAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_BAT_FORM);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_BAT_FORM);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_JEKLIK, DONE);
@@ -96,9 +96,9 @@ struct boss_jeklikAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->getVictim() && m_creature->isAlive())
+ if (me->getVictim() && me->isAlive())
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
+ if ((me->GetHealth()*100 / me->GetMaxHealth() > 50))
{
if (Charge_Timer <= diff)
{
@@ -113,13 +113,13 @@ struct boss_jeklikAI : public ScriptedAI
if (SonicBurst_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SONICBURST);
+ DoCast(me->getVictim(), SPELL_SONICBURST);
SonicBurst_Timer = 8000 + rand()%5000;
} else SonicBurst_Timer -= diff;
if (Screech_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SCREECH);
+ DoCast(me->getVictim(), SPELL_SCREECH);
Screech_Timer = 18000 + rand()%8000;
} else Screech_Timer -= diff;
@@ -128,21 +128,21 @@ struct boss_jeklikAI : public ScriptedAI
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Bat = NULL;
- Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
- Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
- Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
- Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
- Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
- Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
SpawnBats_Timer = 60000;
@@ -163,21 +163,21 @@ struct boss_jeklikAI : public ScriptedAI
if (MindFlay_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ DoCast(me->getVictim(), SPELL_MIND_FLAY);
MindFlay_Timer = 16000;
}MindFlay_Timer -=diff;
if (ChainMindFlay_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_CHAIN_MIND_FLAY);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY);
ChainMindFlay_Timer = 15000 + rand()%15000;
}ChainMindFlay_Timer -=diff;
if (GreaterHeal_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_GREATERHEAL);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_GREATERHEAL);
GreaterHeal_Timer = 25000 + rand()%10000;
}GreaterHeal_Timer -=diff;
@@ -187,7 +187,7 @@ struct boss_jeklikAI : public ScriptedAI
if (!pTarget)
return;
- Creature* FlyingBat = m_creature->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (FlyingBat)
FlyingBat->AI()->AttackStart(pTarget);
@@ -196,7 +196,7 @@ struct boss_jeklikAI : public ScriptedAI
}
else
{
- m_creature->SetDisplayId(15219);
+ me->SetDisplayId(15219);
DoResetThreat();
PhaseTwo = true;
}
@@ -225,7 +225,7 @@ struct mob_batriderAI : public ScriptedAI
Bomb_Timer = 2000;
Check_Timer = 1000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who) {}
@@ -252,8 +252,8 @@ struct mob_batriderAI : public ScriptedAI
{
if (m_pInstance->GetData(TYPE_JEKLIK) == DONE)
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
return;
}
}
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp
index 5673fbfc4a8..77475ae3d41 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp
@@ -60,7 +60,7 @@ struct boss_jindoAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -71,25 +71,25 @@ struct boss_jindoAI : public ScriptedAI
//BrainWashTotem_Timer
if (BrainWashTotem_Timer <= diff)
{
- DoCast(m_creature, SPELL_BRAINWASHTOTEM);
+ DoCast(me, SPELL_BRAINWASHTOTEM);
BrainWashTotem_Timer = 18000 + rand()%8000;
} else BrainWashTotem_Timer -= diff;
//HealingWard_Timer
if (HealingWard_Timer <= diff)
{
- //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD);
- m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
+ //DoCast(me, SPELL_POWERFULLHEALINGWARD);
+ me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
HealingWard_Timer = 14000 + rand()%6000;
} else HealingWard_Timer -= diff;
//Hex_Timer
if (Hex_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HEX);
+ DoCast(me->getVictim(), SPELL_HEX);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-80);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-80);
Hex_Timer = 12000 + rand()%8000;
} else Hex_Timer -= diff;
@@ -101,7 +101,7 @@ struct boss_jindoAI : public ScriptedAI
{
DoCast(pTarget, SPELL_DELUSIONSOFJINDO);
- Creature *Shade = m_creature->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Shade)
Shade->AI()->AttackStart(pTarget);
}
@@ -118,35 +118,35 @@ struct boss_jindoAI : public ScriptedAI
{
DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745);
- if (DoGetThreat(m_creature->getVictim()))
+ if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(pTarget,-100);
Creature *Skeletons;
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
- Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
}
@@ -186,7 +186,7 @@ struct mob_healing_wardAI : public ScriptedAI
{
if (pInstance)
{
- Unit *pJindo = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JINDO));
+ Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO));
if (pJindo)
DoCast(pJindo, SPELL_HEAL);
}
@@ -207,7 +207,7 @@ struct mob_shade_of_jindoAI : public ScriptedAI
void Reset()
{
ShadowShock_Timer = 1000;
- DoCast(m_creature, SPELL_INVISIBLE, true);
+ DoCast(me, SPELL_INVISIBLE, true);
}
void EnterCombat(Unit *who){}
@@ -218,7 +218,7 @@ struct mob_shade_of_jindoAI : public ScriptedAI
//ShadowShock_Timer
if (ShadowShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
+ DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
ShadowShock_Timer = 2000;
} else ShadowShock_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp
index 56ebe4a5c4b..4d982147557 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp
@@ -92,7 +92,7 @@ struct boss_mandokirAI : public ScriptedAI
RaptorDead = false;
CombatStart = false;
- DoCast(m_creature, 23243);
+ DoCast(me, 23243);
}
void KilledUnit(Unit* victim)
@@ -103,21 +103,21 @@ struct boss_mandokirAI : public ScriptedAI
if (KillCount == 3)
{
- DoScriptText(SAY_DING_KILL, m_creature);
+ DoScriptText(SAY_DING_KILL, me);
if (m_pInstance)
{
uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO);
if (JindoGUID)
{
- if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID))
+ if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID))
{
if (jTemp->isAlive())
DoScriptText(SAY_GRATS_JINDO, jTemp);
}
}
}
- DoCast(m_creature, SPELL_LEVEL_UP, true);
+ DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
@@ -125,7 +125,7 @@ struct boss_mandokirAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -133,15 +133,15 @@ struct boss_mandokirAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->getVictim() && m_creature->isAlive())
+ if (me->getVictim() && me->isAlive())
{
if (!CombatStart)
{
//At combat Start Mandokir is mounted so we must unmount it first
- m_creature->Unmount();
+ me->Unmount();
//And summon his raptor
- m_creature->SummonCreature(14988, m_creature->getVictim()->GetPositionX(), m_creature->getVictim()->GetPositionY(), m_creature->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
+ me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
CombatStart = true;
}
@@ -149,7 +149,7 @@ struct boss_mandokirAI : public ScriptedAI
{
if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him
{
- Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget);
+ Unit* pUnit = Unit::GetUnit(*me, WatchTarget);
if (pUnit && (
targetX != pUnit->GetPositionX() ||
@@ -157,14 +157,14 @@ struct boss_mandokirAI : public ScriptedAI
targetZ != pUnit->GetPositionZ() ||
pUnit->isInCombat()))
{
- if (m_creature->IsWithinMeleeRange(pUnit))
+ if (me->IsWithinMeleeRange(pUnit))
{
DoCast(pUnit, 24316);
}
else
{
DoCast(pUnit, SPELL_CHARGE);
- //m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
+ //me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
AttackStart(pUnit);
}
}
@@ -177,7 +177,7 @@ struct boss_mandokirAI : public ScriptedAI
{
if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- DoScriptText(SAY_WATCH, m_creature, p);
+ DoScriptText(SAY_WATCH, me, p);
DoCast(p, SPELL_WATCH);
WatchTarget = p->GetGUID();
someWatched = true;
@@ -187,7 +187,7 @@ struct boss_mandokirAI : public ScriptedAI
if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
{
- Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget);
+ Unit* pUnit = Unit::GetUnit(*me, WatchTarget);
if (pUnit)
{
targetX = pUnit->GetPositionX();
@@ -202,14 +202,14 @@ struct boss_mandokirAI : public ScriptedAI
//Cleave
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Whirlwind
if (Whirlwind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 18000;
} else Whirlwind_Timer -= diff;
@@ -218,26 +218,26 @@ struct boss_mandokirAI : public ScriptedAI
{
TargetInRange = 0;
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (; i != me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid());
- if (pUnit && m_creature->IsWithinMeleeRange(pUnit))
+ Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid());
+ if (pUnit && me->IsWithinMeleeRange(pUnit))
++TargetInRange;
}
if (TargetInRange > 3)
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 4000;
} else Fear_Timer -=diff;
//Mortal Strike if target below 50% hp
- if (m_creature->getVictim() && m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5)
+ if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5)
{
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
}
@@ -251,7 +251,7 @@ struct boss_mandokirAI : public ScriptedAI
{
if (!RaptorDead)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
RaptorDead = true;
}
}
@@ -298,7 +298,7 @@ struct mob_ohganAI : public ScriptedAI
//SunderArmor_Timer
if (SunderArmor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR);
+ DoCast(me->getVictim(), SPELL_SUNDERARMOR);
SunderArmor_Timer = 10000 + rand()%5000;
} else SunderArmor_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp
index 7be13a76c45..608bc028b2d 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp
@@ -74,12 +74,12 @@ struct boss_marliAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_MARLI, DONE);
}
@@ -89,23 +89,23 @@ struct boss_marliAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->getVictim() && m_creature->isAlive())
+ if (me->getVictim() && me->isAlive())
{
if (PoisonVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISONVOLLEY);
+ DoCast(me->getVictim(), SPELL_POISONVOLLEY);
PoisonVolley_Timer = 10000 + rand()%10000;
} else PoisonVolley_Timer -= diff;
if (!PhaseTwo && Aspect_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_MARLI);
+ DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
Aspect_Timer = 13000 + rand()%5000;
} else Aspect_Timer -= diff;
if (!Spawned && SpawnStartSpiders_Timer <= diff)
{
- DoScriptText(SAY_SPIDER_SPAWN, m_creature);
+ DoScriptText(SAY_SPIDER_SPAWN, me);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
@@ -113,16 +113,16 @@ struct boss_marliAI : public ScriptedAI
Creature *Spider = NULL;
- Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
- Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
- Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
- Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
@@ -135,7 +135,7 @@ struct boss_marliAI : public ScriptedAI
if (!pTarget)
return;
- Creature *Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
SpawnSpider_Timer = 12000 + rand()%5000;
@@ -143,16 +143,16 @@ struct boss_marliAI : public ScriptedAI
if (!PhaseTwo && Transform_Timer <= diff)
{
- DoScriptText(SAY_TRANSFORM, m_creature);
- DoCast(m_creature, SPELL_SPIDER_FORM);
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
- DoCast(m_creature->getVictim(), SPELL_ENVOLWINGWEB);
+ DoScriptText(SAY_TRANSFORM, me);
+ DoCast(me, SPELL_SPIDER_FORM);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
+ me->UpdateDamagePhysical(BASE_ATTACK);
+ DoCast(me->getVictim(), SPELL_ENVOLWINGWEB);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-100);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-100);
PhaseTwo = true;
Transform_Timer = urand(35000,60000);
@@ -174,8 +174,8 @@ struct boss_marliAI : public ScriptedAI
if (pTarget)
{
DoCast(pTarget, SPELL_CHARGE);
- //m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
- //m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
+ //me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
+ //me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
AttackStart(pTarget);
}
@@ -184,11 +184,11 @@ struct boss_marliAI : public ScriptedAI
if (TransformBack_Timer <= diff)
{
- m_creature->SetDisplayId(15220);
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ me->SetDisplayId(15220);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
+ me->UpdateDamagePhysical(BASE_ATTACK);
PhaseTwo = false;
TransformBack_Timer = urand(25000,40000);
@@ -226,7 +226,7 @@ struct mob_spawn_of_marliAI : public ScriptedAI
//LevelUp_Timer
if (LevelUp_Timer <= diff)
{
- DoCast(m_creature, SPELL_LEVELUP);
+ DoCast(me, SPELL_LEVELUP);
LevelUp_Timer = 3000;
} else LevelUp_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp
index 1bc15936035..706d751e881 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp
@@ -66,12 +66,12 @@ struct boss_renatakiAI : public ScriptedAI
//Invisible_Timer
if (Invisible_Timer <= diff)
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- m_creature->SetDisplayId(11686);
+ me->SetDisplayId(11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = true;
Invisible_Timer = 15000 + rand()%15000;
@@ -98,12 +98,12 @@ struct boss_renatakiAI : public ScriptedAI
{
if (Visible_Timer <= diff)
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->SetDisplayId(15268);
+ me->SetDisplayId(15268);
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = false;
Visible_Timer = 4000;
@@ -117,8 +117,8 @@ struct boss_renatakiAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-50);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
@@ -129,7 +129,7 @@ struct boss_renatakiAI : public ScriptedAI
if (!Invisible)
if (ThousandBlades_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THOUSANDBLADES);
+ DoCast(me->getVictim(), SPELL_THOUSANDBLADES);
ThousandBlades_Timer = 7000 + rand()%5000;
} else ThousandBlades_Timer -= diff;
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp
index 85a03475569..0fe6e2570ee 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp
@@ -91,12 +91,12 @@ struct boss_thekalAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_THEKAL, DONE);
}
@@ -120,7 +120,7 @@ struct boss_thekalAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL)
{
//Resurrect LorKhan
- if (Unit *pLorKhan = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_LORKHAN)))
+ if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN)))
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->setFaction(14);
@@ -134,7 +134,7 @@ struct boss_thekalAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL)
{
//Resurrect Zath
- Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH));
+ Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH));
if (pZath)
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
@@ -152,21 +152,21 @@ struct boss_thekalAI : public ScriptedAI
if (!PhaseTwo && MortalCleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALCLEAVE);
+ DoCast(me->getVictim(), SPELL_MORTALCLEAVE);
MortalCleave_Timer = 15000 + rand()%5000;
} else MortalCleave_Timer -= diff;
if (!PhaseTwo && Silence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 20000 + rand()%5000;
} else Silence_Timer -= diff;
- if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ if (!PhaseTwo && !WasDead && me->GetHealth() <= me->GetMaxHealth() * 0.05)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
- m_creature->AttackStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
+ me->AttackStop();
if (m_pInstance)
m_pInstance->SetData(TYPE_THEKAL, SPECIAL);
@@ -179,21 +179,21 @@ struct boss_thekalAI : public ScriptedAI
{
if (Resurrect_Timer <= diff)
{
- DoCast(m_creature, SPELL_TIGER_FORM);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0));
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40)));
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ DoCast(me, SPELL_TIGER_FORM);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetHealth(int(me->GetMaxHealth()*1.0));
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40)));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40)));
+ me->UpdateDamagePhysical(BASE_ATTACK);
DoResetThreat();
PhaseTwo = true;
} else Resurrect_Timer -= diff;
}
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead)
+ if ((me->GetHealth()*100 / me->GetMaxHealth() == 100) && WasDead)
{
WasDead = false;
}
@@ -214,25 +214,25 @@ struct boss_thekalAI : public ScriptedAI
if (Frenzy_Timer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
Frenzy_Timer = 30000;
} else Frenzy_Timer -= diff;
if (ForcePunch_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
ForcePunch_Timer = 16000 + rand()%5000;
} else ForcePunch_Timer -= diff;
if (SummonTigers_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUMMONTIGERS);
+ DoCast(me->getVictim(), SPELL_SUMMONTIGERS);
SummonTigers_Timer = 10000 + rand()%4000;
} else SummonTigers_Timer -= diff;
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged)
+ if ((me->GetHealth()*100 / me->GetMaxHealth() < 11) && !Enraged)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
}
@@ -273,8 +273,8 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
if (m_pInstance)
m_pInstance->SetData(TYPE_LORKHAN, NOT_STARTED);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who)
@@ -289,14 +289,14 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
//Shield_Timer
if (Shield_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHIELD);
+ DoCast(me, SPELL_SHIELD);
Shield_Timer = 61000;
} else Shield_Timer -= diff;
//BloodLust_Timer
if (BloodLust_Timer <= diff)
{
- DoCast(m_creature, SPELL_BLOODLUST);
+ DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000+rand()%8000;
} else BloodLust_Timer -= diff;
@@ -305,8 +305,8 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
{
if (m_pInstance)
{
- Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL));
- Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH));
+ Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL));
+ Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH));
if (!pThekal || !pZath)
return;
@@ -314,11 +314,11 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
- if (m_creature->IsWithinMeleeRange(pThekal))
+ if (me->IsWithinMeleeRange(pThekal))
DoCast(pThekal, SPELL_GREATERHEAL);
break;
case 1:
- if (m_creature->IsWithinMeleeRange(pZath))
+ if (me->IsWithinMeleeRange(pZath))
DoCast(pZath, SPELL_GREATERHEAL);
break;
}
@@ -330,7 +330,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
//Disarm_Timer
if (Disarm_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DISARM);
+ DoCast(me->getVictim(), SPELL_DISARM);
Disarm_Timer = 15000+rand()%10000;
} else Disarm_Timer -= diff;
@@ -342,7 +342,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL)
{
//Resurrect Thekal
- if (Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL)))
+ if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL)))
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -354,7 +354,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL)
{
//Resurrect Zath
- if (Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH)))
+ if (Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)))
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -367,12 +367,12 @@ struct mob_zealot_lorkhanAI : public ScriptedAI
Check_Timer = 5000;
} else Check_Timer -= diff;
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ if (me->GetHealth() <= me->GetMaxHealth() * 0.05)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
- m_creature->setFaction(35);
- m_creature->AttackStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
+ me->setFaction(35);
+ me->AttackStop();
if (m_pInstance)
m_pInstance->SetData(TYPE_LORKHAN, SPECIAL);
@@ -417,8 +417,8 @@ struct mob_zealot_zathAI : public ScriptedAI
if (m_pInstance)
m_pInstance->SetData(TYPE_ZATH, NOT_STARTED);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who)
@@ -433,24 +433,24 @@ struct mob_zealot_zathAI : public ScriptedAI
//SweepingStrikes_Timer
if (SweepingStrikes_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SWEEPINGSTRIKES);
+ DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES);
SweepingStrikes_Timer = 22000+rand()%4000;
} else SweepingStrikes_Timer -= diff;
//SinisterStrike_Timer
if (SinisterStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SINISTERSTRIKE);
+ DoCast(me->getVictim(), SPELL_SINISTERSTRIKE);
SinisterStrike_Timer = 8000+rand()%8000;
} else SinisterStrike_Timer -= diff;
//Gouge_Timer
if (Gouge_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ DoCast(me->getVictim(), SPELL_GOUGE);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-100);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-100);
Gouge_Timer = 17000+rand()%10000;
} else Gouge_Timer -= diff;
@@ -458,14 +458,14 @@ struct mob_zealot_zathAI : public ScriptedAI
//Kick_Timer
if (Kick_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KICK);
+ DoCast(me->getVictim(), SPELL_KICK);
Kick_Timer = 15000+rand()%10000;
} else Kick_Timer -= diff;
//Blind_Timer
if (Blind_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLIND);
+ DoCast(me->getVictim(), SPELL_BLIND);
Blind_Timer = 10000+rand()%10000;
} else Blind_Timer -= diff;
@@ -477,7 +477,7 @@ struct mob_zealot_zathAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL)
{
//Resurrect LorKhan
- if (Unit *pLorKhan = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_LORKHAN)))
+ if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN)))
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -489,7 +489,7 @@ struct mob_zealot_zathAI : public ScriptedAI
if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL)
{
//Resurrect Thekal
- if (Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL)))
+ if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL)))
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -502,12 +502,12 @@ struct mob_zealot_zathAI : public ScriptedAI
Check_Timer = 5000;
} else Check_Timer -= diff;
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ if (me->GetHealth() <= me->GetMaxHealth() * 0.05)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
- m_creature->setFaction(35);
- m_creature->AttackStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
+ me->setFaction(35);
+ me->AttackStop();
if (m_pInstance)
m_pInstance->SetData(TYPE_ZATH, SPECIAL);
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp
index bcfa15d97af..e1778a107f2 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp
@@ -79,7 +79,7 @@ struct boss_venoxisAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_VENOXIS, DONE);
}
@@ -89,23 +89,23 @@ struct boss_venoxisAI : public ScriptedAI
if (!UpdateVictim())
return;
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
+ if ((me->GetHealth()*100 / me->GetMaxHealth() > 50))
{
if (Dispell_Timer <= diff)
{
- DoCast(m_creature, SPELL_DISPELL);
+ DoCast(me, SPELL_DISPELL);
Dispell_Timer = 15000 + rand()%15000;
} else Dispell_Timer -= diff;
if (Renew_Timer <= diff)
{
- DoCast(m_creature, SPELL_RENEW);
+ DoCast(me, SPELL_RENEW);
Renew_Timer = 20000 + rand()%10000;
} else Renew_Timer -= diff;
if (HolyWrath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HOLY_WRATH);
+ DoCast(me->getVictim(), SPELL_HOLY_WRATH);
HolyWrath_Timer = 15000 + rand()%10000;
} else HolyWrath_Timer -= diff;
@@ -115,13 +115,13 @@ struct boss_venoxisAI : public ScriptedAI
for (uint8 i = 0; i < 10; ++i)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i))
- if (m_creature->IsWithinMeleeRange(pTarget))
+ if (me->IsWithinMeleeRange(pTarget))
++TargetInRange;
}
if (TargetInRange > 1)
{
- DoCast(m_creature->getVictim(), SPELL_HOLY_NOVA);
+ DoCast(me->getVictim(), SPELL_HOLY_NOVA);
HolyNova_Timer = 1000;
}
else
@@ -143,21 +143,21 @@ struct boss_venoxisAI : public ScriptedAI
{
if (!PhaseTwo)
{
- DoScriptText(SAY_TRANSFORM, m_creature);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_SNAKE_FORM);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25)));
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
+ DoScriptText(SAY_TRANSFORM, me);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_SNAKE_FORM);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
+ const CreatureInfo *cinfo = me->GetCreatureInfo();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25)));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25)));
+ me->UpdateDamagePhysical(BASE_ATTACK);
DoResetThreat();
PhaseTwo = true;
}
if (PhaseTwo && PoisonCloud_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD);
+ DoCast(me->getVictim(), SPELL_POISON_CLOUD);
PoisonCloud_Timer = 15000;
}PoisonCloud_Timer -=diff;
@@ -169,12 +169,12 @@ struct boss_venoxisAI : public ScriptedAI
VenomSpit_Timer = 15000 + rand()%5000;
} else VenomSpit_Timer -= diff;
- if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11))
+ if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11))
{
if (!InBerserk)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_BERSERK);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_BERSERK);
InBerserk = true;
}
}
diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp
index c9fc61394b5..ee4dda504b9 100644
--- a/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp
+++ b/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp
@@ -52,7 +52,7 @@ struct boss_wushoolayAI : public ScriptedAI
//LightningCloud_Timer
if (LightningCloud_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LIGHTNINGCLOUD);
+ DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD);
LightningCloud_Timer = 15000 + rand()%5000;
} else LightningCloud_Timer -= diff;
diff --git a/src/scripts/examples/example_creature.cpp b/src/scripts/examples/example_creature.cpp
index 7a1db72e57e..b24dd7bdf1b 100644
--- a/src/scripts/examples/example_creature.cpp
+++ b/src/scripts/examples/example_creature.cpp
@@ -105,7 +105,7 @@ struct example_creatureAI : public ScriptedAI
m_uiSpell3Timer = 19000; // 19 seconds
m_uiBeserkTimer = 120000; // 2 minutes
- m_creature->RestoreFaction();
+ me->RestoreFaction();
}
//*** HANDLED FUNCTION ***
@@ -113,7 +113,7 @@ struct example_creatureAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
//Say some stuff
- DoScriptText(SAY_AGGRO, m_creature, pWho);
+ DoScriptText(SAY_AGGRO, me, pWho);
}
//*** HANDLED FUNCTION ***
@@ -128,22 +128,22 @@ struct example_creatureAI : public ScriptedAI
// Called when going out of combat. Reset is called just after.
void EnterEvadeMode()
{
- DoScriptText(SAY_EVADE, m_creature);
+ DoScriptText(SAY_EVADE, me);
}
//*** HANDLED FUNCTION ***
//Our Receive emote function
void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
{
- m_creature->HandleEmoteCommand(uiTextEmote);
+ me->HandleEmoteCommand(uiTextEmote);
switch(uiTextEmote)
{
case TEXTEMOTE_DANCE:
- DoScriptText(SAY_DANCE, m_creature);
+ DoScriptText(SAY_DANCE, me);
break;
case TEXTEMOTE_SALUTE:
- DoScriptText(SAY_SALUTE, m_creature);
+ DoScriptText(SAY_SALUTE, me);
break;
}
}
@@ -153,13 +153,13 @@ struct example_creatureAI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
//Out of combat timers
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
//Random Say timer
if (m_uiSayTimer <= uiDiff)
{
//Random switch between 5 outcomes
- DoScriptText(RAND(SAY_RANDOM_0,SAY_RANDOM_1,SAY_RANDOM_2,SAY_RANDOM_3,SAY_RANDOM_4), m_creature);
+ DoScriptText(RAND(SAY_RANDOM_0,SAY_RANDOM_1,SAY_RANDOM_2,SAY_RANDOM_3,SAY_RANDOM_4), me);
m_uiSayTimer = 45000; //Say something agian in 45 seconds
}
@@ -169,7 +169,7 @@ struct example_creatureAI : public ScriptedAI
//Rebuff timer
if (m_uiRebuffTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_BUFF);
+ DoCast(me, SPELL_BUFF);
m_uiRebuffTimer = 900000; //Rebuff agian in 15 minutes
}
else
@@ -185,9 +185,9 @@ struct example_creatureAI : public ScriptedAI
{
//Cast spell one on our current target.
if (rand()%50 > 10)
- DoCast(m_creature->getVictim(), SPELL_ONE_ALT);
- else if (m_creature->IsWithinDist(m_creature->getVictim(), 25.0f))
- DoCast(m_creature->getVictim(), SPELL_ONE);
+ DoCast(me->getVictim(), SPELL_ONE_ALT);
+ else if (me->IsWithinDist(me->getVictim(), 25.0f))
+ DoCast(me->getVictim(), SPELL_ONE);
m_uiSpell1Timer = 5000;
}
@@ -198,7 +198,7 @@ struct example_creatureAI : public ScriptedAI
if (m_uiSpell2Timer <= uiDiff)
{
//Cast spell two on our current target.
- DoCast(m_creature->getVictim(), SPELL_TWO);
+ DoCast(me->getVictim(), SPELL_TWO);
m_uiSpell2Timer = 37000;
}
else
@@ -211,7 +211,7 @@ struct example_creatureAI : public ScriptedAI
if (m_uiSpell3Timer <= uiDiff)
{
//Cast spell one on our current target.
- DoCast(m_creature->getVictim(), SPELL_THREE);
+ DoCast(me->getVictim(), SPELL_THREE);
m_uiSpell3Timer = 19000;
}
@@ -221,8 +221,8 @@ struct example_creatureAI : public ScriptedAI
if (m_uiBeserkTimer <= uiDiff)
{
//Say our line then cast uber death spell
- DoScriptText(SAY_BERSERK, m_creature, m_creature->getVictim());
- DoCast(m_creature->getVictim(), SPELL_BERSERK);
+ DoScriptText(SAY_BERSERK, me, me->getVictim());
+ DoCast(me->getVictim(), SPELL_BERSERK);
//Cast our beserk spell agian in 12 seconds if we didn't kill everyone
m_uiBeserkTimer = 12000;
@@ -236,8 +236,8 @@ struct example_creatureAI : public ScriptedAI
{
//Go to next phase
++m_uiPhase;
- DoScriptText(SAY_PHASE, m_creature);
- DoCast(m_creature, SPELL_FRENZY);
+ DoScriptText(SAY_PHASE, me);
+ DoCast(me, SPELL_FRENZY);
}
else
m_uiPhaseTimer -= uiDiff;
diff --git a/src/scripts/examples/example_escort.cpp b/src/scripts/examples/example_escort.cpp
index bf0241eaeb5..a4282d4c447 100644
--- a/src/scripts/examples/example_escort.cpp
+++ b/src/scripts/examples/example_escort.cpp
@@ -60,7 +60,7 @@ struct example_escortAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
// Pure Virtual Functions (Have to be implemented)
@@ -69,17 +69,17 @@ struct example_escortAI : public npc_escortAI
switch (uiWP)
{
case 1:
- DoScriptText(SAY_WP_1, m_creature);
+ DoScriptText(SAY_WP_1, me);
break;
case 3:
- DoScriptText(SAY_WP_2, m_creature);
- m_creature->SummonCreature(NPC_FELBOAR, m_creature->GetPositionX()+5.0f, m_creature->GetPositionY()+7.0f, m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
+ DoScriptText(SAY_WP_2, me);
+ me->SummonCreature(NPC_FELBOAR, me->GetPositionX()+5.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
break;
case 4:
if (Player* pPlayer = GetPlayerForEscort())
{
//pTmpPlayer is the target of the text
- DoScriptText(SAY_WP_3, m_creature, pPlayer);
+ DoScriptText(SAY_WP_3, me, pPlayer);
//pTmpPlayer is the source of the text
DoScriptText(SAY_WP_4, pPlayer);
}
@@ -92,10 +92,10 @@ struct example_escortAI : public npc_escortAI
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (Player* pPlayer = GetPlayerForEscort())
- DoScriptText(SAY_AGGRO1, m_creature, pPlayer);
+ DoScriptText(SAY_AGGRO1, me, pPlayer);
}
else
- DoScriptText(SAY_AGGRO2, m_creature);
+ DoScriptText(SAY_AGGRO2, me);
}
void Reset()
@@ -111,16 +111,16 @@ struct example_escortAI : public npc_escortAI
if (Player* pPlayer = GetPlayerForEscort())
{
// not a likely case, code here for the sake of example
- if (pKiller == m_creature)
+ if (pKiller == me)
{
- DoScriptText(SAY_DEATH_1, m_creature, pPlayer);
+ DoScriptText(SAY_DEATH_1, me, pPlayer);
}
else
- DoScriptText(SAY_DEATH_2, m_creature, pPlayer);
+ DoScriptText(SAY_DEATH_2, me, pPlayer);
}
}
else
- DoScriptText(SAY_DEATH_3, m_creature);
+ DoScriptText(SAY_DEATH_3, me);
}
void UpdateAI(const uint32 uiDiff)
@@ -129,12 +129,12 @@ struct example_escortAI : public npc_escortAI
npc_escortAI::UpdateAI(uiDiff);
//Combat check
- if (m_creature->getVictim())
+ if (me->getVictim())
{
if (m_uiDeathCoilTimer <= uiDiff)
{
- DoScriptText(SAY_SPELL, m_creature);
- DoCast(m_creature->getVictim(), SPELL_DEATH_COIL, false);
+ DoScriptText(SAY_SPELL, me);
+ DoCast(me->getVictim(), SPELL_DEATH_COIL, false);
m_uiDeathCoilTimer = 4000;
}
else
@@ -147,15 +147,15 @@ struct example_escortAI : public npc_escortAI
{
if (m_uiChatTimer <= uiDiff)
{
- if (m_creature->HasAura(SPELL_ELIXIR_OF_FORTITUDE, 0))
+ if (me->HasAura(SPELL_ELIXIR_OF_FORTITUDE, 0))
{
- DoScriptText(SAY_RAND_1, m_creature);
- DoCast(m_creature, SPELL_BLUE_FIREWORK, false);
+ DoScriptText(SAY_RAND_1, me);
+ DoCast(me, SPELL_BLUE_FIREWORK, false);
}
else
{
- DoScriptText(SAY_RAND_2, m_creature);
- DoCast(m_creature, SPELL_ELIXIR_OF_FORTITUDE, false);
+ DoScriptText(SAY_RAND_2, me);
+ DoCast(me, SPELL_ELIXIR_OF_FORTITUDE, false);
}
m_uiChatTimer = 12000;
diff --git a/src/scripts/kalimdor/ashenvale.cpp b/src/scripts/kalimdor/ashenvale.cpp
index 961600ba91d..07bb3bfa42f 100644
--- a/src/scripts/kalimdor/ashenvale.cpp
+++ b/src/scripts/kalimdor/ashenvale.cpp
@@ -67,25 +67,25 @@ struct npc_torekAI : public npc_escortAI
switch (i)
{
case 1:
- DoScriptText(SAY_MOVE, m_creature, pPlayer);
+ DoScriptText(SAY_MOVE, me, pPlayer);
break;
case 8:
- DoScriptText(SAY_PREPARE, m_creature, pPlayer);
+ DoScriptText(SAY_PREPARE, me, pPlayer);
break;
case 19:
//TODO: verify location and creatures amount.
- m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
- m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
- m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
+ me->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
+ me->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
+ me->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
break;
case 20:
- DoScriptText(SAY_WIN, m_creature, pPlayer);
+ DoScriptText(SAY_WIN, me, pPlayer);
Completed = true;
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, m_creature);
+ pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
- DoScriptText(SAY_END, m_creature, pPlayer);
+ DoScriptText(SAY_END, me, pPlayer);
break;
}
}
@@ -103,7 +103,7 @@ struct npc_torekAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
@@ -115,13 +115,13 @@ struct npc_torekAI : public npc_escortAI
if (Rend_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REND);
+ DoCast(me->getVictim(), SPELL_REND);
Rend_Timer = 20000;
} else Rend_Timer -= diff;
if (Thunderclap_Timer <= diff)
{
- DoCast(m_creature, SPELL_THUNDERCLAP);
+ DoCast(me, SPELL_THUNDERCLAP);
Thunderclap_Timer = 30000;
} else Thunderclap_Timer -= diff;
}
@@ -168,25 +168,25 @@ struct npc_ruul_snowhoofAI : public npc_escortAI
switch(i)
{
case 0: {
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
Cage->SetGoState(GO_STATE_ACTIVE);
break;}
case 13:
- m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
- m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
- m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
- m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
- m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
- m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 21:{
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, m_creature);
+ pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break; }
}
@@ -196,14 +196,14 @@ struct npc_ruul_snowhoofAI : public npc_escortAI
void Reset()
{
- GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20);
+ GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
Cage->SetGoState(GO_STATE_READY);
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
diff --git a/src/scripts/kalimdor/azshara.cpp b/src/scripts/kalimdor/azshara.cpp
index d9d63d90061..7ec8fea9c42 100644
--- a/src/scripts/kalimdor/azshara.cpp
+++ b/src/scripts/kalimdor/azshara.cpp
@@ -59,7 +59,7 @@ struct mobs_spitelashesAI : public ScriptedAI
(Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826))
{
spellhit=true;
- DoCast(m_creature, 29124); //become a sheep
+ DoCast(me, 29124); //become a sheep
}
}
@@ -68,7 +68,7 @@ struct mobs_spitelashesAI : public ScriptedAI
// we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons
if (spellhit && morphtimer >= 5000)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
// walk 5 seconds before summoning
@@ -77,8 +77,8 @@ struct mobs_spitelashesAI : public ScriptedAI
morphtimer+=diff;
if (morphtimer >= 5000)
{
- DoCast(m_creature, 28406); //summon copies
- DoCast(m_creature, 6924); //visual explosion
+ DoCast(me, 28406); //summon copies
+ DoCast(me, 6924); //visual explosion
}
}
if (!UpdateVictim())
@@ -282,7 +282,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (Must_Die)
if (Must_Die_Timer <= diff)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
} else Must_Die_Timer -= diff;
@@ -293,27 +293,27 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (spellEscape_Timer <= diff)
{
- DoCast(m_creature, SPELL_RIZZLE_ESCAPE, false);
+ DoCast(me, SPELL_RIZZLE_ESCAPE, false);
spellEscape_Timer = 10000;
} else spellEscape_Timer -= diff;
if (Teleport_Timer <= diff)
{
//temp solution - unit can't be teleported by core using spelleffect 5, only players
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap)
{
- pMap->CreatureRelocation(m_creature, 3706.39, -3969.15, 35.9118, 0);
- m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0);
+ pMap->CreatureRelocation(me, 3706.39, -3969.15, 35.9118, 0);
+ me->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0);
}
//begin swimming and summon depth charges
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
SendText(MSG_ESCAPE_NOTICE, pPlayer);
- DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
- m_creature->SetSpeed(MOVE_RUN, 0.85f, true);
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
+ DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
+ me->SetSpeed(MOVE_RUN, 0.85f, true);
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
Escape = true;
} else Teleport_Timer -= diff;
@@ -322,7 +322,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (ContinueWP)
{
- m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
+ me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
ContinueWP = false;
}
@@ -331,7 +331,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
{
- DoScriptText(SAY_RIZZLE_GRENADE, m_creature, pPlayer);
+ DoScriptText(SAY_RIZZLE_GRENADE, me, pPlayer);
DoCast(pPlayer, SPELL_RIZZLE_FROST_GRENADE, true);
}
Grenade_Timer = 30000;
@@ -342,17 +342,17 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!pPlayer)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
- if (m_creature->IsWithinDist(pPlayer, 10) && m_creature->GetPositionX() > pPlayer->GetPositionX() && !Reached)
+ if (me->IsWithinDist(pPlayer, 10) && me->GetPositionX() > pPlayer->GetPositionX() && !Reached)
{
- DoScriptText(SAY_RIZZLE_FINAL, m_creature);
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1);
- m_creature->setFaction(35);
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
+ DoScriptText(SAY_RIZZLE_FINAL, me);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
+ me->setFaction(35);
+ me->GetMotionMaster()->MoveIdle();
+ me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
Reached = true;
}
@@ -377,7 +377,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE)
{
PlayerGUID = who->GetGUID();
- DoScriptText(SAY_RIZZLE_START, m_creature);
+ DoScriptText(SAY_RIZZLE_START, me);
DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
return;
}
@@ -392,7 +392,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (id == 57)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -441,8 +441,8 @@ struct mob_depth_chargeAI : public ScriptedAI
void Reset()
{
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
we_must_die = false;
must_die_timer = 1000;
}
@@ -452,7 +452,7 @@ struct mob_depth_chargeAI : public ScriptedAI
if (we_must_die)
if (must_die_timer <= diff)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
} else must_die_timer -= diff;
return;
}
@@ -462,7 +462,7 @@ struct mob_depth_chargeAI : public ScriptedAI
if (!who)
return;
- if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 5))
+ if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5))
{
DoCast(who, SPELL_DEPTH_CHARGE_TRAP);
we_must_die = true;
diff --git a/src/scripts/kalimdor/azuremyst_isle.cpp b/src/scripts/kalimdor/azuremyst_isle.cpp
index c530b2eedde..b6eb7e4c774 100644
--- a/src/scripts/kalimdor/azuremyst_isle.cpp
+++ b/src/scripts/kalimdor/azuremyst_isle.cpp
@@ -78,22 +78,22 @@ struct npc_draenei_survivorAI : public ScriptedAI
CanSayHelp = true;
- DoCast(m_creature, SPELL_IRRIDATION, true);
+ DoCast(me, SPELL_IRRIDATION, true);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ me->SetHealth(int(me->GetMaxHealth()*.1));
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
}
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who)
{
- if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f))
+ if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 25.0f))
{
//Random switch between 4 texts
- DoScriptText(RAND(SAY_HELP1, SAY_HELP2, SAY_HELP3, SAY_HELP4), m_creature, who);
+ DoScriptText(RAND(SAY_HELP1, SAY_HELP2, SAY_HELP3, SAY_HELP4), me, who);
SayHelpTimer = 20000;
CanSayHelp = false;
@@ -104,10 +104,10 @@ struct npc_draenei_survivorAI : public ScriptedAI
{
if (Spell->SpellFamilyFlags[2] & 0x080000000)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_STUNNED, true);
+ DoCast(me, SPELL_STUNNED, true);
pCaster = Caster->GetGUID();
@@ -121,17 +121,17 @@ struct npc_draenei_survivorAI : public ScriptedAI
{
if (SayThanksTimer <= diff)
{
- m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION);
+ me->RemoveAurasDueToSpell(SPELL_IRRIDATION);
if (Player* pPlayer = Unit::GetPlayer(pCaster))
{
- DoScriptText(RAND(SAY_HEAL1, SAY_HEAL2, SAY_HEAL3, SAY_HEAL4), m_creature, pPlayer);
+ DoScriptText(RAND(SAY_HEAL1, SAY_HEAL2, SAY_HEAL3, SAY_HEAL4), me, pPlayer);
- pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
+ pPlayer->TalkedToCreature(me->GetEntry(),me->GetGUID());
}
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
RunAwayTimer = 10000;
SayThanksTimer = 0;
@@ -143,7 +143,7 @@ struct npc_draenei_survivorAI : public ScriptedAI
if (RunAwayTimer)
{
if (RunAwayTimer <= diff)
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
else
RunAwayTimer -= diff;
@@ -205,25 +205,25 @@ struct npc_engineer_spark_overgrindAI : public ScriptedAI
Dynamite_Timer = 8000;
Emote_Timer = 120000 + rand()%30000;
- m_creature->setFaction(NormFaction);
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
+ me->setFaction(NormFaction);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
IsTreeEvent = false;
}
void EnterCombat(Unit* who)
{
- DoScriptText(ATTACK_YELL, m_creature, who);
+ DoScriptText(ATTACK_YELL, me, who);
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat() && !IsTreeEvent)
+ if (!me->isInCombat() && !IsTreeEvent)
{
if (Emote_Timer <= diff)
{
- DoScriptText(SAY_TEXT, m_creature);
- DoScriptText(SAY_EMOTE, m_creature);
+ DoScriptText(SAY_TEXT, me);
+ DoScriptText(SAY_EMOTE, me);
Emote_Timer = 120000 + rand()%30000;
} else Emote_Timer -= diff;
}
@@ -235,7 +235,7 @@ struct npc_engineer_spark_overgrindAI : public ScriptedAI
if (Dynamite_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
+ DoCast(me->getVictim(), SPELL_DYNAMITE);
Dynamite_Timer = 8000;
} else Dynamite_Timer -= diff;
@@ -278,12 +278,12 @@ struct npc_injured_draeneiAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ me->SetHealth(int(me->GetMaxHealth()*.15));
switch (rand()%2)
{
- case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break;
- case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break;
+ case 0: me->SetStandState(UNIT_STAND_STATE_SIT); break;
+ case 1: me->SetStandState(UNIT_STAND_STATE_SLEEP); break;
}
}
@@ -335,25 +335,25 @@ struct npc_magwinAI : public npc_escortAI
switch(i)
{
case 0:
- DoScriptText(SAY_START, m_creature, pPlayer);
+ DoScriptText(SAY_START, me, pPlayer);
break;
case 17:
- DoScriptText(SAY_PROGRESS, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS, me, pPlayer);
break;
case 28:
- DoScriptText(SAY_END1, m_creature, pPlayer);
+ DoScriptText(SAY_END1, me, pPlayer);
break;
case 29:
- DoScriptText(EMOTE_HUG, m_creature, pPlayer);
- DoScriptText(SAY_END2, m_creature, pPlayer);
- pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature);
+ DoScriptText(EMOTE_HUG, me, pPlayer);
+ DoScriptText(SAY_END2, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,me);
break;
}
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature, who);
+ DoScriptText(SAY_AGGRO, me, who);
}
void Reset() { }
@@ -425,7 +425,7 @@ struct npc_geezleAI : public ScriptedAI
{
Step = 0;
EventStarted = true;
- Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
+ Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
if (Spark)
{
SparkGUID = Spark->GetGUID();
@@ -437,35 +437,35 @@ struct npc_geezleAI : public ScriptedAI
uint32 NextStep(uint32 Step)
{
- Creature* Spark = Unit::GetCreature(*m_creature, SparkGUID);
+ Creature* Spark = Unit::GetCreature(*me, SparkGUID);
switch(Step)
{
case 0:
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56);
- m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71);
+ me->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71);
return 9000; // NPCs are walking up to fire
case 1:
DespawnNagaFlag(true);
DoScriptText(EMOTE_SPARK, Spark);
return 1000;
case 2:
- DoScriptText(GEEZLE_SAY_1, m_creature, Spark);
+ DoScriptText(GEEZLE_SAY_1, me, Spark);
if (Spark)
{
- Spark->SetInFront(m_creature);
- m_creature->SetInFront(Spark);
+ Spark->SetInFront(me);
+ me->SetInFront(Spark);
}
return 5000;
case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000;
case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000;
- case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000;
+ case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000;
case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000;
case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000;
- case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000;
+ case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000;
case 9:
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]);
CompleteQuest();
@@ -474,7 +474,7 @@ struct npc_geezleAI : public ScriptedAI
if (Spark)
Spark->DisappearAndDie();
DespawnNagaFlag(false);
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
default: return 99999999;
}
}
@@ -484,9 +484,9 @@ struct npc_geezleAI : public ScriptedAI
{
float radius = 50.0f;
std::list<Player*> players;
- Trinity::AnyPlayerInObjectRangeCheck checker(m_creature, radius);
- Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(m_creature, players, checker);
- m_creature->VisitNearbyWorldObject(radius, searcher);
+ Trinity::AnyPlayerInObjectRangeCheck checker(me, radius);
+ Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
+ me->VisitNearbyWorldObject(radius, searcher);
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
@@ -501,7 +501,7 @@ struct npc_geezleAI : public ScriptedAI
void DespawnNagaFlag(bool despawn)
{
std::list<GameObject*> FlagList;
- m_creature->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 100.0f);
+ me->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 100.0f);
if (!FlagList.empty())
{
@@ -564,7 +564,7 @@ struct npc_nestlewood_owlkinAI : public ScriptedAI
if (DespawnTimer <= diff)
{
//once we are able to, despawn us
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
} else DespawnTimer -= diff;
}
@@ -637,8 +637,8 @@ struct npc_death_ravagerAI : public ScriptedAI
RendTimer = 30000;
EnragingBiteTimer = 20000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 diff)
@@ -648,14 +648,14 @@ struct npc_death_ravagerAI : public ScriptedAI
if (RendTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REND);
+ DoCast(me->getVictim(), SPELL_REND);
RendTimer = 30000;
}
else RendTimer -= diff;
if (EnragingBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENRAGING_BITE);
+ DoCast(me->getVictim(), SPELL_ENRAGING_BITE);
EnragingBiteTimer = 15000;
}
else EnragingBiteTimer -= diff;
diff --git a/src/scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp b/src/scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp
index 35452d06cf7..4c024668818 100644
--- a/src/scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp
+++ b/src/scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp
@@ -86,7 +86,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
void AttackPlayer()
{
- Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
+ Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
@@ -100,9 +100,9 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (pPlayer->isAlive())
{
- m_creature->SetInCombatWith(pPlayer);
- pPlayer->SetInCombatWith(m_creature);
- m_creature->AddThreat(pPlayer, 0.0f);
+ me->SetInCombatWith(pPlayer);
+ pPlayer->SetInCombatWith(me);
+ me->AddThreat(pPlayer, 0.0f);
}
}
}
@@ -113,13 +113,13 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (!UpdateVictim())
return;
- switch (m_creature->GetEntry())
+ switch (me->GetEntry())
{
case NPC_AKU_MAI_SNAPJAW:
{
if (uiRavageTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_RAVAGE);
+ DoCast(me->getVictim(), SPELL_RAVAGE);
uiRavageTimer = urand(9000,14000);
} else uiRavageTimer -= uiDiff;
break;
@@ -130,7 +130,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (!bFlee && HealthBelowPct(15))
{
bFlee = true;
- m_creature->DoFleeToGetAssistance();
+ me->DoFleeToGetAssistance();
}
break;
}
@@ -159,7 +159,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- if (m_creature->isSummon()) //we are not a normal spawn.
+ if (me->isSummon()) //we are not a normal spawn.
if (pInstance)
pInstance->SetData(DATA_EVENT, pInstance->GetData(DATA_EVENT) + 1);
}
@@ -181,7 +181,7 @@ struct npc_morriduneAI : public npc_escortAI
npc_morriduneAI(Creature* pCreature) : npc_escortAI(pCreature)
{
DoScriptText(SAY_MORRIDUNE_1,pCreature);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
Start(false,false,NULL);
}
@@ -191,10 +191,10 @@ struct npc_morriduneAI : public npc_escortAI
{
case 4:
SetEscortPaused(true);
- m_creature->SetOrientation(1.775791);
- m_creature->SendMovementFlagUpdate();
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoScriptText(SAY_MORRIDUNE_2,m_creature);
+ me->SetOrientation(1.775791);
+ me->SendMovementFlagUpdate();
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ DoScriptText(SAY_MORRIDUNE_2,me);
break;
}
}
diff --git a/src/scripts/kalimdor/blackfathom_depths/boss_aku_mai.cpp b/src/scripts/kalimdor/blackfathom_depths/boss_aku_mai.cpp
index ebdcf43ea82..e60bee43596 100644
--- a/src/scripts/kalimdor/blackfathom_depths/boss_aku_mai.cpp
+++ b/src/scripts/kalimdor/blackfathom_depths/boss_aku_mai.cpp
@@ -70,7 +70,7 @@ struct boss_aku_maiAI : public ScriptedAI
if (!bIsEnraged && HealthBelowPct(30))
{
- DoCast(m_creature,SPELL_FRENZIED_RAGE);
+ DoCast(me,SPELL_FRENZIED_RAGE);
bIsEnraged = true;
}
diff --git a/src/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp b/src/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
index 4578d4ba0e2..c0572b766f3 100644
--- a/src/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
+++ b/src/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
@@ -55,14 +55,14 @@ struct boss_kelrisAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(TYPE_KELRIS, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_KELRIS, DONE);
}
@@ -82,7 +82,7 @@ struct boss_kelrisAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- DoScriptText(SAY_SLEEP, m_creature);
+ DoScriptText(SAY_SLEEP, me);
DoCast(pTarget, SPELL_SLEEP);
}
uiSleepTimer = urand(15000,20000);
diff --git a/src/scripts/kalimdor/bloodmyst_isle.cpp b/src/scripts/kalimdor/bloodmyst_isle.cpp
index f0a41a1e954..35078e96196 100644
--- a/src/scripts/kalimdor/bloodmyst_isle.cpp
+++ b/src/scripts/kalimdor/bloodmyst_isle.cpp
@@ -56,7 +56,7 @@ struct mob_webbed_creatureAI : public ScriptedAI
case 0:
spawnCreatureID = 17681;
if (Killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, me->GetGUID());
break;
case 1:
case 2:
@@ -65,7 +65,7 @@ struct mob_webbed_creatureAI : public ScriptedAI
}
if (spawnCreatureID)
- m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
};
CreatureAI* GetAI_mob_webbed_creature(Creature* pCreature)
diff --git a/src/scripts/kalimdor/boss_azuregos.cpp b/src/scripts/kalimdor/boss_azuregos.cpp
index f152dbe1378..894506937ff 100644
--- a/src/scripts/kalimdor/boss_azuregos.cpp
+++ b/src/scripts/kalimdor/boss_azuregos.cpp
@@ -70,15 +70,15 @@ struct boss_azuregosAI : public ScriptedAI
if (Teleport_Timer <= diff)
{
- DoScriptText(SAY_TELEPORT, m_creature);
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ DoScriptText(SAY_TELEPORT, me);
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
+ DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, pUnit->GetOrientation());
}
}
@@ -89,21 +89,21 @@ struct boss_azuregosAI : public ScriptedAI
// //MarkOfFrost_Timer
// if (MarkOfFrost_Timer <= diff)
// {
- // DoCast(m_creature->getVictim(), SPELL_MARKOFFROST);
+ // DoCast(me->getVictim(), SPELL_MARKOFFROST);
// MarkOfFrost_Timer = 25000;
// } else MarkOfFrost_Timer -= diff;
//Chill_Timer
if (Chill_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHILL);
+ DoCast(me->getVictim(), SPELL_CHILL);
Chill_Timer = 13000 + rand()%12000;
} else Chill_Timer -= diff;
//Breath_Timer
if (Breath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBREATH);
+ DoCast(me->getVictim(), SPELL_FROSTBREATH);
Breath_Timer = 10000 + rand()%5000;
} else Breath_Timer -= diff;
@@ -118,21 +118,21 @@ struct boss_azuregosAI : public ScriptedAI
//Reflect_Timer
if (Reflect_Timer <= diff)
{
- DoCast(m_creature, SPELL_REFLECT);
+ DoCast(me, SPELL_REFLECT);
Reflect_Timer = 20000 + rand()%15000;
} else Reflect_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Enrage_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 26 && !Enraged)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
diff --git a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
index f2e6233c10e..8ea971d4556 100644
--- a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
@@ -82,7 +82,7 @@ struct boss_epochAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
@@ -115,7 +115,7 @@ struct boss_epochAI : public ScriptedAI
if (uiTimeWarpTimer < diff)
{
- DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), m_creature);
+ DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), me);
DoCastAOE(SPELL_TIME_WARP);
uiTimeWarpTimer = 25300;
} else uiTimeWarpTimer -= diff;
@@ -125,7 +125,7 @@ struct boss_epochAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, DONE);
@@ -133,10 +133,10 @@ struct boss_epochAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
index fd87bfd5491..cfd30d85de9 100644
--- a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
@@ -107,15 +107,15 @@ struct boss_mal_ganisAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && done_by != m_creature)
- damage = m_creature->GetHealth()-1;
+ if (damage >= me->GetHealth() && done_by != me)
+ damage = me->GetHealth()-1;
}
void UpdateAI(const uint32 diff)
@@ -129,30 +129,30 @@ struct boss_mal_ganisAI : public ScriptedAI
if (!bYelled && HealthBelowPct(30))
{
- DoScriptText(SAY_30HEALTH, m_creature);
+ DoScriptText(SAY_30HEALTH, me);
bYelled = true;
}
if (!bYelled2 && HealthBelowPct(15))
{
- DoScriptText(SAY_15HEALTH, m_creature);
+ DoScriptText(SAY_15HEALTH, me);
bYelled2 = true;
}
if (HealthBelowPct(1))
{
//Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
uiOutroStep = 1;
Phase = OUTRO;
return;
}
- if (Creature* pArthas = m_creature->GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
+ if (Creature* pArthas = me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
if (pArthas->isDead())
{
EnterEvadeMode();
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
}
@@ -172,13 +172,13 @@ struct boss_mal_ganisAI : public ScriptedAI
if (uiVampiricTouchTimer < diff)
{
- DoCast(m_creature, SPELL_VAMPIRIC_TOUCH);
+ DoCast(me, SPELL_VAMPIRIC_TOUCH);
uiVampiricTouchTimer = 32000;
} else uiVampiricTouchTimer -= diff;
if (uiSleepTimer < diff)
{
- DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), m_creature);
+ DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SLEEP);
uiSleepTimer = urand(15000,20000);
@@ -192,31 +192,31 @@ struct boss_mal_ganisAI : public ScriptedAI
switch(uiOutroStep)
{
case 1:
- DoScriptText(SAY_ESCAPE_SPEECH_1, m_creature);
+ DoScriptText(SAY_ESCAPE_SPEECH_1, me);
me->GetMotionMaster()->MoveTargetedHome();
++uiOutroStep;
uiOutroTimer = 8000;
break;
case 2:
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
- m_creature->HandleEmoteCommand(29);
- DoScriptText(SAY_ESCAPE_SPEECH_2, m_creature);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
+ me->HandleEmoteCommand(29);
+ DoScriptText(SAY_ESCAPE_SPEECH_2, me);
++uiOutroStep;
uiOutroTimer = 9000;
break;
case 3:
- DoScriptText(SAY_OUTRO, m_creature);
+ DoScriptText(SAY_OUTRO, me);
++uiOutroStep;
uiOutroTimer = 16000;
break;
case 4:
- m_creature->HandleEmoteCommand(33);
+ me->HandleEmoteCommand(33);
++uiOutroStep;
uiOutroTimer = 500;
break;
case 5:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->Kill(m_creature);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->Kill(me);
break;
}
@@ -239,10 +239,10 @@ struct boss_mal_ganisAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
};
diff --git a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
index 0baba07416e..0fa7ace3a16 100644
--- a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
@@ -52,7 +52,7 @@ struct boss_meathookAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
if (pInstance)
- DoScriptText(SAY_SPAWN,m_creature);
+ DoScriptText(SAY_SPAWN,me);
}
uint32 uiChainTimer;
@@ -73,7 +73,7 @@ struct boss_meathookAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
@@ -93,7 +93,7 @@ struct boss_meathookAI : public ScriptedAI
if (uiFrenzyTimer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
uiFrenzyTimer = urand(21000,26000);
} else uiFrenzyTimer -= diff;
@@ -109,7 +109,7 @@ struct boss_meathookAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, DONE);
@@ -117,10 +117,10 @@ struct boss_meathookAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
index 6bb5d489c69..1fc97bd91ab 100644
--- a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
@@ -64,7 +64,7 @@ struct boss_salrammAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
if (pInstance)
- DoScriptText(SAY_SPAWN,m_creature);
+ DoScriptText(SAY_SPAWN,me);
}
uint32 uiCurseFleshTimer;
@@ -89,7 +89,7 @@ struct boss_salrammAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
@@ -104,7 +104,7 @@ struct boss_salrammAI : public ScriptedAI
//Curse of twisted flesh timer
if (uiCurseFleshTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
+ DoCast(me->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
uiCurseFleshTimer = 37000;
} else uiCurseFleshTimer -= diff;
@@ -119,7 +119,7 @@ struct boss_salrammAI : public ScriptedAI
//Steal Flesh timer
if (uiStealFleshTimer <= diff)
{
- DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), m_creature);
+ DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_STEAL_FLESH);
uiStealFleshTimer = 10000;
@@ -128,7 +128,7 @@ struct boss_salrammAI : public ScriptedAI
//Summon ghouls timer
if (uiSummonGhoulsTimer <= diff)
{
- DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_SUMMON_GHOULS);
uiSummonGhoulsTimer = 10000;
@@ -139,7 +139,7 @@ struct boss_salrammAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, DONE);
@@ -147,10 +147,10 @@ struct boss_salrammAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp
index d26426166a6..4c1ce891438 100644
--- a/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp
@@ -278,7 +278,7 @@ struct npc_arthasAI : public npc_escortAI
case NOT_STARTED:
bStepping = true;
uiStep = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
uiBossEvent = DATA_MEATHOOK_EVENT;
uiGossipStep = 0;
break;
@@ -291,7 +291,7 @@ struct npc_arthasAI : public npc_escortAI
void EnterCombat(Unit* who)
{
- DoCast(m_creature, SPELL_ARTHAS_AURA);
+ DoCast(me, SPELL_ARTHAS_AURA);
}
void JustDied(Unit *killer)
@@ -302,12 +302,12 @@ struct npc_arthasAI : public npc_escortAI
void SpawnTimeRift(uint32 timeRiftID, uint64* guidVector)
{
- m_creature->SummonCreature((uint32)RiftAndSpawnsLocations[timeRiftID][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_DESPAWN,11000);
+ me->SummonCreature((uint32)RiftAndSpawnsLocations[timeRiftID][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_DESPAWN,11000);
for (uint32 i = timeRiftID+1; i < ENCOUNTER_CHRONO_SPAWNS; ++i)
{
if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_TIME_RIFT) break;
- if (Creature* pTemp = m_creature->SummonCreature((uint32)RiftAndSpawnsLocations[i][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
+ if (Creature* pTemp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
guidVector[i-timeRiftID-1] = pTemp->GetGUID();
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9);
@@ -324,7 +324,7 @@ struct npc_arthasAI : public npc_escortAI
for (uint32 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
{
if ((uint32)WavesLocations[waveID][i][0] == 0) break;
- if (Creature* pTemp = m_creature->SummonCreature((uint32)WavesLocations[waveID][i][0],WavesLocations[waveID][i][1],WavesLocations[waveID][i][2],WavesLocations[waveID][i][3],WavesLocations[waveID][i][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
+ if (Creature* pTemp = me->SummonCreature((uint32)WavesLocations[waveID][i][0],WavesLocations[waveID][i][1],WavesLocations[waveID][i][2],WavesLocations[waveID][i][3],WavesLocations[waveID][i][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
guidVector[i] = pTemp->GetGUID();
}
@@ -361,27 +361,27 @@ struct npc_arthasAI : public npc_escortAI
bStepping = true;
break;
case 7:
- if (Unit* pCityman0 = m_creature->SummonCreature(NPC_CITY_MAN,2091.977f,1275.021f,140.757f,0.558f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
+ if (Unit* pCityman0 = me->SummonCreature(NPC_CITY_MAN,2091.977f,1275.021f,140.757f,0.558f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
uiCitymenGUID[0] = pCityman0->GetGUID();
- if (Unit* pCityman1 = m_creature->SummonCreature(NPC_CITY_MAN2,2093.514f,1275.842f,140.408f,3.801f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
+ if (Unit* pCityman1 = me->SummonCreature(NPC_CITY_MAN2,2093.514f,1275.842f,140.408f,3.801f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
uiCitymenGUID[1] = pCityman1->GetGUID();
break;
case 8:
uiGossipStep = 1;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
case 12:
SetRun(true);
- DoScriptText(SAY_PHASE210, m_creature);
- if (Unit* pDisguised0 = m_creature->SummonCreature(NPC_CITY_MAN3,2398.14f,1207.81f,134.04f,5.155249f,TEMPSUMMON_DEAD_DESPAWN,180000))
+ DoScriptText(SAY_PHASE210, me);
+ if (Unit* pDisguised0 = me->SummonCreature(NPC_CITY_MAN3,2398.14f,1207.81f,134.04f,5.155249f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[0] = pDisguised0->GetGUID();
- if (Unit* pDisguised1 = m_creature->SummonCreature(NPC_CITY_MAN4,2403.22f,1205.54f,134.04f,3.311264f,TEMPSUMMON_DEAD_DESPAWN,180000))
+ if (Unit* pDisguised1 = me->SummonCreature(NPC_CITY_MAN4,2403.22f,1205.54f,134.04f,3.311264f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[1] = pDisguised1->GetGUID();
- if (Unit* pDisguised2 = m_creature->SummonCreature(NPC_CITY_MAN,2400.82f,1201.69f,134.01f,1.534082f,TEMPSUMMON_DEAD_DESPAWN,180000))
+ if (Unit* pDisguised2 = me->SummonCreature(NPC_CITY_MAN,2400.82f,1201.69f,134.01f,1.534082f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[2] = pDisguised2->GetGUID();
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, uiInfiniteDraconianGUID[1]);
@@ -393,23 +393,23 @@ struct npc_arthasAI : public npc_escortAI
break;
case 20:
uiGossipStep = 2;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
SetHoldState(true);
break;
case 21:
- DoScriptText(SAY_PHASE301, m_creature);
+ DoScriptText(SAY_PHASE301, me);
break;
case 25:
SetRun(false);
SpawnTimeRift(0,&uiInfiniteDraconianGUID[0]);
- DoScriptText(SAY_PHASE307,m_creature);
+ DoScriptText(SAY_PHASE307,me);
break;
case 29:
SetRun(false);
SpawnTimeRift(5,&uiInfiniteDraconianGUID[0]);
SpawnTimeRift(8,&uiInfiniteDraconianGUID[2]);
- DoScriptText(SAY_PHASE309,m_creature);
+ DoScriptText(SAY_PHASE309,me);
SetHoldState(true);
bStepping = true;
break;
@@ -417,18 +417,18 @@ struct npc_arthasAI : public npc_escortAI
SetRun(false);
SpawnTimeRift(11,&uiInfiniteDraconianGUID[0]);
SpawnTimeRift(14,&uiInfiniteDraconianGUID[2]);
- DoScriptText(SAY_PHASE311,m_creature);
+ DoScriptText(SAY_PHASE311,me);
SetHoldState(true);
bStepping = true;
break;
case 32:
- DoScriptText(SAY_PHASE401,m_creature);
+ DoScriptText(SAY_PHASE401,me);
break;
case 34:
- DoScriptText(SAY_PHASE402,m_creature);
+ DoScriptText(SAY_PHASE402,me);
break;
case 35:
- DoScriptText(SAY_PHASE403,m_creature);
+ DoScriptText(SAY_PHASE403,me);
break;
case 36:
if (pInstance)
@@ -441,23 +441,23 @@ struct npc_arthasAI : public npc_escortAI
SetRun(true);
SetDespawnAtFar(false);
uiGossipStep = 4;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
case 47:
SetRun(false);
- DoScriptText(SAY_PHASE405,m_creature);
+ DoScriptText(SAY_PHASE405,me);
break;
case 48:
SetRun(true);
- DoScriptText(SAY_PHASE406,m_creature);
+ DoScriptText(SAY_PHASE406,me);
break;
case 53:
- DoScriptText(SAY_PHASE407,m_creature);
+ DoScriptText(SAY_PHASE407,me);
break;
case 54:
uiGossipStep = 5;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
}
@@ -477,28 +477,28 @@ struct npc_arthasAI : public npc_escortAI
{
//After reset
case 0:
- if (Unit* pJaina = GetClosestCreatureWithEntry(m_creature, NPC_JAINA, 50.0f))
+ if (Unit* pJaina = GetClosestCreatureWithEntry(me, NPC_JAINA, 50.0f))
uiJainaGUID = pJaina->GetGUID();
- else if (Unit* pJaina = m_creature->SummonCreature(NPC_JAINA,1895.48f,1292.66f,143.706f,0.023475f,TEMPSUMMON_DEAD_DESPAWN,180000))
+ else if (Unit* pJaina = me->SummonCreature(NPC_JAINA,1895.48f,1292.66f,143.706f,0.023475f,TEMPSUMMON_DEAD_DESPAWN,180000))
uiJainaGUID = pJaina->GetGUID();
bStepping = false;
JumpToNextStep(0);
break;
//After waypoint 0
case 1:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- if (Unit* pUther = m_creature->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ if (Unit* pUther = me->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiUtherGUID = pUther->GetGUID();
pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f);
- pUther->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiUtherGUID);
+ pUther->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiUtherGUID);
}
JumpToNextStep(17000);
break;
case 2:
- DoScriptText(SAY_PHASE101, m_creature);
+ DoScriptText(SAY_PHASE101, me);
JumpToNextStep(2000);
break;
case 3:
@@ -512,14 +512,14 @@ struct npc_arthasAI : public npc_escortAI
SetEscortPaused(false);
bStepping = false;
SetRun(false);
- DoScriptText(SAY_PHASE103, m_creature);
+ DoScriptText(SAY_PHASE103, me);
JumpToNextStep(0);
break;
//After waypoint 1
case 5:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
- pJaina->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- DoScriptText(SAY_PHASE104, m_creature);
+ pJaina->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ DoScriptText(SAY_PHASE104, me);
JumpToNextStep(10000);
break;
case 6:
@@ -528,7 +528,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 7:
- DoScriptText(SAY_PHASE106, m_creature);
+ DoScriptText(SAY_PHASE106, me);
JumpToNextStep(4000);
break;
case 8:
@@ -537,7 +537,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(6000);
break;
case 9:
- DoScriptText(SAY_PHASE108, m_creature);
+ DoScriptText(SAY_PHASE108, me);
JumpToNextStep(4000);
break;
case 10:
@@ -546,7 +546,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(8000);
break;
case 11:
- DoScriptText(SAY_PHASE110, m_creature);
+ DoScriptText(SAY_PHASE110, me);
JumpToNextStep(4000);
break;
case 12:
@@ -555,7 +555,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(4000);
break;
case 13:
- DoScriptText(SAY_PHASE112, m_creature);
+ DoScriptText(SAY_PHASE112, me);
JumpToNextStep(11000);
break;
case 14:
@@ -564,7 +564,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(3000);
break;
case 15:
- DoScriptText(SAY_PHASE114, m_creature);
+ DoScriptText(SAY_PHASE114, me);
JumpToNextStep(9000);
break;
case 16:
@@ -583,14 +583,14 @@ struct npc_arthasAI : public npc_escortAI
case 18:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
{
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pJaina->GetMotionMaster()->MovePoint(0, 1794.357f,1272.183f,140.558f);
}
JumpToNextStep(1000);
break;
case 19:
- DoScriptText(SAY_PHASE116, m_creature);
+ DoScriptText(SAY_PHASE116, me);
JumpToNextStep(1000);
break;
case 20:
@@ -601,13 +601,13 @@ struct npc_arthasAI : public npc_escortAI
case 21:
SetEscortPaused(false);
bStepping = false;
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After waypoint 3
case 22:
- DoScriptText(SAY_PHASE118, m_creature);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
+ DoScriptText(SAY_PHASE118, me);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
JumpToNextStep(10000);
break;
case 23:
@@ -621,35 +621,35 @@ struct npc_arthasAI : public npc_escortAI
if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID))
pUther->DisappearAndDie();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After Gossip 1 (waypoint 8)
case 24:
- if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2026.469f,1287.088f,143.596f,1.37f,TEMPSUMMON_TIMED_DESPAWN,14000))
+ if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2026.469f,1287.088f,143.596f,1.37f,TEMPSUMMON_TIMED_DESPAWN,14000))
{
uiStalkerGUID = pStalker->GetGUID();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
JumpToNextStep(1000);
break;
case 25:
- DoScriptText(SAY_PHASE201, m_creature);
+ DoScriptText(SAY_PHASE201, me);
JumpToNextStep(12000);
break;
case 26:
SetEscortPaused(false);
bStepping = false;
SetRun(false);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After waypoint 9
case 27:
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[0]);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[0]);
if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0]))
{
- pCityman->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pCityman->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pCityman->GetMotionMaster()->MovePoint(0, 2088.625f,1279.191f,140.743f);
}
@@ -663,12 +663,12 @@ struct npc_arthasAI : public npc_escortAI
case 29:
SetEscortPaused(false);
bStepping = false;
- DoScriptText(SAY_PHASE203, m_creature);
+ DoScriptText(SAY_PHASE203, me);
JumpToNextStep(0);
break;
//After waypoint 10
case 30:
- m_creature->HandleEmoteCommand(37);
+ me->HandleEmoteCommand(37);
JumpToNextStep(1000);
break;
case 31:
@@ -677,16 +677,16 @@ struct npc_arthasAI : public npc_escortAI
if (Creature* pCityman1 = Unit::GetCreature(*me, uiCitymenGUID[1]))
{
DoScriptText(SAY_PHASE204, pCityman1);
- pCityman1->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pCityman1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pCityman0 = Unit::GetCreature(*me, uiCitymenGUID[0]))
pCityman0->Kill(pCityman0);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[1]);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[1]);
}
JumpToNextStep(0);
break;
//After waypoint 11
case 32:
- m_creature->HandleEmoteCommand(37);
+ me->HandleEmoteCommand(37);
JumpToNextStep(1000);
break;
case 33:
@@ -695,31 +695,31 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 34:
- if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
+ if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
{
uiStalkerGUID = pStalker->GetGUID();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
- DoScriptText(SAY_PHASE205, m_creature);
+ DoScriptText(SAY_PHASE205, me);
JumpToNextStep(3000);
break;
case 35:
- if (Unit* pStalkerM = m_creature->SummonCreature(NPC_INVIS_TARGET,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
+ if (Unit* pStalkerM = me->SummonCreature(NPC_INVIS_TARGET,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
{
uiStalkerGUID = pStalkerM->GetGUID();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
JumpToNextStep(1000);
break;
case 36:
- if (Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
+ if (Creature* pMalganis = me->SummonCreature(NPC_MAL_GANIS,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
{
if (Creature* pStalkerM = Unit::GetCreature(*me, uiStalkerGUID))
pMalganis->CastSpell(pStalkerM,63793,false);
uiMalganisGUID = pMalganis->GetGUID();
DoScriptText(SAY_PHASE206, pMalganis);
- pMalganis->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pMalganis->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
pMalganis->SetReactState(REACT_PASSIVE);
}
JumpToNextStep(11000);
@@ -746,22 +746,22 @@ struct npc_arthasAI : public npc_escortAI
case 39:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
pMalganis->SetVisibility(VISIBILITY_OFF);
- DoScriptText(SAY_PHASE208, m_creature);
+ DoScriptText(SAY_PHASE208, me);
JumpToNextStep(7000);
break;
case 40:
- if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
+ if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
{
uiStalkerGUID = pStalker->GetGUID();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
- DoScriptText(SAY_PHASE209, m_creature);
+ DoScriptText(SAY_PHASE209, me);
uiBossEvent = DATA_MEATHOOK_EVENT;
if (pInstance)
pInstance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
- m_creature->SetReactState(REACT_DEFENSIVE);
+ me->SetReactState(REACT_DEFENSIVE);
SetDespawnAtFar(false);
JumpToNextStep(5000);
break;
@@ -820,7 +820,7 @@ struct npc_arthasAI : public npc_escortAI
else if (uiBossEvent == DATA_SALRAMM_EVENT)
uiBossID = NPC_SALRAMM;
- if (Unit* pBoss = m_creature->SummonCreature(uiBossID,2232.19f,1331.933f,126.662f,3.15f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
+ if (Unit* pBoss = me->SummonCreature(uiBossID,2232.19f,1331.933f,126.662f,3.15f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
uiBossGUID = pBoss->GetGUID();
pBoss->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -853,13 +853,13 @@ struct npc_arthasAI : public npc_escortAI
break;
//After Gossip 2 (waypoint 22)
case 61:
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
if (Creature* pDisguised0 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[0]))
- pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pDisguised1 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[1]))
- pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pDisguised2 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[2]))
- pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
JumpToNextStep(1000);
break;
case 62:
@@ -868,14 +868,14 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(7000);
break;
case 63:
- DoScriptText(SAY_PHASE303, m_creature);
+ DoScriptText(SAY_PHASE303, me);
SetHoldState(false);
bStepping = false;
JumpToNextStep(0);
break;
//After waypoint 23
case 64:
- m_creature->HandleEmoteCommand(54);
+ me->HandleEmoteCommand(54);
JumpToNextStep(1000);
break;
case 65:
@@ -884,7 +884,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 66:
- DoScriptText(SAY_PHASE304,m_creature);
+ DoScriptText(SAY_PHASE304,me);
JumpToNextStep(2000);
break;
case 67:
@@ -939,13 +939,13 @@ struct npc_arthasAI : public npc_escortAI
case 72:
case 74:
case 76:
- if (m_creature->isInCombat())
+ if (me->isInCombat())
uiPhaseTimer = 1000;
else
{
- if (uiStep == 72) DoScriptText(SAY_PHASE308,m_creature);
- if (uiStep == 74) DoScriptText(SAY_PHASE308,m_creature);
- if (uiStep == 76) DoScriptText(SAY_PHASE310,m_creature);
+ if (uiStep == 72) DoScriptText(SAY_PHASE308,me);
+ if (uiStep == 74) DoScriptText(SAY_PHASE308,me);
+ if (uiStep == 76) DoScriptText(SAY_PHASE310,me);
SetHoldState(false);
bStepping = false;
SetRun(true);
@@ -953,16 +953,16 @@ struct npc_arthasAI : public npc_escortAI
}
break;
case 78:
- if (m_creature->isInCombat())
+ if (me->isInCombat())
uiPhaseTimer = 1000;
else
{
- DoScriptText(SAY_PHASE312,m_creature);
+ DoScriptText(SAY_PHASE312,me);
JumpToNextStep(5000);
}
break;
case 79:
- DoScriptText(SAY_PHASE313,m_creature);
+ DoScriptText(SAY_PHASE313,me);
JumpToNextStep(1000);
break;
case 80:
@@ -972,14 +972,14 @@ struct npc_arthasAI : public npc_escortAI
SpawnTimeRift(17,&uiEpochGUID);
if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID))
DoScriptText(SAY_PHASE314,pEpoch);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiEpochGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiEpochGUID);
}
JumpToNextStep(18000);
break;
case 81:
if (pInstance)
if (pInstance->GetData(DATA_EPOCH_EVENT) != DONE)
- DoScriptText(SAY_PHASE315, m_creature);
+ DoScriptText(SAY_PHASE315, me);
JumpToNextStep(6000);
break;
case 82:
@@ -1003,7 +1003,7 @@ struct npc_arthasAI : public npc_escortAI
if (pInstance->GetData(DATA_EPOCH_EVENT) == DONE)
{
uiGossipStep = 3;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
bStepping = false;
uiBossEvent = DATA_MAL_GANIS_EVENT;
JumpToNextStep(15000);
@@ -1016,14 +1016,14 @@ struct npc_arthasAI : public npc_escortAI
break;
//After Gossip 4
case 84:
- DoScriptText(SAY_PHASE404,m_creature);
+ DoScriptText(SAY_PHASE404,me);
SetHoldState(false);
bStepping = false;
break;
//After Gossip 5
case 85:
- DoScriptText(SAY_PHASE501, m_creature);
- if (Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
+ DoScriptText(SAY_PHASE501, me);
+ if (Creature* pMalganis = me->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
uiMalganisGUID = pMalganis->GetGUID();
pMalganis->SetReactState(REACT_PASSIVE);
@@ -1039,9 +1039,9 @@ struct npc_arthasAI : public npc_escortAI
break;
//After waypoint 55
case 86:
- DoScriptText(SAY_PHASE502, m_creature);
+ DoScriptText(SAY_PHASE502, me);
JumpToNextStep(6000);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
break;
case 87:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
@@ -1068,17 +1068,17 @@ struct npc_arthasAI : public npc_escortAI
//After waypoint 56
case 89:
SetRun(true);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
- DoScriptText(SAY_PHASE503, m_creature);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
+ DoScriptText(SAY_PHASE503, me);
JumpToNextStep(7000);
break;
case 90:
if (pInstance)
{
pInstance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
+ me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
}
- DoScriptText(SAY_PHASE504, m_creature);
+ DoScriptText(SAY_PHASE504, me);
bStepping = false;
break;
}
@@ -1086,7 +1086,7 @@ struct npc_arthasAI : public npc_escortAI
}
//Battling skills
- if (!m_creature->getVictim())
+ if (!me->getVictim())
return;
if (uiExorcismTimer < diff)
@@ -1097,7 +1097,7 @@ struct npc_arthasAI : public npc_escortAI
} else uiExorcismTimer -= diff;
if (HealthBelowPct(40))
- DoCast(m_creature, SPELL_HOLY_LIGHT);
+ DoCast(me, SPELL_HOLY_LIGHT);
}
};
diff --git a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp
index 60e34dd4402..1b9a4e7d075 100644
--- a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp
@@ -63,7 +63,7 @@ struct boss_aeonusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
@@ -71,10 +71,10 @@ struct boss_aeonusAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
- if (m_creature->IsWithinDistInMap(who,20.0f))
+ if (me->IsWithinDistInMap(who,20.0f))
{
- DoScriptText(SAY_BANISH, m_creature);
- m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ DoScriptText(SAY_BANISH, me);
+ me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -83,7 +83,7 @@ struct boss_aeonusAI : public ScriptedAI
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -94,7 +94,7 @@ struct boss_aeonusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void UpdateAI(const uint32 diff)
@@ -106,22 +106,22 @@ struct boss_aeonusAI : public ScriptedAI
//Sand Breath
if (SandBreath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SAND_BREATH);
+ DoCast(me->getVictim(), SPELL_SAND_BREATH);
SandBreath_Timer = 15000+rand()%10000;
} else SandBreath_Timer -= diff;
//Time Stop
if (TimeStop_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TIME_STOP);
+ DoCast(me->getVictim(), SPELL_TIME_STOP);
TimeStop_Timer = 20000+rand()%15000;
} else TimeStop_Timer -= diff;
//Frenzy
if (Frenzy_Timer <= diff)
{
- DoScriptText(EMOTE_FRENZY, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ DoScriptText(EMOTE_FRENZY, me);
+ DoCast(me, SPELL_ENRAGE);
Frenzy_Timer = 20000+rand()%15000;
} else Frenzy_Timer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
index 61e87b0e005..693db6124eb 100644
--- a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
@@ -65,7 +65,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
@@ -73,10 +73,10 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
- if (m_creature->IsWithinDistInMap(who,20.0f))
+ if (me->IsWithinDistInMap(who,20.0f))
{
- DoScriptText(SAY_BANISH, m_creature);
- m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ DoScriptText(SAY_BANISH, me);
+ me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -85,12 +85,12 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
@@ -105,7 +105,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Arcane Blast
if (ArcaneBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST);
+ DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 15000+rand()%10000;
} else ArcaneBlast_Timer -= diff;
@@ -120,8 +120,8 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Time Lapse
if (TimeLapse_Timer <= diff)
{
- DoScriptText(SAY_BANISH, m_creature);
- DoCast(m_creature, SPELL_TIME_LAPSE);
+ DoScriptText(SAY_BANISH, me);
+ DoCast(me, SPELL_TIME_LAPSE);
TimeLapse_Timer = 15000+rand()%10000;
} else TimeLapse_Timer -= diff;
@@ -129,7 +129,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
{
if (Attraction_Timer <= diff)
{
- DoCast(m_creature, SPELL_ATTRACTION);
+ DoCast(me, SPELL_ATTRACTION);
Attraction_Timer = 25000+rand()%10000;
} else Attraction_Timer -= diff;
}
diff --git a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp
index 612fb17ebd4..465bd0256a2 100644
--- a/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp
@@ -64,17 +64,17 @@ struct boss_temporusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
@@ -85,11 +85,11 @@ struct boss_temporusAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
- if (m_creature->IsWithinDistInMap(who,20.0f))
+ if (me->IsWithinDistInMap(who,20.0f))
{
- DoScriptText(SAY_BANISH, m_creature);
+ DoScriptText(SAY_BANISH, me);
- m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -105,21 +105,21 @@ struct boss_temporusAI : public ScriptedAI
//Attack Haste
if (Haste_Timer <= diff)
{
- DoCast(m_creature, SPELL_HASTE);
+ DoCast(me, SPELL_HASTE);
Haste_Timer = 20000+rand()%5000;
} else Haste_Timer -= diff;
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
- DoCast(m_creature, SPELL_MORTAL_WOUND);
+ DoCast(me, SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000+rand()%10000;
} else MortalWound_Timer -= diff;
//Wing ruffet
if (WingBuffet_Timer <= diff)
{
- DoCast(m_creature, SPELL_WING_BUFFET);
+ DoCast(me, SPELL_WING_BUFFET);
WingBuffet_Timer = 20000+rand()%10000;
} else WingBuffet_Timer -= diff;
@@ -127,7 +127,7 @@ struct boss_temporusAI : public ScriptedAI
{
if (SpellReflection_Timer <= diff)
{
- DoCast(m_creature, SPELL_REFLECT);
+ DoCast(me, SPELL_REFLECT);
SpellReflection_Timer = 25000+rand()%10000;
} else SpellReflection_Timer -= diff;
}
diff --git a/src/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp b/src/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp
index 6a06bf2382c..e29e0f33f0f 100644
--- a/src/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp
@@ -78,11 +78,11 @@ struct npc_medivh_bmAI : public ScriptedAI
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
- DoCast(m_creature, SPELL_CHANNEL, true);
- else if (m_creature->HasAura(SPELL_CHANNEL))
- m_creature->RemoveAura(SPELL_CHANNEL);
+ DoCast(me, SPELL_CHANNEL, true);
+ else if (me->HasAura(SPELL_CHANNEL))
+ me->RemoveAura(SPELL_CHANNEL);
- DoCast(m_creature, SPELL_PORTAL_RUNE, true);
+ DoCast(me, SPELL_PORTAL_RUNE, true);
}
void MoveInLineOfSight(Unit *who)
@@ -90,17 +90,17 @@ struct npc_medivh_bmAI : public ScriptedAI
if (!pInstance)
return;
- if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
+ if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
return;
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
- DoCast(m_creature, SPELL_CHANNEL, false);
+ DoCast(me, SPELL_CHANNEL, false);
Check_Timer = 5000;
}
- else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f))
+ else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
return;
@@ -109,12 +109,12 @@ struct npc_medivh_bmAI : public ScriptedAI
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
who->StopMoving();
- who->CastSpell(m_creature,SPELL_CORRUPT,false);
+ who->CastSpell(me,SPELL_CORRUPT,false);
}
else if (entry == C_AEONUS)
{
who->StopMoving();
- who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false);
+ who->CastSpell(me,SPELL_CORRUPT_AEONUS,false);
}
}
}
@@ -143,10 +143,10 @@ struct npc_medivh_bmAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- if (Killer->GetEntry() == m_creature->GetEntry())
+ if (Killer->GetEntry() == me->GetEntry())
return;
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -160,9 +160,9 @@ struct npc_medivh_bmAI : public ScriptedAI
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
- if (m_creature->HasAura(SPELL_CORRUPT_AEONUS))
+ if (me->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
- else if (m_creature->HasAura(SPELL_CORRUPT))
+ else if (me->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
@@ -179,36 +179,36 @@ struct npc_medivh_bmAI : public ScriptedAI
if (Life25 && pct <= 25)
{
- DoScriptText(SAY_WEAK25, m_creature);
+ DoScriptText(SAY_WEAK25, me);
Life25 = false;
}
else if (Life50 && pct <= 50)
{
- DoScriptText(SAY_WEAK50, m_creature);
+ DoScriptText(SAY_WEAK50, me);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
- DoScriptText(SAY_WEAK75, m_creature);
+ DoScriptText(SAY_WEAK75, me);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
- m_creature->Respawn();
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
+ me->Respawn();
return;
}
if (pInstance->GetData(TYPE_RIFT) == DONE)
{
- DoScriptText(SAY_WIN, m_creature);
+ DoScriptText(SAY_WIN, me);
Check_Timer = 0;
- if (m_creature->HasAura(SPELL_CHANNEL))
- m_creature->RemoveAura(SPELL_CHANNEL);
+ if (me->HasAura(SPELL_CHANNEL))
+ me->RemoveAura(SPELL_CHANNEL);
//TODO: start the post-event here
pInstance->SetData(TYPE_MEDIVH,DONE);
@@ -281,19 +281,19 @@ struct npc_time_riftAI : public ScriptedAI
if (pInstance && pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
{
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
return;
}
Position pos;
- m_creature->GetRandomNearPosition(pos, 10.0f);
+ me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
- pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
+ pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
- if (Unit *temp = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
+ if (Unit *temp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
Summon->AddThreat(temp,0.0f);
}
@@ -327,11 +327,11 @@ struct npc_time_riftAI : public ScriptedAI
TimeRiftWave_Timer = 15000;
} else TimeRiftWave_Timer -= diff;
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die.");
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
pInstance->SetData(TYPE_RIFT,SPECIAL);
diff --git a/src/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp
index 5560d99787f..8684df4ca3f 100644
--- a/src/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp
@@ -245,7 +245,7 @@ struct instance_dark_portal : public ScriptedInstance
return 0;
}
- Creature* SummonedPortalBoss(Creature* m_creature)
+ Creature* SummonedPortalBoss(Creature* me)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
@@ -255,12 +255,12 @@ struct instance_dark_portal : public ScriptedInstance
debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Position pos;
- m_creature->GetRandomNearPosition(pos, 10.0f);
+ me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
- pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
+ pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
- if (Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
+ if (Creature *summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
debug_log("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp
index 82a89faacce..f0f56f42c7b 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp
@@ -74,8 +74,8 @@ struct boss_anetheronAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
- m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONAGGRO);
+ me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit *victim)
@@ -83,16 +83,16 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
- m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONSLAY1);
+ me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
- m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONSLAY2);
+ me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
break;
case 2:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
- m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONSLAY3);
+ me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
break;
}
}
@@ -102,9 +102,9 @@ struct boss_anetheronAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
@@ -113,8 +113,8 @@ struct boss_anetheronAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, DONE);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
- m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONDEATH);
+ me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
}
void UpdateAI(const uint32 diff)
@@ -155,12 +155,12 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_SWARM1);
- m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SWARM1);
+ me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_SWARM2);
- m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SWARM2);
+ me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
break;
}
} else SwarmTimer -= diff;
@@ -176,18 +176,18 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_SLEEP1);
- m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SLEEP1);
+ me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLEEP2);
- m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SLEEP2);
+ me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
break;
}
} else SleepTimer -= diff;
if (AuraTimer <= diff)
{
- DoCast(m_creature, SPELL_VAMPIRIC_AURA, true);
+ DoCast(me, SPELL_VAMPIRIC_AURA, true);
AuraTimer = urand(10000,20000);
} else AuraTimer -= diff;
if (InfernoTimer <= diff)
@@ -197,12 +197,12 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_INFERNO1);
- m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_INFERNO1);
+ me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_INFERNO2);
- m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_INFERNO2);
+ me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
break;
}
} else InfernoTimer -= diff;
@@ -235,7 +235,7 @@ struct mob_towering_infernalAI : public ScriptedAI
void Reset()
{
- DoCast(m_creature, SPELL_INFERNO_EFFECT);
+ DoCast(me, SPELL_INFERNO_EFFECT);
ImmolationTimer = 5000;
CheckTimer = 5000;
}
@@ -254,7 +254,7 @@ struct mob_towering_infernalAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who))
+ if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
@@ -264,11 +264,11 @@ struct mob_towering_infernalAI : public ScriptedAI
{
if (AnetheronGUID)
{
- Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID);
+ Creature* boss = Unit::GetCreature((*me),AnetheronGUID);
if (!boss || (boss && boss->isDead()))
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
return;
}
}
@@ -281,7 +281,7 @@ struct mob_towering_infernalAI : public ScriptedAI
if (ImmolationTimer <= diff)
{
- DoCast(m_creature, SPELL_IMMOLATION);
+ DoCast(me, SPELL_IMMOLATION);
ImmolationTimer = 5000;
} else ImmolationTimer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp
index 91ff54153ea..51e87178369 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp
@@ -91,7 +91,7 @@ struct mob_ancient_wispAI : public ScriptedAI
if (pInstance)
ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void EnterCombat(Unit* who) {}
@@ -102,10 +102,10 @@ struct mob_ancient_wispAI : public ScriptedAI
{
if (CheckTimer <= diff)
{
- if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID))
+ if (Unit* Archimonde = Unit::GetUnit((*me), ArchimondeGUID))
{
if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
- DoCast(m_creature, SPELL_DENOUEMENT_WISP);
+ DoCast(me, SPELL_DENOUEMENT_WISP);
else
DoCast(Archimonde, SPELL_ANCIENT_SPARK);
}
@@ -158,16 +158,16 @@ struct mob_doomfire_targettingAI : public ScriptedAI
{
if (ChangeTargetTimer <= diff)
{
- if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID))
+ if (Unit *temp = Unit::GetUnit(*me,TargetGUID))
{
- m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f);
+ me->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f);
TargetGUID = 0;
}
else
{
Position pos;
- m_creature->GetRandomNearPosition(pos, 40);
- m_creature->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
+ me->GetRandomNearPosition(pos, 40);
+ me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
ChangeTargetTimer = 5000;
@@ -245,8 +245,8 @@ struct boss_archimondeAI : public hyjal_trashAI
void EnterCombat(Unit *who)
{
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
- DoScriptText(SAY_AGGRO, m_creature);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
@@ -255,7 +255,7 @@ struct boss_archimondeAI : public hyjal_trashAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
GainSoulCharge(CAST_PLR(victim));
@@ -268,17 +268,17 @@ struct boss_archimondeAI : public hyjal_trashAI
case CLASS_PRIEST:
case CLASS_PALADIN:
case CLASS_WARLOCK:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
+ victim->CastSpell(me, SPELL_SOUL_CHARGE_RED, true);
break;
case CLASS_MAGE:
case CLASS_ROGUE:
case CLASS_WARRIOR:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
+ victim->CastSpell(me, SPELL_SOUL_CHARGE_YELLOW, true);
break;
case CLASS_DRUID:
case CLASS_SHAMAN:
case CLASS_HUNTER:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
+ victim->CastSpell(me, SPELL_SOUL_CHARGE_GREEN, true);
break;
}
@@ -289,7 +289,7 @@ struct boss_archimondeAI : public hyjal_trashAI
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
@@ -298,11 +298,11 @@ struct boss_archimondeAI : public hyjal_trashAI
bool CanUseFingerOfDeath()
{
// First we check if our current victim is in melee range or not.
- Unit* victim = m_creature->getVictim();
- if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
+ Unit* victim = me->getVictim();
+ if (victim && me->IsWithinDistInMap(victim, me->GetAttackDistance(victim)))
return false;
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
if (m_threatlist.empty())
return false;
@@ -310,7 +310,7 @@ struct boss_archimondeAI : public hyjal_trashAI
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
for (; itr != m_threatlist.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive())
targets.push_back(pUnit);
}
@@ -318,14 +318,14 @@ struct boss_archimondeAI : public hyjal_trashAI
if (targets.empty())
return false;
- targets.sort(ObjectDistanceOrder(m_creature));
+ targets.sort(ObjectDistanceOrder(me));
Unit *pTarget = targets.front();
if (pTarget)
{
- if (!m_creature->IsWithinDistInMap(pTarget, m_creature->GetAttackDistance(pTarget)))
+ if (!me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
return true; // Cast Finger of Death
else // This target is closest, he is our new tank
- m_creature->AddThreat(pTarget, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
+ me->AddThreat(pTarget, me->getThreatManager().getThreat(me->getVictim()));
}
return false;
@@ -334,10 +334,10 @@ struct boss_archimondeAI : public hyjal_trashAI
void JustSummoned(Creature *summoned)
{
if (summoned->GetEntry() == CREATURE_ANCIENT_WISP)
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
else
{
- summoned->setFaction(m_creature->getFaction());
+ summoned->setFaction(me->getFaction());
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -350,9 +350,9 @@ struct boss_archimondeAI : public hyjal_trashAI
if (summoned->GetEntry() == CREATURE_DOOMFIRE)
{
summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false);
- summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID());
+ summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,me->GetGUID());
- if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID))
+ if (Unit *DoomfireSpirit = Unit::GetUnit(*me, DoomfireSpiritGUID))
{
summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f);
DoomfireSpiritGUID = 0;
@@ -363,18 +363,18 @@ struct boss_archimondeAI : public hyjal_trashAI
//this is code doing close to what the summoning spell would do (spell 31903)
void SummonDoomfire(Unit *pTarget)
{
- m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
+ me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
pTarget->GetPositionX()+15.0,pTarget->GetPositionY()+15.0,pTarget->GetPositionZ(),0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
- m_creature->SummonCreature(CREATURE_DOOMFIRE,
+ me->SummonCreature(CREATURE_DOOMFIRE,
pTarget->GetPositionX()-15.0,pTarget->GetPositionY()-15.0,pTarget->GetPositionZ(),0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
}
void UnleashSoulCharge()
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
bool HasCast = false;
uint32 chargeSpell = 0;
@@ -396,10 +396,10 @@ struct boss_archimondeAI : public hyjal_trashAI
break;
}
- if (m_creature->HasAura(chargeSpell))
+ if (me->HasAura(chargeSpell))
{
- m_creature->RemoveAuraFromStack(chargeSpell);
- DoCast(m_creature->getVictim(), unleashSpell);
+ me->RemoveAuraFromStack(chargeSpell);
+ DoCast(me->getVictim(), unleashSpell);
HasCast = true;
SoulChargeCount--;
}
@@ -410,20 +410,20 @@ struct boss_archimondeAI : public hyjal_trashAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
if (pInstance)
{
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
- if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
+ if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((me->GetVisibility() != VISIBILITY_OFF) || (me->getFaction() != 35)))
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setFaction(35);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->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) && ((me->GetVisibility() != VISIBILITY_ON) || (me->getFaction() == 35)))
{
- m_creature->setFaction(1720);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->setFaction(1720);
+ me->SetVisibility(VISIBILITY_ON);
}
}
@@ -431,12 +431,12 @@ struct boss_archimondeAI : public hyjal_trashAI
{
if (!IsChanneling)
{
- Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
+ Creature *temp = me->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))
+ if (Unit *Nordrassil = Unit::GetUnit(*me, WorldTreeGUID))
{
Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Nordrassil->SetDisplayId(11686);
@@ -445,9 +445,9 @@ struct boss_archimondeAI : public hyjal_trashAI
}
}
- if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID))
+ if (Unit *Nordrassil = Unit::GetUnit(*me, WorldTreeGUID))
{
- Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
+ Nordrassil->CastSpell(me, SPELL_DRAIN_WORLD_TREE_2, true);
DrainNordrassilTimer = 1000;
}
} else DrainNordrassilTimer -= diff;
@@ -456,36 +456,36 @@ struct boss_archimondeAI : public hyjal_trashAI
if (!UpdateVictim())
return;
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
+ if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
BelowTenPercent = true;
if (!Enraged)
{
if (EnrageTimer <= diff)
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) > 10)
{
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
Enraged = true;
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoScriptText(SAY_ENRAGE, me);
}
} else EnrageTimer -= diff;
if (CheckDistanceTimer <= diff)
{
// To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature
- Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
+ Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
if (Check)
{
Check->SetVisibility(VISIBILITY_OFF);
- if (m_creature->IsWithinDistInMap(Check, 75))
+ if (me->IsWithinDistInMap(Check, 75))
{
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
Enraged = true;
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoScriptText(SAY_ENRAGE, me);
}
}
CheckDistanceTimer = 5000;
@@ -496,11 +496,11 @@ struct boss_archimondeAI : public hyjal_trashAI
{
if (!HasProtected)
{
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
//all members of raid must get this buff
- DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
+ DoCast(me->getVictim(), SPELL_PROTECTION_OF_ELUNE);
HasProtected = true;
Enraged = true;
}
@@ -513,14 +513,14 @@ struct boss_archimondeAI : public hyjal_trashAI
} else SummonWispTimer -= diff;
if (WispCount >= 30)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
if (Enraged)
{
if (HandOfDeathTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
+ DoCast(me->getVictim(), SPELL_HAND_OF_DEATH);
HandOfDeathTimer = 2000;
} else HandOfDeathTimer -= diff;
return; // Don't do anything after this point.
@@ -542,9 +542,9 @@ struct boss_archimondeAI : public hyjal_trashAI
if (AirBurstTimer <= diff)
{
if (urand(0,1))
- DoScriptText(SAY_AIR_BURST1, m_creature);
+ DoScriptText(SAY_AIR_BURST1, me);
else
- DoScriptText(SAY_AIR_BURST2, m_creature);
+ DoScriptText(SAY_AIR_BURST2, me);
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank
AirBurstTimer = urand(25000,40000);
@@ -552,20 +552,20 @@ struct boss_archimondeAI : public hyjal_trashAI
if (FearTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
FearTimer = 42000;
} else FearTimer -= diff;
if (DoomfireTimer <= diff)
{
if (urand(0,1))
- DoScriptText(SAY_DOOMFIRE1, m_creature);
+ DoScriptText(SAY_DOOMFIRE1, me);
else
- DoScriptText(SAY_DOOMFIRE2, m_creature);
+ DoScriptText(SAY_DOOMFIRE2, me);
Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!temp)
- temp = m_creature->getVictim();
+ temp = me->getVictim();
//replace with spell cast 31903 once implicitTarget 73 implemented
SummonDoomfire(temp);
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp
index 259e92c3cc4..a5d4ca6dfee 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp
@@ -67,8 +67,8 @@ struct boss_azgalorAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
- m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONAGGRO);
+ me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit *victim)
@@ -76,16 +76,16 @@ struct boss_azgalorAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
- m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY1);
+ me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
- m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY2);
+ me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
- m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY3);
+ me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -95,9 +95,9 @@ struct boss_azgalorAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
@@ -106,7 +106,7 @@ struct boss_azgalorAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, DONE);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
+ DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -152,20 +152,20 @@ struct boss_azgalorAI : public hyjal_trashAI
if (HowlTimer <= diff)
{
- DoCast(m_creature, SPELL_HOWL_OF_AZGALOR);
+ DoCast(me, SPELL_HOWL_OF_AZGALOR);
HowlTimer = 30000;
} else HowlTimer -= diff;
if (CleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 10000+rand()%5000;
} else CleaveTimer -= diff;
if (EnrageTimer < diff && !enraged)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_BERSERK, true);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_BERSERK, true);
enraged = true;
EnrageTimer = 600000;
} else EnrageTimer -= diff;
@@ -202,7 +202,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
{
CrippleTimer = 50000;
WarstompTimer = 10000;
- DoCast(m_creature, SPELL_THRASH);
+ DoCast(me, SPELL_THRASH);
CheckTimer = 5000;
}
@@ -222,7 +222,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
void MoveInLineOfSight(Unit *who)
{
- if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who))
+ if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
@@ -237,11 +237,11 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
{
if (AzgalorGUID)
{
- Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID);
+ Creature* boss = Unit::GetCreature((*me),AzgalorGUID);
if (!boss || (boss && boss->isDead()))
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
return;
}
}
@@ -254,7 +254,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
if (WarstompTimer <= diff)
{
- DoCast(m_creature, SPELL_WARSTOMP);
+ DoCast(me, SPELL_WARSTOMP);
WarstompTimer = 10000+rand()%5000;
} else WarstompTimer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp
index 743ef4c56c1..f742d858080 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp
@@ -62,8 +62,8 @@ struct boss_kazrogalAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
- m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONAGGRO);
+ me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit *victim)
@@ -71,16 +71,16 @@ struct boss_kazrogalAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
- m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY1);
+ me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
- m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY2);
+ me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
- m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY3);
+ me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -90,9 +90,9 @@ struct boss_kazrogalAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
@@ -101,7 +101,7 @@ struct boss_kazrogalAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, DONE);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
+ DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -135,27 +135,27 @@ struct boss_kazrogalAI : public hyjal_trashAI
if (CleaveTimer <= diff)
{
- DoCast(m_creature, SPELL_CLEAVE);
+ DoCast(me, SPELL_CLEAVE);
CleaveTimer = 6000+rand()%15000;
} else CleaveTimer -= diff;
if (WarStompTimer <= diff)
{
- DoCast(m_creature, SPELL_WARSTOMP);
+ DoCast(me, SPELL_WARSTOMP);
WarStompTimer = 60000;
} else WarStompTimer -= diff;
- if (m_creature->HasAura(SPELL_MARK))
- m_creature->RemoveAurasDueToSpell(SPELL_MARK);
+ if (me->HasAura(SPELL_MARK))
+ me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
//cast dummy, useful for bos addons
- m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
+ me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->getPowerType() == POWER_MANA)
{
pTarget->CastSpell(pTarget, SPELL_MARK,true);//only cast on mana users
@@ -168,12 +168,12 @@ struct boss_kazrogalAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_MARK1);
- m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_MARK1);
+ me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_MARK2);
- m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_MARK2);
+ me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
break;
}
} else MarkTimer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp
index 2e74c701f23..1297000b99d 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp
@@ -62,8 +62,8 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
- m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ONAGGRO);
+ me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit *victim)
@@ -71,12 +71,12 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
- m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY1);
+ me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
- m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONSLAY2);
+ me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -86,9 +86,9 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0f);
+ me->AddThreat(pTarget,0.0f);
}
}
@@ -97,8 +97,8 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
- m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_ONDEATH);
+ me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
}
void UpdateAI(const uint32 diff)
@@ -132,38 +132,38 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
if (FrostArmorTimer <= diff)
{
- DoCast(m_creature, SPELL_FROST_ARMOR);
+ DoCast(me, SPELL_FROST_ARMOR);
FrostArmorTimer = 40000+rand()%20000;
} else FrostArmorTimer -= diff;
if (DecayTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY);
+ DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
DecayTimer = 60000+rand()%20000;
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_DECAY1);
- m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_DECAY1);
+ me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_DECAY2);
- m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_DECAY2);
+ me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
break;
}
} else DecayTimer -= diff;
if (NovaTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_NOVA);
+ DoCast(me->getVictim(), SPELL_FROST_NOVA);
NovaTimer = 30000+rand()%15000;
switch (urand(0,1))
{
case 0:
- DoPlaySoundToSet(m_creature, SOUND_NOVA1);
- m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NOVA1);
+ me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
break;
case 1:
- DoPlaySoundToSet(m_creature, SOUND_NOVA2);
- m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_NOVA2);
+ me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
break;
}
} else NovaTimer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
index 879c9b723d9..3e6c9a8cfe6 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
@@ -308,7 +308,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde
{5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596}
};
-hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature)
+hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
VeinsSpawned[0] = false;
@@ -343,7 +343,7 @@ void hyjalAI::SummonedCreatureDespawn(Creature* summoned)
void hyjalAI::Reset()
{
IsDummy = false;
- m_creature->setActive(true);
+ me->setActive(true);
// GUIDs
PlayerGUID = 0;
BossGUID[0] = 0;
@@ -359,11 +359,11 @@ void hyjalAI::Reset()
EnemyCount = 0;
// Set faction properly based on Creature entry
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case JAINA:
Faction = 0;
- DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
+ DoCast(me, SPELL_BRILLIANCE_AURA, true);
break;
case THRALL:
@@ -384,7 +384,7 @@ void hyjalAI::Reset()
Debug = false;
//Flags
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
//Initialize spells
memset(Spell, 0, sizeof(Spell));
@@ -392,7 +392,7 @@ void hyjalAI::Reset()
//Reset Instance Data for trash count
if (pInstance)
{
- if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL))
+ if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
{
//Reset World States
pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
@@ -408,16 +408,16 @@ void hyjalAI::Reset()
void hyjalAI::EnterEvadeMode()
{
- if (m_creature->GetEntry() != JAINA)
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- m_creature->LoadCreaturesAddon();
+ if (me->GetEntry() != JAINA)
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->LoadCreaturesAddon();
- if (m_creature->isAlive())
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ if (me->isAlive())
+ me->GetMotionMaster()->MoveTargetedHome();
- m_creature->SetLootRecipient(NULL);
+ me->SetLootRecipient(NULL);
}
void hyjalAI::EnterCombat(Unit *who)
@@ -454,19 +454,19 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3))
{//summon at tower
- pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (pCreature)
CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true;
}else{//summon at gate
- pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
}
break;
case 17907: //FROST_WYRM ,
if (FirstBossDead && WaveCount == 1) //summon at gate
- pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
else
{
- pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (pCreature)
CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true;
}
@@ -475,10 +475,10 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
++InfernalCount;
if (InfernalCount > 7)
InfernalCount = 0;
- pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
break;
default:
- pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ pCreature = me->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
break;
}
@@ -592,7 +592,7 @@ void hyjalAI::StartEvent(Player* pPlayer)
CheckTimer = 5000;
PlayerGUID = pPlayer->GetGUID();
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
@@ -643,7 +643,7 @@ void hyjalAI::Talk(uint32 id)
}
if (YellId)
- DoScriptText(YellId, m_creature);
+ DoScriptText(YellId, me);
}
void hyjalAI::Retreat()
@@ -663,7 +663,7 @@ void hyjalAI::Retreat()
if (Faction == 1)
{
pInstance->SetData(DATA_HORDE_RETREAT, 1);
- Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000);
+ Creature* JainaDummy = me->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000);
if (JainaDummy)
{
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -677,7 +677,7 @@ void hyjalAI::Retreat()
}
SpawnVeins();
Overrun = true;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
}
void hyjalAI::SpawnVeins()
@@ -688,7 +688,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 0; i<7; ++i)
{
- GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
+ GameObject* gem = me->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
@@ -698,7 +698,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 7; i<14; ++i)
{
- GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
+ GameObject* gem = me->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
@@ -712,7 +712,7 @@ void hyjalAI::DeSpawnVeins()
return;
if (Faction == 1)
{
- Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Creature* pUnit=Unit::GetCreature((*me),pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (!pUnit)return;
hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI());
if (!ai)return;
@@ -723,7 +723,7 @@ void hyjalAI::DeSpawnVeins()
}
} else if (Faction)
{
- Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL));
+ Creature* pUnit=Unit::GetCreature((*me),pInstance->GetData64(DATA_THRALL));
if (!pUnit)return;
hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI());
if (!ai)return;
@@ -741,7 +741,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (MassTeleportTimer < diff && DoMassTeleport)
{
- DoCast(m_creature, SPELL_MASS_TELEPORT, false);
+ DoCast(me, SPELL_MASS_TELEPORT, false);
DoMassTeleport = false;
} else MassTeleportTimer -= diff;
return;
@@ -749,32 +749,32 @@ void hyjalAI::UpdateAI(const uint32 diff)
if (DoHide)
{
DoHide = false;
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case JAINA:
if (pInstance && pInstance->GetData(DATA_ALLIANCE_RETREAT))
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
+ me->SetVisibility(VISIBILITY_OFF);
+ HideNearPos(me->GetPositionX(), me->GetPositionY());
HideNearPos(5037.76, -1889.71);
for (uint8 i = 0; i < 92; ++i)//summon fires
- m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
+ me->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
}
- else m_creature->SetVisibility(VISIBILITY_ON);
+ else me->SetVisibility(VISIBILITY_ON);
break;
case THRALL: //thrall
if (pInstance && pInstance->GetData(DATA_HORDE_RETREAT))
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
+ me->SetVisibility(VISIBILITY_OFF);
+ HideNearPos(me->GetPositionX(), me->GetPositionY());
HideNearPos(5563, -2763.19);
HideNearPos(5542.2, -2629.36);
for (uint8 i = 0; i < 65; ++i)//summon fires
- m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
+ me->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
}
- else m_creature->SetVisibility(VISIBILITY_ON);
+ else me->SetVisibility(VISIBILITY_ON);
break;
}
}
@@ -783,7 +783,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
if (RespawnTimer <= diff)
{
DoRespawn = false;
- RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
+ RespawnNearPos(me->GetPositionX(), me->GetPositionY());
if (Faction == 0)
{
RespawnNearPos(5037.76, -1889.71);
@@ -792,10 +792,10 @@ void hyjalAI::UpdateAI(const uint32 diff)
RespawnNearPos(5563, -2763.19);
RespawnNearPos(5542.2, -2629.36);
}
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
}else{
RespawnTimer -= diff;
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
}
return;
}
@@ -807,8 +807,8 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
IsDummy = true;
bRetreat = false;
- HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
- switch(m_creature->GetEntry())
+ HideNearPos(me->GetPositionX(), me->GetPositionY());
+ switch(me->GetEntry())
{
case JAINA://jaina
HideNearPos(5037.76, -1889.71);
@@ -819,7 +819,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
HideNearPos(5603.75, -2853.12);
break;
}
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
} else RetreatTimer -= diff;
}
@@ -851,7 +851,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (BossGUID[i])
{
- Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]);
+ Unit* pUnit = Unit::GetUnit((*me), BossGUID[i]);
if (pUnit && (!pUnit->isAlive()))
{
if (BossGUID[i] == BossGUID[0])
@@ -866,7 +866,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
}
EventBegun = false;
CheckTimer = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
BossGUID[i] = 0;
if (pInstance)
pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
@@ -885,16 +885,16 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (SpellTimer[i] <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
Unit *pTarget = NULL;
switch(Spell[i].TargetType)
{
- case TARGETTYPE_SELF: pTarget = m_creature; break;
+ case TARGETTYPE_SELF: pTarget = me; break;
case TARGETTYPE_RANDOM: pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); break;
- case TARGETTYPE_VICTIM: pTarget = m_creature->getVictim(); break;
+ case TARGETTYPE_VICTIM: pTarget = me->getVictim(); break;
}
if (pTarget && pTarget->isAlive())
@@ -911,8 +911,8 @@ void hyjalAI::UpdateAI(const uint32 diff)
void hyjalAI::JustDied(Unit* killer)
{
if (IsDummy)return;
- m_creature->Respawn();
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->Respawn();
+ me->SetVisibility(VISIBILITY_OFF);
DoRespawn = true;
RespawnTimer = 120000;
Talk(DEATH);
@@ -939,14 +939,14 @@ 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(m_creature, creatures, creature_check);
+ Trinity::AllFriendlyCreaturesInGrid creature_check(me);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
// Get Creatures
- cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
@@ -965,61 +965,61 @@ void hyjalAI::RespawnNearPos(float x, float y)
cell.SetNoCreate();
Trinity::RespawnDo u_do;
- Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(m_creature, u_do);
+ Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(me, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
- cell.Visit(p, obj_worker, *m_creature->GetMap());
+ cell.Visit(p, obj_worker, *me->GetMap());
}
void hyjalAI::WaypointReached(uint32 i)
{
- if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL))
+ if (i == 1 || (i == 0 && me->GetEntry() == THRALL))
{
- m_creature->MonsterYell(YELL_HURRY,0,0);
+ me->MonsterYell(YELL_HURRY,0,0);
WaitForTeleport = true;
TeleportTimer = 20000;
- if (m_creature->GetEntry() == JAINA)
- DoCast(m_creature, SPELL_MASS_TELEPORT, false);
- if (m_creature->GetEntry() == THRALL && DummyGuid)
+ if (me->GetEntry() == JAINA)
+ DoCast(me, SPELL_MASS_TELEPORT, false);
+ if (me->GetEntry() == THRALL && DummyGuid)
{
- Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid);
+ Unit* Dummy = Unit::GetUnit((*me),DummyGuid);
if (Dummy)
{
CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true;
CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000;
- Dummy->CastSpell(m_creature, SPELL_MASS_TELEPORT, false);
+ Dummy->CastSpell(me, SPELL_MASS_TELEPORT, false);
}
}
//do some talking
//all alive guards walk near here
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
// First get all creatures.
std::list<Creature*> creatures;
- Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
+ Trinity::AllFriendlyCreaturesInGrid creature_check(me);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
{
- if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA)
+ if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA)
{
- if (!(*itr)->IsWithinDist(m_creature, 60))
+ if (!(*itr)->IsWithinDist(me, 60))
(*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
float x, y, z;
(*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE);
(*itr)->GetMotionMaster()->Initialize();
float range = 10;
- if (m_creature->GetEntry() == THRALL)range = 20;
- m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr)));
- (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ());
+ if (me->GetEntry() == THRALL)range = 20;
+ me->GetNearPoint(me, x, y, z, range, 0, me->GetAngle((*itr)));
+ (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), me->GetPositionZ());
}
}
}
@@ -1032,19 +1032,19 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
if (TeleportTimer <= diff)
{
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Creature*> creatures;
- Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
+ Trinity::AllFriendlyCreaturesInGrid creature_check(me);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
@@ -1057,7 +1057,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
(*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
- DoCast(m_creature, SPELL_TELEPORT_VISUAL);
+ DoCast(me, SPELL_TELEPORT_VISUAL);
bRetreat = true;
RetreatTimer = 1000;
}
@@ -1073,12 +1073,12 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
case 0://alliance
for (uint8 i = 0; i < 92; ++i)//summon fires
- m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
+ me->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
{
uint8 r = rand()%4;
- Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1090,7 +1090,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
{
uint8 r = rand()%4;
- Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1101,7 +1101,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
}
for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
{
- Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]);
@@ -1114,11 +1114,11 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
break;
case 1://horde
for (uint8 i = 0; i < 65; ++i)//summon fires
- m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
+ me->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
for (uint8 i = 0; i < 26; ++i)//summon infernals
{
- Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]);
@@ -1131,7 +1131,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
{
uint8 r = rand()%4;
- Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1143,7 +1143,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
{
uint8 r = rand()%4;
- Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
+ Creature* pUnit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp
index 6fd51e06312..634d30e7cae 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp
@@ -171,13 +171,13 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
SetupOverrun = true;
if (faction == 0)
{
- if (m_creature->GetEntry() == GARGOYLE)
+ if (me->GetEntry() == GARGOYLE)
{
DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4
DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1];
DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2];
}
- if (m_creature->GetEntry() == ABOMINATION)
+ if (me->GetEntry() == ABOMINATION)
{
for (uint8 i = 0; i < 4; ++i)
AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]);
@@ -200,7 +200,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]);
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]);
AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0);
+ me->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 18;
Start(true, true);
@@ -222,7 +222,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]);
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]);
AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0);
+ me->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 18;
Start(true, true);
@@ -237,7 +237,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
break;
}
}
- if (m_creature->GetEntry() == GHOUL)
+ if (me->GetEntry() == GHOUL)
{
for (uint8 i = 0; i < 4; ++i)
AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]);
@@ -246,7 +246,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
case 0:
AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]);
AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0);
+ me->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 5;
Start(true, true);
@@ -255,7 +255,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]);
AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]);
AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0);
+ me->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -265,7 +265,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]);
AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]);
AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0);
+ me->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 7;
Start(true, true);
@@ -274,7 +274,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]);
AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]);
AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0);
+ me->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -283,7 +283,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]);
AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]);
AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0);
+ me->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -295,7 +295,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]);
AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]);
AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]);
- m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0);
+ me->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 9;
Start(true, true);
@@ -312,7 +312,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
}
if (faction == 1)
{
- if (m_creature->GetEntry() == GHOUL)
+ if (me->GetEntry() == GHOUL)
{
for (uint8 i = 0; i < 6; ++i)
AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]);
@@ -323,7 +323,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]);
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]);
- m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0);
+ me->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 8;
Start(true, true);
@@ -333,7 +333,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]);
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]);
- m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0);
+ me->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 8;
Start(true, true);
@@ -347,7 +347,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
break;
}
}
- if (m_creature->GetEntry() == ABOMINATION)
+ if (me->GetEntry() == ABOMINATION)
{
for (uint8 i = 0; i < 6; ++i)
AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]);
@@ -365,11 +365,11 @@ void hyjal_trashAI::JustDied(Unit *victim)
{
if (!pInstance)
return;
- if (IsEvent && !m_creature->isWorldBoss())
+ if (IsEvent && !me->isWorldBoss())
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
- if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss()))
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
+ if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth()/4 && me->isWorldBoss()))
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
}
struct mob_giant_infernalAI : public hyjal_trashAI
@@ -380,9 +380,9 @@ struct mob_giant_infernalAI : public hyjal_trashAI
meteor = false;//call once!
CanMove = false;
Delay = rand()%30000;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(MODEL_INVIS);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(MODEL_INVIS);
pGo = false;
pos = 0;
Reset();
@@ -413,9 +413,9 @@ struct mob_giant_infernalAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
}
@@ -432,31 +432,31 @@ struct mob_giant_infernalAI : public hyjal_trashAI
if (!meteor)
{
float x,y,z;
- m_creature->GetPosition(x,y,z);
- Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000);
+ me->GetPosition(x,y,z);
+ Creature* trigger = me->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000);
if (trigger)
{
trigger->SetVisibility(VISIBILITY_OFF);
- trigger->setFaction(m_creature->getFaction());
+ trigger->setFaction(me->getFaction());
trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- trigger->CastSpell(m_creature,SPELL_METEOR,true);
+ trigger->CastSpell(me,SPELL_METEOR,true);
}
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
meteor = true;
} else if (!CanMove){
if (spawnTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
CanMove = true;
if (pInstance)
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
} else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){
//do overrun
}
@@ -485,12 +485,12 @@ struct mob_giant_infernalAI : public hyjal_trashAI
return;
if (!imol)
{
- DoCast(m_creature, SPELL_IMMOLATION);
+ DoCast(me, SPELL_IMMOLATION);
imol=true;
}
if (FlameBuffetTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAME_BUFFET, true);
+ DoCast(me->getVictim(), SPELL_FLAME_BUFFET, true);
FlameBuffetTimer = 7000;
} else FlameBuffetTimer -= diff;
DoMeleeAttackIfReady();
@@ -530,21 +530,21 @@ struct mob_abominationAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
if (i == LastOverronPos && IsOverrun)
{
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
- m_creature->setDeathState(DEAD);
- m_creature->RemoveCorpse();
+ me->setDeathState(DEAD);
+ me->RemoveCorpse();
}
}
}
@@ -579,13 +579,13 @@ struct mob_abominationAI : public hyjal_trashAI
}
}
}
- if (!m_creature->HasAura(SPELL_DISEASE_CLOUD))
- DoCast(m_creature, SPELL_DISEASE_CLOUD);
+ if (!me->HasAura(SPELL_DISEASE_CLOUD))
+ DoCast(me, SPELL_DISEASE_CLOUD);
if (!UpdateVictim())
return;
if (KnockDownTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ DoCast(me->getVictim(), SPELL_KNOCKDOWN);
KnockDownTimer = 15000+rand()%10000;
} else KnockDownTimer -= diff;
DoMeleeAttackIfReady();
@@ -628,22 +628,22 @@ struct mob_ghoulAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
if (i == LastOverronPos && IsOverrun)
{
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
- m_creature->setDeathState(DEAD);
- m_creature->RemoveCorpse();
+ me->setDeathState(DEAD);
+ me->RemoveCorpse();
}
}
@@ -681,7 +681,7 @@ struct mob_ghoulAI : public hyjal_trashAI
}
if (FrenzyTimer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
FrenzyTimer = 15000+rand()%15000;
} else FrenzyTimer -= diff;
if (!UpdateVictim())
@@ -703,7 +703,7 @@ CreatureAI* GetAI_mob_ghoul(Creature* pCreature)
struct mob_necromancerAI : public hyjal_trashAI
{
- mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(m_creature)
+ mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(me)
{
pInstance = c->GetInstanceData();
pGo = false;
@@ -735,13 +735,13 @@ struct mob_necromancerAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
}
@@ -798,7 +798,7 @@ struct mob_necromancerAI : public hyjal_trashAI
return;
if (ShadowBoltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
ShadowBoltTimer = 20000+rand()%10000;
} else ShadowBoltTimer -= diff;
@@ -844,13 +844,13 @@ struct mob_bansheeAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
}
@@ -889,17 +889,17 @@ struct mob_bansheeAI : public hyjal_trashAI
return;
if (CourseTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BANSHEE_CURSE);
+ DoCast(me->getVictim(), SPELL_BANSHEE_CURSE);
CourseTimer = 20000+rand()%5000;
} else CourseTimer -= diff;
if (WailTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BANSHEE_WAIL);
+ DoCast(me->getVictim(), SPELL_BANSHEE_WAIL);
WailTimer = 15000+rand()%5000;
} else WailTimer -= diff;
if (ShellTimer <= diff)
{
- DoCast(m_creature, SPELL_ANTI_MAGIC_SHELL);
+ DoCast(me, SPELL_ANTI_MAGIC_SHELL);
ShellTimer = 50000+rand()%10000;
} else ShellTimer -= diff;
DoMeleeAttackIfReady();
@@ -938,13 +938,13 @@ struct mob_crypt_fiendAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
}
@@ -984,7 +984,7 @@ struct mob_crypt_fiendAI : public hyjal_trashAI
return;
if (WebTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WEB);
+ DoCast(me->getVictim(), SPELL_WEB);
WebTimer = 20000+rand()%5000;
} else WebTimer -= diff;
DoMeleeAttackIfReady();
@@ -1023,13 +1023,13 @@ struct mob_fel_stalkerAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}else{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
}
}
}
@@ -1069,7 +1069,7 @@ struct mob_fel_stalkerAI : public hyjal_trashAI
return;
if (ManaBurnTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MANA_BURN);
+ DoCast(me->getVictim(), SPELL_MANA_BURN);
ManaBurnTimer = 9000+rand()%5000;
} else ManaBurnTimer -= diff;
DoMeleeAttackIfReady();
@@ -1102,7 +1102,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
{
FrostBreathTimer = 5000;
MoveTimer = 0;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
}
void WaypointReached(uint32 i)
@@ -1110,10 +1110,10 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
{
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
DoCast(pTarget, SPELL_FROST_BREATH, true);
}
}
@@ -1125,10 +1125,10 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
float x,y,z;
- m_creature->GetPosition(x,y,z);
- z = m_creature->GetMap()->GetVmapHeight(x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
- m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
+ me->GetPosition(x,y,z);
+ z = me->GetMap()->GetVmapHeight(x, y, z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z);
+ me->GetMap()->CreatureRelocation(me, x,y,z,0);
}
void EnterCombat(Unit* who) {}
@@ -1138,7 +1138,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
hyjal_trashAI::UpdateAI(diff);
if (IsEvent || IsOverrun)
{
- CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
+ CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
npc_escortAI::UpdateAI(diff);
}
if (IsEvent)
@@ -1165,21 +1165,21 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
}
if (!UpdateVictim())
return;
- if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){
+ if (!me->IsWithinDist(me->getVictim(), 25)){
if (MoveTimer <= diff)
{
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
MoveTimer = 2000;
} else MoveTimer-=diff;
}
if (FrostBreathTimer <= diff)
{
- if (!m_creature->IsWithinDist(m_creature->getVictim(), 25))
+ if (!me->IsWithinDist(me->getVictim(), 25))
{
- DoCast(m_creature->getVictim(), SPELL_FROST_BREATH);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
+ DoCast(me->getVictim(), SPELL_FROST_BREATH);
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
FrostBreathTimer = 4000;
}
} else FrostBreathTimer -= diff;
@@ -1217,7 +1217,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
Zpos = 10.0;
StrikeTimer = 2000+rand()%5000;
MoveTimer = 0;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
}
void WaypointReached(uint32 i)
@@ -1225,10 +1225,10 @@ struct mob_gargoyleAI : public hyjal_trashAI
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
{
- m_creature->AddThreat(pTarget,0.0);
+ me->AddThreat(pTarget,0.0);
DoCast(pTarget, SPELL_GARGOYLE_STRIKE, true);
}
}
@@ -1237,10 +1237,10 @@ struct mob_gargoyleAI : public hyjal_trashAI
void JustDied(Unit *victim)
{
float x,y,z;
- m_creature->GetPosition(x,y,z);
- z = m_creature->GetMap()->GetVmapHeight(x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
- m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
+ me->GetPosition(x,y,z);
+ z = me->GetMap()->GetVmapHeight(x, y, z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z);
+ me->GetMap()->CreatureRelocation(me, x,y,z,0);
hyjal_trashAI::JustDied(victim);
}
@@ -1249,7 +1249,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
hyjal_trashAI::UpdateAI(diff);
if (IsEvent || IsOverrun)
{
- CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
+ CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
npc_escortAI::UpdateAI(diff);
}
if (IsEvent)
@@ -1280,27 +1280,27 @@ struct mob_gargoyleAI : public hyjal_trashAI
{
if (StrikeTimer <= diff)
{
- m_creature->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false);
+ me->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false);
StrikeTimer = 2000+rand()%1000;
} else StrikeTimer -= diff;
}
}
if (!UpdateVictim())
return;
- if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove)
+ if (!me->IsWithinDist(me->getVictim(), 20) || forcemove)
{
forcemove = false;
if (forcemove)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
- m_creature->Attack(pTarget,false);
+ me->Attack(pTarget,false);
}
if (MoveTimer <= diff)
{
float x,y,z;
- m_creature->getVictim()->GetPosition(x,y,z);
- m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos);
+ me->getVictim()->GetPosition(x,y,z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z+Zpos);
Zpos-=1.0;
if (Zpos <= 0)Zpos=0;
MoveTimer = 2000;
@@ -1308,11 +1308,11 @@ struct mob_gargoyleAI : public hyjal_trashAI
}
if (StrikeTimer <= diff)
{
- if (m_creature->IsWithinDist(m_creature->getVictim(), 20))
+ if (me->IsWithinDist(me->getVictim(), 20))
{
- DoCast(m_creature->getVictim(), SPELL_GARGOYLE_STRIKE);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
+ DoCast(me->getVictim(), SPELL_GARGOYLE_STRIKE);
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
StrikeTimer = 2000+rand()%1000;
} else StrikeTimer=0;
} else StrikeTimer -= diff;
@@ -1346,13 +1346,13 @@ struct alliance_riflemanAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *who)
{
- if (!who || m_creature->getVictim())
+ if (!who || me->getVictim())
return;
- if (who->isTargetableForAttack() && m_creature->IsHostileTo(who))
+ if (who->isTargetableForAttack() && me->IsHostileTo(who))
{
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, 30))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, 30))
{
AttackStart(who);
}
@@ -1370,13 +1370,13 @@ struct alliance_riflemanAI : public Scripted_NoMovementAI
return;
if (ExplodeTimer <= diff)
{
- if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30))
+ if (!me->IsWithinDistInMap(me->getVictim(), 30))
{
EnterEvadeMode();
return;
}
int dmg = 500+rand()%700;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
+ me->CastCustomSpell(me->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
ExplodeTimer = 5000+rand()%5000;
} else ExplodeTimer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
index 077a49ade01..1060d42d4ea 100644
--- a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
@@ -67,18 +67,18 @@ struct boss_captain_skarlocAI : public ScriptedAI
void EnterCombat(Unit *who)
{
//This is not correct. Should taunt Thrall before engage in combat
- DoScriptText(SAY_TAUNT1, m_creature);
- DoScriptText(SAY_TAUNT2, m_creature);
+ DoScriptText(SAY_TAUNT1, me);
+ DoScriptText(SAY_TAUNT2, me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART1, DONE);
@@ -93,42 +93,42 @@ struct boss_captain_skarlocAI : public ScriptedAI
//Holy_Light
if (Holy_Light_Timer <= diff)
{
- DoCast(m_creature, SPELL_HOLY_LIGHT);
+ DoCast(me, SPELL_HOLY_LIGHT);
Holy_Light_Timer = 30000;
} else Holy_Light_Timer -= diff;
//Cleanse
if (Cleanse_Timer <= diff)
{
- DoCast(m_creature, SPELL_CLEANSE);
+ DoCast(me, SPELL_CLEANSE);
Cleanse_Timer = 10000;
} else Cleanse_Timer -= diff;
//Hammer of Justice
if (HammerOfJustice_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
+ DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
HammerOfJustice_Timer = 60000;
} else HammerOfJustice_Timer -= diff;
//Holy Shield
if (HolyShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_HOLY_SHIELD);
+ DoCast(me, SPELL_HOLY_SHIELD);
HolyShield_Timer = 240000;
} else HolyShield_Timer -= diff;
//Devotion_Aura
if (DevotionAura_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEVOTION_AURA);
+ DoCast(me, SPELL_DEVOTION_AURA);
DevotionAura_Timer = 45000 + rand()%10000;
} else DevotionAura_Timer -= diff;
//Consecration
if (Consecration_Timer <= diff)
{
- //DoCast(m_creature->getVictim(), SPELL_CONSECRATION);
+ //DoCast(me->getVictim(), SPELL_CONSECRATION);
Consecration_Timer = 5000 + rand()%5000;
} else Consecration_Timer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
index c7a1bc34f72..70c02e26bc9 100644
--- a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
@@ -64,17 +64,17 @@ struct boss_epoch_hunterAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART4, DONE);
@@ -89,19 +89,19 @@ struct boss_epoch_hunterAI : public ScriptedAI
//Sand Breath
if (SandBreath_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_SAND_BREATH);
+ DoCast(me->getVictim(), SPELL_SAND_BREATH);
- DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), m_creature);
+ DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), me);
SandBreath_Timer = 10000 + rand()%10000;
} else SandBreath_Timer -= diff;
if (ImpendingDeath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_IMPENDING_DEATH);
+ DoCast(me->getVictim(), SPELL_IMPENDING_DEATH);
ImpendingDeath_Timer = 25000+rand()%5000;
} else ImpendingDeath_Timer -= diff;
@@ -114,7 +114,7 @@ struct boss_epoch_hunterAI : public ScriptedAI
if (Mda_Timer <= diff)
{
- DoCast(m_creature, SPELL_MAGIC_DISRUPTION_AURA);
+ DoCast(me, SPELL_MAGIC_DISRUPTION_AURA);
Mda_Timer = 15000;
} else Mda_Timer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
index ee6860b1858..31f7f7647a2 100644
--- a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
@@ -115,17 +115,17 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -133,7 +133,7 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
//TODO: make this work
if (CanPatrol && wpId == 0)
{
- m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
+ me->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
++wpId;
}
@@ -144,23 +144,23 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
//Whirlwind
if (Whirlwind_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 20000+rand()%5000;
} else Whirlwind_Timer -= diff;
//Fear
if (Fear_Timer <= diff)
{
- DoScriptText(SAY_SHOUT, m_creature);
- DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
+ DoScriptText(SAY_SHOUT, me);
+ DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Fear_Timer = 25000+rand()%10000;
} else Fear_Timer -= diff;
//Mortal Strike
if (MortalStrike_Timer <= diff)
{
- DoScriptText(SAY_MORTAL, m_creature);
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoScriptText(SAY_MORTAL, me);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 20000+rand()%10000;
} else MortalStrike_Timer -= diff;
diff --git a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
index 3e71ba5bd8f..8b1583dae69 100644
--- a/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
@@ -184,7 +184,7 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
pInstance = c->GetInstanceData();
HadMount = false;
- m_creature->setActive(true);
+ me->setActive(true);
}
ScriptedInstance *pInstance;
@@ -203,73 +203,73 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
case 8:
SetRun(false);
- m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
- DoScriptText(SAY_TH_ARMORY, m_creature);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
- //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
- //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
- //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
- //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
+ DoScriptText(SAY_TH_ARMORY, me);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
+ //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
+ //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
+ //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
+ //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
break;
case 10:
- m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED);
+ me->SetDisplayId(THRALL_MODEL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
- m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 21:
- m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 25:
- m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 29:
- DoScriptText(SAY_TH_SKARLOC_MEET, m_creature);
- m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ DoScriptText(SAY_TH_SKARLOC_MEET, me);
+ me->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
//temporary,skarloc should rather be triggered to walk up to thrall
break;
case 30:
SetEscortPaused(true);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
- DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
+ DoScriptText(SAY_TH_MOUNTS_UP, me);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
- m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 59:
- m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
+ me->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);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
@@ -277,10 +277,10 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
SetRun(false);
break;
case 68:
- m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
SetRun();
@@ -289,42 +289,42 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
SetRun(false);
break;
case 83:
- m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ me->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ me->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
break;
case 84:
- DoScriptText(SAY_TH_CHURCH_END, m_creature);
+ DoScriptText(SAY_TH_CHURCH_END, me);
SetRun();
break;
case 91:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 93:
- m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 94:
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
- if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID))
- DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature);
+ if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID))
+ DoScriptText(SAY_TA_ESCAPED, Taretha, me);
}
break;
case 95:
- DoScriptText(SAY_TH_MEET_TARETHA, m_creature);
+ DoScriptText(SAY_TH_MEET_TARETHA, me);
pInstance->SetData(TYPE_THRALL_PART3,DONE);
SetEscortPaused(true);
break;
case 96:
- DoScriptText(SAY_TH_EPOCH_WONDER, m_creature);
+ DoScriptText(SAY_TH_EPOCH_WONDER, me);
break;
case 97:
- DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature);
+ DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, me);
SetRun();
break;
case 98:
@@ -342,24 +342,24 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
}
//kill credit Creature for quest
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const& players = pMap->GetPlayers();
if (!players.isEmpty() && pMap->IsDungeon())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
- pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID());
+ pPlayer->KilledMonsterCredit(20156,me->GetGUID());
}
}
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
- m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
+ me->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
}
break;
case 108:
//last waypoint, just set Thrall invisible, respawn is turned off
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
break;
}
}
@@ -375,34 +375,34 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
DoUnmount();
HadMount = false;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
- m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ me->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), m_creature);
+ DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), me);
}
}
void StartWP()
{
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(false);
}
void DoMount()
{
- m_creature->Mount(SKARLOC_MOUNT_MODEL);
- m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT);
+ me->Mount(SKARLOC_MOUNT_MODEL);
+ me->SetSpeed(MOVE_RUN,SPEED_MOUNT);
}
void DoUnmount()
{
- m_creature->Unmount();
- m_creature->SetSpeed(MOVE_RUN,SPEED_RUN);
+ me->Unmount();
+ me->SetSpeed(MOVE_RUN,SPEED_RUN);
}
void EnterCombat(Unit* who)
{
- DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), m_creature);
- if (m_creature->IsMounted())
+ DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), me);
+ if (me->IsMounted())
{
DoUnmount();
HadMount = true;
@@ -421,14 +421,14 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
case EROZION_ENTRY:
break;
default:
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
break;
}
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), m_creature);
+ DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), me);
}
void JustDied(Unit *slayer)
{
@@ -436,10 +436,10 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
- if (slayer == m_creature)
+ if (slayer == me)
return;
- DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), m_creature);
+ DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), me);
}
void UpdateAI(const uint32 diff)
@@ -450,9 +450,9 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
return;
//TODO: add his abilities'n-crap here
- if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20))
+ if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
{
- DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), m_creature);
+ DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), me);
LowHp = true;
}
}
@@ -567,10 +567,10 @@ struct npc_tarethaAI : public npc_escortAI
switch(i)
{
case 6:
- DoScriptText(SAY_TA_FREE, m_creature);
+ DoScriptText(SAY_TA_FREE, me);
break;
case 7:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
break;
}
}
diff --git a/src/scripts/kalimdor/darkshore.cpp b/src/scripts/kalimdor/darkshore.cpp
index b524dd328b1..97266b923b5 100644
--- a/src/scripts/kalimdor/darkshore.cpp
+++ b/src/scripts/kalimdor/darkshore.cpp
@@ -78,16 +78,16 @@ struct npc_kerlonianAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_LILADRIS)
+ if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_LILADRIS)
{
- if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*5))
+ if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*5))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE)
- pPlayer->GroupEventHappens(QUEST_SLEEPER_AWAKENED, m_creature);
+ pPlayer->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me);
- DoScriptText(SAY_KER_END, m_creature);
+ DoScriptText(SAY_KER_END, me);
}
SetFollowComplete();
@@ -105,20 +105,20 @@ struct npc_kerlonianAI : public FollowerAI
{
SetFollowPaused(true);
- DoScriptText(RAND(EMOTE_KER_SLEEP_1,EMOTE_KER_SLEEP_2,EMOTE_KER_SLEEP_3), m_creature);
+ DoScriptText(RAND(EMOTE_KER_SLEEP_1,EMOTE_KER_SLEEP_2,EMOTE_KER_SLEEP_3), me);
- DoScriptText(RAND(SAY_KER_SLEEP_1,SAY_KER_SLEEP_2,SAY_KER_SLEEP_3,SAY_KER_SLEEP_4), m_creature);
+ DoScriptText(RAND(SAY_KER_SLEEP_1,SAY_KER_SLEEP_2,SAY_KER_SLEEP_3,SAY_KER_SLEEP_4), me);
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
- DoCast(m_creature, SPELL_SLEEP_VISUAL, false);
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
+ DoCast(me, SPELL_SLEEP_VISUAL, false);
}
void ClearSleeping()
{
- m_creature->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
- DoScriptText(EMOTE_KER_AWAKEN, m_creature);
+ DoScriptText(EMOTE_KER_AWAKEN, me);
SetFollowPaused(false);
}
@@ -273,7 +273,7 @@ struct npc_prospector_remtravelAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
//unsure if it should be any
- //pSummoned->AI()->AttackStart(m_creature);
+ //pSummoned->AI()->AttackStart(me);
}
};
@@ -320,9 +320,9 @@ struct npc_threshwackonatorAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_GELKAK)
+ if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_GELKAK)
{
- if (m_creature->IsWithinDistInMap(pWho, 10.0f))
+ if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(SAY_AT_CLOSE, pWho);
DoAtEnd();
diff --git a/src/scripts/kalimdor/desolace.cpp b/src/scripts/kalimdor/desolace.cpp
index 4798da72819..e5fa9b02ed1 100644
--- a/src/scripts/kalimdor/desolace.cpp
+++ b/src/scripts/kalimdor/desolace.cpp
@@ -64,15 +64,15 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
if (pWho->GetEntry() == NPC_SMEED)
{
- if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return;
- if (m_creature->IsWithinDistInMap(pWho, 10.0f))
+ if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(RAND(SAY_SMEED_HOME_1,SAY_SMEED_HOME_2,SAY_SMEED_HOME_3), pWho);
//spell have no implemented effect (dummy), so useful to notify spellHit
- DoCast(m_creature, SPELL_KODO_KOMBO_GOSSIP, true);
+ DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
}
}
}
@@ -81,7 +81,7 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_uiDespawnTimer = 60000;
}
}
@@ -91,11 +91,11 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
//timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
if (m_uiDespawnTimer && m_uiDespawnTimer <= diff)
{
- if (!m_creature->getVictim() && m_creature->isAlive())
+ if (!me->getVictim() && me->isAlive())
{
Reset();
- m_creature->setDeathState(JUST_DIED);
- m_creature->Respawn();
+ me->setDeathState(JUST_DIED);
+ me->Respawn();
return;
}
} else m_uiDespawnTimer -= diff;
diff --git a/src/scripts/kalimdor/durotar.cpp b/src/scripts/kalimdor/durotar.cpp
index 8dbf33a2788..15ad1036770 100644
--- a/src/scripts/kalimdor/durotar.cpp
+++ b/src/scripts/kalimdor/durotar.cpp
@@ -62,21 +62,21 @@ struct npc_lazy_peonAI : public ScriptedAI
if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER
&& CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
{
- caster->ToPlayer()->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID());
- DoScriptText(SAY_SPELL_HIT, m_creature, caster);
- m_creature->RemoveAllAuras();
- if (GameObject* Lumberpile = m_creature->FindNearestGameObject(GO_LUMBERPILE, 20))
- m_creature->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
+ caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
+ DoScriptText(SAY_SPELL_HIT, me, caster);
+ me->RemoveAllAuras();
+ if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
+ me->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
}
}
void UpdateAI(const uint32 uiDiff)
{
if (work = true)
- m_creature->HandleEmoteCommand(466);
+ me->HandleEmoteCommand(466);
if (m_uiRebuffTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_BUFF_SLEEP);
+ DoCast(me, SPELL_BUFF_SLEEP);
m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes
}
else
diff --git a/src/scripts/kalimdor/dustwallow_marsh.cpp b/src/scripts/kalimdor/dustwallow_marsh.cpp
index 8caecc70ab1..0f4780fd559 100644
--- a/src/scripts/kalimdor/dustwallow_marsh.cpp
+++ b/src/scripts/kalimdor/dustwallow_marsh.cpp
@@ -70,8 +70,8 @@ struct mobs_risen_husk_spiritAI : public ScriptedAI
if (m_uiConsumeFlesh_Timer <= uiDiff)
{
- if (m_creature->GetEntry() == NPC_RISEN_HUSK)
- DoCast(m_creature->getVictim(), SPELL_CONSUME_FLESH);
+ if (me->GetEntry() == NPC_RISEN_HUSK)
+ DoCast(me->getVictim(), SPELL_CONSUME_FLESH);
m_uiConsumeFlesh_Timer = 15000;
}
@@ -80,8 +80,8 @@ struct mobs_risen_husk_spiritAI : public ScriptedAI
if (m_uiIntangiblePresence_Timer <= uiDiff)
{
- if (m_creature->GetEntry() == NPC_RISEN_SPIRIT)
- DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
+ if (me->GetEntry() == NPC_RISEN_SPIRIT)
+ DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
m_uiIntangiblePresence_Timer = 20000;
}
@@ -124,7 +124,7 @@ struct npc_restless_apparitionAI : public ScriptedAI
void Reset()
{
- DoScriptText(RAND(SAY_RESTLESS_1,SAY_RESTLESS_2,SAY_RESTLESS_3), m_creature);
+ DoScriptText(RAND(SAY_RESTLESS_1,SAY_RESTLESS_2,SAY_RESTLESS_3), me);
}
};
@@ -272,10 +272,10 @@ struct npc_private_hendelAI : public ScriptedAI
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
return;
- if (m_creature->IsFriendlyTo(pAttacker))
+ if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -283,14 +283,14 @@ struct npc_private_hendelAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 20))
+ if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 20))
{
uiDamage = 0;
if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself())
- pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, m_creature);
+ pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me);
- DoScriptText(EMOTE_SURRENDER, m_creature);
+ DoScriptText(EMOTE_SURRENDER, me);
EnterEvadeMode();
}
}
@@ -333,13 +333,13 @@ struct npc_zelfraxAI : public ScriptedAI
if (!pWho)
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
if (IsCombatMovement())
- m_creature->GetMotionMaster()->MoveChase(pWho);
+ me->GetMotionMaster()->MoveChase(pWho);
}
}
@@ -348,21 +348,21 @@ struct npc_zelfraxAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
+ me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
SetCombatMovement(true);
- if (m_creature->isInCombat())
- if (Unit* pUnit = m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(pUnit);
+ if (me->isInCombat())
+ if (Unit* pUnit = me->getVictim())
+ me->GetMotionMaster()->MoveChase(pUnit);
}
void MoveToDock()
{
SetCombatMovement(false);
- m_creature->GetMotionMaster()->MovePoint(0,MovePosition);
- DoScriptText(SAY_ZELFRAX,m_creature);
- DoScriptText(SAY_ZELFRAX_2,m_creature);
+ me->GetMotionMaster()->MovePoint(0,MovePosition);
+ DoScriptText(SAY_ZELFRAX,me);
+ DoScriptText(SAY_ZELFRAX_2,me);
}
void UpdateAI(uint32 const uiDiff)
diff --git a/src/scripts/kalimdor/feralas.cpp b/src/scripts/kalimdor/feralas.cpp
index fb180552944..8f8a1f435f2 100644
--- a/src/scripts/kalimdor/feralas.cpp
+++ b/src/scripts/kalimdor/feralas.cpp
@@ -89,32 +89,32 @@ struct npc_oox22feAI : public npc_escortAI
{
// First Ambush(3 Yetis)
case 11:
- DoScriptText(SAY_OOX_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);
+ DoScriptText(SAY_OOX_AMBUSH, me);
+ me->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->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_OOX_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);
+ DoScriptText(SAY_OOX_AMBUSH, me);
+ me->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->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_OOX_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);
+ DoScriptText(SAY_OOX_AMBUSH, me);
+ me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ me->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
break;
case 37:
- DoScriptText(SAY_OOX_END, m_creature);
+ DoScriptText(SAY_OOX_END, me);
// Award quest credit
if (Player* pPlayer = GetPlayerForEscort())
{
- pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature);
+ pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
}
break;
}
@@ -123,19 +123,19 @@ struct npc_oox22feAI : public npc_escortAI
void Reset()
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
}
void EnterCombat(Unit* who)
{
//For an small probability the npc says something when he get aggro
if (urand(0,9) > 7)
- DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), m_creature);
+ DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), me);
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
};
diff --git a/src/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp b/src/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp
index 83c62b7085f..eac460846d0 100644
--- a/src/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp
+++ b/src/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp
@@ -46,7 +46,7 @@ struct celebras_the_cursedAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ me->SummonCreature(13716, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -67,15 +67,15 @@ struct celebras_the_cursedAI : public ScriptedAI
//EntanglingRoots
if (EntanglingRoots_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENTANGLINGROOTS);
+ DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
EntanglingRoots_Timer = 20000;
} else EntanglingRoots_Timer -= diff;
//CorruptForces
if (CorruptForces_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_CORRUPT_FORCES);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_CORRUPT_FORCES);
CorruptForces_Timer = 20000;
} else CorruptForces_Timer -= diff;
diff --git a/src/scripts/kalimdor/maraudon/boss_landslide.cpp b/src/scripts/kalimdor/maraudon/boss_landslide.cpp
index 65b00702107..894bb97637f 100644
--- a/src/scripts/kalimdor/maraudon/boss_landslide.cpp
+++ b/src/scripts/kalimdor/maraudon/boss_landslide.cpp
@@ -54,24 +54,24 @@ struct boss_landslideAI : public ScriptedAI
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 15000;
} else KnockAway_Timer -= diff;
//Trample_Timer
if (Trample_Timer <= diff)
{
- DoCast(m_creature, SPELL_TRAMPLE);
+ DoCast(me, SPELL_TRAMPLE);
Trample_Timer = 8000;
} else Trample_Timer -= diff;
//Landslide
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
if (Landslide_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_LANDSLIDE);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_LANDSLIDE);
Landslide_Timer = 60000;
} else Landslide_Timer -= diff;
}
diff --git a/src/scripts/kalimdor/maraudon/boss_noxxion.cpp b/src/scripts/kalimdor/maraudon/boss_noxxion.cpp
index e68eb2928fb..3860e2d8777 100644
--- a/src/scripts/kalimdor/maraudon/boss_noxxion.cpp
+++ b/src/scripts/kalimdor/maraudon/boss_noxxion.cpp
@@ -60,12 +60,12 @@ struct boss_noxxionAI : public ScriptedAI
if (Invisible && Invisible_Timer <= diff)
{
//Become visible again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//Noxxion model
- m_creature->SetDisplayId(11172);
+ me->SetDisplayId(11172);
Invisible = false;
- //m_creature->m_canMove = true;
+ //me->m_canMove = true;
} else if (Invisible)
{
Invisible_Timer -= diff;
@@ -80,14 +80,14 @@ struct boss_noxxionAI : public ScriptedAI
//ToxicVolley_Timer
if (ToxicVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TOXICVOLLEY);
+ DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
ToxicVolley_Timer = 9000;
} else ToxicVolley_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 12000;
} else Uppercut_Timer -= diff;
@@ -95,17 +95,17 @@ struct boss_noxxionAI : public ScriptedAI
if (!Invisible && Adds_Timer <= diff)
{
//Inturrupt any spell casting
- //m_creature->m_canMove = true;
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //me->m_canMove = true;
+ me->InterruptNonMeleeSpells(false);
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// Invisible Model
- m_creature->SetDisplayId(11686);
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
+ me->SetDisplayId(11686);
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
+ SummonAdds(me->getVictim());
Invisible = true;
Invisible_Timer = 15000;
diff --git a/src/scripts/kalimdor/maraudon/boss_princess_theradras.cpp b/src/scripts/kalimdor/maraudon/boss_princess_theradras.cpp
index 79ce7351fa2..ca11e11ccc2 100644
--- a/src/scripts/kalimdor/maraudon/boss_princess_theradras.cpp
+++ b/src/scripts/kalimdor/maraudon/boss_princess_theradras.cpp
@@ -51,7 +51,7 @@ struct boss_ptheradrasAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
+ me->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
}
void UpdateAI(const uint32 diff)
@@ -62,7 +62,7 @@ struct boss_ptheradrasAI : public ScriptedAI
//Dustfield_Timer
if (Dustfield_Timer <= diff)
{
- DoCast(m_creature, SPELL_DUSTFIELD);
+ DoCast(me, SPELL_DUSTFIELD);
Dustfield_Timer = 14000;
} else Dustfield_Timer -= diff;
@@ -79,14 +79,14 @@ struct boss_ptheradrasAI : public ScriptedAI
//RepulsiveGaze_Timer
if (RepulsiveGaze_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REPULSIVEGAZE);
+ DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
RepulsiveGaze_Timer = 20000;
} else RepulsiveGaze_Timer -= diff;
//Thrash_Timer
if (Thrash_Timer <= diff)
{
- DoCast(m_creature, SPELL_THRASH);
+ DoCast(me, SPELL_THRASH);
Thrash_Timer = 18000;
} else Thrash_Timer -= diff;
diff --git a/src/scripts/kalimdor/moonglade.cpp b/src/scripts/kalimdor/moonglade.cpp
index cb319f43a18..3bdec51f0aa 100644
--- a/src/scripts/kalimdor/moonglade.cpp
+++ b/src/scripts/kalimdor/moonglade.cpp
@@ -314,8 +314,8 @@ public:
uint32 rnd = rand()%2;
switch(rnd)
{
- case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, m_creature, who); break;
- case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, m_creature, who); break;
+ case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break;
+ case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break;
}
}
@@ -341,11 +341,11 @@ public:
if (!PlayerGUID)
{
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
return;
}
- if (!m_creature->isInCombat() && !Event_onWait)
+ if (!me->isInCombat() && !Event_onWait)
{
if (checkPlayer_Timer <= diff)
{
@@ -362,7 +362,7 @@ public:
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!pPlayer || (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_NONE))
{
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
return;
}
@@ -372,7 +372,7 @@ public:
switch(Step)
{
case 0:
- m_creature->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID);
+ me->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID);
Event_Timer = 8000;
Step = 1;
break;
@@ -385,13 +385,13 @@ public:
switch(Step)
{
case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, m_creature, pPlayer);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, pPlayer);
Event_onWait = false;
break;
}
@@ -400,12 +400,12 @@ public:
switch(Step)
{
case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false;
break;
}
@@ -414,7 +414,7 @@ public:
switch(Step)
{
case 0:
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, m_creature, pPlayer);
+ DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, pPlayer);
Event_Timer = 15000;
Step = 1;
break;
@@ -428,11 +428,11 @@ public:
{
case 0:
{
- Creature *mob = m_creature->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);
+ Creature *mob = me->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);
if (mob)
{
- mob->AddThreat(m_creature,10000.0f);
- mob->AI()->AttackStart(m_creature);
+ mob->AddThreat(me,10000.0f);
+ mob->AI()->AttackStart(me);
}
Event_Timer = 2000;
Step = 1;
@@ -447,12 +447,12 @@ public:
switch(Step)
{
case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false;
break;
}
@@ -461,7 +461,7 @@ public:
switch(Step)
{
case 0:
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, m_creature, pPlayer);
+ DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, pPlayer);
Event_Timer = 4000;
Step = 1;
break;
@@ -474,22 +474,22 @@ public:
switch(Step)
{
case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, m_creature, pPlayer);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
+ DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, pPlayer);
pPlayer->CompleteQuest(10965);
Event_Timer = 1500;
Step = 1;
break;
case 1:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_Timer = 3000;
Step = 2;
break;
case 2:
- pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID());
+ pPlayer->TalkedToCreature(me->GetEntry(), me->GetGUID());
PlayerGUID = 0;
Reset();
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
break;
}
break;
diff --git a/src/scripts/kalimdor/mulgore.cpp b/src/scripts/kalimdor/mulgore.cpp
index 627e2812427..464f0d3a255 100644
--- a/src/scripts/kalimdor/mulgore.cpp
+++ b/src/scripts/kalimdor/mulgore.cpp
@@ -92,27 +92,27 @@ struct npc_kyle_frenziedAI : public ScriptedAI
uiEventTimer = 5000;
uiEventPhase = 0;
- if (m_creature->GetEntry() == NPC_KYLE_FRIENDLY)
- m_creature->UpdateEntry(NPC_KYLE_FRENZIED);
+ if (me->GetEntry() == NPC_KYLE_FRIENDLY)
+ me->UpdateEntry(NPC_KYLE_FRENZIED);
}
void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
{
- if (!m_creature->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH)
+ if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH)
{
if (pCaster->GetTypeId() == TYPEID_PLAYER)
uiPlayerGUID = pCaster->GetGUID();
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
}
bEvent = true;
- DoScriptText(EMOTE_SEE_LUNCH, m_creature);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL);
+ DoScriptText(EMOTE_SEE_LUNCH, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL);
}
}
@@ -140,34 +140,34 @@ struct npc_kyle_frenziedAI : public ScriptedAI
switch(uiEventPhase)
{
case 1:
- if (Unit* pUnit = Unit::GetUnit(*m_creature,uiPlayerGUID))
+ if (Unit* pUnit = Unit::GetUnit(*me,uiPlayerGUID))
{
if (GameObject* pGo = pUnit->GetGameObject(SPELL_LUNCH))
{
m_bIsMovingToLunch = true;
- m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
}
}
break;
case 2:
- DoScriptText(EMOTE_EAT_LUNCH, m_creature);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
+ DoScriptText(EMOTE_EAT_LUNCH, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
break;
case 3:
if (Player* pUnit = Unit::GetPlayer(uiPlayerGUID))
- pUnit->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID());
+ pUnit->TalkedToCreature(me->GetEntry(), me->GetGUID());
- m_creature->UpdateEntry(NPC_KYLE_FRIENDLY);
+ me->UpdateEntry(NPC_KYLE_FRIENDLY);
break;
case 4:
uiEventTimer = 30000;
- DoScriptText(EMOTE_DANCE, m_creature);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL);
+ DoScriptText(EMOTE_DANCE, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL);
break;
case 5:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
Reset();
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
break;
}
}
@@ -269,8 +269,8 @@ struct npc_plains_visionAI : public ScriptedAI
}
else
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
}
}
@@ -278,7 +278,7 @@ struct npc_plains_visionAI : public ScriptedAI
{
if (newWaypoint)
{
- m_creature->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]);
+ me->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]);
newWaypoint = false;
}
}
diff --git a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
index 81ddf3db69d..219a1327575 100644
--- a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
+++ b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
@@ -149,8 +149,8 @@ struct boss_onyxiaAI : public ScriptedAI
void Aggro(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
- m_creature->SetInCombatWithZone();
+ DoScriptText(SAY_AGGRO, me);
+ me->SetInCombatWithZone();
}
void JustSummoned(Creature *pSummoned)
@@ -163,7 +163,7 @@ struct boss_onyxiaAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void SpellHit(Unit *pCaster, const SpellEntry* pSpell)
@@ -177,8 +177,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_pPointData)
{
- m_creature->GetMap()->CreatureRelocation(m_creature, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, 0.0f);
- m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
+ me->GetMap()->CreatureRelocation(me, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, 0.0f);
+ me->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
}
}
@@ -218,7 +218,7 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiFlameBreathTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
+ DoCast(me->getVictim(), SPELL_FLAMEBREATH);
m_uiFlameBreathTimer = urand(10000, 20000);
}
else
@@ -226,7 +226,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiTailSweepTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_TAILSWEEP);
+ DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweepTimer = urand(15000, 20000);
}
else
@@ -234,7 +234,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiCleaveTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleaveTimer = urand(2000, 5000);
}
else
@@ -242,7 +242,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiWingBuffetTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
+ DoCast(me->getVictim(), SPELL_WINGBUFFET);
m_uiWingBuffetTimer = urand(15000, 30000);
}
else
@@ -252,7 +252,7 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiBellowingRoarTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
m_uiBellowingRoarTimer = 30000;
}
else
@@ -260,19 +260,19 @@ struct boss_onyxiaAI : public ScriptedAI
}
else
{
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 60)
{
m_uiPhase = PHASE_BREATH;
SetCombatMovement(false);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
- DoScriptText(SAY_PHASE_2_TRANS, m_creature);
+ DoScriptText(SAY_PHASE_2_TRANS, me);
if (m_pPointData)
- m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
SetNextRandomPoint();
return;
@@ -283,13 +283,13 @@ struct boss_onyxiaAI : public ScriptedAI
}
else
{
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 40)
{
m_uiPhase = PHASE_END;
- DoScriptText(SAY_PHASE_3_TRANS, m_creature);
+ DoScriptText(SAY_PHASE_3_TRANS, me);
SetCombatMovement(true);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
return;
}
@@ -307,15 +307,15 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiMovePoint == m_pPointData->uiLocIdEnd)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoScriptText(EMOTE_BREATH, m_creature);
- DoCast(m_creature, m_pPointData->uiSpellId);
+ DoScriptText(EMOTE_BREATH, me);
+ DoCast(me, m_pPointData->uiSpellId);
}
else
{
- m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
}
}
else
@@ -323,7 +323,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiEngulfingFlamesTimer <= uiDiff)
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_FIREBALL);
@@ -340,8 +340,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiWhelpTimer <= uiDiff)
{
- m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ me->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ me->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_uiWhelpTimer = 1000;
}
else
@@ -365,8 +365,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiLairGuardTimer <= uiDiff)
{
- m_creature->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- m_creature->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ me->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ me->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_uiLairGuardTimer = 30000;
}
else
diff --git a/src/scripts/kalimdor/orgrimmar.cpp b/src/scripts/kalimdor/orgrimmar.cpp
index d940c81aa46..639885e41a1 100644
--- a/src/scripts/kalimdor/orgrimmar.cpp
+++ b/src/scripts/kalimdor/orgrimmar.cpp
@@ -114,7 +114,7 @@ struct npc_shenthulAI : public ScriptedAI
{
if (Salute_Timer <= diff)
{
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
CanEmote = true;
Reset_Timer = 60000;
} else Salute_Timer -= diff;
@@ -194,13 +194,13 @@ struct npc_thrall_warchiefAI : public ScriptedAI
if (ChainLightning_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
ChainLightning_Timer = 9000;
} else ChainLightning_Timer -= diff;
if (Shock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHOCK);
+ DoCast(me->getVictim(), SPELL_SHOCK);
Shock_Timer = 15000;
} else Shock_Timer -= diff;
diff --git a/src/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
index fc912474ef7..25b6af4ddfe 100644
--- a/src/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
+++ b/src/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
@@ -57,12 +57,12 @@ struct boss_amnennar_the_coldbringerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit()
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -73,40 +73,40 @@ struct boss_amnennar_the_coldbringerAI : public ScriptedAI
//AmnenarsWrath_Timer
if (AmnenarsWrath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AMNENNARSWRATH);
+ DoCast(me->getVictim(), SPELL_AMNENNARSWRATH);
AmnenarsWrath_Timer = 12000;
} else AmnenarsWrath_Timer -= diff;
//FrostBolt_Timer
if (FrostBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
FrostBolt_Timer = 8000;
} else FrostBolt_Timer -= diff;
if (FrostNova_Timer <= diff)
{
- DoCast(m_creature, SPELL_FROST_NOVA);
+ DoCast(me, SPELL_FROST_NOVA);
FrostNova_Timer = 15000;
} else FrostNova_Timer -= diff;
- if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
+ if (!Spectrals60 && me->GetHealth()*100 / me->GetMaxHealth() < 60)
{
- DoScriptText(SAY_SUMMON60, m_creature);
- DoCast(m_creature->getVictim(), SPELL_FROST_SPECTRES);
+ DoScriptText(SAY_SUMMON60, me);
+ DoCast(me->getVictim(), SPELL_FROST_SPECTRES);
Spectrals60 = true;
}
- if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ if (!Hp && me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
- DoScriptText(SAY_HP, m_creature);
+ DoScriptText(SAY_HP, me);
Hp = true;
}
- if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ if (!Spectrals30 && me->GetHealth()*100 / me->GetMaxHealth() < 30)
{
- DoScriptText(SAY_SUMMON30, m_creature);
- DoCast(m_creature->getVictim(), SPELL_FROST_SPECTRES);
+ DoScriptText(SAY_SUMMON30, me);
+ DoCast(me->getVictim(), SPELL_FROST_SPECTRES);
Spectrals30 = true;
}
diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
index ad9202df097..c6fdfe806ae 100644
--- a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
+++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
@@ -119,11 +119,11 @@ struct npc_tomb_creatureAI : public ScriptedAI
return;
//from acid
- if (m_creature->GetEntry() == CREATURE_TOMB_REAVER)
+ if (me->GetEntry() == CREATURE_TOMB_REAVER)
{
if (uiWebTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_WEB);
+ DoCast(me->getVictim(), SPELL_WEB);
uiWebTimer = urand(7000,16000);
} else uiWebTimer -= uiDiff;
}
diff --git a/src/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp
index 2fe7fc9cd60..ae75d5f8f8c 100644
--- a/src/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp
+++ b/src/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp
@@ -59,43 +59,43 @@ struct npc_willixAI : public npc_escortAI
switch (i)
{
case 3:
- m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
- DoScriptText(SAY_POINT, m_creature, pPlayer);
+ me->HandleEmoteCommand(EMOTE_STATE_POINT);
+ DoScriptText(SAY_POINT, me, pPlayer);
break;
case 4:
- m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 8:
- DoScriptText(SAY_BLUELEAF, m_creature, pPlayer);
+ DoScriptText(SAY_BLUELEAF, me, pPlayer);
break;
case 9:
- DoScriptText(SAY_DANGER, m_creature, pPlayer);
+ DoScriptText(SAY_DANGER, me, pPlayer);
break;
case 13:
- DoScriptText(SAY_BAD, m_creature, pPlayer);
+ DoScriptText(SAY_BAD, me, pPlayer);
break;
case 14:
- m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 25:
- DoScriptText(SAY_THINK, m_creature, pPlayer);
+ DoScriptText(SAY_THINK, me, pPlayer);
break;
case 31:
- DoScriptText(SAY_SOON, m_creature, pPlayer);
+ DoScriptText(SAY_SOON, me, pPlayer);
break;
case 42:
- DoScriptText(SAY_FINALY, m_creature, pPlayer);
+ DoScriptText(SAY_FINALY, me, pPlayer);
break;
case 43:
- m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 45:
- DoScriptText(SAY_WIN, m_creature, pPlayer);
+ DoScriptText(SAY_WIN, me, pPlayer);
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,me);
break;
case 46:
- DoScriptText(SAY_END, m_creature, pPlayer);
+ DoScriptText(SAY_END, me, pPlayer);
break;
}
}
@@ -104,12 +104,12 @@ struct npc_willixAI : public npc_escortAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO1, m_creature, NULL);
+ DoScriptText(SAY_AGGRO1, me, NULL);
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -148,7 +148,7 @@ struct npc_deaths_head_ward_keeperAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isAlive())
+ if (!me->isAlive())
return;
if (pInstance)
@@ -156,9 +156,9 @@ struct npc_deaths_head_ward_keeperAI : public ScriptedAI
if (QuillboarChanneling_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_QUILLBOAR_CHANNELING);
QuillboarChanneling_Timer = 1100;
} else QuillboarChanneling_Timer -= diff;
diff --git a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp
index 78591df0390..080c5c8d392 100644
--- a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp
+++ b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp
@@ -80,7 +80,7 @@ struct boss_ayamissAI : public ScriptedAI
return;
//If he is 70% start phase 2
- if (phase == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (phase == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 70 && !me->IsNonMeleeSpellCasted(false))
{
phase=2;
}
@@ -88,21 +88,21 @@ struct boss_ayamissAI : public ScriptedAI
//STINGERSPRAY_Timer (only in phase2)
if (phase == 2 && STINGERSPRAY_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STINGERSPRAY);
+ DoCast(me->getVictim(), SPELL_STINGERSPRAY);
STINGERSPRAY_Timer = 30000;
} else STINGERSPRAY_Timer -= diff;
//POISONSTINGER_Timer (only in phase1)
if (phase == 1 && POISONSTINGER_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISONSTINGER);
+ DoCast(me->getVictim(), SPELL_POISONSTINGER);
POISONSTINGER_Timer = 30000;
} else POISONSTINGER_Timer -= diff;
//SUMMONSWARMER_Timer (only in phase1)
if (SUMMONSWARMER_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUMMONSWARMER);
+ DoCast(me->getVictim(), SPELL_SUMMONSWARMER);
SUMMONSWARMER_Timer = 60000;
} else SUMMONSWARMER_Timer -= diff;
diff --git a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
index 8c1ade43a32..65654b3008d 100644
--- a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
+++ b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
@@ -81,16 +81,16 @@ struct boss_kurinnaxxAI : public ScriptedAI
return;
//If we are <30% cast enrage
- if (!bIsEnraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (!bIsEnraged && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
{
bIsEnraged = true;
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
}
//Mortal Wound spell
if (uiMortalWoundTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTALWOUND);
+ DoCast(me->getVictim(), SPELL_MORTALWOUND);
uiMortalWoundTimer = urand(2000,7000);
} else uiMortalWoundTimer -= diff;
@@ -105,14 +105,14 @@ struct boss_kurinnaxxAI : public ScriptedAI
//Wide Slash spell
if (uiWideSlashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WIDE_SLASH);
+ DoCast(me->getVictim(), SPELL_WIDE_SLASH);
uiWideSlashTimer = urand(10000,15000);
} else uiWideSlashTimer -= diff;
//Trash spell
if (uiTrashTimer <= diff)
{
- DoCast(m_creature, SPELL_TRASH);
+ DoCast(me, SPELL_TRASH);
uiTrashTimer = urand(20000,25000);
} else uiTrashTimer -= diff;
diff --git a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp
index d700bad6ff8..9d93628f7da 100644
--- a/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp
+++ b/src/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp
@@ -70,7 +70,7 @@ struct boss_moamAI : public ScriptedAI
uiDrainManaTimer = urand(3000,7000);
uiPhaseTimer = 90000;
Phase = NORMAL;
- m_creature->SetPower(POWER_MANA,0);
+ me->SetPower(POWER_MANA,0);
if (pInstance)
pInstance->SetData(DATA_MOAM_EVENT, NOT_STARTED);
@@ -78,7 +78,7 @@ struct boss_moamAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(EMOTE_AGGRO, m_creature);
+ DoScriptText(EMOTE_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MOAM_EVENT, IN_PROGRESS);
@@ -97,7 +97,7 @@ struct boss_moamAI : public ScriptedAI
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
pTarget->ModifyPower(POWER_MANA, -500);
- m_creature->ModifyPower(POWER_MANA, 1000);
+ me->ModifyPower(POWER_MANA, 1000);
}
}
}
@@ -110,17 +110,17 @@ struct boss_moamAI : public ScriptedAI
return;
//If we are 100%MANA cast Arcane Erruption
- if (m_creature->GetPower(POWER_MANA) == m_creature->GetMaxPower(POWER_MANA))
+ if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
{
- DoCast(m_creature->getVictim(), SPELL_ARCANEERUPTION);
- DoScriptText(EMOTE_MANA_FULL, m_creature);
- m_creature->SetPower(POWER_MANA,0);
+ DoCast(me->getVictim(), SPELL_ARCANEERUPTION);
+ DoScriptText(EMOTE_MANA_FULL, me);
+ me->SetPower(POWER_MANA,0);
}
//Trample Spell
if (uiTrampleTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
+ DoCast(me->getVictim(), SPELL_TRAMPLE);
uiTrampleTimer = urand(3000,7000);
} else uiTrampleTimer -= diff;
@@ -137,10 +137,10 @@ struct boss_moamAI : public ScriptedAI
if (uiPhaseTimer <= diff)
{
Phase = STONE;
- DoCast(m_creature, SPELL_SUMMONMANA);
- DoCast(m_creature, SPELL_SUMMONMANA);
- DoCast(m_creature, SPELL_SUMMONMANA);
- DoCast(m_creature, SPELL_GRDRSLEEP);
+ DoCast(me, SPELL_SUMMONMANA);
+ DoCast(me, SPELL_SUMMONMANA);
+ DoCast(me, SPELL_SUMMONMANA);
+ DoCast(me, SPELL_GRDRSLEEP);
} else uiPhaseTimer -= diff;
}
}
diff --git a/src/scripts/kalimdor/silithus.cpp b/src/scripts/kalimdor/silithus.cpp
index ee272d64499..089dc3ed849 100644
--- a/src/scripts/kalimdor/silithus.cpp
+++ b/src/scripts/kalimdor/silithus.cpp
@@ -493,7 +493,7 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
PlayerGUID = 0;
eventEnd = false;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void HandleAnimation()
@@ -502,10 +502,10 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
if (!plr)
return;
- Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, m_creature);
- Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,m_creature);
- Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, m_creature);
- Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,m_creature);
+ Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, me);
+ Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,me);
+ Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, me);
+ Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,me);
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
return;
@@ -517,11 +517,11 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
switch(AnimationCount)
{
case 0:
- DoScriptText(ANACHRONOS_SAY_1, m_creature , Fandral);
+ DoScriptText(ANACHRONOS_SAY_1, me , Fandral);
break;
case 1:
- Fandral->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- DoScriptText(FANDRAL_SAY_1, Fandral,m_creature);
+ Fandral->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ DoScriptText(FANDRAL_SAY_1, Fandral,me);
break;
case 2:
Fandral->SetUInt64Value(UNIT_FIELD_TARGET,NULL);
@@ -611,143 +611,143 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
Caelestrasz->CastSpell(Caelestrasz,54293,false);
break;
case 28:
- DoScriptText(ANACHRONOS_SAY_2,m_creature, Fandral);
+ DoScriptText(ANACHRONOS_SAY_2,me, Fandral);
break;
case 29:
Caelestrasz->GetMotionMaster()->MoveCharge(-8150,1530,50,7);
- DoScriptText(FANDRAL_SAY_2, Fandral, m_creature);
+ DoScriptText(FANDRAL_SAY_2, Fandral, me);
break;
case 30:
break;
case 31:
- DoScriptText(ANACHRONOS_SAY_3, m_creature, Fandral);
+ DoScriptText(ANACHRONOS_SAY_3, me, Fandral);
break;
case 32:
Caelestrasz->SetVisibility(VISIBILITY_OFF);
Fandral->GetMotionMaster()->MoveCharge(-8108,1529,2.77,8);
- m_creature->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8);
+ me->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8);
break;//both run to the gate
case 33:
- DoScriptText(ANACHRONOS_SAY_4, m_creature);
+ DoScriptText(ANACHRONOS_SAY_4, me);
Caelestrasz->GetMotionMaster()->MoveCharge(-8165,1530,65,7);
break; //Text: sands will stop
case 34:
DoCast(plr, 23017, true);//Arcane Channeling
break;
case 35:
- m_creature->CastSpell(-8088,1520.43,2.67,25158,true);
+ me->CastSpell(-8088,1520.43,2.67,25158,true);
break;
case 36:
DoCast(plr, 25159, true);
break;
case 37:
- m_creature->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
+ me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
break;
case 38:
DoCast(plr, 25166, true);
- m_creature->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
+ me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
break;
case 39:
- DoScriptText(ANACHRONOS_SAY_5, m_creature, Fandral);
+ DoScriptText(ANACHRONOS_SAY_5, me, Fandral);
break;
case 40:
- Fandral->CastSpell(m_creature, 25167, true);
+ Fandral->CastSpell(me, 25167, true);
break;
case 41:
Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
DoScriptText(FANDRAL_SAY_3, Fandral);
break;
case 42:
- m_creature->CastStop();
+ me->CastStop();
DoScriptText(FANDRAL_EMOTE_1, Fandral);
break;
case 43:
Fandral->CastStop();
break;
case 44:
- DoScriptText(ANACHRONOS_SAY_6, m_creature);
+ DoScriptText(ANACHRONOS_SAY_6, me);
break;
case 45:
- DoScriptText(ANACHRONOS_SAY_7, m_creature);
+ DoScriptText(ANACHRONOS_SAY_7, me);
break;
case 46:
- DoScriptText(ANACHRONOS_SAY_8, m_creature);
- m_creature->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4);
+ DoScriptText(ANACHRONOS_SAY_8, me);
+ me->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4);
break;
case 47:
- DoScriptText(ANACHRONOS_EMOTE_1, m_creature);
+ DoScriptText(ANACHRONOS_EMOTE_1, me);
break;
case 48:
- DoScriptText(FANDRAL_SAY_4,Fandral,m_creature);
+ DoScriptText(FANDRAL_SAY_4,Fandral,me);
break;
case 49:
- DoScriptText(FANDRAL_SAY_5,Fandral,m_creature);
+ DoScriptText(FANDRAL_SAY_5,Fandral,me);
break;
case 50:
DoScriptText(FANDRAL_EMOTE_2,Fandral);
Fandral->CastSpell(-8127,1525,17.5,33806,true);
break;
case 51:
- while (mob = plr->FindNearestCreature(15423,50,m_creature))
+ while (mob = plr->FindNearestCreature(15423,50,me))
mob->RemoveFromWorld();
- while (mob = plr->FindNearestCreature(15424,50,m_creature))
+ while (mob = plr->FindNearestCreature(15424,50,me))
mob->RemoveFromWorld();
- while (mob = plr->FindNearestCreature(15414,50,m_creature))
+ while (mob = plr->FindNearestCreature(15414,50,me))
mob->RemoveFromWorld();
- while (mob = plr->FindNearestCreature(15422,50,m_creature))
+ while (mob = plr->FindNearestCreature(15422,50,me))
mob->RemoveFromWorld();
break;
case 52:
Fandral->GetMotionMaster()->MoveCharge(-8028.75, 1538.795, 2.61,4);
- DoScriptText(ANACHRONOS_SAY_9, m_creature,Fandral);
+ DoScriptText(ANACHRONOS_SAY_9, me,Fandral);
break;
case 53:
DoScriptText(FANDRAL_SAY_6,Fandral);
break;
case 54:
- DoScriptText(ANACHRONOS_EMOTE_2,m_creature);
+ DoScriptText(ANACHRONOS_EMOTE_2,me);
break;
case 55:
Fandral->SetVisibility(VISIBILITY_OFF);
break;
case 56:
- DoScriptText(ANACHRONOS_EMOTE_3, m_creature);
- m_creature->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4);
+ DoScriptText(ANACHRONOS_EMOTE_3, me);
+ me->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4);
break;
case 57:
- m_creature->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4);
+ me->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4);
break;
case 58:
- m_creature->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4);
+ me->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4);
break;
case 59:
- m_creature->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4);
+ me->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4);
break;
case 60:
if (plr)
- DoScriptText(ANACHRONOS_SAY_10, m_creature,plr);
- m_creature->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4);
+ DoScriptText(ANACHRONOS_SAY_10, me,plr);
+ me->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4);
break;
case 61:
- m_creature->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6);
- if (plr->IsInRange(m_creature,0,15))
- plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,m_creature);
+ me->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6);
+ if (plr->IsInRange(me,0,15))
+ plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,me);
break;
case 62:
- m_creature->SetDisplayId(15500);
+ me->SetDisplayId(15500);
break;
case 63:
- m_creature->HandleEmoteCommand(254);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->HandleEmoteCommand(254);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
break;
case 64:
- m_creature->GetMotionMaster()->MoveCharge(-8000,1400,150,9);
+ me->GetMotionMaster()->MoveCharge(-8000,1400,150,9);
break;
case 65:
- m_creature->SetVisibility(VISIBILITY_OFF);
- if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*m_creature, AnachronosQuestTriggerGUID)))
+ me->SetVisibility(VISIBILITY_OFF);
+ if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID)))
{
- DoScriptText(ARYGOS_YELL_1,m_creature);
+ DoScriptText(ARYGOS_YELL_1,me);
AnachronosQuestTrigger->AI()->EnterEvadeMode();
eventEnd=true;
}
@@ -765,9 +765,9 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
else AnimationTimer -= diff;
}
if (AnimationCount < 65)
- m_creature->CombatStop();
+ me->CombatStop();
if (AnimationCount == 65 || eventEnd)
- m_creature->AI()->EnterEvadeMode();
+ me->AI()->EnterEvadeMode();
}
};
@@ -799,70 +799,70 @@ struct mob_qiraj_war_spawnAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
Unit *pTarget;
- Player* plr = m_creature->GetPlayer(PlayerGUID);
+ Player* plr = me->GetPlayer(PlayerGUID);
if (!Timers)
{
- if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) //all but Kaldorei Soldiers
+ if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
{
SpellTimer1 = SpawnCast[1].Timer1;
SpellTimer2 = SpawnCast[2].Timer1;
SpellTimer3 = SpawnCast[3].Timer1;
}
- if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
+ if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
SpellTimer4 = SpawnCast[0].Timer1;
Timers = true;
}
- if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422|| m_creature->GetEntry() == 15414)
+ if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414)
{
if (SpellTimer1 <= diff)
{
- DoCast(m_creature, SpawnCast[1].SpellId);
- DoCast(m_creature, 24319);
+ DoCast(me, SpawnCast[1].SpellId);
+ DoCast(me, 24319);
SpellTimer1 = SpawnCast[1].Timer2;
} else SpellTimer1 -= diff;
if (SpellTimer2 <= diff)
{
- DoCast(m_creature, SpawnCast[2].SpellId);
+ DoCast(me, SpawnCast[2].SpellId);
SpellTimer2 = SpawnCast[2].Timer2;
} else SpellTimer2 -= diff;
if (SpellTimer3 <= diff)
{
- DoCast(m_creature, SpawnCast[3].SpellId);
+ DoCast(me, SpawnCast[3].SpellId);
SpellTimer3 = SpawnCast[3].Timer2;
} else SpellTimer3 -= diff;
}
- if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
+ if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
{
if (SpellTimer4 <= diff)
{
- m_creature->RemoveAllAttackers();
- m_creature->AttackStop();
- DoCast(m_creature, 15533);
+ me->RemoveAllAttackers();
+ me->AttackStop();
+ DoCast(me, 15533);
SpellTimer4 = SpawnCast[0].Timer2;
} else SpellTimer4 -= diff;
}
if (!hasTarget)
{
- if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
- pTarget = m_creature->FindNearestCreature(15423,20,true);
- if (m_creature->GetEntry() == 15423)
+ if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
+ pTarget = me->FindNearestCreature(15423,20,true);
+ if (me->GetEntry() == 15423)
{
uint8 tar = urand(0,2);
if (tar == 0)
- pTarget = m_creature->FindNearestCreature(15422,20,true);
+ pTarget = me->FindNearestCreature(15422,20,true);
else if (tar == 1)
- pTarget = m_creature->FindNearestCreature(15424,20,true);
+ pTarget = me->FindNearestCreature(15424,20,true);
else if (tar == 2)
- pTarget = m_creature->FindNearestCreature(15414,20,true);
+ pTarget = me->FindNearestCreature(15414,20,true);
}
hasTarget = true;
if (pTarget)
- m_creature->AI()->AttackStart(pTarget);
+ me->AI()->AttackStart(pTarget);
}
- if (!(m_creature->FindNearestCreature(15379,100)))
- DoCast(m_creature, 33652);
+ if (!(me->FindNearestCreature(15379,100)))
+ DoCast(me, 33652);
if (!UpdateVictim())
{
@@ -907,7 +907,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
Announced = false;
Failed = false;
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
}
void SummonNextWave()
@@ -926,7 +926,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
float Z = SpawnLocation[locIndex + i].z;
float O = SpawnLocation[locIndex + i].o;
uint32 desptimer = WavesInfo[WaveCount].DespTimer;
- Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);
+ Spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);
if (Spawn)
{
@@ -940,7 +940,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
if (WaveCount < 5) //1-4 Wave
{
- CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->MobGUID = m_creature->GetGUID();
+ CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->MobGUID = me->GetGUID();
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->PlayerGUID = PlayerGUID;
}
}
@@ -971,7 +971,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
GroupMember = (Unit::GetPlayer(itr->guid));
if (!GroupMember)
continue;
- if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
+ if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
{
GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
GroupMember->SetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, QUEST_STATUS_NONE);
@@ -983,7 +983,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
++DeadMemberCount;
}
- if (GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS))
+ if (GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
Failed = true; //only so event can restart
}
}
@@ -1004,7 +1004,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
{
if (!Announced && AnnounceTimer <= diff)
{
- DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature);
+ DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
Announced = true;
} else AnnounceTimer -= diff;
@@ -1019,8 +1019,8 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
};
void mob_qiraj_war_spawnAI::JustDied(Unit* slayer)
{
- m_creature->RemoveCorpse();
- if (Creature* Mob = (Unit::GetCreature(*m_creature, MobGUID)))
+ me->RemoveCorpse();
+ if (Creature* Mob = (Unit::GetCreature(*me, MobGUID)))
CAST_AI(npc_anachronos_quest_triggerAI, Mob->AI())->LiveCounter();
};
diff --git a/src/scripts/kalimdor/stonetalon_mountains.cpp b/src/scripts/kalimdor/stonetalon_mountains.cpp
index 2706c952ce8..b2fa410a2e7 100644
--- a/src/scripts/kalimdor/stonetalon_mountains.cpp
+++ b/src/scripts/kalimdor/stonetalon_mountains.cpp
@@ -109,22 +109,22 @@ struct npc_kaya_flathoofAI : public npc_escortAI
switch(i)
{
case 16:
- DoScriptText(SAY_AMBUSH, m_creature);
- m_creature->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- m_creature->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ DoScriptText(SAY_AMBUSH, me);
+ me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
- case 18: m_creature->SetInFront(pPlayer);
- DoScriptText(SAY_END, m_creature, pPlayer);
+ case 18: me->SetInFront(pPlayer);
+ DoScriptText(SAY_END, me, pPlayer);
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature);
+ pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, me);
break;
}
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void Reset(){}
diff --git a/src/scripts/kalimdor/tanaris.cpp b/src/scripts/kalimdor/tanaris.cpp
index 73ac865d91e..57e6b0ee061 100644
--- a/src/scripts/kalimdor/tanaris.cpp
+++ b/src/scripts/kalimdor/tanaris.cpp
@@ -59,7 +59,7 @@ struct mob_aquementasAI : public ScriptedAI
{
SendItem_Timer = 0;
SwitchFaction_Timer = 10000;
- m_creature->setFaction(35);
+ me->setFaction(35);
isFriendly = true;
AquaJet_Timer = 5000;
@@ -82,7 +82,7 @@ struct mob_aquementasAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(AGGRO_YELL_AQUE, m_creature, who);
+ DoScriptText(AGGRO_YELL_AQUE, me, who);
}
void UpdateAI(const uint32 diff)
@@ -91,7 +91,7 @@ struct mob_aquementasAI : public ScriptedAI
{
if (SwitchFaction_Timer <= diff)
{
- m_creature->setFaction(91);
+ me->setFaction(91);
isFriendly = false;
} else SwitchFaction_Timer -= diff;
}
@@ -103,21 +103,21 @@ struct mob_aquementasAI : public ScriptedAI
{
if (SendItem_Timer <= diff)
{
- if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)
- SendItem(m_creature->getVictim());
+ if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
+ SendItem(me->getVictim());
SendItem_Timer = 5000;
} else SendItem_Timer -= diff;
}
if (FrostShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
FrostShock_Timer = 15000;
} else FrostShock_Timer -= diff;
if (AquaJet_Timer <= diff)
{
- DoCast(m_creature, SPELL_AQUA_JET);
+ DoCast(me, SPELL_AQUA_JET);
AquaJet_Timer = 15000;
} else AquaJet_Timer -= diff;
@@ -160,25 +160,25 @@ struct npc_custodian_of_timeAI : public npc_escortAI
switch(i)
{
- case 0: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pPlayer); break;
- case 1: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pPlayer); break;
- case 2: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pPlayer); break;
- case 3: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
- case 5: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pPlayer); break;
- case 6: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pPlayer); break;
- case 7: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pPlayer); break;
- case 8: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pPlayer); break;
- case 9: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pPlayer); break;
- case 10: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
- case 13: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pPlayer); break;
- case 14: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
- case 16: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pPlayer); break;
- case 17: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pPlayer); break;
- case 18: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
- case 22: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pPlayer); break;
- case 23: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
+ case 0: DoScriptText(WHISPER_CUSTODIAN_1, me, pPlayer); break;
+ case 1: DoScriptText(WHISPER_CUSTODIAN_2, me, pPlayer); break;
+ case 2: DoScriptText(WHISPER_CUSTODIAN_3, me, pPlayer); break;
+ case 3: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
+ case 5: DoScriptText(WHISPER_CUSTODIAN_5, me, pPlayer); break;
+ case 6: DoScriptText(WHISPER_CUSTODIAN_6, me, pPlayer); break;
+ case 7: DoScriptText(WHISPER_CUSTODIAN_7, me, pPlayer); break;
+ case 8: DoScriptText(WHISPER_CUSTODIAN_8, me, pPlayer); break;
+ case 9: DoScriptText(WHISPER_CUSTODIAN_9, me, pPlayer); break;
+ case 10: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
+ case 13: DoScriptText(WHISPER_CUSTODIAN_10, me, pPlayer); break;
+ case 14: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
+ case 16: DoScriptText(WHISPER_CUSTODIAN_11, me, pPlayer); break;
+ case 17: DoScriptText(WHISPER_CUSTODIAN_12, me, pPlayer); break;
+ case 18: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
+ case 22: DoScriptText(WHISPER_CUSTODIAN_13, me, pPlayer); break;
+ case 23: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 24:
- DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pPlayer);
+ DoScriptText(WHISPER_CUSTODIAN_14, me, pPlayer);
DoCast(pPlayer, 34883);
// below here is temporary workaround, to be removed when spell works properly
pPlayer->AreaExploredOrEventHappens(10277);
@@ -196,7 +196,7 @@ struct npc_custodian_of_timeAI : public npc_escortAI
if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
- if (m_creature->IsWithinDistInMap(who, Radius))
+ if (me->IsWithinDistInMap(who, Radius))
{
Start(false, false, who->GetGUID());
}
@@ -370,17 +370,17 @@ struct npc_OOX17AI : public npc_escortAI
switch(i) {
case 23:
- m_creature->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_OOX_AMBUSH, m_creature);
+ me->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 56:
- m_creature->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_OOX_AMBUSH, m_creature);
+ me->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoScriptText(SAY_OOX_AMBUSH, me);
if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30))
DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff);
break;
@@ -388,8 +388,8 @@ struct npc_OOX17AI : public npc_escortAI
case 86:
if (pPlayer)
{
- DoScriptText(SAY_OOX_END, m_creature);
- pPlayer->GroupEventHappens(Q_OOX17, m_creature);
+ DoScriptText(SAY_OOX_END, me);
+ pPlayer->GroupEventHappens(Q_OOX17, me);
}
break;
}
@@ -399,12 +399,12 @@ struct npc_OOX17AI : public npc_escortAI
void EnterCombat(Unit* who)
{
- DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), m_creature);
+ DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), me);
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
};
@@ -476,14 +476,14 @@ struct npc_toogaAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && pWho->GetEntry() == NPC_TORTA)
+ if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && pWho->GetEntry() == NPC_TORTA)
{
- if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
+ if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
- pPlayer->GroupEventHappens(QUEST_TOOGA, m_creature);
+ pPlayer->GroupEventHappens(QUEST_TOOGA, me);
}
TortaGUID = pWho->GetGUID();
@@ -514,7 +514,7 @@ struct npc_toogaAI : public FollowerAI
{
m_uiPostEventTimer = 5000;
- Unit *pTorta = Unit::GetUnit(*m_creature, TortaGUID);
+ Unit *pTorta = Unit::GetUnit(*me, TortaGUID);
if (!pTorta || !pTorta->isAlive())
{
//something happened, so just complete
@@ -525,23 +525,23 @@ struct npc_toogaAI : public FollowerAI
switch(m_uiPhasePostEvent)
{
case 1:
- DoScriptText(SAY_TOOG_POST_1, m_creature);
+ DoScriptText(SAY_TOOG_POST_1, me);
break;
case 2:
DoScriptText(SAY_TORT_POST_2, pTorta);
break;
case 3:
- DoScriptText(SAY_TOOG_POST_3, m_creature);
+ DoScriptText(SAY_TOOG_POST_3, me);
break;
case 4:
DoScriptText(SAY_TORT_POST_4, pTorta);
break;
case 5:
- DoScriptText(SAY_TOOG_POST_5, m_creature);
+ DoScriptText(SAY_TOOG_POST_5, me);
break;
case 6:
DoScriptText(SAY_TORT_POST_6, pTorta);
- m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
+ me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
break;
}
@@ -558,7 +558,7 @@ struct npc_toogaAI : public FollowerAI
m_uiCheckSpeechTimer = 5000;
if (urand(0,9) > 8)
- DoScriptText(RAND(SAY_TOOG_THIRST,SAY_TOOG_WORRIED), m_creature);
+ DoScriptText(RAND(SAY_TOOG_THIRST,SAY_TOOG_WORRIED), me);
}
else
m_uiCheckSpeechTimer -= uiDiff;
diff --git a/src/scripts/kalimdor/teldrassil.cpp b/src/scripts/kalimdor/teldrassil.cpp
index c45d80cab46..1607ab904a8 100644
--- a/src/scripts/kalimdor/teldrassil.cpp
+++ b/src/scripts/kalimdor/teldrassil.cpp
@@ -51,9 +51,9 @@ struct npc_mistAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ARYNIA)
+ if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ARYNIA)
{
- if (m_creature->IsWithinDistInMap(pWho, 10.0f))
+ if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(SAY_AT_HOME, pWho);
DoComplete();
@@ -63,12 +63,12 @@ struct npc_mistAI : public FollowerAI
void DoComplete()
{
- DoScriptText(EMOTE_AT_HOME, m_creature);
+ DoScriptText(EMOTE_AT_HOME, me);
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
- pPlayer->GroupEventHappens(QUEST_MIST, m_creature);
+ pPlayer->GroupEventHappens(QUEST_MIST, me);
}
//The follow is over (and for later development, run off to the woods before really end)
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp
index 3167a2f2e92..d5c22e5ad8e 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp
@@ -71,7 +71,7 @@ struct boss_kriAI : public ScriptedAI
{
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
@@ -85,20 +85,20 @@ struct boss_kriAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 5000 + rand()%7000;
} else Cleave_Timer -= diff;
//ToxicVolley_Timer
if (ToxicVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TOXIC_VOLLEY);
+ DoCast(me->getVictim(), SPELL_TOXIC_VOLLEY);
ToxicVolley_Timer = 10000 + rand()%5000;
} else ToxicVolley_Timer -= diff;
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death)
+ if (me->GetHealth() <= me->GetMaxHealth() * 0.05 && !Death)
{
- DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD);
+ DoCast(me->getVictim(), SPELL_POISON_CLOUD);
Death = true;
}
@@ -109,7 +109,7 @@ struct boss_kriAI : public ScriptedAI
{
if (pInstance && pInstance->GetData(DATA_VEMISDEAD))
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
VemDead = true;
}
Check_Timer = 2000;
@@ -151,7 +151,7 @@ struct boss_vemAI : public ScriptedAI
pInstance->SetData(DATA_VEM_DEATH, 0);
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
}
@@ -174,7 +174,7 @@ struct boss_vemAI : public ScriptedAI
if (pTarget)
{
DoCast(pTarget, SPELL_CHARGE);
- //m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
+ //me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
AttackStart(pTarget);
}
@@ -184,16 +184,16 @@ struct boss_vemAI : public ScriptedAI
//KnockBack_Timer
if (KnockBack_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKBACK);
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-80);
+ DoCast(me->getVictim(), SPELL_KNOCKBACK);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-80);
KnockBack_Timer = 15000 + rand()%10000;
} else KnockBack_Timer -= diff;
//Enrage_Timer
if (!Enraged && Enrage_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Charge_Timer -= diff;
@@ -231,14 +231,14 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
for (uint8 i = 0; i < 10; ++i)
{
Unit *pTarget = 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);
+ Creature* Summoned = me->SummonCreature(15621,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
if (Summoned && pTarget)
Summoned->AI()->AttackStart(pTarget);
}
@@ -257,7 +257,7 @@ struct boss_yaujAI : public ScriptedAI
//Fear_Timer
if (Fear_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
DoResetThreat();
Fear_Timer = 20000;
} else Fear_Timer -= diff;
@@ -267,8 +267,8 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance)
{
- Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI));
- Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM));
+ Unit *pKri = Unit::GetUnit((*me), pInstance->GetData64(DATA_KRI));
+ Unit *pVem = Unit::GetUnit((*me), pInstance->GetData64(DATA_VEM));
switch (urand(0,2))
{
@@ -281,7 +281,7 @@ struct boss_yaujAI : public ScriptedAI
DoCast(pVem, SPELL_HEAL);
break;
case 2:
- DoCast(m_creature, SPELL_HEAL);
+ DoCast(me, SPELL_HEAL);
break;
}
}
@@ -298,7 +298,7 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance->GetData(DATA_VEMISDEAD))
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
VemDead = true;
}
}
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp
index 61c7e644695..945b1b7df3b 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp
@@ -204,17 +204,17 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
ClockWise = false;
//Reset flags
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
- m_creature->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+ me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
//Reset Phase
if (pInst)
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
//to avoid having a following void zone
- Creature* pPortal= m_creature->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
+ Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
if (pPortal)
pPortal->SetReactState(REACT_PASSIVE);
}
@@ -274,11 +274,11 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//SPELL_GREEN_BEAM
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(pTarget, SPELL_GREEN_BEAM);
//Correctly update our target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTarget->GetGUID());
+ me->SetUInt64Value(UNIT_FIELD_TARGET, pTarget->GetGUID());
}
//Beam every 3 seconds
@@ -309,29 +309,29 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//Switch to Dark Beam
pInst->SetData(DATA_CTHUN_PHASE, PHASE_EYE_RED_BEAM);
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->InterruptNonMeleeSpells(false);
+ me->SetReactState(REACT_PASSIVE);
//Remove any target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Select random target for dark beam to start on
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
//Face our target
- DarkGlareAngle = m_creature->GetAngle(pTarget);
+ DarkGlareAngle = me->GetAngle(pTarget);
DarkGlareTickTimer = 1000;
DarkGlareTick = 0;
ClockWise = RAND(true, false);
}
//Add red coloration to C'thun
- DoCast(m_creature, SPELL_RED_COLORATION, true);
+ DoCast(me, SPELL_RED_COLORATION, true);
//Freeze animation
- DoCast(m_creature, SPELL_FREEZE_ANIM);
- m_creature->SetOrientation(DarkGlareAngle);
- m_creature->StopMoving();
+ DoCast(me, SPELL_FREEZE_ANIM);
+ me->SetOrientation(DarkGlareAngle);
+ me->StopMoving();
//Darkbeam for 35 seconds
PhaseTimer = 35000;
@@ -345,14 +345,14 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
{
//Set angle and cast
if (ClockWise)
- m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
+ me->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
else
- m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
+ me->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
- m_creature->StopMoving();
+ me->StopMoving();
//Actual dark glare cast, maybe something missing here?
- DoCast(m_creature, SPELL_DARK_GLARE, false);
+ DoCast(me, SPELL_DARK_GLARE, false);
//Increase tick
++DarkGlareTick;
@@ -370,14 +370,14 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
BeamTimer = 3000;
ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam)
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Remove Red coloration from c'thun
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
- m_creature->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
+ me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+ me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
//set it back to aggressive
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
//Eye Beam for 50 seconds
PhaseTimer = 50000;
@@ -388,18 +388,18 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//Transition phase
case PHASE_CTHUN_TRANSITION:
//Remove any target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- m_creature->SetHealth(0);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetHealth(0);
+ me->SetVisibility(VISIBILITY_OFF);
break;
//Dead phase
case PHASE_CTHUN_DONE:
- Creature* pPortal= m_creature->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
+ Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
if (pPortal)
pPortal->ForcedDespawn();
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
break;
}
}
@@ -415,29 +415,29 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
case PHASE_EYE_GREEN_BEAM:
case PHASE_EYE_RED_BEAM:
//Only if it will kill
- if (damage < m_creature->GetHealth())
+ if (damage < me->GetHealth())
return;
//Fake death in phase 0 or 1 (green beam or dark glare phase)
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Remove Red coloration from c'thun
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+ me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
//Reset to normal emote state and prevent select and attack
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Remove Target field
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Death animation/respawning;
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
- m_creature->SetHealth(0);
+ me->SetHealth(0);
damage = 0;
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
break;
case PHASE_CTHUN_DONE:
@@ -514,9 +514,9 @@ struct cthunAI : public Scripted_NoMovementAI
Stomach_Map.clear();
//Reset flags
- m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->RemoveAurasDueToSpell(SPELL_TRANSFORM);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
if (pInst)
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
@@ -550,7 +550,7 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+ Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only units out of stomach
if (pUnit && i->second == false)
@@ -580,7 +580,7 @@ struct cthunAI : public Scripted_NoMovementAI
//WisperTimer
if (WisperTimer <= diff)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap->IsDungeon()) return;
//Play random sound to the zone
@@ -602,7 +602,7 @@ struct cthunAI : public Scripted_NoMovementAI
return;
}
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//No instance
if (!pInst)
@@ -640,22 +640,22 @@ struct cthunAI : public Scripted_NoMovementAI
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
//Switch to c'thun model
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_TRANSFORM, false);
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_TRANSFORM, false);
+ me->SetHealth(me->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Emerging phase
- //AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer));
+ //AttackStart(Unit::GetUnit(*me, HoldpPlayer));
DoZoneInCombat();
//Place all units in threat list on outside of stomach
Stomach_Map.clear();
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (; i != me->getThreatManager().getThreatList().end(); ++i)
{
//Outside stomach
Stomach_Map[(*i)->getUnitGuid()] = false;
@@ -680,17 +680,17 @@ struct cthunAI : public Scripted_NoMovementAI
//Body Phase
case PHASE_CTHUN_STOMACH:
//Remove Target field
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Weaken
if (FleshTentaclesKilled > 1)
{
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK);
- DoScriptText(EMOTE_WEAKENED, m_creature);
+ DoScriptText(EMOTE_WEAKENED, me);
PhaseTimer = 45000;
- DoCast(m_creature, SPELL_PURPLE_COLORATION, true);
+ DoCast(me, SPELL_PURPLE_COLORATION, true);
UNORDERED_MAP<uint64, bool>::iterator i = Stomach_Map.begin();
@@ -698,13 +698,13 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+ Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only move units in stomach
if (pUnit && i->second == true)
{
//Teleport each player out
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
+ DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, rand()%6);
//Cast knockback on them
DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
@@ -729,7 +729,7 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+ Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only apply to units in stomach
if (pUnit && i->second == true)
@@ -741,7 +741,7 @@ struct cthunAI : public Scripted_NoMovementAI
if (pUnit->IsWithinDist3d(&KickPos, 15.0f))
{
//Teleport each player out
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
+ DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, rand()%6);
//Cast knockback on them
DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
@@ -766,7 +766,7 @@ struct cthunAI : public Scripted_NoMovementAI
//Set target in stomach
Stomach_Map[pTarget->GetGUID()] = true;
pTarget->InterruptNonMeleeSpells(false);
- pTarget->CastSpell(pTarget, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID());
+ pTarget->CastSpell(pTarget, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
StomachEnterTarget = pTarget->GetGUID();
StomachEnterVisTimer = 3800;
}
@@ -778,7 +778,7 @@ struct cthunAI : public Scripted_NoMovementAI
if (StomachEnterVisTimer <= diff)
{
//Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget);
+ Unit* pUnit = Unit::GetUnit(*me, StomachEnterTarget);
if (pUnit)
{
@@ -830,7 +830,7 @@ struct cthunAI : public Scripted_NoMovementAI
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
//Remove purple coloration
- m_creature->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
+ me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
//Spawn 2 flesh tentacles
FleshTentaclesKilled = 0;
@@ -871,7 +871,7 @@ struct cthunAI : public Scripted_NoMovementAI
damage = 1;
//Prevent death in non-weakened state
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
damage = 0;
return;
@@ -901,7 +901,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
{
eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
- if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -914,7 +914,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -941,7 +941,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
//KillSelfTimer
if (KillSelfTimer <= diff)
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
} else KillSelfTimer -= diff;
@@ -964,7 +964,7 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
- if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -978,7 +978,7 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1002,26 +1002,26 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
return;
//EvadeTimer
- if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (!me->IsWithinMeleeRange(me->getVictim()))
if (EvadeTimer <= diff)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
//Dissapear and reappear at new position
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
{
- m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
- if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
+ if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1033,20 +1033,20 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
AttackStart(pTarget);
}
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
} else EvadeTimer -= diff;
//GroundRuptureTimer
if (GroundRuptureTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
+ DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
GroundRuptureTimer = 30000;
} else GroundRuptureTimer -= diff;
//HamstringTimer
if (HamstringTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ DoCast(me->getVictim(), SPELL_HAMSTRING);
HamstringTimer = 5000;
} else HamstringTimer -= diff;
@@ -1060,7 +1060,7 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
- if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1075,7 +1075,7 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1100,26 +1100,26 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
return;
//EvadeTimer
- if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (!me->IsWithinMeleeRange(me->getVictim()))
if (EvadeTimer <= diff)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
//Dissapear and reappear at new position
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
{
- m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
- if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
+ if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1132,28 +1132,28 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
AttackStart(pTarget);
}
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
} else EvadeTimer -= diff;
//GroundRuptureTimer
if (GroundRuptureTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
+ DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
GroundRuptureTimer = 30000;
} else GroundRuptureTimer -= diff;
//ThrashTimer
if (ThrashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THRASH);
+ DoCast(me->getVictim(), SPELL_THRASH);
ThrashTimer = 10000;
} else ThrashTimer -= diff;
//HamstringTimer
if (HamstringTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ DoCast(me->getVictim(), SPELL_HAMSTRING);
HamstringTimer = 10000;
} else HamstringTimer -= diff;
@@ -1167,7 +1167,7 @@ struct giant_eye_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
- if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
+ if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1179,7 +1179,7 @@ struct giant_eye_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
- if (Unit* p = Unit::GetUnit(*m_creature, Portal))
+ if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1222,8 +1222,8 @@ struct flesh_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* killer)
{
- if (CAST_SUM(m_creature))
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (CAST_SUM(me))
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (pSummoner->AI())
pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
}
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp
index 4def1fa2a0c..cb4e4944d41 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp
@@ -93,7 +93,7 @@ struct boss_fankrissAI : public ScriptedAI
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_WOUND);
+ DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000 + rand()%10000;
} else MortalWound_Timer -= diff;
@@ -120,7 +120,7 @@ struct boss_fankrissAI : public ScriptedAI
// Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer.
//We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot.
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3)
+ if (me->GetHealth()*100 / me->GetMaxHealth() > 3)
{
if (SpawnHatchlings_Timer <= diff)
{
@@ -137,46 +137,46 @@ struct boss_fankrissAI : public ScriptedAI
{
case 0:
DoTeleportPlayer(pTarget, -8106.0142,1289.2900,-74.419533,5.112);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
case 1:
DoTeleportPlayer(pTarget, -7990.135354,1155.1907,-78.849319,2.608);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
case 2:
DoTeleportPlayer(pTarget,-8159.7753,1127.9064,-76.868660,0.675);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
- Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp
index 4a8c93300da..c8c583334fe 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp
@@ -73,8 +73,8 @@ struct boss_huhuranAI : public ScriptedAI
//Frenzy_Timer
if (!Frenzy && Frenzy_Timer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
Frenzy = true;
PoisonBolt_Timer = 3000;
Frenzy_Timer = 25000 + rand()%10000;
@@ -91,14 +91,14 @@ struct boss_huhuranAI : public ScriptedAI
//Spit Timer
if (Spit_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ACIDSPIT);
+ DoCast(me->getVictim(), SPELL_ACIDSPIT);
Spit_Timer = 5000 + rand()%5000;
} else Spit_Timer -= diff;
//NoxiousPoison_Timer
if (NoxiousPoison_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_NOXIOUSPOISON);
+ DoCast(me->getVictim(), SPELL_NOXIOUSPOISON);
NoxiousPoison_Timer = 12000 + rand()%12000;
} else NoxiousPoison_Timer -= diff;
@@ -107,7 +107,7 @@ struct boss_huhuranAI : public ScriptedAI
{
if (PoisonBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISONBOLT);
+ DoCast(me->getVictim(), SPELL_POISONBOLT);
PoisonBolt_Timer = 3000;
} else PoisonBolt_Timer -= diff;
}
@@ -115,16 +115,16 @@ struct boss_huhuranAI : public ScriptedAI
//FrenzyBack_Timer
if (Frenzy && FrenzyBack_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
Frenzy = false;
FrenzyBack_Timer = 15000;
} else FrenzyBack_Timer -= diff;
- if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31)
+ if (!Berserk && me->GetHealth()*100 / me->GetMaxHealth() < 31)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoScriptText(EMOTE_GENERIC_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK);
+ me->InterruptNonMeleeSpells(false);
+ DoScriptText(EMOTE_GENERIC_BERSERK, me);
+ DoCast(me, SPELL_BERSERK);
Berserk = true;
}
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp
index 7e782836be5..2dce8d5c710 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp
@@ -60,7 +60,7 @@ struct boss_ouroAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoCast(m_creature->getVictim(), SPELL_BIRTH);
+ DoCast(me->getVictim(), SPELL_BIRTH);
}
void UpdateAI(const uint32 diff)
@@ -72,14 +72,14 @@ struct boss_ouroAI : public ScriptedAI
//Sweep_Timer
if (!Submerged && Sweep_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SWEEP);
+ DoCast(me->getVictim(), SPELL_SWEEP);
Sweep_Timer = 15000 + rand()%15000;
} else Sweep_Timer -= diff;
//SandBlast_Timer
if (!Submerged && SandBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SANDBLAST);
+ DoCast(me->getVictim(), SPELL_SANDBLAST);
SandBlast_Timer = 20000 + rand()%15000;
} else SandBlast_Timer -= diff;
@@ -87,10 +87,10 @@ struct boss_ouroAI : public ScriptedAI
if (!Submerged && Submerge_Timer <= diff)
{
//Cast
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(35);
- DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(35);
+ DoCast(me, SPELL_DIRTMOUND_PASSIVE);
Submerged = true;
Back_Timer = 30000 + rand()%15000;
@@ -111,10 +111,10 @@ struct boss_ouroAI : public ScriptedAI
//Back_Timer
if (Submerged && Back_Timer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
- DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
+ DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
Submerged = false;
Submerge_Timer = 60000 + rand()%60000;
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp
index 88e6c93ab6e..4d5237b07ad 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp
@@ -69,17 +69,17 @@ struct boss_sarturaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_SLAY, m_creature);
+ DoScriptText(SAY_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -96,8 +96,8 @@ struct boss_sarturaAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
- m_creature->AddThreat(pTarget, 1.0f);
- m_creature->TauntApply(pTarget);
+ me->AddThreat(pTarget, 1.0f);
+ me->TauntApply(pTarget);
AttackStart(pTarget);
WhirlWindRandom_Timer = 3000 + rand()%4000;
@@ -114,7 +114,7 @@ struct boss_sarturaAI : public ScriptedAI
{
if (WhirlWind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
WhirlWind = true;
WhirlWindEnd_Timer = 15000;
} else WhirlWind_Timer -= diff;
@@ -125,8 +125,8 @@ struct boss_sarturaAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
- m_creature->AddThreat(pTarget, 1.0f);
- m_creature->TauntApply(pTarget);
+ me->AddThreat(pTarget, 1.0f);
+ me->TauntApply(pTarget);
AttackStart(pTarget);
AggroReset = true;
@@ -146,9 +146,9 @@ struct boss_sarturaAI : public ScriptedAI
//If she is 20% enrage
if (!Enraged)
{
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 20 && !me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
}
@@ -158,7 +158,7 @@ struct boss_sarturaAI : public ScriptedAI
{
if (EnrageHard_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGEHARD);
+ DoCast(me, SPELL_ENRAGEHARD);
EnragedHard = true;
} else EnrageHard_Timer -= diff;
}
@@ -207,7 +207,7 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
if (!WhirlWind && WhirlWind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWINDADD);
+ DoCast(me, SPELL_WHIRLWINDADD);
WhirlWind = true;
WhirlWind_Timer = 25000 + rand()%15000;
WhirlWindEnd_Timer = 15000;
@@ -221,8 +221,8 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
- m_creature->AddThreat(pTarget, 1.0f);
- m_creature->TauntApply(pTarget);
+ me->AddThreat(pTarget, 1.0f);
+ me->TauntApply(pTarget);
AttackStart(pTarget);
WhirlWindRandom_Timer = 3000 + rand()%4000;
@@ -242,8 +242,8 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
- m_creature->AddThreat(pTarget, 1.0f);
- m_creature->TauntApply(pTarget);
+ me->AddThreat(pTarget, 1.0f);
+ me->TauntApply(pTarget);
AttackStart(pTarget);
AggroReset = true;
@@ -252,7 +252,7 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
if (KnockBack_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWINDADD);
+ DoCast(me, SPELL_WHIRLWINDADD);
KnockBack_Timer = 10000 + rand()%10000;
} else KnockBack_Timer -= diff;
}
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
index c772cfd0a33..fb0c0371c04 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
@@ -81,29 +81,29 @@ struct boss_skeramAI : public ScriptedAI
Images25 = false;
Invisible = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
if (IsImage)
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit* Killer)
{
if (!IsImage)
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
if (IsImage || Images75)
return;
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
}
void UpdateAI(const uint32 diff)
@@ -115,25 +115,25 @@ struct boss_skeramAI : public ScriptedAI
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
ArcaneExplosion_Timer = 8000 + rand()%10000;
} else ArcaneExplosion_Timer -= diff;
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}else
{
//EarthShock_Timer
if (EarthShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_EARTH_SHOCK);
+ DoCast(me->getVictim(), SPELL_EARTH_SHOCK);
EarthShock_Timer = 1000;
} else EarthShock_Timer -= diff;
}
@@ -141,19 +141,19 @@ struct boss_skeramAI : public ScriptedAI
//Blink_Timer
if (Blink_Timer <= diff)
{
- //DoCast(m_creature, SPELL_BLINK);
+ //DoCast(me, SPELL_BLINK);
switch (urand(0,2))
{
case 0:
- m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f);
+ me->GetMap()->CreatureRelocation(me, -8340.782227,2083.814453,125.648788,0.0f);
DoResetThreat();
break;
case 1:
- m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f);
+ me->GetMap()->CreatureRelocation(me, -8341.546875,2118.504639,133.058151,0.0f);
DoResetThreat();
break;
case 2:
- m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f);
+ me->GetMap()->CreatureRelocation(me, -8318.822266,2058.231201,133.058151,0.0f);
DoResetThreat();
break;
}
@@ -162,7 +162,7 @@ struct boss_skeramAI : public ScriptedAI
Blink_Timer= 20000 + rand()%20000;
} else Blink_Timer -= diff;
- int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5);
+ int procent = (int) (me->GetHealth()*100 / me->GetMaxHealth() +0.5);
//Summoning 2 Images and teleporting to a random position on 75% health
if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70))
@@ -183,8 +183,8 @@ struct boss_skeramAI : public ScriptedAI
if (Invisible_Timer <= diff)
{
//Making Skeram visible after telporting
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible_Timer = 2500;
Invisible = false;
@@ -196,7 +196,7 @@ struct boss_skeramAI : public ScriptedAI
void DoSplit(int atPercent /* 75 50 25 */)
{
- DoScriptText(SAY_SPLIT, m_creature);
+ DoScriptText(SAY_SPLIT, me);
ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0);
ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0);
@@ -230,7 +230,7 @@ struct boss_skeramAI : public ScriptedAI
if (Group *pGrp = pTarget->GetGroup())
for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
{
- //if (grp->m_targetIcons[ico] == m_creature->GetGUID()) -- private member :(
+ //if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :(
pGrp->SetTargetIcon(ico, 0, 0);
}
@@ -238,10 +238,10 @@ struct boss_skeramAI : public ScriptedAI
}
}
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true;
delete place1;
delete place2;
@@ -258,21 +258,21 @@ struct boss_skeramAI : public ScriptedAI
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- Creature *Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
+ Creature *Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image1)
{
- Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image1->SetHealth(m_creature->GetHealth() / 5);
+ Image1->SetMaxHealth(me->GetMaxHealth() / 5);
+ Image1->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image1->AI()->AttackStart(pTarget);
CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true;
}
- Creature *Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
+ Creature *Image2 = me->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image2)
{
- Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image2->SetHealth(m_creature->GetHealth() / 5);
+ Image2->SetMaxHealth(me->GetMaxHealth() / 5);
+ Image2->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image2->AI()->AttackStart(pTarget);
CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true;
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
index ea5cece3a08..980e81f292f 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
@@ -88,7 +88,7 @@ struct boss_twinemperorsAI : public ScriptedAI
AfterTeleportTimer = 0;
Abuse_Bug_Timer = 10000 + rand()%7000;
BugsTimer = 2000;
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_STUNNED);
DontYellWhenDead = false;
EnrageTimer = 15*60000;
}
@@ -96,7 +96,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *GetOtherBoss()
{
if (pInstance)
- return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
+ return Unit::GetCreature(*me, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
else
return NULL;
}
@@ -106,7 +106,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Unit *pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
- float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth());
+ float dPercent = ((float)damage) / ((float)me->GetMaxHealth());
int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth()));
int ohealth = pOtherBoss->GetHealth()-odmg;
pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0);
@@ -129,12 +129,12 @@ struct boss_twinemperorsAI : public ScriptedAI
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);
+ DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH);
}
void KilledUnit(Unit* victim)
{
- DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
+ DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
}
void EnterCombat(Unit *who)
@@ -148,7 +148,7 @@ struct boss_twinemperorsAI : public ScriptedAI
ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI());
if (!pOtherBoss->isInCombat())
{
- DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
+ DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
otherAI->AttackStart(who);
otherAI->DoZoneInCombat();
}
@@ -157,7 +157,7 @@ struct boss_twinemperorsAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *entry)
{
- if (caster == m_creature)
+ if (caster == me)
return;
Creature *pOtherBoss = GetOtherBoss();
@@ -165,19 +165,19 @@ struct boss_twinemperorsAI : public ScriptedAI
return;
// add health so we keep same percentage for both brothers
- uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
+ uint32 mytotal = me->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
float mult = ((float)mytotal) / ((float)histotal);
if (mult < 1)
mult = 1.0f/mult;
#define HEAL_BROTHER_AMOUNT 30000.0f
uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT);
- uint32 myh = m_creature->GetHealth();
+ uint32 myh = me->GetHealth();
uint32 hish = pOtherBoss->GetHealth();
if (mytotal > histotal)
{
- uint32 h = m_creature->GetHealth()+largerAmount;
- m_creature->SetHealth(std::min(mytotal, h));
+ uint32 h = me->GetHealth()+largerAmount;
+ me->SetHealth(std::min(mytotal, h));
}
else
{
@@ -194,7 +194,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (Heal_Timer <= diff)
{
Unit *pOtherBoss = GetOtherBoss();
- if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60))
+ if (pOtherBoss && pOtherBoss->IsWithinDist(me,60))
{
DoCast(pOtherBoss, SPELL_HEAL_BROTHER);
Heal_Timer = 1000;
@@ -215,16 +215,16 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
- //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
+ //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
float other_x = pOtherBoss->GetPositionX();
float other_y = pOtherBoss->GetPositionY();
float other_z = pOtherBoss->GetPositionZ();
float other_o = pOtherBoss->GetOrientation();
- Map *thismap = m_creature->GetMap();
- thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(),
- m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation());
- thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o);
+ Map *thismap = me->GetMap();
+ thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(),
+ me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o);
SetAfterTeleport();
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport();
@@ -233,11 +233,11 @@ struct boss_twinemperorsAI : public ScriptedAI
void SetAfterTeleport()
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoStopAttack();
DoResetThreat();
- DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
+ me->addUnitState(UNIT_STAT_STUNNED);
AfterTeleport = true;
AfterTeleportTimer = 2000;
tspellcasted = false;
@@ -249,9 +249,9 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (!tspellcasted)
{
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
- DoCast(m_creature, SPELL_TWIN_TELEPORT);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_STUNNED);
+ DoCast(me, SPELL_TWIN_TELEPORT);
+ me->addUnitState(UNIT_STAT_STUNNED);
}
tspellcasted = true;
@@ -259,13 +259,13 @@ struct boss_twinemperorsAI : public ScriptedAI
if (AfterTeleportTimer <= diff)
{
AfterTeleport = false;
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
- Unit *nearu = m_creature->SelectNearestTarget(100);
+ me->clearUnitState(UNIT_STAT_STUNNED);
+ Unit *nearu = me->SelectNearestTarget(100);
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
if (nearu)
{
AttackStart(nearu);
- m_creature->getThreatManager().addThreat(nearu, 10000);
+ me->getThreatManager().addThreat(nearu, 10000);
}
return true;
}
@@ -292,15 +292,15 @@ struct boss_twinemperorsAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!who || m_creature->getVictim())
+ if (!who || me->getVictim())
return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
{
- float attackRadius = m_creature->GetAttackDistance(who);
+ float attackRadius = me->GetAttackDistance(who);
if (attackRadius < PULL_RANGE)
attackRadius = PULL_RANGE;
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
+ if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
{
//if (who->HasStealthAura())
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
@@ -312,8 +312,8 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *RespawnNearbyBugsAndGetOne()
{
std::list<Creature*> lUnitList;
- m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f);
- m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f);
+ me->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f);
+ me->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f);
if (lUnitList.empty())
return NULL;
@@ -331,7 +331,7 @@ struct boss_twinemperorsAI : public ScriptedAI
c->setFaction(7);
c->RemoveAllAuras();
}
- if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
+ if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
{
if (!nearb || (rand()%4) == 0)
nearb = c;
@@ -375,9 +375,9 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (EnrageTimer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(true))
+ if (!me->IsNonMeleeSpellCasted(true))
{
- DoCast(m_creature, SPELL_BERSERK);
+ DoCast(me, SPELL_BERSERK);
EnrageTimer = 60*60000;
} else EnrageTimer = 0;
} else EnrageTimer-=diff;
@@ -406,13 +406,13 @@ struct boss_veknilashAI : public boss_twinemperorsAI
Scarabs_Timer = 7000 + rand()%7000;
//Added. Can be removed if its included in DB.
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void CastSpellOnBug(Creature *pTarget)
{
pTarget->setFaction(14);
- pTarget->AI()->AttackStart(m_creature->getThreatManager().getHostilTarget());
+ pTarget->AI()->AttackStart(me->getThreatManager().getHostilTarget());
pTarget->AddAura(SPELL_MUTATE_BUG, pTarget);
pTarget->SetHealth(pTarget->GetMaxHealth());
}
@@ -429,7 +429,7 @@ struct boss_veknilashAI : public boss_twinemperorsAI
//UnbalancingStrike_Timer
if (UnbalancingStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UNBALANCING_STRIKE);
+ DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE);
UnbalancingStrike_Timer = 8000+rand()%12000;
} else UnbalancingStrike_Timer -= diff;
@@ -482,9 +482,9 @@ struct boss_veklorAI : public boss_twinemperorsAI
Scorpions_Timer = 7000 + rand()%7000;
//Added. Can be removed if its included in DB.
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
}
void CastSpellOnBug(Creature *pTarget)
@@ -511,10 +511,10 @@ struct boss_veklorAI : public boss_twinemperorsAI
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
- if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0);
+ if (!me->IsWithinDist(me->getVictim(), 45.0f))
+ me->GetMotionMaster()->MoveChase(me->getVictim(), VEKLOR_DIST, 0);
else
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
} else ShadowBolt_Timer -= diff;
@@ -563,10 +563,10 @@ struct boss_veklorAI : public boss_twinemperorsAI
if (who->isTargetableForAttack())
{
// VL doesn't melee
- if (m_creature->Attack(who, false))
+ if (me->Attack(who, false))
{
- m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
- m_creature->AddThreat(who, 0.0f);
+ me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
+ me->AddThreat(who, 0.0f);
}
}
}
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
index 13692b77195..7badb7562db 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
@@ -89,7 +89,7 @@ struct aqsentinelAI : public ScriptedAI
void AddBuddyToList(uint64 CreatureGUID)
{
- if (CreatureGUID == m_creature->GetGUID())
+ if (CreatureGUID == me->GetGUID())
return;
for (int i=0; i<3; ++i)
@@ -110,13 +110,13 @@ struct aqsentinelAI : public ScriptedAI
for (int i=0; i<3; ++i)
if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID())
cai->AddBuddyToList(NearbyGUID[i]);
- cai->AddBuddyToList(m_creature->GetGUID());
+ cai->AddBuddyToList(me->GetGUID());
}
void SendMyListToBuddies()
{
for (int i=0; i<3; ++i)
- if (Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[i]))
+ if (Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[i]))
GiveBuddyMyList(pNearby);
}
@@ -124,7 +124,7 @@ struct aqsentinelAI : public ScriptedAI
{
for (int i=0; i<3; ++i)
{
- Creature *c = Unit::GetCreature(*m_creature, NearbyGUID[i]);
+ Creature *c = Unit::GetCreature(*me, NearbyGUID[i]);
if (c)
{
if (!c->isInCombat())
@@ -140,7 +140,7 @@ struct aqsentinelAI : public ScriptedAI
void AddSentinelsNear(Unit *nears)
{
std::list<Creature*> assistList;
- m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f);
+ me->GetCreatureListWithEntryInGrid(assistList,15264,70.0f);
if (assistList.empty())
return;
@@ -172,14 +172,14 @@ struct aqsentinelAI : public ScriptedAI
selectAbility(pickAbilityRandom(chosenAbilities));
ClearBuddyList();
- AddSentinelsNear(m_creature);
+ AddSentinelsNear(me);
int bli;
for (bli = 0; bli < 3; ++bli)
{
if (!NearbyGUID[bli])
break;
- Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[bli]);
+ Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[bli]);
if (!pNearby)
break;
@@ -199,13 +199,13 @@ struct aqsentinelAI : public ScriptedAI
void Reset()
{
- if (!m_creature->isDead())
+ if (!me->isDead())
{
for (int i=0; i<3; ++i)
{
if (!NearbyGUID[i])
continue;
- if (Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[i]))
+ if (Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[i]))
{
if (pNearby->isDead())
pNearby->Respawn();
@@ -218,7 +218,7 @@ struct aqsentinelAI : public ScriptedAI
void GainSentinelAbility(uint32 id)
{
- m_creature->AddAura(id, m_creature);
+ me->AddAura(id, me);
}
void EnterCombat(Unit *who)
@@ -234,7 +234,7 @@ struct aqsentinelAI : public ScriptedAI
{
for (int ni=0; ni<3; ++ni)
{
- Creature *sent = Unit::GetCreature(*m_creature, NearbyGUID[ni]);
+ Creature *sent = Unit::GetCreature(*me, NearbyGUID[ni]);
if (!sent)
continue;
if (sent->isDead())
@@ -250,9 +250,9 @@ struct aqsentinelAI : public ScriptedAI
Unit *GetHatedManaUser() const
{
std::list<HostileReference*>::const_iterator i;
- for (i = m_creature->getThreatManager().getThreatList().begin(); i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit->getPowerType() == POWER_MANA)
return pUnit;
}
@@ -267,7 +267,7 @@ struct aqsentinelAI : public ScriptedAI
case SPELL_THUNDER_BUFF:
case SPELL_MSTRIKE_BUFF:
case SPELL_STORM_BUFF:
- return m_creature->getVictim();
+ return me->getVictim();
case SPELL_MANAB_BUFF:
return GetHatedManaUser();
@@ -277,7 +277,7 @@ struct aqsentinelAI : public ScriptedAI
case SPELL_REFLECTSFr_BUFF:
case SPELL_THORNS_BUFF:
default:
- return m_creature;
+ return me;
}
}
};
diff --git a/src/scripts/kalimdor/the_barrens.cpp b/src/scripts/kalimdor/the_barrens.cpp
index 1655a0694df..007e5e4b372 100644
--- a/src/scripts/kalimdor/the_barrens.cpp
+++ b/src/scripts/kalimdor/the_barrens.cpp
@@ -102,23 +102,23 @@ struct npc_giltharesAI : public npc_escortAI
switch(uiPointId)
{
case 16:
- DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer);
+ DoScriptText(SAY_GIL_AT_LAST, me, pPlayer);
break;
case 17:
- DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer);
+ DoScriptText(SAY_GIL_PROCEED, me, pPlayer);
break;
case 18:
- DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer);
+ DoScriptText(SAY_GIL_FREEBOOTERS, me, pPlayer);
break;
case 37:
- DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer);
+ DoScriptText(SAY_GIL_ALMOST, me, pPlayer);
break;
case 47:
- DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer);
+ DoScriptText(SAY_GIL_SWEET, me, pPlayer);
break;
case 53:
- DoScriptText(SAY_GIL_FREED, m_creature, pPlayer);
- pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature);
+ DoScriptText(SAY_GIL_FREED, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, me);
break;
}
}
@@ -130,10 +130,10 @@ struct npc_giltharesAI : public npc_escortAI
return;
//only aggro text if not player and only in this area
- if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST)
+ if (pWho->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST)
{
//appears to be pretty much random (possible only if escorter not in combat with pWho yet?)
- DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), m_creature, pWho);
+ DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, pWho);
}
}
};
@@ -214,20 +214,20 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
IsFriend = false;
Reset_Timer = 120000;
FlareCount = 0;
- m_creature->setFaction(factionNorm);
+ me->setFaction(factionNorm);
}
void DoFriend()
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
- m_creature->setFaction(FACTION_FRIENDLY_F);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ me->setFaction(FACTION_FRIENDLY_F);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
@@ -266,7 +266,7 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
{
if (FlareCount >= 2)
{
- if (m_creature->getFaction() == FACTION_FRIENDLY_F)
+ if (me->getFaction() == FACTION_FRIENDLY_F)
return;
DoFriend();
@@ -345,7 +345,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (!who || (!who->isAlive())) return;
- if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
+ if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
{
PlayerGUID = who->GetGUID();
EventInProgress = true;
@@ -367,14 +367,14 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
EventInProgress = false;
- DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
+ DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
pWarrior->FailQuest(1719);
for (uint8 i = 0; i < 6; ++i)
{
if (AffrayChallenger[i])
{
- Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
+ Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
if (pCreature) {
if (pCreature->isAlive())
{
@@ -390,7 +390,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (BigWill)
{
- Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
+ Creature* pCreature = Unit::GetCreature((*me), BigWill);
if (pCreature) {
if (pCreature->isAlive()) {
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
@@ -409,11 +409,11 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
pWarrior->AreaExploredOrEventHappens(1719);
- DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature);
+ DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me);
for (uint8 i = 0; i < 6; ++i)
{
- Creature* pCreature = m_creature->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ Creature* pCreature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if (!pCreature)
continue;
pCreature->setFaction(35);
@@ -435,10 +435,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (AffrayChallenger[i])
{
- Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
+ Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
if ((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
{
- DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
+ DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
Challenger_down[i] = true;
}
}
@@ -450,8 +450,8 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
{
- DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature);
- Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]);
+ DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me);
+ Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[Wave]);
if (pCreature && (pCreature->isAlive()))
{
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -464,7 +464,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
}
}
else if (Wave >= 6 && !EventBigWill) {
- if (Creature* pCreature = m_creature->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
+ if (Creature* pCreature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
{
BigWill = pCreature->GetGUID();
//pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
@@ -477,10 +477,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
}
else if (Wave >= 6 && EventBigWill && BigWill)
{
- Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
+ Creature* pCreature = Unit::GetCreature((*me), BigWill);
if (!pCreature || !pCreature->isAlive())
{
- DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature);
+ DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me);
EventInProgress = false;
EventBigWill = false;
EventGrate = false;
@@ -537,8 +537,8 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD)
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ if (me->getStandState() == UNIT_STAND_STATE_DEAD)
+ me->SetStandState(UNIT_STAND_STATE_STAND);
m_bIsPostEvent = false;
m_uiPostEventTimer = 1000;
@@ -556,16 +556,16 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(uiPointId)
{
case 0:
- DoScriptText(SAY_STARTUP1, m_creature);
+ DoScriptText(SAY_STARTUP1, me);
break;
case 9:
SetRun(false);
break;
case 17:
- if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
+ if (Creature* pTemp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
{
DoScriptText(SAY_MERCENARY, pTemp);
- m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
}
break;
case 24:
@@ -584,10 +584,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(uiPointId)
{
case 9:
- DoScriptText(SAY_STARTUP2, m_creature, pPlayer);
+ DoScriptText(SAY_STARTUP2, me, pPlayer);
break;
case 18:
- DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS_1, me, pPlayer);
SetRun();
break;
}
@@ -596,10 +596,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == NPC_PILOT_WIZZ)
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
if (pSummoned->GetEntry() == NPC_MERCENARY)
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
void UpdateEscortAI(const uint32 uiDiff)
@@ -613,19 +613,19 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(m_uiPostEventCount)
{
case 0:
- DoScriptText(SAY_PROGRESS_2, m_creature);
+ DoScriptText(SAY_PROGRESS_2, me);
break;
case 1:
- DoScriptText(SAY_PROGRESS_3, m_creature);
+ DoScriptText(SAY_PROGRESS_3, me);
break;
case 2:
- DoScriptText(SAY_END, m_creature);
+ DoScriptText(SAY_END, me);
break;
case 3:
if (Player* pPlayer = GetPlayerForEscort())
{
- pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature);
- m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
+ pPlayer->GroupEventHappens(QUEST_ESCAPE, me);
+ me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
}
break;
}
diff --git a/src/scripts/kalimdor/thousand_needles.cpp b/src/scripts/kalimdor/thousand_needles.cpp
index ecd87918ba4..59aac7ba233 100644
--- a/src/scripts/kalimdor/thousand_needles.cpp
+++ b/src/scripts/kalimdor/thousand_needles.cpp
@@ -58,12 +58,12 @@ struct npc_kanatiAI : public npc_escortAI
switch(uiPointId)
{
case 0:
- DoScriptText(SAY_KAN_START, m_creature);
+ DoScriptText(SAY_KAN_START, me);
DoSpawnGalak();
break;
case 1:
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature);
+ pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, me);
break;
}
}
@@ -71,14 +71,14 @@ struct npc_kanatiAI : public npc_escortAI
void DoSpawnGalak()
{
for (int i = 0; i < 3; ++i)
- m_creature->SummonCreature(NPC_GALAK_ASS,
+ me->SummonCreature(NPC_GALAK_ASS,
m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f,
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
}
void JustSummoned(Creature* pSummoned)
{
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
};
@@ -139,20 +139,20 @@ struct npc_lakota_windsongAI : public npc_escortAI
switch(uiPointId)
{
case 8:
- DoScriptText(SAY_LAKO_LOOK_OUT, m_creature);
+ DoScriptText(SAY_LAKO_LOOK_OUT, me);
DoSpawnBandits(ID_AMBUSH_1);
break;
case 14:
- DoScriptText(SAY_LAKO_HERE_COME, m_creature);
+ DoScriptText(SAY_LAKO_HERE_COME, me);
DoSpawnBandits(ID_AMBUSH_2);
break;
case 21:
- DoScriptText(SAY_LAKO_MORE, m_creature);
+ DoScriptText(SAY_LAKO_MORE, me);
DoSpawnBandits(ID_AMBUSH_3);
break;
case 45:
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature);
+ pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, me);
break;
}
}
@@ -160,7 +160,7 @@ struct npc_lakota_windsongAI : public npc_escortAI
void DoSpawnBandits(int uiAmbushId)
{
for (int i = 0; i < 2; ++i)
- m_creature->SummonCreature(NPC_GRIM_BANDIT,
+ me->SummonCreature(NPC_GRIM_BANDIT,
m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
@@ -217,15 +217,15 @@ struct npc_paoka_swiftmountainAI : public npc_escortAI
switch(uiPointId)
{
case 15:
- DoScriptText(SAY_WYVERN, m_creature);
+ DoScriptText(SAY_WYVERN, me);
DoSpawnWyvern();
break;
case 26:
- DoScriptText(SAY_COMPLETE, m_creature);
+ DoScriptText(SAY_COMPLETE, me);
break;
case 27:
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature);
+ pPlayer->GroupEventHappens(QUEST_HOMEWARD, me);
break;
}
}
@@ -233,7 +233,7 @@ struct npc_paoka_swiftmountainAI : public npc_escortAI
void DoSpawnWyvern()
{
for (int i = 0; i < 3; ++i)
- m_creature->SummonCreature(NPC_WYVERN,
+ me->SummonCreature(NPC_WYVERN,
m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
@@ -282,13 +282,13 @@ struct npc_pluckyAI : public ScriptedAI
{
m_uiResetTimer = 120000;
- if (m_creature->getFaction() != m_uiNormFaction)
- m_creature->setFaction(m_uiNormFaction);
+ if (me->getFaction() != m_uiNormFaction)
+ me->setFaction(m_uiNormFaction);
- if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(m_creature, SPELL_PLUCKY_CHICKEN, false);
+ DoCast(me, SPELL_PLUCKY_CHICKEN, false);
}
void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
@@ -297,36 +297,36 @@ struct npc_pluckyAI : public ScriptedAI
{
if (uiTextEmote == TEXTEMOTE_BECKON)
{
- m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(m_creature, SPELL_PLUCKY_HUMAN, false);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ DoCast(me, SPELL_PLUCKY_HUMAN, false);
}
}
if (uiTextEmote == TEXTEMOTE_CHICKEN)
{
- if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return;
else
{
- m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(m_creature, SPELL_PLUCKY_HUMAN, false);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ DoCast(me, SPELL_PLUCKY_HUMAN, false);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
}
}
}
void UpdateAI(const uint32 uiDiff)
{
- if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
{
if (m_uiResetTimer <= uiDiff)
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
EnterEvadeMode();
else
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
return;
}
@@ -394,8 +394,8 @@ struct npc_enraged_pantherAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 diff)
diff --git a/src/scripts/kalimdor/thunder_bluff.cpp b/src/scripts/kalimdor/thunder_bluff.cpp
index 1f776bbb048..f622acbd993 100644
--- a/src/scripts/kalimdor/thunder_bluff.cpp
+++ b/src/scripts/kalimdor/thunder_bluff.cpp
@@ -71,25 +71,25 @@ struct npc_cairne_bloodhoofAI : public ScriptedAI
if (Uppercut_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 20000;
} else Uppercut_Timer -= diff;
if (Thunderclap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 15000;
} else Thunderclap_Timer -= diff;
if (MortalStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
diff --git a/src/scripts/kalimdor/ungoro_crater.cpp b/src/scripts/kalimdor/ungoro_crater.cpp
index 3a9944fb041..7b20eafeae2 100644
--- a/src/scripts/kalimdor/ungoro_crater.cpp
+++ b/src/scripts/kalimdor/ungoro_crater.cpp
@@ -61,24 +61,24 @@ struct npc_ameAI : public npc_escortAI
{
case 19:
- m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO1, m_creature, pPlayer);
+ me->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoScriptText(SAY_AGGRO1, me, pPlayer);
break;
case 28:
- DoScriptText(SAY_SEARCH, m_creature, pPlayer);
+ DoScriptText(SAY_SEARCH, me, pPlayer);
break;
case 38:
- m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO2, m_creature, pPlayer);
+ me->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoScriptText(SAY_AGGRO2, me, pPlayer);
break;
case 49:
- m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO3, m_creature, pPlayer);
+ me->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoScriptText(SAY_AGGRO3, me, pPlayer);
break;
case 55:
- DoScriptText(SAY_FINISH, m_creature, pPlayer);
+ DoScriptText(SAY_FINISH, me, pPlayer);
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_CHASING_AME,m_creature);
+ pPlayer->GroupEventHappens(QUEST_CHASING_AME,me);
break;
}
@@ -91,7 +91,7 @@ struct npc_ameAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -108,7 +108,7 @@ struct npc_ameAI : public npc_escortAI
if (DEMORALIZINGSHOUT_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEMORALIZINGSHOUT);
+ DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
DEMORALIZINGSHOUT_Timer = 70000;
} else DEMORALIZINGSHOUT_Timer -= diff;
@@ -189,14 +189,14 @@ struct npc_ringoAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SPRAGGLE)
+ if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SPRAGGLE)
{
- if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
+ if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE)
- pPlayer->GroupEventHappens(QUEST_A_LITTLE_HELP, m_creature);
+ pPlayer->GroupEventHappens(QUEST_A_LITTLE_HELP, me);
}
SpraggleGUID = pWho->GetGUID();
@@ -217,21 +217,21 @@ struct npc_ringoAI : public FollowerAI
{
SetFollowPaused(true);
- DoScriptText(RAND(SAY_FAINT_1,SAY_FAINT_2,SAY_FAINT_3,SAY_FAINT_4), m_creature);
+ DoScriptText(RAND(SAY_FAINT_1,SAY_FAINT_2,SAY_FAINT_3,SAY_FAINT_4), me);
}
//what does actually happen here? Emote? Aura?
- m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
+ me->SetStandState(UNIT_STAND_STATE_SLEEP);
}
void ClearFaint()
{
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
if (HasFollowState(STATE_FOLLOW_POSTEVENT))
return;
- DoScriptText(RAND(SAY_WAKE_1,SAY_WAKE_2,SAY_WAKE_3,SAY_WAKE_4), m_creature);
+ DoScriptText(RAND(SAY_WAKE_1,SAY_WAKE_2,SAY_WAKE_3,SAY_WAKE_4), me);
SetFollowPaused(false);
}
@@ -244,7 +244,7 @@ struct npc_ringoAI : public FollowerAI
{
if (m_uiEndEventTimer <= uiDiff)
{
- Unit *pSpraggle = Unit::GetUnit(*m_creature, SpraggleGUID);
+ Unit *pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
if (!pSpraggle || !pSpraggle->isAlive())
{
SetFollowComplete();
@@ -254,7 +254,7 @@ struct npc_ringoAI : public FollowerAI
switch(m_uiEndEventProgress)
{
case 1:
- DoScriptText(SAY_RIN_END_1, m_creature);
+ DoScriptText(SAY_RIN_END_1, me);
m_uiEndEventTimer = 3000;
break;
case 2:
@@ -262,21 +262,21 @@ struct npc_ringoAI : public FollowerAI
m_uiEndEventTimer = 5000;
break;
case 3:
- DoScriptText(SAY_RIN_END_3, m_creature);
+ DoScriptText(SAY_RIN_END_3, me);
m_uiEndEventTimer = 1000;
break;
case 4:
- DoScriptText(EMOTE_RIN_END_4, m_creature);
+ DoScriptText(EMOTE_RIN_END_4, me);
SetFaint();
m_uiEndEventTimer = 9000;
break;
case 5:
- DoScriptText(EMOTE_RIN_END_5, m_creature);
+ DoScriptText(EMOTE_RIN_END_5, me);
ClearFaint();
m_uiEndEventTimer = 1000;
break;
case 6:
- DoScriptText(SAY_RIN_END_6, m_creature);
+ DoScriptText(SAY_RIN_END_6, me);
m_uiEndEventTimer = 3000;
break;
case 7:
@@ -284,7 +284,7 @@ struct npc_ringoAI : public FollowerAI
m_uiEndEventTimer = 10000;
break;
case 8:
- DoScriptText(EMOTE_RIN_END_8, m_creature);
+ DoScriptText(EMOTE_RIN_END_8, me);
m_uiEndEventTimer = 5000;
break;
case 9:
diff --git a/src/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/src/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp
index 1dfefaa4be3..6eed1b80e1d 100644
--- a/src/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp
+++ b/src/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp
@@ -81,8 +81,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 0;
currentEvent = 0;
eventProgress = 0;
- m_creature->setActive(true);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->setActive(true);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
uint32 eventTimer;
@@ -103,7 +103,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS);
break;
case 5:
- DoScriptText(SAY_MUST_CONTINUE, m_creature);
+ DoScriptText(SAY_MUST_CONTINUE, me);
pInstance->SetData(TYPE_NARALEX_PART1, DONE);
break;
case 11:
@@ -112,7 +112,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS);
break;
case 19:
- DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature);
+ DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me);
break;
case 24:
eventProgress = 1;
@@ -129,7 +129,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_ATTACKED, m_creature, who);
+ DoScriptText(SAY_ATTACKED, me, who);
}
void JustDied(Unit *slayer)
@@ -145,7 +145,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
@@ -166,31 +166,31 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
if (eventProgress == 1)
{
++eventProgress;
- DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature);
- m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
- m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ DoScriptText(SAY_TEMPLE_OF_PROMISE, me);
+ me->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ me->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
}
break;
case TYPE_NARALEX_PART2:
if (eventProgress == 1)
{
++eventProgress;
- DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature);
- DoCast(m_creature, SPELL_SERPENTINE_CLEANSING);
- //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false);
+ DoScriptText(SAY_BANISH_THE_SPIRITS, me);
+ DoCast(me, SPELL_SERPENTINE_CLEANSING);
+ //CAST_AI(npc_escortAI, me->AI())->SetCanDefend(false);
eventTimer = 30000;
- m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
- m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
- m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ me->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ me->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ me->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
}
else
if (eventProgress == 2)
{
- //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true);
- DoScriptText(SAY_CAVERNS_PURIFIED, m_creature);
+ //CAST_AI(npc_escortAI, me->AI())->SetCanDefend(true);
+ DoScriptText(SAY_CAVERNS_PURIFIED, me);
pInstance->SetData(TYPE_NARALEX_PART2, DONE);
- if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING))
- m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING);
+ if (me->HasAura(SPELL_SERPENTINE_CLEANSING))
+ me->RemoveAura(SPELL_SERPENTINE_CLEANSING);
}
break;
case TYPE_NARALEX_PART3:
@@ -198,18 +198,18 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
{
++eventProgress;
eventTimer = 4000;
- m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
- DoScriptText(SAY_EMERALD_DREAM, m_creature);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
+ DoScriptText(SAY_EMERALD_DREAM, me);
}
else
if (eventProgress == 2)
{
++eventProgress;
eventTimer = 15000;
- //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false);
+ //CAST_AI(npc_escortAI, me->AI())->SetCanDefend(false);
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoCast(naralex, SPELL_NARALEXS_AWAKENING, true);
- DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature);
+ DoScriptText(EMOTE_AWAKENING_RITUAL, me);
}
else
if (eventProgress == 3)
@@ -218,9 +218,9 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 15000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_TROUBLED_SLEEP, naralex);
- m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 4)
@@ -229,13 +229,13 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 30000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
- m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
+ me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 5)
@@ -243,8 +243,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
++eventProgress;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_HORRENDOUS_VISION, naralex);
- m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature);
+ me->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ DoScriptText(SAY_MUTANUS_THE_DEVOURER, me);
pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS);
}
else
@@ -257,7 +257,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS);
if (AchievWC)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -265,12 +265,12 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
itr->getSource()->CompletedAchievement(AchievWC);
}
}
- if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING))
- m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING);
+ if (me->HasAura(SPELL_NARALEXS_AWAKENING))
+ me->RemoveAura(SPELL_NARALEXS_AWAKENING);
naralex->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_I_AM_AWAKE, naralex);
}
- DoScriptText(SAY_NARALEX_AWAKES, m_creature);
+ DoScriptText(SAY_NARALEX_AWAKES, me);
}
else
if (eventProgress == 7)
@@ -291,8 +291,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
naralex->AddAura(SPELL_FLIGHT_FORM, naralex);
}
SetRun();
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->AddAura(SPELL_FLIGHT_FORM, me);
}
else
if (eventProgress == 9)
@@ -312,15 +312,15 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870);
naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801);
}
- m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870);
- m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135);
+ me->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870);
+ me->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135);
}
else
if (eventProgress == 11)
{
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
naralex->SetVisibility(VISIBILITY_OFF);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
pInstance->SetData(TYPE_NARALEX_PART3, DONE);
}
break;
diff --git a/src/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/scripts/kalimdor/zulfarrak/zulfarrak.cpp
index b32ad99ce1e..94fd13fe266 100644
--- a/src/scripts/kalimdor/zulfarrak/zulfarrak.cpp
+++ b/src/scripts/kalimdor/zulfarrak/zulfarrak.cpp
@@ -50,14 +50,14 @@ struct npc_sergeant_blyAI : public ScriptedAI
//ScriptedInstance* pInstance;
uint32 ShieldBash_Timer;
- uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required.
+ uint32 Revenge_Timer; //this is wrong, spell should never be used unless me->getVictim() dodge, parry or block attack. Trinity support required.
void Reset()
{
ShieldBash_Timer = 5000;
Revenge_Timer = 8000;
- m_creature->setFaction(FACTION_FRIENDLY);
+ me->setFaction(FACTION_FRIENDLY);
/*if (pInstance)
pInstance->SetData(0, NOT_STARTED);*/
@@ -82,13 +82,13 @@ struct npc_sergeant_blyAI : public ScriptedAI
if (ShieldBash_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHIELD_BASH);
+ DoCast(me->getVictim(), SPELL_SHIELD_BASH);
ShieldBash_Timer = 15000;
} else ShieldBash_Timer -= diff;
if (Revenge_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_REVENGE);
+ DoCast(me->getVictim(), SPELL_REVENGE);
Revenge_Timer = 10000;
} else Revenge_Timer -= diff;
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
index 92f9440db66..c7219d791c0 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
@@ -66,8 +66,8 @@ struct boss_amanitarAI : public ScriptedAI
uiBoltTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS);
uiSpawnTimer = 0;
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
if (pInstance)
{
@@ -93,7 +93,7 @@ struct boss_amanitarAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
- DoCast(m_creature, SPELL_MINI, false);
+ DoCast(me, SPELL_MINI, false);
}
void SpawnAdds()
@@ -106,10 +106,10 @@ struct boss_amanitarAI : public ScriptedAI
{
Position pos;
victim->GetPosition(&pos);
- m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
- m_creature->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS);
- m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
- m_creature->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS);
+ me->GetRandomNearPosition(pos, float(urand(5,80)));
+ me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS);
+ me->GetRandomNearPosition(pos, float(urand(5,80)));
+ me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS);
}
}
}
@@ -159,10 +159,10 @@ struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
void Reset()
{
- DoCast(m_creature, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
+ DoCast(me, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
- if (m_creature->GetEntry() == NPC_POISONOUS_MUSHROOM)
- DoCast(m_creature, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
+ if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
+ DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
uiAuraTimer = 0;
uiDeathTimer = 30*IN_MILISECONDS;
@@ -173,9 +173,9 @@ struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
if (!killer)
return;
- if (m_creature->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
+ if (me->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(killer, SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, false);
}
}
@@ -185,17 +185,17 @@ struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
void UpdateAI(const uint32 diff)
{
- if (m_creature->GetEntry() == NPC_POISONOUS_MUSHROOM)
+ if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
if (uiAuraTimer <= diff)
{
- DoCast(m_creature, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
- DoCast(m_creature, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false);
+ DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
+ DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false);
uiAuraTimer = 7*IN_MILISECONDS;
} else uiAuraTimer -= diff;
}
if (uiDeathTimer <= diff)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else uiDeathTimer -= diff;
}
};
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
index 6f373e8482d..515b5d80678 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
@@ -93,7 +93,7 @@ struct boss_elder_nadoxAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_DEATH,m_creature);
+ DoScriptText(SAY_DEATH,me);
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS);
@@ -101,12 +101,12 @@ struct boss_elder_nadoxAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_SLAY_3,m_creature); //SAY_SLAY_3 on death?
+ DoScriptText(SAY_SLAY_3,me); //SAY_SLAY_3 on death?
if (pInstance)
{
@@ -123,14 +123,14 @@ struct boss_elder_nadoxAI : public ScriptedAI
if (uiPlagueTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BROOD_PLAGUE);
+ DoCast(me->getVictim(), SPELL_BROOD_PLAGUE);
uiPlagueTimer = 15*IN_MILISECONDS;
} else uiPlagueTimer -= diff;
if (IsHeroic())
if (uiRagueTimer <= diff)
{
- if (Creature *pSwarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35))
+ if (Creature *pSwarmer = me->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35))
{
DoCast(pSwarmer, H_SPELL_BROOD_RAGE, true);
uiRagueTimer = 15*IN_MILISECONDS;
@@ -139,31 +139,31 @@ struct boss_elder_nadoxAI : public ScriptedAI
if (uiSwarmerSpawnTimer <= diff)
{
- DoCast(m_creature, SPELL_SUMMON_SWARMERS, true);
- DoCast(m_creature, SPELL_SUMMON_SWARMERS);
+ DoCast(me, SPELL_SUMMON_SWARMERS, true);
+ DoCast(me, SPELL_SUMMON_SWARMERS);
if (urand(1,3) == 3) // 33% chance of dialog
- DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), m_creature);
+ DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), me);
uiSwarmerSpawnTimer = 10*IN_MILISECONDS;
} else uiSwarmerSpawnTimer -= diff;
if (!bGuardSpawned && uiGuardSpawnTimer <= diff)
{
- m_creature->MonsterTextEmote(EMOTE_HATCHES,m_creature->GetGUID(),true);
- DoCast(m_creature, SPELL_SUMMON_SWARM_GUARD);
+ me->MonsterTextEmote(EMOTE_HATCHES,me->GetGUID(),true);
+ DoCast(me, SPELL_SUMMON_SWARM_GUARD);
bGuardSpawned = true;
} else uiGuardSpawnTimer -= diff;
if (uiEnragueTimer <= diff)
{
- if (m_creature->HasAura(SPELL_ENRAGE,0))
+ if (me->HasAura(SPELL_ENRAGE,0))
return;
float x, y, z, o;
- m_creature->GetHomePosition(x, y, z, o);
+ me->GetHomePosition(x, y, z, o);
if (z < 24)
- if (!m_creature->IsNonMeleeSpellCasted(false))
- DoCast(m_creature, SPELL_ENRAGE, true);
+ if (!me->IsNonMeleeSpellCasted(false))
+ DoCast(me, SPELL_ENRAGE, true);
uiEnragueTimer = 5*IN_MILISECONDS;
} else uiEnragueTimer -= diff;
@@ -195,14 +195,14 @@ struct mob_ahnkahar_nerubianAI : public ScriptedAI
void Reset()
{
- if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) //magic numbers are bad!
- DoCast(m_creature, SPELL_GUARDIAN_AURA, true);
+ if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) //magic numbers are bad!
+ DoCast(me, SPELL_GUARDIAN_AURA, true);
uiSprintTimer = 10*IN_MILISECONDS;
}
void JustDied(Unit *killer)
{
- if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
+ if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
DeadAhnkaharGuardian = true;
}
@@ -213,14 +213,14 @@ struct mob_ahnkahar_nerubianAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
- m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA);
+ if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
+ me->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA);
if (pInstance)
{
if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS)
{
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
}
@@ -229,7 +229,7 @@ struct mob_ahnkahar_nerubianAI : public ScriptedAI
if (uiSprintTimer <= diff)
{
- DoCast(m_creature, SPELL_SPRINT);
+ DoCast(me, SPELL_SPRINT);
uiSprintTimer = 25*IN_MILISECONDS;
} else uiSprintTimer -= diff;
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
index c17061ab9ff..5b222c9b116 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
@@ -66,7 +66,7 @@ enum Achievements
struct boss_volazjAI : public ScriptedAI
{
- boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature),Summons(m_creature)
+ boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature),Summons(me)
{
pInstance = pCreature->GetInstanceData();
}
@@ -119,7 +119,7 @@ struct boss_volazjAI : public ScriptedAI
// phase mask
pTarget->CastSpell(pTarget, SPELL_INSANITY_TARGET+insanityHandled, true);
// summon twisted party members for this target
- Map::PlayerList const &players = m_creature->GetMap()->GetPlayers();
+ Map::PlayerList const &players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = i->getSource();
@@ -163,7 +163,7 @@ struct boss_volazjAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_HERALD_VOLAZJ, IN_PROGRESS);
@@ -207,7 +207,7 @@ struct boss_volazjAI : public ScriptedAI
// Check if all summons in this phase killed
for (SummonList::const_iterator iter = Summons.begin(); iter != Summons.end(); ++iter)
{
- if (Creature *visage = Unit::GetCreature(*m_creature, *iter))
+ if (Creature *visage = Unit::GetCreature(*me, *iter))
{
// Not all are dead
if (phase == visage->GetPhaseMask())
@@ -220,7 +220,7 @@ struct boss_volazjAI : public ScriptedAI
// Roll Insanity
uint32 spell = GetSpellForPhaseMask(phase);
uint32 spell2 = GetSpellForPhaseMask(nextPhase);
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (!pMap)
return;
@@ -261,13 +261,13 @@ struct boss_volazjAI : public ScriptedAI
if (uiMindFlayTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 20*IN_MILISECONDS;
} else uiMindFlayTimer -= diff;
if (uiShadowBoltVolleyTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
uiShadowBoltVolleyTimer = 5*IN_MILISECONDS;
} else uiShadowBoltVolleyTimer -= diff;
@@ -284,7 +284,7 @@ struct boss_volazjAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH_1, m_creature);
+ DoScriptText(SAY_DEATH_1, me);
if (pInstance)
{
@@ -298,7 +298,7 @@ struct boss_volazjAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
index 6149c3ecb3c..2a80d9885de 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -120,8 +120,8 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (!pInstance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
- DoScriptText(TEXT_AGGRO, m_creature);
- m_creature->SetInCombatWithZone();
+ DoScriptText(TEXT_AGGRO, me);
+ me->SetInCombatWithZone();
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS);
}
@@ -138,12 +138,12 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER)
return;
- DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), m_creature);
+ DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(TEXT_DEATH, m_creature);
+ DoScriptText(TEXT_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE);
}
@@ -153,29 +153,29 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (!pInstance || !who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
- if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance(who) < 100.0f)
+ if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) < 100.0f)
{
- DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), m_creature);
+ DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), me);
bPreDone = true;
}
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS || !bOnGround)
return;
- if (!m_creature->getVictim() && who->isTargetableForAttack() && m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
{
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
- else if (m_creature->GetMap()->IsDungeon())
+ else if (me->GetMap()->IsDungeon())
{
- who->SetInCombatWith(m_creature);
- m_creature->AddThreat(who, 0.0f);
+ who->SetInCombatWith(me);
+ me->AddThreat(who, 0.0f);
}
}
}
@@ -189,35 +189,35 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
bOpFerokFail = false;
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
- m_creature->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
-/* m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
- m_creature->SendMonsterMove(JedogaPosition[1], MOVEFLAG_JUMP, 0);
- m_creature->Relocate(JedogaPosition[1][0], JedogaPosition[1][1], JedogaPosition[1][2], JedogaPosition[1][3]);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
+/* me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
+ me->SendMonsterMove(JedogaPosition[1], MOVEFLAG_JUMP, 0);
+ me->Relocate(JedogaPosition[1][0], JedogaPosition[1][1], JedogaPosition[1][2], JedogaPosition[1][3]);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
*/
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
+ me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
bOnGround = true;
if (UpdateVictim())
{
- AttackStart(m_creature->getVictim());
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ AttackStart(me->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
else
{
- if (Unit* pTarget = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
+ if (Unit* pTarget = Unit::GetUnit(*me, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
{
AttackStart(pTarget);
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
EnterCombat(pTarget);
}
- else if (!m_creature->isInCombat())
+ else if (!me->isInCombat())
EnterEvadeMode();
}
}
@@ -227,21 +227,21 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (!pInstance)
return;
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
-
- m_creature->AttackStop();
- m_creature->RemoveAllAuras();
- m_creature->LoadCreaturesAddon();
- m_creature->GetMotionMaster()->MovePoint(0, JedogaPosition[0]);
-/* m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
- m_creature->SendMonsterMove(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], 0, MOVEFLAG_JUMP, 0);
- m_creature->Relocate(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], JedogaPosition[0][3]);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+
+ me->AttackStop();
+ me->RemoveAllAuras();
+ me->LoadCreaturesAddon();
+ me->GetMotionMaster()->MovePoint(0, JedogaPosition[0]);
+/* me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
+ me->SendMonsterMove(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], 0, MOVEFLAG_JUMP, 0);
+ me->Relocate(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], JedogaPosition[0][3]);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
*/
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 1);
@@ -260,7 +260,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (opfer)
{
- DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), m_creature);
+ DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), me);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer);
} else
bCanDown = true;
@@ -268,10 +268,10 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
void Opfern()
{
- DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), m_creature);
+ DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), me);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_GIFT_OF_THE_HERALD, false);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_GIFT_OF_THE_HERALD, false);
bOpFerok = false;
bCanDown = true;
@@ -303,14 +303,14 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (uiCycloneTimer <= diff)
{
- DoCast(m_creature, SPELL_CYCLONE_STRIKE, false);
+ DoCast(me, SPELL_CYCLONE_STRIKE, false);
uiCycloneTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiCycloneTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
+ me->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
uiBoltTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiBoltTimer -= diff;
@@ -318,7 +318,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI
if (uiThunderTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
+ me->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
uiThunderTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiThunderTimer -= diff;
@@ -356,17 +356,17 @@ struct mob_jedoga_initiandAI : public ScriptedAI
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
{
- m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
else
{
- DoCast(m_creature, SPELL_SPHERE_VISUAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(me, SPELL_SPHERE_VISUAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
}
@@ -376,7 +376,7 @@ struct mob_jedoga_initiandAI : public ScriptedAI
if (bWalking)
{
- Creature* boss = m_creature->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
+ Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss && !CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true;
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData(DATA_INITIAND_KILLED, 1);
@@ -414,12 +414,12 @@ struct mob_jedoga_initiandAI : public ScriptedAI
{
case 1:
{
- Creature* boss = m_creature->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
+ Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss)
{
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok = true;
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = false;
- m_creature->Kill(m_creature);
+ me->Kill(me);
}
}
break;
@@ -430,41 +430,41 @@ struct mob_jedoga_initiandAI : public ScriptedAI
{
if (pInstance && bCheckTimer <= diff)
{
- if (m_creature->GetGUID() == pInstance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking)
+ if (me->GetGUID() == pInstance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking)
{
- m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
- float distance = m_creature->GetDistance(JedogaPosition[1]);
+ float distance = me->GetDistance(JedogaPosition[1]);
if (distance < 9.0f)
- m_creature->SetSpeed(MOVE_WALK, 0.5f, true);
+ me->SetSpeed(MOVE_WALK, 0.5f, true);
else if (distance < 15.0f)
- m_creature->SetSpeed(MOVE_WALK, 0.75f, true);
+ me->SetSpeed(MOVE_WALK, 0.75f, true);
else if (distance < 20.0f)
- m_creature->SetSpeed(MOVE_WALK, 1.0f, true);
+ me->SetSpeed(MOVE_WALK, 1.0f, true);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
bWalking = true;
}
if (!bWalking)
{
- if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && m_creature->HasAura(SPELL_SPHERE_VISUAL))
+ if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && me->HasAura(SPELL_SPHERE_VISUAL))
{
- m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
- if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS && !m_creature->HasAura(SPELL_SPHERE_VISUAL))
+ if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS && !me->HasAura(SPELL_SPHERE_VISUAL))
{
- DoCast(m_creature, SPELL_SPHERE_VISUAL, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(me, SPELL_SPHERE_VISUAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
}
bCheckTimer = 2*IN_MILISECONDS;
@@ -517,35 +517,35 @@ struct npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI
if (!pInstance)
return;
- if (!bRemoved && m_creature->GetPositionX() > 440.0f)
+ if (!bRemoved && me->GetPositionX() > 440.0f)
{
if (pInstance->GetData(DATA_PRINCE_TALDARAM_EVENT) == DONE)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
bRemoved = true;
return;
}
if (!bCasted)
{
- DoCast(m_creature, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
+ DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
bCasted = true;
}
}
- if (!bRemoved2 && m_creature->GetPositionX() < 440.0f)
+ if (!bRemoved2 && me->GetPositionX() < 440.0f)
{
if (!bCasted2 && pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
- DoCast(m_creature, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
+ DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
bCasted2 = true;
}
if (bCasted2 && !pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
bCasted2 = false;
}
if (!bRemoved2 && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == DONE)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
bRemoved2 = true;
}
}
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
index c550566909f..5d28a7efbbb 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
@@ -78,8 +78,8 @@ struct boss_taldaramAI : public ScriptedAI
boss_taldaramAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
uint32 uiBloodthirstTimer;
@@ -114,7 +114,7 @@ struct boss_taldaramAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS);
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -129,7 +129,7 @@ struct boss_taldaramAI : public ScriptedAI
{
Creature* pSpheres[3];
- //DoCast(m_creature, SPELL_FLAME_SPHERE_SUMMON_1);
+ //DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS);
Unit *pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pSphereTarget && pSpheres[0])
@@ -142,9 +142,9 @@ struct boss_taldaramAI : public ScriptedAI
}
if (IsHeroic())
{
- //DoCast(m_creature, H_SPELL_FLAME_SPHERE_SUMMON_1);
+ //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS);
- //DoCast(m_creature, H_SPELL_FLAME_SPHERE_SUMMON_2);
+ //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2);
pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS);
if (pSphereTarget && pSpheres[1] && pSpheres[2])
{
@@ -167,9 +167,9 @@ struct boss_taldaramAI : public ScriptedAI
case JUST_VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->SetSpeed(MOVE_WALK, 2.0f, true);
- m_creature->GetMotionMaster()->MoveChase(pEmbraceTarget);
+ me->GetMotionMaster()->Clear();
+ me->SetSpeed(MOVE_WALK, 2.0f, true);
+ me->GetMotionMaster()->MoveChase(pEmbraceTarget);
}
Phase = VANISHED;
uiPhaseTimer = 1300;
@@ -177,9 +177,9 @@ struct boss_taldaramAI : public ScriptedAI
case VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
DoCast(pEmbraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR);
- m_creature->GetMotionMaster()->Clear();
- m_creature->SetSpeed(MOVE_WALK, 1.0f, true);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->Clear();
+ me->SetSpeed(MOVE_WALK, 1.0f, true);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
Phase = FEEDING;
uiPhaseTimer = 20*IN_MILISECONDS;
break;
@@ -191,13 +191,13 @@ struct boss_taldaramAI : public ScriptedAI
case NORMAL:
if (uiBloodthirstTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLOODTHIRST);
+ DoCast(me->getVictim(), SPELL_BLOODTHIRST);
uiBloodthirstTimer = 10*IN_MILISECONDS;
} else uiBloodthirstTimer -= diff;
if (uiFlamesphereTimer <= diff)
{
- DoCast(m_creature, SPELL_CONJURE_FLAME_SPHERE);
+ DoCast(me, SPELL_CONJURE_FLAME_SPHERE);
Phase = CASTING_FLAME_SPHERES;
uiPhaseTimer = 3*IN_MILISECONDS + diff;
uiFlamesphereTimer = 15*IN_MILISECONDS;
@@ -207,11 +207,11 @@ struct boss_taldaramAI : public ScriptedAI
{
//Count alive players
Unit *pTarget = NULL;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
// exclude pets & totems
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
target_list.push_back(pTarget);
@@ -220,8 +220,8 @@ struct boss_taldaramAI : public ScriptedAI
//He only vanishes if there are 3 or more alive players
if (target_list.size() > 2)
{
- DoScriptText(RAND(SAY_VANISH_1,SAY_VANISH_2), m_creature);
- DoCast(m_creature, SPELL_VANISH);
+ DoScriptText(RAND(SAY_VANISH_1,SAY_VANISH_2), me);
+ DoCast(me, SPELL_VANISH);
Phase = JUST_VANISHED;
uiPhaseTimer = 500;
if (Unit* pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
@@ -249,14 +249,14 @@ struct boss_taldaramAI : public ScriptedAI
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
- m_creature->CastStop();
+ me->CastStop();
}
}
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
@@ -264,7 +264,7 @@ struct boss_taldaramAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
Unit* pEmbraceTarget = GetEmbraceTarget();
@@ -274,7 +274,7 @@ struct boss_taldaramAI : public ScriptedAI
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
}
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
bool CheckSpheres()
@@ -303,18 +303,18 @@ struct boss_taldaramAI : public ScriptedAI
if (!uiEmbraceTarget)
return NULL;
- return Unit::GetUnit(*m_creature, uiEmbraceTarget);
+ return Unit::GetUnit(*me, uiEmbraceTarget);
}
void RemovePrison()
{
if (!pInstance)
return;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetHomePosition(m_creature->GetPositionX(), m_creature->GetPositionY(), DATA_GROUND_POSITION_Z, m_creature->GetOrientation());
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation());
uint64 prison_GUID = pInstance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM);
pInstance->HandleGameObject(prison_GUID,true);
}
@@ -332,13 +332,13 @@ struct mob_taldaram_flamesphereAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
- m_creature->setFaction(16);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
- DoCast(m_creature, SPELL_FLAME_SPHERE_VISUAL);
- DoCast(m_creature, SPELL_FLAME_SPHERE_SPAWN_EFFECT);
- DoCast(m_creature, SPELL_FLAME_SPHERE_PERIODIC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
+ me->setFaction(16);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
+ DoCast(me, SPELL_FLAME_SPHERE_VISUAL);
+ DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT);
+ DoCast(me, SPELL_FLAME_SPHERE_PERIODIC);
uiDespawnTimer = 10*IN_MILISECONDS;
}
@@ -347,13 +347,13 @@ struct mob_taldaram_flamesphereAI : public ScriptedAI
void JustDied(Unit* slayer)
{
- DoCast(m_creature, SPELL_FLAME_SPHERE_DEATH_EFFECT);
+ DoCast(me, SPELL_FLAME_SPHERE_DEATH_EFFECT);
}
void UpdateAI(const uint32 diff)
{
if (uiDespawnTimer <= diff)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else
uiDespawnTimer -= diff;
}
diff --git a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
index 239acd5623a..d1563b14873 100644
--- a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
+++ b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
@@ -99,8 +99,8 @@ struct boss_anub_arakAI : public ScriptedAI
uiPhaseTimer = 0;
bChanneling = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveAura(SPELL_SUBMERGE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAura(SPELL_SUBMERGE);
lSummons.DespawnAll();
@@ -111,7 +111,7 @@ struct boss_anub_arakAI : public ScriptedAI
void EnterCombat(Unit *pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
@@ -127,7 +127,7 @@ struct boss_anub_arakAI : public ScriptedAI
if (bChanneling == true)
{
for (uint8 i = 0; i < 4; ++i)
- DoCast(m_creature->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
+ DoCast(me->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
bChanneling = false;
}
@@ -136,7 +136,7 @@ struct boss_anub_arakAI : public ScriptedAI
if (uiImpaleTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_IMPALE,H_SPELL_IMPALE), true);
+ me->CastSpell(pTarget, DUNGEON_MODE(SPELL_IMPALE,H_SPELL_IMPALE), true);
uiImpaleTimer = 9*IN_MILISECONDS;
} else uiImpaleTimer -= diff;
@@ -144,9 +144,9 @@ struct boss_anub_arakAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
- if (Creature *Guardian = m_creature->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
+ if (Creature *Guardian = me->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
- Guardian->AddThreat(m_creature->getVictim(), 0.0f);
+ Guardian->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Guardian);
}
}
@@ -161,9 +161,9 @@ struct boss_anub_arakAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
- if (Creature *Venomancer = m_creature->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
+ if (Creature *Venomancer = me->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
- Venomancer->AddThreat(m_creature->getVictim(), 0.0f);
+ Venomancer->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Venomancer);
}
}
@@ -180,9 +180,9 @@ struct boss_anub_arakAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
- if (Creature *Datter = m_creature->SummonCreature(CREATURE_DATTER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
+ if (Creature *Datter = me->SummonCreature(CREATURE_DATTER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
- Datter->AddThreat(m_creature->getVictim(), 0.0f);
+ Datter->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Datter);
}
}
@@ -193,8 +193,8 @@ struct boss_anub_arakAI : public ScriptedAI
if (uiUndergroundTimer <= diff)
{
- m_creature->RemoveAura(SPELL_SUBMERGE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAura(SPELL_SUBMERGE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = 0;
} else uiUndergroundTimer -= diff;
}
@@ -203,7 +203,7 @@ struct boss_anub_arakAI : public ScriptedAI
{
if (uiLeechingSwarmTimer <= diff)
{
- DoCast(m_creature, SPELL_LEECHING_SWARM, true);
+ DoCast(me, SPELL_LEECHING_SWARM, true);
uiLeechingSwarmTimer = 19*IN_MILISECONDS;
} else uiLeechingSwarmTimer -= diff;
@@ -235,9 +235,9 @@ struct boss_anub_arakAI : public ScriptedAI
uiVenomancerTimer = 25*IN_MILISECONDS;
uiDatterTimer = 32*IN_MILISECONDS;
- DoCast(m_creature, SPELL_SUBMERGE, false);
+ DoCast(me, SPELL_SUBMERGE, false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = 1;
}
@@ -248,7 +248,7 @@ struct boss_anub_arakAI : public ScriptedAI
void JustDied(Unit *pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_ANUBARAK_EVENT, DONE);
@@ -256,10 +256,10 @@ struct boss_anub_arakAI : public ScriptedAI
void KilledUnit(Unit *pVictim)
{
- if (pVictim == m_creature)
+ if (pVictim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustSummoned(Creature* summon)
diff --git a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp
index 5956de009ec..c5c4f64c926 100644
--- a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp
+++ b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp
@@ -69,8 +69,8 @@ struct boss_hadronoxAI : public ScriptedAI
void Reset()
{
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
- m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
+ me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
uiAcidTimer = urand(10*IN_MILISECONDS,14*IN_MILISECONDS);
uiLeechTimer = urand(3*IN_MILISECONDS,9*IN_MILISECONDS);
@@ -89,15 +89,15 @@ struct boss_hadronoxAI : public ScriptedAI
void KilledUnit(Unit* Victim)
{
// not sure if this aura check is correct, I think it is though
- if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !m_creature->isAlive())
+ if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !me->isAlive())
return;
- uint32 health = m_creature->GetMaxHealth()/10;
+ uint32 health = me->GetMaxHealth()/10;
- if ((m_creature->GetHealth()+health) >= m_creature->GetMaxHealth())
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ if ((me->GetHealth()+health) >= me->GetMaxHealth())
+ me->SetHealth(me->GetMaxHealth());
else
- m_creature->SetHealth(m_creature->GetHealth()+health);
+ me->SetHealth(me->GetHealth()+health);
}
void JustDied(Unit* Killer)
@@ -110,16 +110,16 @@ struct boss_hadronoxAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_HADRONOX_EVENT, IN_PROGRESS);
- m_creature->SetInCombatWithZone();
+ me->SetInCombatWithZone();
}
void CheckDistance(float dist, const uint32 uiDiff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return;
float x=0.0f, y=0.0f, z=0.0f;
- m_creature->GetRespawnCoord(x,y,z);
+ me->GetRespawnCoord(x,y,z);
if (uiCheckDistanceTimer <= uiDiff)
uiCheckDistanceTimer = 5*IN_MILISECONDS;
@@ -128,9 +128,9 @@ struct boss_hadronoxAI : public ScriptedAI
uiCheckDistanceTimer -= uiDiff;
return;
}
- if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
+ if (me->IsInEvadeMode() || !me->getVictim())
return;
- if (m_creature->GetDistance(x,y,z) > dist)
+ if (me->GetDistance(x,y,z) > dist)
EnterEvadeMode();
}
@@ -142,7 +142,7 @@ struct boss_hadronoxAI : public ScriptedAI
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
CheckDistance(fMaxDistance, diff);
- if (m_creature->HasAura(SPELL_WEB_FRONT_DOORS) || m_creature->HasAura(SPELL_WEB_SIDE_DOORS))
+ if (me->HasAura(SPELL_WEB_FRONT_DOORS) || me->HasAura(SPELL_WEB_SIDE_DOORS))
{
if (IsCombatMovement())
SetCombatMovement(false);
@@ -152,7 +152,7 @@ struct boss_hadronoxAI : public ScriptedAI
if (uiPierceTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PIERCE_ARMOR);
+ DoCast(me->getVictim(), SPELL_PIERCE_ARMOR);
uiPierceTimer = 8*IN_MILISECONDS;
} else uiPierceTimer -= diff;
@@ -182,7 +182,7 @@ struct boss_hadronoxAI : public ScriptedAI
if (uiDoorsTimer <= diff)
{
- //DoCast(m_creature, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS));
+ //DoCast(me, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS));
uiDoorsTimer = urand(30*IN_MILISECONDS,60*IN_MILISECONDS);
} else uiDoorsTimer -= diff;
diff --git a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
index 8397c0a3283..dc7608d76ec 100644
--- a/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
+++ b/src/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
@@ -116,7 +116,7 @@ struct boss_krik_thirAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
Summon();
uiSummonTimer = 15*IN_MILISECONDS;
@@ -126,22 +126,22 @@ struct boss_krik_thirAI : public ScriptedAI
void Summon()
{
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
- m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
+ me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
}
void UpdateAI(const uint32 diff)
@@ -157,7 +157,7 @@ struct boss_krik_thirAI : public ScriptedAI
if (uiMindFlayTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 15*IN_MILISECONDS;
} else uiMindFlayTimer -= diff;
@@ -173,38 +173,38 @@ struct boss_krik_thirAI : public ScriptedAI
uiCurseFatigueTimer = 10*IN_MILISECONDS;
} else uiCurseFatigueTimer -= diff;
- if (!m_creature->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
- DoCast(m_creature, SPELL_FRENZY, true);
+ if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
+ DoCast(me, SPELL_FRENZY, true);
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die
Creature *pAdd1, *pAdd2, *pAdd3;
- if ((pAdd1 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() &&
- (pAdd2 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() &&
- (pAdd3 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() &&
+ if ((pAdd1 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() &&
+ (pAdd2 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() &&
+ (pAdd3 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() &&
IsHeroic())
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
}
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustSummoned(Creature* summoned)
{
- summoned->GetMotionMaster()->MovePoint(0,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ summoned->GetMotionMaster()->MovePoint(0,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ());
}
};
@@ -215,7 +215,7 @@ struct npc_skittering_infectorAI : public ScriptedAI
void JustDied(Unit* killer)
{
//The spell is not working propperly
- DoCast(m_creature->getVictim(),SPELL_ACID_SPLASH, true);
+ DoCast(me->getVictim(),SPELL_ACID_SPLASH, true);
}
};
@@ -243,7 +243,7 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoResetThreat();
- m_creature->AddThreat(pTarget,1.0f);
+ me->AddThreat(pTarget,1.0f);
DoCast(pTarget, SPELL_CHARGE, true);
}
uiChargeTimer = 15*IN_MILISECONDS;
@@ -251,7 +251,7 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI
if (uiBackstabTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BACKSTAB);
+ DoCast(me->getVictim(), SPELL_BACKSTAB);
uiBackstabTimer = 12*IN_MILISECONDS;
} else uiBackstabTimer -= diff;
@@ -287,7 +287,7 @@ struct npc_anub_ar_shadowcasterAI : public ScriptedAI
if (uiShadowNovaTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_NOVA, true);
+ DoCast(me->getVictim(), SPELL_SHADOW_NOVA, true);
uiShadowNovaTimer = 17*IN_MILISECONDS;
} else uiShadowNovaTimer -= diff;
@@ -315,13 +315,13 @@ struct npc_anub_ar_warriorAI : public ScriptedAI
if (uiStrikeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STRIKE, true);
+ DoCast(me->getVictim(), SPELL_STRIKE, true);
uiStrikeTimer = 15*IN_MILISECONDS;
} else uiStrikeTimer -= diff;
if (uiCleaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE, true);
+ DoCast(me->getVictim(), SPELL_CLEAVE, true);
uiCleaveTimer = 17*IN_MILISECONDS;
} else uiCleaveTimer -= diff;
@@ -346,7 +346,7 @@ struct npc_watcher_gashraAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoCast(m_creature, SPELL_ENRAGE, true);
+ DoCast(me, SPELL_ENRAGE, true);
}
void UpdateAI(const uint32 diff)
@@ -363,7 +363,7 @@ struct npc_watcher_gashraAI : public ScriptedAI
if (uiInfectedBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INFECTED_BITE, true);
+ DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILISECONDS;
} else uiInfectedBiteTimer -= diff;
@@ -400,13 +400,13 @@ struct npc_watcher_narjilAI : public ScriptedAI
if (uiInfectedBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INFECTED_BITE, true);
+ DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 11*IN_MILISECONDS;
} else uiInfectedBiteTimer -= diff;
if (uiBindingWebsTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLINDING_WEBS, true);
+ DoCast(me->getVictim(), SPELL_BLINDING_WEBS, true);
uiBindingWebsTimer = 17*IN_MILISECONDS;
} else uiBindingWebsTimer -= diff;
@@ -444,13 +444,13 @@ struct npc_watcher_silthikAI : public ScriptedAI
if (uiInfectedBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INFECTED_BITE, true);
+ DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILISECONDS;
} else uiInfectedBiteTimer -= diff;
if (uiPoisonSprayTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POSION_SPRAY, true);
+ DoCast(me->getVictim(), SPELL_POSION_SPRAY, true);
uiPoisonSprayTimer = 17*IN_MILISECONDS;
} else uiPoisonSprayTimer -= diff;
diff --git a/src/scripts/northrend/borean_tundra.cpp b/src/scripts/northrend/borean_tundra.cpp
index 069eadaedf8..1936b20507b 100644
--- a/src/scripts/northrend/borean_tundra.cpp
+++ b/src/scripts/northrend/borean_tundra.cpp
@@ -243,27 +243,27 @@ struct npc_sinkhole_kill_creditAI : public ScriptedAI
switch (Phase)
{
case 1:
- DoCast(m_creature, SPELL_EXPLODE_CART, true);
- DoCast(m_creature, SPELL_SUMMON_CART, true);
- if (GameObject* cart = m_creature->FindNearestGameObject(188160,3))
+ DoCast(me, SPELL_EXPLODE_CART, true);
+ DoCast(me, SPELL_SUMMON_CART, true);
+ if (GameObject* cart = me->FindNearestGameObject(188160,3))
cart->SetUInt32Value(GAMEOBJECT_FACTION, 14);
uiPhaseTimer = 3000;
Phase = 2;
break;
case 2:
- if (GameObject* cart = m_creature->FindNearestGameObject(188160,3))
+ if (GameObject* cart = me->FindNearestGameObject(188160,3))
cart->UseDoorOrButton();
- DoCast(m_creature, SPELL_EXPLODE_CART, true);
+ DoCast(me, SPELL_EXPLODE_CART, true);
uiPhaseTimer = 3000;
Phase = 3;
break;
case 3:
- DoCast(m_creature, SPELL_EXPLODE_CART, true);
+ DoCast(me, SPELL_EXPLODE_CART, true);
uiPhaseTimer = 2000;
Phase = 4;
case 5:
- DoCast(m_creature, SPELL_SUMMON_WORM, true);
- if (Unit* worm = m_creature->FindNearestCreature(26250, 3))
+ DoCast(me, SPELL_SUMMON_WORM, true);
+ if (Unit* worm = me->FindNearestCreature(26250, 3))
{
worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
@@ -272,19 +272,19 @@ struct npc_sinkhole_kill_creditAI : public ScriptedAI
Phase = 6;
break;
case 6:
- DoCast(m_creature, SPELL_EXPLODE_CART, true);
- if (Unit* worm = m_creature->FindNearestCreature(26250, 3))
+ DoCast(me, SPELL_EXPLODE_CART, true);
+ if (Unit* worm = me->FindNearestCreature(26250, 3))
{
- m_creature->Kill(worm);
+ me->Kill(worm);
worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
uiPhaseTimer = 2000;
Phase = 7;
break;
case 7:
- DoCast(m_creature, SPELL_EXPLODE_CART, true);
+ DoCast(me, SPELL_EXPLODE_CART, true);
if (Player *caster = Unit::GetPlayer(casterGuid))
- caster->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID());
+ caster->KilledMonster(me->GetCreatureInfo(),me->GetGUID());
uiPhaseTimer = 5000;
Phase = 8;
break;
@@ -475,11 +475,11 @@ struct mob_nerubar_victimAI : public ScriptedAI
uint8 uiRand = urand(0,99);
if (uiRand < 25)
{
- Killer->CastSpell(m_creature,45532,true);
+ Killer->CastSpell(me,45532,true);
CAST_PLR(Killer)->KilledMonsterCredit(WARSONG_PEON, 0);
}
else if (uiRand < 75)
- Killer->CastSpell(m_creature, nerubarVictims[urand(0,2)], true);
+ Killer->CastSpell(me, nerubarVictims[urand(0,2)], true);
}
}
}
@@ -503,9 +503,9 @@ struct npc_scourge_prisonerAI : public ScriptedAI
void Reset()
{
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
- if (GameObject* pGO = m_creature->FindNearestGameObject(GO_SCOURGE_CAGE,5.0f))
+ if (GameObject* pGO = me->FindNearestGameObject(GO_SCOURGE_CAGE,5.0f))
if (pGO->GetGoState() == GO_STATE_ACTIVE)
pGO->SetGoState(GO_STATE_READY);
}
@@ -542,35 +542,35 @@ struct npc_jennyAI : public ScriptedAI
if (!setCrateNumber)
setCrateNumber = true;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
- switch (CAST_PLR(m_creature->GetOwner())->GetTeamId())
+ switch (CAST_PLR(me->GetOwner())->GetTeamId())
{
case TEAM_ALLIANCE:
- m_creature->setFaction(FACTION_ESCORT_A_NEUTRAL_ACTIVE);
+ me->setFaction(FACTION_ESCORT_A_NEUTRAL_ACTIVE);
break;
default:
case TEAM_HORDE:
- m_creature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE);
+ me->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE);
break;
}
}
void DamageTaken(Unit* pDone_by, uint32& uiDamage)
{
- DoCast(m_creature, SPELL_DROP_CRATE, true);
+ DoCast(me, SPELL_DROP_CRATE, true);
}
void UpdateAI(const uint32 diff)
{
if (setCrateNumber)
{
- m_creature->AddAura(SPELL_CRATES_CARRIED,m_creature);
+ me->AddAura(SPELL_CRATES_CARRIED,me);
setCrateNumber = false;
}
- if (!setCrateNumber && !m_creature->HasAura(SPELL_CRATES_CARRIED))
- m_creature->DisappearAndDie();
+ if (!setCrateNumber && !me->HasAura(SPELL_CRATES_CARRIED))
+ me->DisappearAndDie();
if (!UpdateVictim())
return;
@@ -597,7 +597,7 @@ struct npc_fezzix_geartwistAI : public ScriptedAI
if (pWho->GetTypeId() != TYPEID_UNIT)
return;
- if (pWho->GetEntry() == NPC_JENNY && m_creature->IsWithinDistInMap(pWho, 10.0f))
+ if (pWho->GetEntry() == NPC_JENNY && me->IsWithinDistInMap(pWho, 10.0f))
{
if (Unit* pOwner = pWho->GetOwner())
{
@@ -659,7 +659,7 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
void Reset()
{
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
uiPhaseTimer = 2500;
Phase = 1;
go_caribouGUID = 0;
@@ -669,16 +669,16 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
void JustDied(Unit *who)
{
- if (GameObject *go_caribou = m_creature->GetMap()->GetGameObject(go_caribouGUID))
+ if (GameObject *go_caribou = me->GetMap()->GetGameObject(go_caribouGUID))
go_caribou->SetLootState(GO_JUST_DEACTIVATED);
- if (TempSummon *summon = m_creature->ToTempSummon())
+ if (TempSummon *summon = me->ToTempSummon())
if (summon->isSummon())
if (Unit *pTemp = summon->GetSummoner())
if (pTemp->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pTemp)->KilledMonsterCredit(m_creature->GetEntry(),0);
+ CAST_PLR(pTemp)->KilledMonsterCredit(me->GetEntry(),0);
- if (GameObject *go_caribou = m_creature->GetMap()->GetGameObject(go_caribouGUID))
+ if (GameObject *go_caribou = me->GetMap()->GetGameObject(go_caribouGUID))
go_caribou->SetGoState(GO_STATE_READY);
}
@@ -689,34 +689,34 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
switch (Phase)
{
case 1:
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
uiPhaseTimer = 2000;
Phase = 2;
break;
case 2:
- if (GameObject *go_fur = m_creature->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f))
- m_creature->GetMotionMaster()->MovePoint(0, go_fur->GetPositionX(), go_fur->GetPositionY(), go_fur->GetPositionZ());
+ if (GameObject *go_fur = me->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f))
+ me->GetMotionMaster()->MovePoint(0, go_fur->GetPositionX(), go_fur->GetPositionY(), go_fur->GetPositionZ());
uiPhaseTimer = 1500;
Phase = 3;
break;
case 3:
- //DoScriptText(SAY_NESINGWARY_1, m_creature);
+ //DoScriptText(SAY_NESINGWARY_1, me);
uiPhaseTimer = 2000;
Phase = 4;
break;
case 4:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LOOT);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT);
uiPhaseTimer = 1000;
Phase = 5;
break;
case 5:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_NONE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_NONE);
uiPhaseTimer = 500;
Phase = 6;
break;
case 6:
- if (GameObject *go_fur = m_creature->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f))
+ if (GameObject *go_fur = me->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f))
go_fur->Delete();
uiPhaseTimer = 500;
Phase = 7;
@@ -725,21 +725,21 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
case 7:
{
GameObject *go_caribou = NULL;
- if ((go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_1, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_2, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_3, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_4, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_5, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_6, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_7, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_8, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_9, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_10, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_11, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_12, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_13, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_14, 5.0f)) ||
- (go_caribou = m_creature->FindNearestGameObject(GO_CARIBOU_TRAP_15, 5.0f)))
+ if ((go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_1, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_2, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_3, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_4, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_5, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_6, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_7, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_8, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_9, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_10, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_11, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_12, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_13, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_14, 5.0f)) ||
+ (go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_15, 5.0f)))
{
go_caribou->SetGoState(GO_STATE_ACTIVE);
go_caribouGUID = go_caribou->GetGUID();
@@ -749,7 +749,7 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
}
break;
case 8:
- DoCast(m_creature, SPELL_TRAPPED, true);
+ DoCast(me, SPELL_TRAPPED, true);
Phase = 0;
break;
}
@@ -821,27 +821,27 @@ struct npc_lurgglbrAI : public npc_escortAI
switch(IntroPhase)
{
case 1:
- //DoScriptText(SAY_WP_1_LUR_START,m_creature);
+ //DoScriptText(SAY_WP_1_LUR_START,me);
IntroPhase = 2;
IntroTimer = 7500;
break;
case 2:
- //DoScriptText(SAY_WP_1_LUR_END,m_creature);
+ //DoScriptText(SAY_WP_1_LUR_END,me);
IntroPhase = 3;
IntroTimer = 7500;
break;
case 3:
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
IntroPhase = 0;
IntroTimer = 0;
break;
case 4:
- //DoScriptText(SAY_WP_41_LUR_START,m_creature);
+ //DoScriptText(SAY_WP_41_LUR_START,me);
IntroPhase = 5;
IntroTimer = 8000;
break;
case 5:
- //DoScriptText(SAY_WP_41_LUR_END,m_creature);
+ //DoScriptText(SAY_WP_41_LUR_END,me);
IntroPhase = 6;
IntroTimer = 2500;
break;
@@ -854,7 +854,7 @@ struct npc_lurgglbrAI : public npc_escortAI
break;
case 7:
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
IntroPhase = 0;
IntroTimer = 0;
break;
@@ -935,7 +935,7 @@ struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the
void EnterCombat(Unit* pWho)
{
- if (m_creature->canAttack(pWho))
+ if (me->canAttack(pWho))
AttackStart(pWho);
}
@@ -944,7 +944,7 @@ struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the
if (spell->Id == SPELL_DRAKE_HARPOON && caster->GetTypeId() == TYPEID_PLAYER)
{
HarpoonerGUID = caster->GetGUID();
- DoCast(m_creature, SPELL_RED_DRAGONBLOOD, true);
+ DoCast(me, SPELL_RED_DRAGONBLOOD, true);
}
WithRedDragonBlood = true;
}
@@ -956,9 +956,9 @@ struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the
if (!HarpoonerGUID)
return;
- if (m_creature->HasAura(SPELL_SUBDUED) && pWho->GetEntry() == NPC_RAELORASZ)
+ if (me->HasAura(SPELL_SUBDUED) && pWho->GetEntry() == NPC_RAELORASZ)
{
- if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
+ if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
if (Player *pHarpooner = Unit::GetPlayer(HarpoonerGUID))
{
@@ -966,7 +966,7 @@ struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the
pHarpooner->RemoveAura(SPELL_DRAKE_HATCHLING_SUBDUED);
SetFollowComplete();
HarpoonerGUID = 0;
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
}
}
@@ -974,17 +974,17 @@ struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the
void UpdateAI(const uint32 diff)
{
- if (WithRedDragonBlood && HarpoonerGUID && !m_creature->HasAura(SPELL_RED_DRAGONBLOOD))
+ if (WithRedDragonBlood && HarpoonerGUID && !me->HasAura(SPELL_RED_DRAGONBLOOD))
{
if (Player *pHarpooner = Unit::GetPlayer(HarpoonerGUID))
{
EnterEvadeMode();
StartFollow(pHarpooner, 35, NULL);
- DoCast(m_creature, SPELL_SUBDUED, true);
+ DoCast(me, SPELL_SUBDUED, true);
pHarpooner->CastSpell(pHarpooner, SPELL_DRAKE_HATCHLING_SUBDUED, true);
- m_creature->AttackStop();
+ me->AttackStop();
WithRedDragonBlood = false;
}
}
@@ -1064,8 +1064,8 @@ struct npc_thassarianAI : public npc_escortAI
void Reset()
{
- m_creature->RestoreFaction();
- m_creature->RemoveStandFlags(UNIT_STAND_STATE_SIT);
+ me->RestoreFaction();
+ me->RemoveStandFlags(UNIT_STAND_STATE_SIT);
uiArthas = 0;
uiTalbot = 0;
@@ -1092,7 +1092,7 @@ struct npc_thassarianAI : public npc_escortAI
{
case 3:
SetEscortPaused(true);
- if (Creature *pArthas = m_creature->SummonCreature(NPC_IMAGE_LICH_KING, 3730.313, 3518.689, 473.324, 1.562, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000))
+ if (Creature *pArthas = me->SummonCreature(NPC_IMAGE_LICH_KING, 3730.313, 3518.689, 473.324, 1.562, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000))
{
uiArthas = pArthas->GetGUID();
pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -1100,13 +1100,13 @@ struct npc_thassarianAI : public npc_escortAI
pArthas->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pArthas->GetMotionMaster()->MovePoint(0, 3737.374756,3564.841309,477.433014);
}
- if (Creature *pTalbot = m_creature->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23, 3614.936, 473.321, 4.462012, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
+ if (Creature *pTalbot = me->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23, 3614.936, 473.321, 4.462012, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
{
uiTalbot = pTalbot->GetGUID();
pTalbot->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pTalbot->GetMotionMaster()->MovePoint(0, 3738.000977,3568.882080,477.433014);
}
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 4:
@@ -1131,14 +1131,14 @@ struct npc_thassarianAI : public npc_escortAI
{
bArlosInPosition = false;
bLeryssaInPosition = false;
- DoScriptText(SAY_THASSARIAN_1, m_creature);
+ DoScriptText(SAY_THASSARIAN_1, me);
SetEscortPaused(false);
}
if (uiPhaseTimer <= uiDiff)
{
- Creature* pTalbot = m_creature->GetCreature(*m_creature, uiTalbot);
- Creature* pArthas = m_creature->GetCreature(*m_creature, uiArthas);
+ Creature* pTalbot = me->GetCreature(*me, uiTalbot);
+ Creature* pArthas = me->GetCreature(*me, uiArthas);
switch (uiPhase)
{
case 1:
@@ -1182,13 +1182,13 @@ struct npc_thassarianAI : public npc_escortAI
break;
case 6:
- if (Creature* pArlos = m_creature->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100, 3615.655029, 473.321533, 4.447805, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
+ if (Creature* pArlos = me->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100, 3615.655029, 473.321533, 4.447805, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
{
uiArlos = pArlos->GetGUID();
pArlos->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pArlos->GetMotionMaster()->MovePoint(0, 3735.570068, 3572.419922, 477.441010);
}
- if (Creature *pLeryssa = m_creature->SummonCreature(NPC_LERYSSA, 3749.654541, 3614.959717, 473.323486, 4.524959, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
+ if (Creature *pLeryssa = me->SummonCreature(NPC_LERYSSA, 3749.654541, 3614.959717, 473.323486, 4.524959, TEMPSUMMON_CORPSE_TIMED_DESPAWN,120000))
{
uiLeryssa = pLeryssa->GetGUID();
pLeryssa->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -1201,7 +1201,7 @@ struct npc_thassarianAI : public npc_escortAI
break;
case 7:
- DoScriptText(SAY_THASSARIAN_2, m_creature);
+ DoScriptText(SAY_THASSARIAN_2, me);
uiPhaseTimer = 5000;
++uiPhase;
break;
@@ -1209,7 +1209,7 @@ struct npc_thassarianAI : public npc_escortAI
case 8:
if (pArthas && pTalbot)
{
- pArthas->SetInFront(m_creature); //The client doesen't update with the new orientation :l
+ pArthas->SetInFront(me); //The client doesen't update with the new orientation :l
pTalbot->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_LICH_2, pArthas);
}
@@ -1218,7 +1218,7 @@ struct npc_thassarianAI : public npc_escortAI
break;
case 9:
- DoScriptText(SAY_THASSARIAN_3, m_creature);
+ DoScriptText(SAY_THASSARIAN_3, me);
uiPhaseTimer = 5000;
uiPhase = 10;
break;
@@ -1251,37 +1251,37 @@ struct npc_thassarianAI : public npc_escortAI
break;
case 14:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (pTalbot)
{
pTalbot->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pTalbot->SetReactState(REACT_AGGRESSIVE);
- pTalbot->CastSpell(m_creature, SPELL_SHADOW_BOLT, false);
+ pTalbot->CastSpell(me, SPELL_SHADOW_BOLT, false);
}
uiPhaseTimer = 1500;
++uiPhase;
break;
case 15:
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
AttackStart(pTalbot);
uiPhase = 0;
break;
case 16:
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
uiPhaseTimer = 20000;
++uiPhase;
break;
case 17:
- if (Creature* pLeryssa = m_creature->GetCreature(*m_creature, uiLeryssa))
+ if (Creature* pLeryssa = me->GetCreature(*me, uiLeryssa))
pLeryssa->RemoveFromWorld();
- if (Creature* pArlos= m_creature->GetCreature(*m_creature, uiArlos))
+ if (Creature* pArlos= me->GetCreature(*me, uiArlos))
pArlos->RemoveFromWorld();
if (pTalbot)
pTalbot->RemoveFromWorld();
- m_creature->RemoveStandFlags(UNIT_STAND_STATE_SIT);
+ me->RemoveStandFlags(UNIT_STAND_STATE_SIT);
SetEscortPaused(false);
uiPhaseTimer = 0;
uiPhase = 0;
@@ -1296,16 +1296,16 @@ struct npc_thassarianAI : public npc_escortAI
void JustDied(Unit* pKiller)
{
- if (Creature* pTalbot = m_creature->GetCreature(*m_creature, uiTalbot))
+ if (Creature* pTalbot = me->GetCreature(*me, uiTalbot))
pTalbot->RemoveFromWorld();
- if (Creature* pLeryssa = m_creature->GetCreature(*m_creature, uiLeryssa))
+ if (Creature* pLeryssa = me->GetCreature(*me, uiLeryssa))
pLeryssa->RemoveFromWorld();
- if (Creature* pArlos = m_creature->GetCreature(*m_creature, uiArlos))
+ if (Creature* pArlos = me->GetCreature(*me, uiArlos))
pArlos->RemoveFromWorld();
- if (Creature* pArthas = m_creature->GetCreature(*m_creature, uiArthas))
+ if (Creature* pArthas = me->GetCreature(*me, uiArthas))
pArthas->RemoveFromWorld();
}
};
@@ -1350,7 +1350,7 @@ struct npc_image_lich_kingAI : public ScriptedAI
void Reset()
{
- m_creature->RestoreFaction();
+ me->RestoreFaction();
}
void MovementInform(uint32 uiType, uint32 uiId)
@@ -1358,8 +1358,8 @@ struct npc_image_lich_kingAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArthasInPosition = true;
}
};
@@ -1382,10 +1382,10 @@ struct npc_general_arlosAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- m_creature->CastSpell(m_creature, SPELL_STUN, true);
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ me->addUnitState(UNIT_STAT_STUNNED);
+ me->CastSpell(me, SPELL_STUN, true);
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArlosInPosition = true;
}
};
@@ -1435,8 +1435,8 @@ struct npc_counselor_talbotAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bTalbotInPosition = true;
}
@@ -1444,9 +1444,9 @@ struct npc_counselor_talbotAI : public ScriptedAI
{
if (bCheck)
{
- if (Creature *pLeryssa = m_creature->FindNearestCreature(NPC_LERYSSA, 50.0f, true))
+ if (Creature *pLeryssa = me->FindNearestCreature(NPC_LERYSSA, 50.0f, true))
LeryssaGUID = pLeryssa->GetGUID();
- if (Creature *pArlos = m_creature->FindNearestCreature(NPC_GENERAL_ARLOS, 50.0f, true))
+ if (Creature *pArlos = me->FindNearestCreature(NPC_GENERAL_ARLOS, 50.0f, true))
ArlosGUID = pArlos->GetGUID();
bCheck = false;
}
@@ -1454,23 +1454,23 @@ struct npc_counselor_talbotAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->GetAreaId() == 4125)
+ if (me->GetAreaId() == 4125)
{
if (uiShadowBoltTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
uiShadowBoltTimer = urand(5000,12000);
} else uiShadowBoltTimer -= uiDiff;
if (uiDeflectionTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_DEFLECTION);
+ DoCast(me->getVictim(), SPELL_DEFLECTION);
uiDeflectionTimer = urand(20000,25000);
} else uiDeflectionTimer -= uiDiff;
if (uiSoulBlastTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_BLAST);
+ DoCast(me->getVictim(), SPELL_SOUL_BLAST);
uiSoulBlastTimer = urand (12000,18000);
} else uiSoulBlastTimer -= uiDiff;
}
@@ -1483,8 +1483,8 @@ struct npc_counselor_talbotAI : public ScriptedAI
if (!LeryssaGUID || !ArlosGUID)
return;
- Creature *pLeryssa = Unit::GetCreature(*m_creature, LeryssaGUID);
- Creature *pArlos = Unit::GetCreature(*m_creature, ArlosGUID);
+ Creature *pLeryssa = Unit::GetCreature(*me, LeryssaGUID);
+ Creature *pArlos = Unit::GetCreature(*me, ArlosGUID);
if (!pLeryssa || !pArlos)
return;
@@ -1534,22 +1534,22 @@ struct npc_leryssaAI : public ScriptedAI
if (!bDone)
{
- if (Creature* pTalbot = m_creature->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
+ if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
CAST_AI(npc_counselor_talbotAI, pTalbot->AI())->bCheck = true;
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- m_creature->CastSpell(m_creature, SPELL_STUN, true);
+ me->addUnitState(UNIT_STAT_STUNNED);
+ me->CastSpell(me, SPELL_STUN, true);
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bLeryssaInPosition = true;
bDone = true;
}
else
{
- m_creature->SetStandState(UNIT_STAND_STATE_SIT);
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
pSummoner->SetStandState(UNIT_STAND_STATE_SIT);
uiPhaseTimer = 1500;
Phase = 1;
@@ -1565,45 +1565,45 @@ struct npc_leryssaAI : public ScriptedAI
switch (Phase)
{
case 1:
- if (m_creature->isSummon())
- if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
DoScriptText(SAY_THASSARIAN_4, pThassarian);
uiPhaseTimer = 5000;
++Phase;
break;
case 2:
- DoScriptText(SAY_LERYSSA_2, m_creature);
+ DoScriptText(SAY_LERYSSA_2, me);
uiPhaseTimer = 5000;
++Phase;
break;
case 3:
- if (m_creature->isSummon())
- if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
DoScriptText(SAY_THASSARIAN_5, pThassarian);
uiPhaseTimer = 5000;
++Phase;
break;
case 4:
- DoScriptText(SAY_LERYSSA_3, m_creature);
+ DoScriptText(SAY_LERYSSA_3, me);
uiPhaseTimer = 5000;
++Phase;
break;
case 5:
- if (m_creature->isSummon())
- if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
DoScriptText(SAY_THASSARIAN_6, pThassarian);
uiPhaseTimer = 5000;
++Phase;
break;
case 6:
- DoScriptText(SAY_LERYSSA_4, m_creature);
+ DoScriptText(SAY_LERYSSA_4, me);
uiPhaseTimer = 5000;
++Phase;
break;
case 7:
- if (m_creature->isSummon())
- if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
{
DoScriptText(SAY_THASSARIAN_7, pThassarian);
CAST_AI(npc_thassarianAI,CAST_CRE(pThassarian)->AI())->uiPhase = 16;
@@ -1648,25 +1648,25 @@ struct npc_beryl_sorcererAI : public FollowerAI
void Reset()
{
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
bEnslaved = false;
}
void EnterCombat(Unit* pWho)
{
- if (m_creature->canAttack(pWho))
+ if (me->canAttack(pWho))
AttackStart(pWho);
}
void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
{
- if (pSpell->Id == SPELL_ARCANE_CHAINS && pCaster->GetTypeId() == TYPEID_PLAYER && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !bEnslaved)
+ if (pSpell->Id == SPELL_ARCANE_CHAINS && pCaster->GetTypeId() == TYPEID_PLAYER && me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !bEnslaved)
{
EnterEvadeMode(); //We make sure that the npc is not attacking the player!
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
StartFollow(CAST_PLR(pCaster), NULL, NULL);
- m_creature->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER, TEAM_NEUTRAL);
- DoCast(m_creature, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true);
+ me->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER, TEAM_NEUTRAL);
+ DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true);
CAST_PLR(pCaster)->KilledMonsterCredit(NPC_CAPTURED_BERLY_SORCERER, 0);
bEnslaved = true;
}
@@ -1676,10 +1676,10 @@ struct npc_beryl_sorcererAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
- if (pWho->GetEntry() == NPC_LIBRARIAN_DONATHAN && m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
+ if (pWho->GetEntry() == NPC_LIBRARIAN_DONATHAN && me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
SetFollowComplete();
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
}
@@ -1750,18 +1750,18 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
{
ScriptedAI::UpdateAI(uiDiff);
- if (!m_creature->HasAura(SPELL_COSMETIC_ENSLAVE_CHAINS_SELF))
- DoCast(m_creature, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF);
+ if (!me->HasAura(SPELL_COSMETIC_ENSLAVE_CHAINS_SELF))
+ DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF);
- if (m_creature->GetReactState() != REACT_PASSIVE)
- m_creature->SetReactState(REACT_PASSIVE);
+ if (me->GetReactState() != REACT_PASSIVE)
+ me->SetReactState(REACT_PASSIVE);
switch (uiPhase)
{
case 1:
if (uiStep == 1)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_1, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_1, me);
uiStep = 2;
}
break;
@@ -1769,7 +1769,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
case 2:
if (uiStep == 2)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_2, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_2, me);
uiStep = 3;
}
break;
@@ -1777,7 +1777,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
case 3:
if (uiStep == 3)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_3, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_3, me);
uiStep = 4;
}
break;
@@ -1785,7 +1785,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
case 4:
if (uiStep == 4)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_4, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_4, me);
uiStep = 5;
}
break;
@@ -1795,7 +1795,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
{
if (Player *pCaster = Unit::GetPlayer(CasterGUID))
{
- DoScriptText(SAY_IMPRISIONED_BERYL_5, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_5, me);
pCaster->KilledMonsterCredit(25478,0);
uiStep = 6;
}
@@ -1805,7 +1805,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
case 6:
if (uiStep == 6)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_6, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_6, me);
uiStep = 7;
}
break;
@@ -1813,7 +1813,7 @@ struct npc_imprisoned_beryl_sorcererAI : public ScriptedAI
case 7:
if (uiStep == 7)
{
- DoScriptText(SAY_IMPRISIONED_BERYL_7, m_creature);
+ DoScriptText(SAY_IMPRISIONED_BERYL_7, me);
uiStep = 1;
uiPhase = 0;
}
@@ -1886,23 +1886,23 @@ struct npc_mootoo_the_youngerAI : public npc_escortAI
switch(i)
{
case 10:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
- DoScriptText(SAY_2, m_creature);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ DoScriptText(SAY_2, me);
break;
case 12:
- DoScriptText(SAY_3, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LOOT);
+ DoScriptText(SAY_3, me);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT);
break;
case 16:
- DoScriptText(SAY_4, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ DoScriptText(SAY_4, me);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
break;
case 20:
me->SetPhaseMask(1,true);
- DoScriptText(SAY_5, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ DoScriptText(SAY_5, me);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_MIST, m_creature);
+ pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true);
break;
}
@@ -1969,7 +1969,7 @@ struct npc_bonker_togglevoltAI : public npc_escortAI
{
if (Bonker_agro == 0)
{
- DoScriptText(SAY_bonker_1,m_creature);
+ DoScriptText(SAY_bonker_1,me);
Bonker_agro++;
}
DoMeleeAttackIfReady();
@@ -1988,7 +1988,7 @@ struct npc_bonker_togglevoltAI : public npc_escortAI
{
case 29:
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, m_creature);
+ pPlayer->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me);
break;
}
}
@@ -2044,28 +2044,28 @@ struct npc_trapped_mammoth_calfAI : public ScriptedAI
uiTimer = 1500;
bStarted = false;
- if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f)))
+ if ((pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f)))
pTrap->SetGoState(GO_STATE_ACTIVE);
}
@@ -2076,8 +2076,8 @@ struct npc_trapped_mammoth_calfAI : public ScriptedAI
if (uiTimer <= diff)
{
Position pos;
- m_creature->GetRandomNearPosition(pos, 10.0f);
- m_creature->GetMotionMaster()->MovePoint(0,pos);
+ me->GetRandomNearPosition(pos, 10.0f);
+ me->GetMotionMaster()->MovePoint(0,pos);
bStarted = false;
}
else uiTimer -= diff;
@@ -2095,30 +2095,30 @@ struct npc_trapped_mammoth_calfAI : public ScriptedAI
GameObject* pTrap;
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->DisappearAndDie();
-
- if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) ||
- (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f)))
+ me->DisappearAndDie();
+
+ if ((pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) ||
+ (pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f)))
pTrap->SetLootState(GO_JUST_DEACTIVATED);
}
};
@@ -2149,8 +2149,8 @@ struct npc_magmoth_crusherAI : public ScriptedAI
{
if (pKiller->GetTypeId() == TYPEID_PLAYER &&
CAST_PLR(pKiller)->GetQuestStatus(QUEST_YOU_RE_NOT_SO_BIG_NOW) == QUEST_STATUS_INCOMPLETE &&
- (m_creature->HasAura(SPELL_AURA_NOTSOBIG_1) || m_creature->HasAura(SPELL_AURA_NOTSOBIG_2) ||
- m_creature->HasAura(SPELL_AURA_NOTSOBIG_3) || m_creature->HasAura(SPELL_AURA_NOTSOBIG_4)))
+ (me->HasAura(SPELL_AURA_NOTSOBIG_1) || me->HasAura(SPELL_AURA_NOTSOBIG_2) ||
+ me->HasAura(SPELL_AURA_NOTSOBIG_3) || me->HasAura(SPELL_AURA_NOTSOBIG_4)))
{
Quest const* qInfo = objmgr.GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW);
if (qInfo)
@@ -2187,9 +2187,9 @@ struct npc_seaforium_depth_chargeAI : public ScriptedAI
DoCast(SPELL_SEAFORIUM_DEPTH_CHARGE_EXPLOSION);
for (uint8 i = 0; i < 4; ++i)
{
- if (Creature* cCredit = m_creature->FindNearestCreature(25402 + i, 10.0f))//25402-25405 credit markers
+ if (Creature* cCredit = me->FindNearestCreature(25402 + i, 10.0f))//25402-25405 credit markers
{
- if (Unit* uOwner = m_creature->GetOwner(true))
+ if (Unit* uOwner = me->GetOwner(true))
{
Player* pOwner = uOwner->ToPlayer();
if (pOwner && pOwner->GetQuestStatus(QUEST_BURY_THOSE_COCKROACHES) == QUEST_STATUS_INCOMPLETE)
@@ -2197,7 +2197,7 @@ struct npc_seaforium_depth_chargeAI : public ScriptedAI
}
}
}
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
} else uiExplosionTimer -= diff;
}
@@ -2233,10 +2233,10 @@ struct npc_valiance_keep_cannoneerAI : public ScriptedAI
{
if (uiTimer <= diff)
{
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
GameObject* pCannon;
- if ((pCannon = m_creature->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_1,10)) || (pCannon = m_creature->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_2,10)))
- pCannon->Use(m_creature);
+ if ((pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_1,10)) || (pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_2,10)))
+ pCannon->Use(me);
uiTimer = urand(13000,18000);
}
else uiTimer -= diff;
@@ -2289,7 +2289,7 @@ struct npc_warmage_coldarraAI : public Scripted_NoMovementAI
if (m_uiTimer <= uiDiff)
{
std::list<Creature*> orbList;
- GetCreatureListWithEntryInGrid(orbList, m_creature, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
+ GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
switch(me->GetEntry())
{
diff --git a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp
index c7dc2e07c08..d8b68a41471 100644
--- a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp
+++ b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp
@@ -87,11 +87,11 @@ struct boss_eadricAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
damage = 0;
EnterEvadeMode();
- m_creature->setFaction(35);
+ me->setFaction(35);
bDone = true;
}
}
@@ -104,14 +104,14 @@ struct boss_eadricAI : public ScriptedAI
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
void UpdateAI(const uint32 uiDiff)
{
if (bDone && uiResetTimer <= uiDiff)
{
- m_creature->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
+ me->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
bDone = false;
} else uiResetTimer -= uiDiff;
@@ -120,7 +120,7 @@ struct boss_eadricAI : public ScriptedAI
if (uiHammerJusticeTimer <= uiDiff)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 250, true))
{
@@ -135,7 +135,7 @@ struct boss_eadricAI : public ScriptedAI
if (uiVenganceTimer <= uiDiff)
{
- DoCast(m_creature,SPELL_VENGEANCE);
+ DoCast(me,SPELL_VENGEANCE);
uiVenganceTimer = 10000;
} else uiVenganceTimer -= uiDiff;
@@ -183,7 +183,7 @@ struct boss_paletressAI : public ScriptedAI
void Reset()
{
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
uiHolyFireTimer = urand(9000,12000);
uiHolySmiteTimer = urand(5000,7000);
@@ -194,7 +194,7 @@ struct boss_paletressAI : public ScriptedAI
bHealth = false;
bDone = false;
- if (Creature *pMemory = Unit::GetCreature(*m_creature, MemoryGUID))
+ if (Creature *pMemory = Unit::GetCreature(*me, MemoryGUID))
if (pMemory->isAlive())
pMemory->RemoveFromWorld();
}
@@ -202,16 +202,16 @@ struct boss_paletressAI : public ScriptedAI
void SetData(uint32 uiId, uint32 uiValue)
{
if (uiId == 1)
- m_creature->RemoveAura(SPELL_SHIELD);
+ me->RemoveAura(SPELL_SHIELD);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
damage = 0;
EnterEvadeMode();
- m_creature->setFaction(35);
+ me->setFaction(35);
bDone = true;
}
}
@@ -224,14 +224,14 @@ struct boss_paletressAI : public ScriptedAI
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
void UpdateAI(const uint32 uiDiff)
{
if (bDone && uiResetTimer <= uiDiff)
{
- m_creature->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
+ me->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
bDone = false;
} else uiResetTimer -= uiDiff;
@@ -245,7 +245,7 @@ struct boss_paletressAI : public ScriptedAI
if (pTarget && pTarget->isAlive())
DoCast(pTarget,SPELL_HOLY_FIRE);
}
- if (m_creature->HasAura(SPELL_SHIELD))
+ if (me->HasAura(SPELL_SHIELD))
uiHolyFireTimer = 13000;
else
uiHolyFireTimer = urand(9000,12000);
@@ -258,24 +258,24 @@ struct boss_paletressAI : public ScriptedAI
if (pTarget && pTarget->isAlive())
DoCast(pTarget,SPELL_SMITE);
}
- if (m_creature->HasAura(SPELL_SHIELD))
+ if (me->HasAura(SPELL_SHIELD))
uiHolySmiteTimer = 9000;
else
uiHolySmiteTimer = urand(5000,7000);
} else uiHolySmiteTimer -= uiDiff;
- if (m_creature->HasAura(SPELL_SHIELD))
+ if (me->HasAura(SPELL_SHIELD))
if (uiRenewTimer <= uiDiff)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
uint8 uiTarget = urand(0,1);
switch(uiTarget)
{
case 0:
- DoCast(m_creature,SPELL_RENEW);
+ DoCast(me,SPELL_RENEW);
break;
case 1:
- if (Creature *pMemory = Unit::GetCreature(*m_creature, MemoryGUID))
+ if (Creature *pMemory = Unit::GetCreature(*me, MemoryGUID))
if (pMemory->isAlive())
DoCast(pMemory, SPELL_RENEW);
break;
@@ -284,11 +284,11 @@ struct boss_paletressAI : public ScriptedAI
} else uiRenewTimer -= uiDiff;
- if (!bHealth && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25)
+ if (!bHealth && me->GetHealth()*100 / me->GetMaxHealth() <= 25)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
DoCastAOE(SPELL_HOLY_NOVA,false);
- DoCast(m_creature, SPELL_SHIELD);
+ DoCast(me, SPELL_SHIELD);
DoCastAOE(SPELL_SUMMON_MEMORY,false);
DoCastAOE(SPELL_CONFESS,false);
@@ -341,7 +341,7 @@ struct npc_memoryAI : public ScriptedAI
if (uiWakingNightmare <= uiDiff)
{
- DoCast(m_creature, SPELL_WAKING_NIGHTMARE);
+ DoCast(me, SPELL_WAKING_NIGHTMARE);
uiWakingNightmare = 7000;
}else uiWakingNightmare -= uiDiff;
@@ -360,9 +360,9 @@ struct npc_memoryAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- if (m_creature->isSummon())
+ if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive())
CAST_CRE(pSummoner)->AI()->SetData(1,0);
@@ -382,7 +382,7 @@ struct npc_argent_soldierAI : public npc_escortAI
npc_argent_soldierAI(Creature* pCreature) : npc_escortAI(pCreature)
{
pInstance = pCreature->GetInstanceData();
- m_creature->SetReactState(REACT_DEFENSIVE);
+ me->SetReactState(REACT_DEFENSIVE);
SetDespawnAtEnd(false);
uiWaypoint = 0;
}
@@ -398,23 +398,23 @@ struct npc_argent_soldierAI : public npc_escortAI
switch(uiWaypoint)
{
case 0:
- m_creature->SetOrientation(5.81);
+ me->SetOrientation(5.81);
break;
case 1:
- m_creature->SetOrientation(4.60);
+ me->SetOrientation(4.60);
break;
case 2:
- m_creature->SetOrientation(2.79);
+ me->SetOrientation(2.79);
break;
}
- m_creature->SendMovementFlagUpdate();
+ me->SendMovementFlagUpdate();
}
}
void SetData(uint32 uiType, uint32 uiData)
{
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case NPC_ARGENT_LIGHWIELDER:
switch(uiType)
diff --git a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp
index 87f54558f8d..2a92412daac 100644
--- a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp
+++ b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp
@@ -104,8 +104,8 @@ struct boss_black_knightAI : public ScriptedAI
void Reset()
{
RemoveSummons();
- m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
- m_creature->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->SetDisplayId(me->GetNativeDisplayId());
+ me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
bEventInProgress = false;
bEvent = false;
@@ -133,7 +133,7 @@ struct boss_black_knightAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
if (pTemp)
pTemp->DisappearAndDie();
}
@@ -143,7 +143,7 @@ struct boss_black_knightAI : public ScriptedAI
void JustSummoned(Creature* pSummon)
{
SummonList.push_back(pSummon->GetGUID());
- pSummon->AI()->AttackStart(m_creature->getVictim());
+ pSummon->AI()->AttackStart(me->getVictim());
}
void UpdateAI(const uint32 uiDiff)
@@ -155,12 +155,12 @@ struct boss_black_knightAI : public ScriptedAI
if (bEventInProgress)
if (uiResurrectTimer <= uiDiff)
{
- m_creature->SetHealth(m_creature->GetMaxHealth());
- DoCast(m_creature,SPELL_BLACK_KNIGHT_RES,true);
+ me->SetHealth(me->GetMaxHealth());
+ DoCast(me,SPELL_BLACK_KNIGHT_RES,true);
uiPhase++;
uiResurrectTimer = 4000;
bEventInProgress = false;
- m_creature->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
} else uiResurrectTimer -= uiDiff;
switch(uiPhase)
@@ -203,13 +203,13 @@ struct boss_black_knightAI : public ScriptedAI
if (!bSummonArmy)
{
bSummonArmy = true;
- m_creature->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
- DoCast(m_creature, SPELL_ARMY_DEAD);
+ me->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ DoCast(me, SPELL_ARMY_DEAD);
}
if (!bDeathArmyDone)
if (uiDeathArmyCheckTimer <= uiDiff)
{
- m_creature->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
uiDeathArmyCheckTimer = 0;
bDeathArmyDone = true;
} else uiDeathArmyCheckTimer -= uiDiff;
@@ -224,7 +224,7 @@ struct boss_black_knightAI : public ScriptedAI
} else uiDesecration -= uiDiff;
if (uiGhoulExplodeTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_GHOUL_EXPLODE);
+ DoCast(me, SPELL_GHOUL_EXPLODE);
uiGhoulExplodeTimer = 8000;
} else uiGhoulExplodeTimer -= uiDiff;
break;
@@ -253,25 +253,25 @@ struct boss_black_knightAI : public ScriptedAI
}
}
- if (!m_creature->hasUnitState(UNIT_STAT_ROOT) && !m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 0)
+ if (!me->hasUnitState(UNIT_STAT_ROOT) && !me->GetHealth()*100 / me->GetMaxHealth() <= 0)
DoMeleeAttackIfReady();
}
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
- if (uiDamage > m_creature->GetHealth() && uiPhase <= PHASE_SKELETON)
+ if (uiDamage > me->GetHealth() && uiPhase <= PHASE_SKELETON)
{
uiDamage = 0;
- m_creature->SetHealth(0);
- m_creature->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->SetHealth(0);
+ me->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
RemoveSummons();
switch(uiPhase)
{
case PHASE_UNDEAD:
- m_creature->SetDisplayId(MODEL_SKELETON);
+ me->SetDisplayId(MODEL_SKELETON);
break;
case PHASE_SKELETON:
- m_creature->SetDisplayId(MODEL_GHOST);
+ me->SetDisplayId(MODEL_GHOST);
break;
}
bEventInProgress = true;
diff --git a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
index a555b50cf8a..e1812f4b608 100644
--- a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
+++ b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
@@ -114,16 +114,16 @@ void AggroAllPlayers(Creature* pTemp)
}
}
-bool GrandChampionsOutVehicle(Creature* m_creature)
+bool GrandChampionsOutVehicle(Creature* me)
{
- ScriptedInstance* pInstance = m_creature->GetInstanceData();
+ ScriptedInstance* pInstance = me->GetInstanceData();
if (!pInstance)
return false;
- Creature* pGrandChampion1 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_GRAND_CHAMPION_1));
- Creature* pGrandChampion2 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_GRAND_CHAMPION_2));
- Creature* pGrandChampion3 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_GRAND_CHAMPION_3));
+ Creature* pGrandChampion1 = Unit::GetCreature(*me, pInstance->GetData64(DATA_GRAND_CHAMPION_1));
+ Creature* pGrandChampion2 = Unit::GetCreature(*me, pInstance->GetData64(DATA_GRAND_CHAMPION_2));
+ Creature* pGrandChampion3 = Unit::GetCreature(*me, pInstance->GetData64(DATA_GRAND_CHAMPION_3));
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
{
@@ -218,7 +218,7 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
void DoCastSpellShield()
{
for (uint8 i = 0; i < 3; ++i)
- DoCast(m_creature,SPELL_SHIELD,true);
+ DoCast(me,SPELL_SHIELD,true);
}
void UpdateAI(const uint32 uiDiff)
@@ -230,7 +230,7 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
if (uiBuffTimer <= uiDiff)
{
- if (!m_creature->HasAura(SPELL_SHIELD))
+ if (!me->HasAura(SPELL_SHIELD))
DoCastSpellShield();
uiBuffTimer = urand(30000,45000);
@@ -238,16 +238,16 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
if (uiChargeTimer <= uiDiff)
{
- Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
- if (m_creature->GetMap()->IsDungeon() && !players.isEmpty())
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (me->GetMap()->IsDungeon() && !players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pPlayer = itr->getSource();
- if (pPlayer && !pPlayer->isGameMaster() && m_creature->IsInRange(pPlayer,8.0f,25.0f,false))
+ if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,8.0f,25.0f,false))
{
DoResetThreat();
- m_creature->AddThreat(pPlayer,1.0f);
+ me->AddThreat(pPlayer,1.0f);
DoCast(pPlayer, SPELL_CHARGE);
break;
}
@@ -259,19 +259,19 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
//dosen't work at all
if (uiShieldBreakerTimer <= uiDiff)
{
- Vehicle *pVehicle = m_creature->GetVehicleKit();
+ Vehicle *pVehicle = me->GetVehicleKit();
if (!pVehicle)
return;
if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
{
- Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
- if (m_creature->GetMap()->IsDungeon() && !players.isEmpty())
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (me->GetMap()->IsDungeon() && !players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pPlayer = itr->getSource();
- if (pPlayer && !pPlayer->isGameMaster() && m_creature->IsInRange(pPlayer,10.0f,30.0f,false))
+ if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,10.0f,30.0f,false))
{
pPassenger->CastSpell(pPlayer,SPELL_SHIELD_BREAKER,true);
break;
@@ -304,9 +304,9 @@ struct boss_warrior_toc5AI : public ScriptedAI
uiPhase = 0;
uiPhaseTimer = 0;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
ScriptedInstance* pInstance;
@@ -344,16 +344,16 @@ struct boss_warrior_toc5AI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (!bDone && GrandChampionsOutVehicle(m_creature))
+ if (!bDone && GrandChampionsOutVehicle(me))
{
bDone = true;
- if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
- m_creature->SetHomePosition(739.678,662.541,412.393,4.49);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
- m_creature->SetHomePosition(746.71,661.02,411.69,4.6);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
- m_creature->SetHomePosition(754.34,660.70,412.39,4.79);
+ if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
+ me->SetHomePosition(739.678,662.541,412.393,4.49);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
+ me->SetHomePosition(746.71,661.02,411.69,4.6);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
+ me->SetHomePosition(754.34,660.70,412.39,4.79);
EnterEvadeMode();
bHome = true;
@@ -363,26 +363,26 @@ struct boss_warrior_toc5AI : public ScriptedAI
{
if (uiPhase == 1)
{
- AggroAllPlayers(m_creature);
+ AggroAllPlayers(me);
uiPhase = 0;
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || m_creature->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
return;
if (uiInterceptTimer <= uiDiff)
{
- Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
- if (m_creature->GetMap()->IsDungeon() && !players.isEmpty())
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (me->GetMap()->IsDungeon() && !players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pPlayer = itr->getSource();
- if (pPlayer && !pPlayer->isGameMaster() && m_creature->IsInRange(pPlayer,8.0f,25.0f,false))
+ if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,8.0f,25.0f,false))
{
DoResetThreat();
- m_creature->AddThreat(pPlayer,5.0f);
+ me->AddThreat(pPlayer,5.0f);
DoCast(pPlayer,SPELL_INTERCEPT);
break;
}
@@ -431,9 +431,9 @@ struct boss_mage_toc5AI : public ScriptedAI
uiPhase = 0;
uiPhaseTimer = 0;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
ScriptedInstance* pInstance;
@@ -472,16 +472,16 @@ struct boss_mage_toc5AI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (!bDone && GrandChampionsOutVehicle(m_creature))
+ if (!bDone && GrandChampionsOutVehicle(me))
{
bDone = true;
- if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
- m_creature->SetHomePosition(739.678,662.541,412.393,4.49);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
- m_creature->SetHomePosition(746.71,661.02,411.69,4.6);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
- m_creature->SetHomePosition(754.34,660.70,412.39,4.79);
+ if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
+ me->SetHomePosition(739.678,662.541,412.393,4.49);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
+ me->SetHomePosition(746.71,661.02,411.69,4.6);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
+ me->SetHomePosition(754.34,660.70,412.39,4.79);
if (pInstance)
pInstance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
@@ -494,20 +494,20 @@ struct boss_mage_toc5AI : public ScriptedAI
{
if (uiPhase == 1)
{
- AggroAllPlayers(m_creature);
+ AggroAllPlayers(me);
uiPhase = 0;
}
}else uiPhaseTimer -= uiDiff;
if (uiFireBallTimer <= uiDiff)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
DoCastVictim(SPELL_FIREBALL);
uiFireBallTimer = 5000;
} else uiFireBallTimer -= uiDiff;
- if (!UpdateVictim() || m_creature->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
return;
if (uiFireBallTimer <= uiDiff)
@@ -531,9 +531,9 @@ struct boss_mage_toc5AI : public ScriptedAI
if (uiHasteTimer <= uiDiff)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
- DoCast(m_creature,SPELL_HASTE);
+ DoCast(me,SPELL_HASTE);
uiHasteTimer = 22000;
} else uiHasteTimer -= uiDiff;
@@ -565,9 +565,9 @@ struct boss_shaman_toc5AI : public ScriptedAI
uiPhase = 0;
uiPhaseTimer = 0;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
ScriptedInstance* pInstance;
@@ -593,7 +593,7 @@ struct boss_shaman_toc5AI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoCast(m_creature,SPELL_EARTH_SHIELD);
+ DoCast(me,SPELL_EARTH_SHIELD);
DoCast(pWho,SPELL_HEX_OF_MENDING);
};
@@ -612,16 +612,16 @@ struct boss_shaman_toc5AI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (!bDone && GrandChampionsOutVehicle(m_creature))
+ if (!bDone && GrandChampionsOutVehicle(me))
{
bDone = true;
- if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
- m_creature->SetHomePosition(739.678,662.541,412.393,4.49);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
- m_creature->SetHomePosition(746.71,661.02,411.69,4.6);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
- m_creature->SetHomePosition(754.34,660.70,412.39,4.79);
+ if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
+ me->SetHomePosition(739.678,662.541,412.393,4.49);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
+ me->SetHomePosition(746.71,661.02,411.69,4.6);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
+ me->SetHomePosition(754.34,660.70,412.39,4.79);
if (pInstance)
pInstance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
@@ -634,12 +634,12 @@ struct boss_shaman_toc5AI : public ScriptedAI
{
if (uiPhase == 1)
{
- AggroAllPlayers(m_creature);
+ AggroAllPlayers(me);
uiPhase = 0;
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || m_creature->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
return;
if (uiChainLightningTimer <= uiDiff)
@@ -659,14 +659,14 @@ struct boss_shaman_toc5AI : public ScriptedAI
if (Unit* pFriend = DoSelectLowestHpFriendly(40))
DoCast(pFriend,SPELL_HEALING_WAVE);
} else
- DoCast(m_creature,SPELL_HEALING_WAVE);
+ DoCast(me,SPELL_HEALING_WAVE);
uiHealingWaveTimer = 12000;
} else uiHealingWaveTimer -= uiDiff;
if (uiEartShieldTimer <= uiDiff)
{
- DoCast(m_creature,SPELL_EARTH_SHIELD);
+ DoCast(me,SPELL_EARTH_SHIELD);
uiEartShieldTimer = urand(30000,35000);
} else uiEartShieldTimer -= uiDiff;
@@ -706,9 +706,9 @@ struct boss_hunter_toc5AI : public ScriptedAI
uiPhase = 0;
uiPhaseTimer = 0;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
ScriptedInstance* pInstance;
@@ -752,16 +752,16 @@ struct boss_hunter_toc5AI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (!bDone && GrandChampionsOutVehicle(m_creature))
+ if (!bDone && GrandChampionsOutVehicle(me))
{
bDone = true;
- if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
- m_creature->SetHomePosition(739.678,662.541,412.393,4.49);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
- m_creature->SetHomePosition(746.71,661.02,411.69,4.6);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
- m_creature->SetHomePosition(754.34,660.70,412.39,4.79);
+ if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
+ me->SetHomePosition(739.678,662.541,412.393,4.49);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
+ me->SetHomePosition(746.71,661.02,411.69,4.6);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
+ me->SetHomePosition(754.34,660.70,412.39,4.79);
if (pInstance)
pInstance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
@@ -774,12 +774,12 @@ struct boss_hunter_toc5AI : public ScriptedAI
{
if (uiPhase == 1)
{
- AggroAllPlayers(m_creature);
+ AggroAllPlayers(me);
uiPhase = 0;
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || m_creature->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
return;
if (uiLightningArrowsTimer <= uiDiff)
@@ -802,21 +802,21 @@ struct boss_hunter_toc5AI : public ScriptedAI
if (bShoot && uiMultiShotTimer <= uiDiff)
{
- m_creature->InterruptNonMeleeSpells(true);
- Unit* pTarget = Unit::GetUnit(*m_creature, uiTargetGUID);
+ me->InterruptNonMeleeSpells(true);
+ Unit* pTarget = Unit::GetUnit(*me, uiTargetGUID);
- if (pTarget && m_creature->IsInRange(pTarget,5.0f,30.0f,false))
+ if (pTarget && me->IsInRange(pTarget,5.0f,30.0f,false))
{
DoCast(pTarget,SPELL_MULTI_SHOT);
} else
{
- Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
- if (m_creature->GetMap()->IsDungeon() && !players.isEmpty())
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (me->GetMap()->IsDungeon() && !players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pPlayer = itr->getSource();
- if (pPlayer && !pPlayer->isGameMaster() && m_creature->IsInRange(pPlayer,5.0f,30.0f,false))
+ if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,5.0f,30.0f,false))
{
DoCast(pTarget,SPELL_MULTI_SHOT);
break;
@@ -855,9 +855,9 @@ struct boss_rouge_toc5AI : public ScriptedAI
uiPhase = 0;
uiPhaseTimer = 0;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
ScriptedInstance* pInstance;
@@ -893,16 +893,16 @@ struct boss_rouge_toc5AI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (!bDone && GrandChampionsOutVehicle(m_creature))
+ if (!bDone && GrandChampionsOutVehicle(me))
{
bDone = true;
- if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
- m_creature->SetHomePosition(739.678,662.541,412.393,4.49);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
- m_creature->SetHomePosition(746.71,661.02,411.69,4.6);
- else if (pInstance && m_creature->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
- m_creature->SetHomePosition(754.34,660.70,412.39,4.79);
+ if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
+ me->SetHomePosition(739.678,662.541,412.393,4.49);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
+ me->SetHomePosition(746.71,661.02,411.69,4.6);
+ else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
+ me->SetHomePosition(754.34,660.70,412.39,4.79);
if (pInstance)
pInstance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
@@ -915,17 +915,17 @@ struct boss_rouge_toc5AI : public ScriptedAI
{
if (uiPhase == 1)
{
- AggroAllPlayers(m_creature);
+ AggroAllPlayers(me);
uiPhase = 0;
}
} else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || m_creature->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
return;
if (uiEviscerateTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(),SPELL_EVISCERATE);
+ DoCast(me->getVictim(),SPELL_EVISCERATE);
uiEviscerateTimer = 8000;
} else uiEviscerateTimer -= uiDiff;
diff --git a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp
index 030257a0605..a246a16b0f2 100644
--- a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp
+++ b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp
@@ -69,9 +69,9 @@ struct npc_announcer_toc5AI : public ScriptedAI
Champion2List.clear();
Champion3List.clear();
- m_creature->SetReactState(REACT_PASSIVE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetGrandChampionsForEncounter();
SetArgentChampion();
@@ -120,8 +120,8 @@ struct npc_announcer_toc5AI : public ScriptedAI
NextStep(10000,false,1);
break;
case DATA_IN_POSITION: //movement done.
- m_creature->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
- if (GameObject* pGO = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_MAIN_GATE)))
+ me->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
+ if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
pInstance->HandleGameObject(pGO->GetGUID(),false);
NextStep(10000,false,3);
break;
@@ -142,7 +142,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
}
for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
- if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pSummon = Unit::GetCreature(*me, *itr))
AggroAllPlayers(pSummon);
}else if (uiLesserChampions == 9)
StartGrandChampionsAttack();
@@ -154,9 +154,9 @@ struct npc_announcer_toc5AI : public ScriptedAI
void StartGrandChampionsAttack()
{
- Creature* pGrandChampion1 = Unit::GetCreature(*m_creature, uiVehicle1GUID);
- Creature* pGrandChampion2 = Unit::GetCreature(*m_creature, uiVehicle2GUID);
- Creature* pGrandChampion3 = Unit::GetCreature(*m_creature, uiVehicle3GUID);
+ Creature* pGrandChampion1 = Unit::GetCreature(*me, uiVehicle1GUID);
+ Creature* pGrandChampion2 = Unit::GetCreature(*me, uiVehicle2GUID);
+ Creature* pGrandChampion3 = Unit::GetCreature(*me, uiVehicle3GUID);
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
{
@@ -173,8 +173,8 @@ struct npc_announcer_toc5AI : public ScriptedAI
if (uiPointId == 1)
{
- m_creature->SetOrientation(ORIENTATION);
- m_creature->SendMovementFlagUpdate();
+ me->SetOrientation(ORIENTATION);
+ me->SendMovementFlagUpdate();
}
}
@@ -209,7 +209,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
return;
}
- if (Creature* pBoss = m_creature->SummonCreature(VEHICLE_TO_SUMMON1,SpawnPosition))
+ if (Creature* pBoss = me->SummonCreature(VEHICLE_TO_SUMMON1,SpawnPosition))
{
switch(uiSummonTimes)
{
@@ -217,7 +217,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
{
uiVehicle1GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss1 = 0;
- if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle1GUID))
+ if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle1GUID))
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* pUnit = pVehicle->GetPassenger(0))
uiGrandChampionBoss1 = pUnit->GetGUID();
@@ -233,7 +233,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
{
uiVehicle2GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss2 = 0;
- if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle2GUID))
+ if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle2GUID))
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* pUnit = pVehicle->GetPassenger(0))
uiGrandChampionBoss2 = pUnit->GetGUID();
@@ -249,7 +249,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
{
uiVehicle3GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss3 = 0;
- if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle3GUID))
+ if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle3GUID))
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* pUnit = pVehicle->GetPassenger(0))
uiGrandChampionBoss3 = pUnit->GetGUID();
@@ -267,7 +267,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
for (uint8 i = 0; i < 3; ++i)
{
- if (Creature* pAdd = m_creature->SummonCreature(VEHICLE_TO_SUMMON2,SpawnPosition,TEMPSUMMON_CORPSE_DESPAWN))
+ if (Creature* pAdd = me->SummonCreature(VEHICLE_TO_SUMMON2,SpawnPosition,TEMPSUMMON_CORPSE_DESPAWN))
{
switch(uiSummonTimes)
{
@@ -302,17 +302,17 @@ struct npc_announcer_toc5AI : public ScriptedAI
void DoStartArgentChampionEncounter()
{
- m_creature->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
+ me->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
- if (Creature* pBoss = m_creature->SummonCreature(uiArgentChampion,SpawnPosition))
+ if (Creature* pBoss = me->SummonCreature(uiArgentChampion,SpawnPosition))
{
for (uint8 i = 0; i < 3; ++i)
{
- if (Creature* pTrash = m_creature->SummonCreature(NPC_ARGENT_LIGHWIELDER,SpawnPosition))
+ if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_LIGHWIELDER,SpawnPosition))
pTrash->AI()->SetData(i,0);
- if (Creature* pTrash = m_creature->SummonCreature(NPC_ARGENT_MONK,SpawnPosition))
+ if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_MONK,SpawnPosition))
pTrash->AI()->SetData(i,0);
- if (Creature* pTrash = m_creature->SummonCreature(NPC_PRIESTESS,SpawnPosition))
+ if (Creature* pTrash = me->SummonCreature(NPC_PRIESTESS,SpawnPosition))
pTrash->AI()->SetData(i,0);
}
}
@@ -349,14 +349,14 @@ struct npc_announcer_toc5AI : public ScriptedAI
if (!pInstance)
return;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if (pInstance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
{
if (pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED && pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED)
{
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
- m_creature->AI()->SetData(DATA_START,0);
+ me->AI()->SetData(DATA_START,0);
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE)
DoStartArgentChampionEncounter();
@@ -365,13 +365,13 @@ struct npc_announcer_toc5AI : public ScriptedAI
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE ||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE)
- m_creature->SummonCreature(VEHICLE_BLACK_KNIGHT,769.834,651.915,447.035,0);
+ me->SummonCreature(VEHICLE_BLACK_KNIGHT,769.834,651.915,447.035,0);
}
}
void AggroAllPlayers(Creature* pTemp)
{
- Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
+ Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
@@ -385,7 +385,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
if (pPlayer->isAlive())
{
- pTemp->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
+ pTemp->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
pTemp->SetReactState(REACT_AGGRESSIVE);
pTemp->SetInCombatWith(pPlayer);
@@ -417,7 +417,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
if (!Champion1List.empty())
{
for (std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
- if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pSummon = Unit::GetCreature(*me, *itr))
AggroAllPlayers(pSummon);
NextStep(0,false);
}
@@ -452,7 +452,7 @@ struct npc_announcer_toc5AI : public ScriptedAI
case VEHICLE_ORGRIMMAR_WOLF:
case VEHICLE_SILVERMOON_HAWKSTRIDER:
case VEHICLE_DARKSPEAR_RAPTOR:
- m_creature->AI()->SetData(DATA_LESSER_CHAMPIONS_DEFEATED,0);
+ me->AI()->SetData(DATA_LESSER_CHAMPIONS_DEFEATED,0);
break;
}
}
diff --git a/src/scripts/northrend/crystalsong_forest.cpp b/src/scripts/northrend/crystalsong_forest.cpp
index 862b10b197a..23fca042e17 100644
--- a/src/scripts/northrend/crystalsong_forest.cpp
+++ b/src/scripts/northrend/crystalsong_forest.cpp
@@ -62,7 +62,7 @@ struct npc_warmage_violetstandAI : public Scripted_NoMovementAI
{
if (m_uiTimer <= uiDiff)
{
- m_creature->CastStop();
+ me->CastStop();
Creature* pTarget = GetClosestCreatureWithEntry(me,NPC_TRANSITUS_SHIELD_DUMMY,32.0f);
switch(me->GetEntry())
@@ -70,7 +70,7 @@ struct npc_warmage_violetstandAI : public Scripted_NoMovementAI
case NPC_WARMAGE_SARINA:
{
std::list<Creature*> orbList;
- GetCreatureListWithEntryInGrid(orbList, m_creature, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
+ GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
if (!orbList.empty())
{
for (std::list<Creature*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr)
diff --git a/src/scripts/northrend/dalaran.cpp b/src/scripts/northrend/dalaran.cpp
index 26b896b473d..03df79c69fe 100644
--- a/src/scripts/northrend/dalaran.cpp
+++ b/src/scripts/northrend/dalaran.cpp
@@ -70,7 +70,7 @@ struct npc_mageguard_dalaranAI : public Scripted_NoMovementAI
if (!pPlayer || pPlayer->isGameMaster() || pPlayer->IsBeingTeleported())
return;
- switch (m_creature->GetEntry())
+ switch (me->GetEntry())
{
case 29254:
if (pPlayer->GetTeam() == HORDE) // Horde unit found in Alliance area
diff --git a/src/scripts/northrend/draktharon_keep/boss_dred.cpp b/src/scripts/northrend/draktharon_keep/boss_dred.cpp
index fde83053869..193c1ff0fe2 100644
--- a/src/scripts/northrend/draktharon_keep/boss_dred.cpp
+++ b/src/scripts/northrend/draktharon_keep/boss_dred.cpp
@@ -127,8 +127,8 @@ struct boss_dredAI : public ScriptedAI
float x,y,z;
- m_creature->GetClosePoint(x,y,z,m_creature->GetObjectSize()/3,10.0f);
- m_creature->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILISECONDS);
+ me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f);
+ me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILISECONDS);
uiRaptorCallTimer = urand(20*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiRaptorCallTimer -=diff;
diff --git a/src/scripts/northrend/draktharon_keep/boss_novos.cpp b/src/scripts/northrend/draktharon_keep/boss_novos.cpp
index d327d0f6c9d..64ac3f01c79 100644
--- a/src/scripts/northrend/draktharon_keep/boss_novos.cpp
+++ b/src/scripts/northrend/draktharon_keep/boss_novos.cpp
@@ -89,15 +89,15 @@ struct boss_novosAI : public Scripted_NoMovementAI
Phase = IDLE;
luiCrystals.clear();
bAchiev = true;
- m_creature->CastStop();
+ me->CastStop();
lSummons.DespawnAll();
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance)
{
@@ -116,7 +116,7 @@ struct boss_novosAI : public Scripted_NoMovementAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
Phase = PHASE_1;
uiCrystalHandlerTimer = 30*IN_MILISECONDS;
uiTimer = 1*IN_MILISECONDS;
@@ -130,9 +130,9 @@ struct boss_novosAI : public Scripted_NoMovementAI
}
pInstance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
}
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void UpdateAI(const uint32 diff)
@@ -142,16 +142,16 @@ struct boss_novosAI : public Scripted_NoMovementAI
case PHASE_1:
if (uiTimer <= diff)
{
- Creature *pSummon = m_creature->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
+ Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
//If spell is casted stops casting arcane field so no spell casting
- //DoCast(m_creature, SPELL_SUMMON_MINIONS);
+ //DoCast(me, SPELL_SUMMON_MINIONS);
uiTimer = 3*IN_MILISECONDS;
} else uiTimer -= diff;
if (uiCrystalHandlerTimer <= diff)
{
- DoScriptText(SAY_NECRO_ADD, m_creature);
- Creature *pCrystalHandler = m_creature->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
+ DoScriptText(SAY_NECRO_ADD, me);
+ Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
uiCrystalHandlerTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiCrystalHandlerTimer -= diff;
@@ -169,7 +169,7 @@ struct boss_novosAI : public Scripted_NoMovementAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_NOVOS_EVENT, DONE);
@@ -182,9 +182,9 @@ struct boss_novosAI : public Scripted_NoMovementAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustSummoned(Creature *summon)
@@ -203,10 +203,10 @@ struct boss_novosAI : public Scripted_NoMovementAI
}
if (luiCrystals.empty())
{
- m_creature->CastStop();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->CastStop();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Phase = PHASE_2;
uiTimer = 1*IN_MILISECONDS;
}
@@ -242,7 +242,7 @@ struct mob_crystal_handlerAI : public ScriptedAI
void JustDied(Unit* killer)
{
- if (Creature* pNovos = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
+ if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
CAST_AI(boss_novosAI,pNovos->AI())->RemoveCrystal();
}
@@ -253,7 +253,7 @@ struct mob_crystal_handlerAI : public ScriptedAI
if (uiFlashOfDarknessTimer <= diff)
{
- DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
+ DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
uiFlashOfDarknessTimer = 5*IN_MILISECONDS;
} else uiFlashOfDarknessTimer -= diff;
@@ -264,7 +264,7 @@ struct mob_crystal_handlerAI : public ScriptedAI
{
if (type != POINT_MOTION_TYPE || id != 0)
return;
- if (Creature *pNovos = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
+ if (Creature *pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
AttackStart(pTarget);
}
@@ -283,7 +283,7 @@ struct mob_novos_minionAI : public ScriptedAI
{
if (type != POINT_MOTION_TYPE || id !=0)
return;
- if (Creature* pNovos = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
+ if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
{
CAST_AI(boss_novosAI, pNovos->AI())->bAchiev = false;
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
diff --git a/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp b/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp
index d86abdad43d..f1ab16467a5 100644
--- a/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp
+++ b/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp
@@ -91,14 +91,14 @@ struct boss_tharon_jaAI : public ScriptedAI
uiRainOfFireTimer = urand(14*IN_MILISECONDS,18*IN_MILISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILISECONDS,10*IN_MILISECONDS);
Phase = SKELETAL;
- m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
+ me->SetDisplayId(me->GetNativeDisplayId());
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS);
@@ -144,15 +144,15 @@ struct boss_tharon_jaAI : public ScriptedAI
case GOING_FLESH:
if (uiPhaseTimer < diff)
{
- DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),m_creature);
- m_creature->SetDisplayId(MODEL_FLESH);
- std::list<HostileReference*>& threatlist = m_creature->getThreatManager().getThreatList();
+ DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
+ me->SetDisplayId(MODEL_FLESH);
+ std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
- Unit *pTemp = Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
+ Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
- m_creature->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
+ me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
pTemp->SetDisplayId(MODEL_SKELETON);
}
}
@@ -195,17 +195,17 @@ struct boss_tharon_jaAI : public ScriptedAI
case GOING_SKELETAL:
if (uiPhaseTimer < diff)
{
- DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), m_creature);
- m_creature->DeMorph();
+ DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me);
+ me->DeMorph();
Phase = SKELETAL;
uiPhaseTimer = 20*IN_MILISECONDS;
uiCurseOfLifeTimer = 1*IN_MILISECONDS;
uiRainOfFireTimer = urand(14*IN_MILISECONDS,18*IN_MILISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILISECONDS,10*IN_MILISECONDS);
- std::list<HostileReference*>& threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
- Unit *pTemp = Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
+ Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
@@ -220,12 +220,12 @@ struct boss_tharon_jaAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),me);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH,m_creature);
+ DoScriptText(SAY_DEATH,me);
if (pInstance)
{
diff --git a/src/scripts/northrend/draktharon_keep/boss_trollgore.cpp b/src/scripts/northrend/draktharon_keep/boss_trollgore.cpp
index 0a75566c17b..7b2bfb9756d 100644
--- a/src/scripts/northrend/draktharon_keep/boss_trollgore.cpp
+++ b/src/scripts/northrend/draktharon_keep/boss_trollgore.cpp
@@ -88,7 +88,7 @@ struct boss_trollgoreAI : public ScriptedAI
lSummons.DespawnAll();
- m_creature->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
+ me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);
@@ -96,7 +96,7 @@ struct boss_trollgoreAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS);
@@ -118,14 +118,14 @@ struct boss_trollgoreAI : public ScriptedAI
if (uiConsumeTimer <= diff)
{
- DoScriptText(SAY_CONSUME, m_creature);
+ DoScriptText(SAY_CONSUME, me);
DoCast(SPELL_CONSUME);
uiConsumeTimer = 15*IN_MILISECONDS;
} else uiConsumeTimer -= diff;
if (bAchiev)
{
- Aura *pConsumeAura = m_creature->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
+ Aura *pConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pConsumeAura && pConsumeAura->GetStackAmount() > 9)
bAchiev = false;
}
@@ -145,7 +145,7 @@ struct boss_trollgoreAI : public ScriptedAI
if (uiExplodeCorpseTimer <= diff)
{
DoCast(SPELL_CORPSE_EXPLODE);
- DoScriptText(SAY_EXPLODE, m_creature);
+ DoScriptText(SAY_EXPLODE, me);
uiExplodeCorpseTimer = urand(15*IN_MILISECONDS,19*IN_MILISECONDS);
} else uiExplodeCorpseTimer -= diff;
@@ -154,7 +154,7 @@ struct boss_trollgoreAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
lSummons.DespawnAll();
@@ -168,16 +168,16 @@ struct boss_trollgoreAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustSummoned(Creature* summon)
{
lSummons.push_back(summon->GetGUID());
if (summon->AI())
- summon->AI()->AttackStart(m_creature);
+ summon->AI()->AttackStart(me);
}
};
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
index 48d53481795..64b01ade2b5 100644
--- a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
@@ -68,7 +68,7 @@ struct boss_bronjahmAI : public ScriptedAI
{
boss_bronjahmAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -79,7 +79,7 @@ struct boss_bronjahmAI : public ScriptedAI
void Reset()
{
phase = PHASE_1;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.Reset();
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
@@ -92,7 +92,7 @@ struct boss_bronjahmAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, IN_PROGRESS);
@@ -100,7 +100,7 @@ struct boss_bronjahmAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, DONE);
@@ -108,7 +108,7 @@ struct boss_bronjahmAI : public ScriptedAI
void KilledUnit(Unit *pWho)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
// Cast aura spell on all players farther than 10y
@@ -124,7 +124,7 @@ struct boss_bronjahmAI : public ScriptedAI
{
Unit* pUnit = (*itr);
if (pUnit && pUnit->isAlive())
- m_creature->CastSpell(pUnit, DUNGEON_MODE(SPELL_SOULSTORM_AURA,H_SPELL_SOULSTORM_AURA), true);
+ me->CastSpell(pUnit, DUNGEON_MODE(SPELL_SOULSTORM_AURA,H_SPELL_SOULSTORM_AURA), true);
}
}
@@ -136,15 +136,15 @@ struct boss_bronjahmAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
if (phase == PHASE_1 && HealthBelowPct(30))
{
phase = PHASE_2;
- DoCast(m_creature,SPELL_TELEPORT);
- m_creature->GetMotionMaster()->Clear();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ DoCast(me,SPELL_TELEPORT);
+ me->GetMotionMaster()->Clear();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.CancelEvent(EVENT_CORRUPT_SOUL);
events.ScheduleEvent(EVENT_SOUL_STORM, 1000);
events.ScheduleEvent(EVENT_FEAR, urand(8000,12000));
@@ -158,14 +158,14 @@ struct boss_bronjahmAI : public ScriptedAI
case EVENT_CORRUPT_SOUL:
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
{
- DoScriptText(SAY_CORRUPT_SOUL, m_creature);
+ DoScriptText(SAY_CORRUPT_SOUL, me);
DoCast(pTarget,SPELL_CORRUPT_SOUL);
}
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(15000,25000));
break;
case EVENT_SOUL_STORM:
- DoScriptText(SAY_SOUL_STORM, m_creature);
- // DoCast(m_creature, SPELL_SOULSTORM); bug: put the aura without the limit of 10 yards.
+ DoScriptText(SAY_SOUL_STORM, me);
+ // DoCast(me, SPELL_SOULSTORM); bug: put the aura without the limit of 10 yards.
events.ScheduleEvent(EVENT_SOUL_STORM_AURA, 1000);
break;
case EVENT_SOUL_STORM_AURA:
@@ -201,7 +201,7 @@ struct mob_corrupted_soul_fragmentAI : public ScriptedAI
{
mob_corrupted_soul_fragmentAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -210,15 +210,15 @@ struct mob_corrupted_soul_fragmentAI : public ScriptedAI
{
SetCombatMovement(false);
if (pInstance)
- if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
- m_creature->GetMotionMaster()->MoveChase(pBronjham);
+ if (Creature* pBronjham = Unit::GetCreature(*me,pInstance->GetData64(DATA_BRONJAHM)))
+ me->GetMotionMaster()->MoveChase(pBronjham);
}
void MovementInform(uint32 type, uint32 id)
{
if (pInstance)
- if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
+ if (Creature* pBronjham = Unit::GetCreature(*me,pInstance->GetData64(DATA_BRONJAHM)))
DoCast(pBronjham,SPELL_CONSUME_SOUL);
}
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp
index 7fa564771c8..398c83df58a 100644
--- a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp
@@ -139,9 +139,9 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
void Reset()
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->SetDisplayId(DISPLAY_ANGER);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetDisplayId(DISPLAY_ANGER);
+ me->SetReactState(REACT_AGGRESSIVE);
events.Reset();
@@ -157,7 +157,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
- DoScriptText(RAND(SAY_FACE_ANGER_AGGRO,SAY_FACE_DESIRE_AGGRO), m_creature);
+ DoScriptText(RAND(SAY_FACE_ANGER_AGGRO,SAY_FACE_DESIRE_AGGRO), me);
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
events.ScheduleEvent(EVENT_MIRRORED_SOUL, 8000);
@@ -168,15 +168,15 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
{
- if (uiMirroredSoulTarget && m_creature->HasAura(SPELL_MIRRORED_SOUL))
+ if (uiMirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
{
if (Player *pPlayer = Unit::GetPlayer(uiMirroredSoulTarget))
{
if (Aura *pAura = pPlayer->GetAura(SPELL_MIRRORED_SOUL))
{
int32 mirrorDamage = (uiDamage * 45)/100;
- m_creature->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true);
-// m_creature->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
+ me->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true);
+// me->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
}
else
uiMirroredSoulTarget = 0;
@@ -187,14 +187,14 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_FACE_ANGER_SLAY_1,SAY_FACE_SORROW_SLAY_1,SAY_FACE_DESIRE_SLAY_1,
- SAY_FACE_ANGER_SLAY_2,SAY_FACE_SORROW_SLAY_2,SAY_FACE_DESIRE_SLAY_2), m_creature);
+ SAY_FACE_ANGER_SLAY_2,SAY_FACE_SORROW_SLAY_2,SAY_FACE_DESIRE_SLAY_2), me);
}
void JustDied(Unit* killer)
{
Position spawnPoint = { 5618.139, 2451.873, 705.854 };
- DoScriptText(RAND(SAY_FACE_SORROW_DEATH,SAY_FACE_DESIRE_DEATH), m_creature);
+ DoScriptText(RAND(SAY_FACE_SORROW_DEATH,SAY_FACE_DESIRE_DEATH), me);
if (pInstance)
{
@@ -211,7 +211,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
for (int8 i = 0; outroPositions[i].entry[entryIndex] != 0; ++i)
{
- if (Creature *pSummon = m_creature->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
+ if (Creature *pSummon = me->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
{
pSummon->GetMotionMaster()->MovePoint(0, outroPositions[i].movePosition);
@@ -238,7 +238,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -255,7 +255,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
{
uiMirroredSoulTarget = pTarget->GetGUID();
DoCast(pTarget, SPELL_MIRRORED_SOUL);
- DoScriptText(EMOTE_MIRRORED_SOUL, m_creature);
+ DoScriptText(EMOTE_MIRRORED_SOUL, me);
}
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000,30000));
break;
@@ -267,42 +267,42 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
case EVENT_UNLEASHED_SOULS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_UNLEASHED_SOULS);
- m_creature->SetDisplayId(DISPLAY_SORROW);
- DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL,SAY_FACE_SORROW_UNLEASH_SOUL,SAY_FACE_DESIRE_UNLEASH_SOUL), m_creature);
- DoScriptText(EMOTE_UNLEASH_SOUL, m_creature);
+ me->SetDisplayId(DISPLAY_SORROW);
+ DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL,SAY_FACE_SORROW_UNLEASH_SOUL,SAY_FACE_DESIRE_UNLEASH_SOUL), me);
+ DoScriptText(EMOTE_UNLEASH_SOUL, me);
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 30000);
events.ScheduleEvent(EVENT_FACE_ANGER, 5000);
break;
case EVENT_FACE_ANGER:
- m_creature->SetDisplayId(DISPLAY_ANGER);
+ me->SetDisplayId(DISPLAY_ANGER);
break;
case EVENT_WAILING_SOULS:
- m_creature->SetDisplayId(DISPLAY_DESIRE);
- DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), m_creature);
- DoScriptText(EMOTE_WAILING_SOUL, m_creature);
- DoCast(m_creature, SPELL_WAILING_SOULS_STARTING);
+ me->SetDisplayId(DISPLAY_DESIRE);
+ DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me);
+ DoScriptText(EMOTE_WAILING_SOUL, me);
+ DoCast(me, SPELL_WAILING_SOULS_STARTING);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- m_creature->SetOrientation(m_creature->GetAngle(pTarget));
- DoCast(m_creature, SPELL_WAILING_SOULS_BEAM);
+ me->SetOrientation(me->GetAngle(pTarget));
+ DoCast(me, SPELL_WAILING_SOULS_BEAM);
}
- beamAngle = m_creature->GetOrientation();
+ beamAngle = me->GetOrientation();
beamAngleDiff = PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
if (RAND(true,false))
beamAngleDiff = -beamAngleDiff;
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->InterruptNonMeleeSpells(false);
+ me->SetReactState(REACT_PASSIVE);
//Remove any target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- m_creature->GetMotionMaster()->Clear();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->GetMotionMaster()->Clear();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
wailingSoulTick = 15;
events.DelayEvents(18000); // no other events during wailing souls
@@ -311,19 +311,19 @@ struct boss_devourer_of_soulsAI : public ScriptedAI
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
- m_creature->SetOrientation(beamAngle);
- m_creature->StopMoving();
+ me->SetOrientation(beamAngle);
+ me->StopMoving();
- DoCast(m_creature, SPELL_WAILING_SOULS);
+ DoCast(me, SPELL_WAILING_SOULS);
if (--wailingSoulTick)
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 1000);
else
{
- m_creature->SetReactState(REACT_AGGRESSIVE);
- m_creature->SetDisplayId(DISPLAY_ANGER);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->SetDisplayId(DISPLAY_ANGER);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
}
break;
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp
index efc2a043e22..468f98e0749 100644
--- a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp
@@ -150,8 +150,8 @@ struct npc_sylvanas_fosAI: public ScriptedAI
{
npc_sylvanas_fosAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ pInstance = me->GetInstanceData();
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
ScriptedInstance* pInstance;
@@ -172,7 +172,7 @@ struct npc_sylvanas_fosAI: public ScriptedAI
case ACTION_INTRO:
{
phase = PHASE_INTRO;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
events.Reset();
events.ScheduleEvent(EVENT_INTRO_1, 1000);
}
@@ -190,32 +190,32 @@ struct npc_sylvanas_fosAI: public ScriptedAI
switch(events.ExecuteEvent())
{
case EVENT_INTRO_1:
- DoScriptText(SAY_SYLVANAS_INTRO_1, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_1, me);
events.ScheduleEvent(EVENT_INTRO_2, 11500);
break;
case EVENT_INTRO_2:
- DoScriptText(SAY_SYLVANAS_INTRO_2, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_2, me);
events.ScheduleEvent(EVENT_INTRO_3, 10500);
break;
case EVENT_INTRO_3:
- DoScriptText(SAY_SYLVANAS_INTRO_3, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_3, me);
events.ScheduleEvent(EVENT_INTRO_4, 9500);
break;
case EVENT_INTRO_4:
- DoScriptText(SAY_SYLVANAS_INTRO_4, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_4, me);
events.ScheduleEvent(EVENT_INTRO_5, 10500);
break;
case EVENT_INTRO_5:
- DoScriptText(SAY_SYLVANAS_INTRO_5, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_5, me);
events.ScheduleEvent(EVENT_INTRO_6, 9500);
break;
case EVENT_INTRO_6:
- DoScriptText(SAY_SYLVANAS_INTRO_6, m_creature);
+ DoScriptText(SAY_SYLVANAS_INTRO_6, me);
// End of Intro
phase = PHASE_NORMAL;
break;
@@ -228,7 +228,7 @@ struct npc_sylvanas_fosAI: public ScriptedAI
events.Update(diff);
- //if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ //if (me->hasUnitState(UNIT_STAT_CASTING))
// return;
//while(uint32 eventId = events.ExecuteEvent())
@@ -246,8 +246,8 @@ struct npc_jaina_fosAI: public ScriptedAI
{
npc_jaina_fosAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ pInstance = me->GetInstanceData();
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
ScriptedInstance* pInstance;
@@ -268,7 +268,7 @@ struct npc_jaina_fosAI: public ScriptedAI
case ACTION_INTRO:
{
phase = PHASE_INTRO;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
events.Reset();
events.ScheduleEvent(EVENT_INTRO_1, 1000);
}
@@ -286,42 +286,42 @@ struct npc_jaina_fosAI: public ScriptedAI
switch(events.ExecuteEvent())
{
case EVENT_INTRO_1:
- DoScriptText(SAY_JAINA_INTRO_1, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_1, me);
events.ScheduleEvent(EVENT_INTRO_2, 8000);
break;
case EVENT_INTRO_2:
- DoScriptText(SAY_JAINA_INTRO_2, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_2, me);
events.ScheduleEvent(EVENT_INTRO_3, 8500);
break;
case EVENT_INTRO_3:
- DoScriptText(SAY_JAINA_INTRO_3, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_3, me);
events.ScheduleEvent(EVENT_INTRO_4, 8000);
break;
case EVENT_INTRO_4:
- DoScriptText(SAY_JAINA_INTRO_4, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_4, me);
events.ScheduleEvent(EVENT_INTRO_5, 10000);
break;
case EVENT_INTRO_5:
- DoScriptText(SAY_JAINA_INTRO_5, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_5, me);
events.ScheduleEvent(EVENT_INTRO_6, 8000);
break;
case EVENT_INTRO_6:
- DoScriptText(SAY_JAINA_INTRO_6, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_6, me);
events.ScheduleEvent(EVENT_INTRO_7, 12000);
break;
case EVENT_INTRO_7:
- DoScriptText(SAY_JAINA_INTRO_7, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_7, me);
events.ScheduleEvent(EVENT_INTRO_8, 8000);
break;
case EVENT_INTRO_8:
- DoScriptText(SAY_JAINA_INTRO_8, m_creature);
+ DoScriptText(SAY_JAINA_INTRO_8, me);
// End of Intro
phase = PHASE_NORMAL;
break;
@@ -334,7 +334,7 @@ struct npc_jaina_fosAI: public ScriptedAI
events.Update(diff);
- //if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ //if (me->hasUnitState(UNIT_STAT_CASTING))
// return;
//while(uint32 eventId = events.ExecuteEvent())
@@ -403,7 +403,7 @@ struct mob_spiteful_apparitionAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -411,7 +411,7 @@ struct mob_spiteful_apparitionAI: public ScriptedAI
switch(eventId)
{
case EVENT_SPITE:
- DoCast(m_creature->getVictim(), SPELL_SPITE);
+ DoCast(me->getVictim(), SPELL_SPITE);
events.RescheduleEvent(EVENT_SPITE, 8000);
return;
}
@@ -448,7 +448,7 @@ struct mob_spectral_wardenAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -456,7 +456,7 @@ struct mob_spectral_wardenAI: public ScriptedAI
switch(eventId)
{
case EVENT_VEIL_OF_SHADOWS:
- DoCast(m_creature->getVictim(), SPELL_VEIL_OF_SHADOWS);
+ DoCast(me->getVictim(), SPELL_VEIL_OF_SHADOWS);
events.RescheduleEvent(EVENT_VEIL_OF_SHADOWS, 10000);
return;
case EVENT_WAIL_OF_SOULS:
@@ -497,7 +497,7 @@ struct mob_soulguard_watchmanAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -505,11 +505,11 @@ struct mob_soulguard_watchmanAI: public ScriptedAI
switch(eventId)
{
case EVENT_SHROUD_OF_RUNES:
- DoCast(m_creature, SPELL_SHROUD_OF_RUNES);
+ DoCast(me, SPELL_SHROUD_OF_RUNES);
events.RescheduleEvent(EVENT_SHROUD_OF_RUNES, 5000);
return;
case EVENT_UNHOLY_RAGE:
- DoCast(m_creature, SPELL_UNHOLY_RAGE);
+ DoCast(me, SPELL_UNHOLY_RAGE);
events.RescheduleEvent(EVENT_UNHOLY_RAGE, 99999);
return;
}
@@ -545,7 +545,7 @@ struct mob_soulguard_reaperAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -553,7 +553,7 @@ struct mob_soulguard_reaperAI: public ScriptedAI
switch(eventId)
{
case EVENT_FROST_NOVA:
- DoCast(m_creature, SPELL_FROST_NOVA);
+ DoCast(me, SPELL_FROST_NOVA);
events.RescheduleEvent(EVENT_FROST_NOVA, 9600);
return;
case EVENT_SHADOW_LANCE:
@@ -596,7 +596,7 @@ struct mob_soulguard_bonecasterAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -608,11 +608,11 @@ struct mob_soulguard_bonecasterAI: public ScriptedAI
events.RescheduleEvent(EVENT_BONE_VOLLEY, 7000);
return;
case EVENT_RAISE_DEAD:
- DoCast(m_creature, SPELL_RAISE_DEAD);
+ DoCast(me, SPELL_RAISE_DEAD);
events.RescheduleEvent(EVENT_RAISE_DEAD, 25000);
return;
case EVENT_SHIELD_OF_BONES:
- DoCast(m_creature, SPELL_SHIELD_OF_BONES);
+ DoCast(me, SPELL_SHIELD_OF_BONES);
events.RescheduleEvent(EVENT_SHIELD_OF_BONES, 8000);
return;
}
@@ -651,7 +651,7 @@ struct mob_soulguard_animatorAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -659,7 +659,7 @@ struct mob_soulguard_animatorAI: public ScriptedAI
switch(eventId)
{
case EVENT_RAISE_DEAD:
- DoCast(m_creature, SPELL_RAISE_DEAD);
+ DoCast(me, SPELL_RAISE_DEAD);
events.RescheduleEvent(EVENT_RAISE_DEAD, 25000);
return;
case EVENT_SHADOW_BOLT:
@@ -713,7 +713,7 @@ struct mob_soulguard_adeptAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -721,7 +721,7 @@ struct mob_soulguard_adeptAI: public ScriptedAI
switch(eventId)
{
case EVENT_RAISE_DEAD:
- DoCast(m_creature, SPELL_RAISE_DEAD);
+ DoCast(me, SPELL_RAISE_DEAD);
events.RescheduleEvent(EVENT_RAISE_DEAD, 25000);
return;
case EVENT_SHADOW_BOLT:
@@ -735,7 +735,7 @@ struct mob_soulguard_adeptAI: public ScriptedAI
events.RescheduleEvent(EVENT_DRAIN_LIFE, 9000);
return;
case EVENT_SHADOW_MEND:
- DoCast(m_creature, SPELL_SHADOW_MEND);
+ DoCast(me, SPELL_SHADOW_MEND);
events.RescheduleEvent(EVENT_SHADOW_MEND, 20000);
return;
}
@@ -771,7 +771,7 @@ struct mob_soul_horrorAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while(uint32 eventId = events.ExecuteEvent())
@@ -779,7 +779,7 @@ struct mob_soul_horrorAI: public ScriptedAI
switch(eventId)
{
case EVENT_SOUL_STRIKE:
- DoCast(m_creature->getVictim(), SPELL_SOUL_STRIKE);
+ DoCast(me->getVictim(), SPELL_SOUL_STRIKE);
events.RescheduleEvent(EVENT_SOUL_STRIKE, 8000);
return;
}
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp
index dd90d4006f8..fb0359ffdf5 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp
@@ -89,8 +89,8 @@ struct boss_garfrostAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_PERMAFROST);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_PERMAFROST);
if (pInstance)
pInstance->SetData(DATA_GARFROST_EVENT, IN_PROGRESS);
@@ -103,24 +103,24 @@ struct boss_garfrostAI : public ScriptedAI
if (HealthBelowPct(66) && !phase2)
{
phase2 = true;
- DoCast(m_creature, SPELL_THUNDERING_STOMP);
+ DoCast(me, SPELL_THUNDERING_STOMP);
// TODO: should go to a forge
- DoCast(m_creature, SPELL_FORGE_BLADE);
+ DoCast(me, SPELL_FORGE_BLADE);
// TODO: should equip when spell completes
SetEquipmentSlots(false, EQUIP_ID_SWORD, -1, -1);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
events.ScheduleEvent(EVENT_CHILLINGWAVE, 10000);
}
if (HealthBelowPct(33) && !phase3)
{
phase3 = true;
- DoCast(m_creature, SPELL_THUNDERING_STOMP);
+ DoCast(me, SPELL_THUNDERING_STOMP);
// TODO: should go to a forge
- DoCast(m_creature, SPELL_FORGE_MACE);
+ DoCast(me, SPELL_FORGE_MACE);
// TODO: should equip when spell completes
SetEquipmentSlots(false, EQUIP_ID_MACE, -1, -1);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
events.CancelEvent(EVENT_CHILLINGWAVE); // cast only in phase 2.
events.ScheduleEvent(EVENT_DEEPFREEZE, 10000);
}
@@ -128,18 +128,18 @@ struct boss_garfrostAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
- if (Creature *pTyrannus = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_TYRANNUS)))
+ if (Creature *pTyrannus = me->GetCreature(*me, pInstance->GetData64(DATA_TYRANNUS)))
DoScriptText(SAY_TYRANNUS_DEATH, pTyrannus);
pInstance->SetData(DATA_GARFROST_EVENT, DONE);
@@ -166,7 +166,7 @@ struct boss_garfrostAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp
index 2604cd5152b..593cec5f04f 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp
@@ -139,7 +139,7 @@ struct boss_ickAI : public ScriptedAI
Creature* GetKrick()
{
- return m_creature->GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KRICK) : 0);
+ return me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KRICK) : 0);
}
void EnterCombat(Unit *pWho)
@@ -149,7 +149,7 @@ struct boss_ickAI : public ScriptedAI
Creature* pKrick = GetKrick();
if (!pKrick)
- pKrick = m_creature->SummonCreature(CREATURE_KRICK, *m_creature, TEMPSUMMON_MANUAL_DESPAWN);
+ pKrick = me->SummonCreature(CREATURE_KRICK, *me, TEMPSUMMON_MANUAL_DESPAWN);
if (pKrick)
DoScriptText(SAY_KRICK_AGGRO, pKrick);
@@ -164,7 +164,7 @@ struct boss_ickAI : public ScriptedAI
void EnterEvadeMode()
{
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
ScriptedAI::EnterEvadeMode();
}
@@ -182,10 +182,10 @@ struct boss_ickAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return;
- if (!m_creature->getVictim() && m_creature->getThreatManager().isThreatListEmpty())
+ if (!me->getVictim() && me->getThreatManager().isThreatListEmpty())
{
EnterEvadeMode();
return;
@@ -193,7 +193,7 @@ struct boss_ickAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
switch(events.ExecuteEvent())
@@ -204,8 +204,8 @@ struct boss_ickAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- m_creature->Attack(pTarget,false);
- DoScriptText(SAY_ICK_CHASE_1, m_creature, pTarget);
+ me->Attack(pTarget,false);
+ DoScriptText(SAY_ICK_CHASE_1, me, pTarget);
DoCast(pTarget, SPELL_PURSUED);
}
@@ -214,7 +214,7 @@ struct boss_ickAI : public ScriptedAI
return;
case EVENT_MIGHTY_KICK:
- DoCast(m_creature->getVictim(), SPELL_MIGHTY_KICK);
+ DoCast(me->getVictim(), SPELL_MIGHTY_KICK);
events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000, GCD_1);
return;
@@ -222,18 +222,18 @@ struct boss_ickAI : public ScriptedAI
if (Creature* pKrick = GetKrick())
DoScriptText(SAY_KRICK_POISON_NOVA, pKrick);
- DoScriptText(SAY_ICK_POISON_NOVA, m_creature);
+ DoScriptText(SAY_ICK_POISON_NOVA, me);
DoCastAOE(SPELL_POISON_NOVA);
events.ScheduleEvent(EVENT_POISON_NOVA, 30000, GCD_1);
return;
case EVENT_TOXIC_WASTE:
- DoCast(m_creature->getVictim(), SPELL_TOXIC_WASTE);
+ DoCast(me->getVictim(), SPELL_TOXIC_WASTE);
events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
return;
case EVENT_SHADOW_BOLT:
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
return;
@@ -245,14 +245,14 @@ struct boss_ickAI : public ScriptedAI
}
DoCastAOE(SPELL_EXPLOSIVE_BARRAGE);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
events.DelayEvents(20000, GCD_1); // 2 sec cast + 18 sec
events.ScheduleEvent(EVENT_END_EXPLOSIVE_BARRAGE, 20000);
return;
case EVENT_END_EXPLOSIVE_BARRAGE:
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
events.ScheduleEvent(EVENT_EXPLOSIVE_BARRAGE, 25000);
break;
}
@@ -281,22 +281,22 @@ struct boss_krickAI : public ScriptedAI
uiTyrannus = 0;
phase = PHASE_COMBAT;
- m_creature->SetReactState(REACT_PASSIVE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
}
Creature* GetIck()
{
- return m_creature->GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ICK) : 0);
+ return me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ICK) : 0);
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_KRICK_SLAY_1,SAY_KRICK_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_KRICK_SLAY_1,SAY_KRICK_SLAY_2), me);
}
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
@@ -316,28 +316,28 @@ struct boss_krickAI : public ScriptedAI
{
// TODO: tele on Ick then run some distance.
pIck->GetNearPosition(pos, 5.0f, 3.14);
- m_creature->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 0.0f);
+ me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 0.0f);
}
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
- Creature* pJainaOrSylvanas = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_JAINA_SYLVANAS_1));
+ Creature* pJainaOrSylvanas = me->GetCreature(*me, pInstance->GetData64(DATA_JAINA_SYLVANAS_1));
if (pJainaOrSylvanas) {
Position pos;
- m_creature->GetNearPosition(pos, 5.0f, 0);
+ me->GetNearPosition(pos, 5.0f, 0);
pJainaOrSylvanas->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(),
- pos.GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ pos.GetAngle(me->GetPositionX(), me->GetPositionY()));
}
else {
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
- pJainaOrSylvanas = m_creature->SummonCreature(NPC_SYLVANAS_PART1, *m_creature, TEMPSUMMON_MANUAL_DESPAWN);
+ pJainaOrSylvanas = me->SummonCreature(NPC_SYLVANAS_PART1, *me, TEMPSUMMON_MANUAL_DESPAWN);
else
- pJainaOrSylvanas = m_creature->SummonCreature(NPC_JAINA_PART1, *m_creature, TEMPSUMMON_MANUAL_DESPAWN);
+ pJainaOrSylvanas = me->SummonCreature(NPC_JAINA_PART1, *me, TEMPSUMMON_MANUAL_DESPAWN);
}
if (pJainaOrSylvanas)
{
- pJainaOrSylvanas->SetOrientation(pJainaOrSylvanas->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()));
- m_creature->SetOrientation(m_creature->GetAngle(pJainaOrSylvanas->GetPositionX(), pJainaOrSylvanas->GetPositionY()));
+ pJainaOrSylvanas->SetOrientation(pJainaOrSylvanas->GetAngle(me->GetPositionX(), me->GetPositionY()));
+ me->SetOrientation(me->GetAngle(pJainaOrSylvanas->GetPositionX(), pJainaOrSylvanas->GetPositionY()));
uiNpcOutroDialog = pJainaOrSylvanas->GetGUID();
}
@@ -361,13 +361,13 @@ struct boss_krickAI : public ScriptedAI
{
case EVENT_OUTRO_1:
{
- DoScriptText(SAY_KRICK_OUTRO_1, m_creature);
+ DoScriptText(SAY_KRICK_OUTRO_1, me);
events.ScheduleEvent(EVENT_OUTRO_2, 14000);
break;
}
case EVENT_OUTRO_2:
{
- Creature* pNpcDialog = m_creature->GetCreature(*m_creature, uiNpcOutroDialog);
+ Creature* pNpcDialog = me->GetCreature(*me, uiNpcOutroDialog);
if (pNpcDialog)
{
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
@@ -379,12 +379,12 @@ struct boss_krickAI : public ScriptedAI
break;
}
case EVENT_OUTRO_3:
- DoScriptText(SAY_KRICK_OUTRO_3, m_creature);
+ DoScriptText(SAY_KRICK_OUTRO_3, me);
events.ScheduleEvent(EVENT_OUTRO_4, 12000);
break;
case EVENT_OUTRO_4:
{
- Creature* pNpcDialog = m_creature->GetCreature(*m_creature, uiNpcOutroDialog);
+ Creature* pNpcDialog = me->GetCreature(*me, uiNpcOutroDialog);
if (pNpcDialog)
{
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
@@ -396,7 +396,7 @@ struct boss_krickAI : public ScriptedAI
break;
}
case EVENT_OUTRO_5:
- DoScriptText(SAY_KRICK_OUTRO_5, m_creature);
+ DoScriptText(SAY_KRICK_OUTRO_5, me);
events.ScheduleEvent(EVENT_OUTRO_6, 4000);
break;
case EVENT_OUTRO_6:
@@ -407,29 +407,29 @@ struct boss_krickAI : public ScriptedAI
events.ScheduleEvent(EVENT_OUTRO_7, 1);
break;
case EVENT_OUTRO_7:
- if (Creature *pTyrannus = m_creature->GetCreature(*m_creature, uiTyrannus))
+ if (Creature *pTyrannus = me->GetCreature(*me, uiTyrannus))
DoScriptText(SAY_TYRANNUS_OUTRO_7, pTyrannus);
events.ScheduleEvent(EVENT_OUTRO_8, 7000);
break;
case EVENT_OUTRO_8:
- DoScriptText(SAY_KRICK_OUTRO_8, m_creature);
+ DoScriptText(SAY_KRICK_OUTRO_8, me);
// TODO: Tyrannus starts killing Krick.
// there shall be some visual spell effect
events.ScheduleEvent(EVENT_OUTRO_9, 6000);
break;
case EVENT_OUTRO_9:
// tyrannus kills krick
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
- m_creature->SetHealth(0);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetHealth(0);
- if (Creature *pTyrannus = m_creature->GetCreature(*m_creature, uiTyrannus))
+ if (Creature *pTyrannus = me->GetCreature(*me, uiTyrannus))
DoScriptText(SAY_TYRANNUS_OUTRO_9, pTyrannus);
events.ScheduleEvent(EVENT_OUTRO_10, 12000);
break;
case EVENT_OUTRO_10:
{
- Creature* pNpcDialog = m_creature->GetCreature(*m_creature, uiNpcOutroDialog);
+ Creature* pNpcDialog = me->GetCreature(*me, uiNpcOutroDialog);
if (pNpcDialog)
{
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
@@ -444,11 +444,11 @@ struct boss_krickAI : public ScriptedAI
}
case EVENT_OUTRO_END:
{
- Creature* pNpcDialog = m_creature->GetCreature(*m_creature, uiNpcOutroDialog);
+ Creature* pNpcDialog = me->GetCreature(*me, uiNpcOutroDialog);
if (pNpcDialog)
pNpcDialog->DisappearAndDie();
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
break;
}
}
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp
index d753af7c5c1..0f6753a0f53 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp
@@ -104,16 +104,16 @@ struct boss_tyrannusAI : public ScriptedAI
Creature* GetRimefang()
{
- return m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_RIMEFANG));
+ return me->GetCreature(*me, pInstance->GetData64(DATA_RIMEFANG));
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- m_creature->ExitVehicle();
+ DoScriptText(SAY_AGGRO, me);
+ me->ExitVehicle();
// restore health if any damage done during intro
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ me->SetHealth(me->GetMaxHealth());
if (pInstance)
pInstance->SetData(DATA_TYRANNUS_EVENT, IN_PROGRESS);
@@ -125,12 +125,12 @@ struct boss_tyrannusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -148,7 +148,7 @@ struct boss_tyrannusAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -156,7 +156,7 @@ struct boss_tyrannusAI : public ScriptedAI
switch(eventId)
{
case EVENT_FORCEFUL_SMASH:
- DoCast(m_creature->getVictim(), SPELL_FORCEFUL_SMASH);
+ DoCast(me->getVictim(), SPELL_FORCEFUL_SMASH);
events.ScheduleEvent(EVENT_FORCEFUL_SMASH, 10000);
return;
case EVENT_OVERLORDS_BRAND:
@@ -165,9 +165,9 @@ struct boss_tyrannusAI : public ScriptedAI
events.ScheduleEvent(EVENT_OVERLORDS_BRAND, 45000);
return;
case EVENT_DARK_MIGHT:
- DoScriptText(SAY_DARK_MIGHT_1, m_creature);
- DoScriptText(SAY_DARK_MIGHT_2, m_creature);
- DoCast(m_creature, SPELL_DARK_MIGHT);
+ DoScriptText(SAY_DARK_MIGHT_1, me);
+ DoScriptText(SAY_DARK_MIGHT_2, me);
+ DoCast(me, SPELL_DARK_MIGHT);
events.ScheduleEvent(EVENT_DARK_MIGHT, 60000);
return;
}
@@ -189,18 +189,18 @@ struct boss_rimefangAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
events.Reset();
}
void EnterCombat(Unit* who)
{
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->InterruptSpell(CURRENT_GENERIC_SPELL);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
events.ScheduleEvent(EVENT_MARK_OF_RIMEFANG, 25000);
events.ScheduleEvent(EVENT_ICY_BLAST, 35000);
}
@@ -213,7 +213,7 @@ struct boss_rimefangAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -221,8 +221,8 @@ struct boss_rimefangAI : public ScriptedAI
switch(eventId)
{
case EVENT_MARK_OF_RIMEFANG:
- DoScriptText(SAY_MARK_RIMEFANG_1, m_creature);
- DoScriptText(SAY_MARK_RIMEFANG_2, m_creature);
+ DoScriptText(SAY_MARK_RIMEFANG_1, me);
+ DoScriptText(SAY_MARK_RIMEFANG_2, me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_MARK_OF_RIMEFANG);
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp b/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp
index 3aef8d60c95..82eebb5d3dd 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp
@@ -174,7 +174,7 @@ struct mob_ymirjar_wrathbringerAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -220,7 +220,7 @@ struct mob_ymirjar_skyCallerAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -228,7 +228,7 @@ struct mob_ymirjar_skyCallerAI: public ScriptedAI
switch(eventId)
{
case EVENT_GLACIAL_STRIKE:
- DoCast(m_creature->getVictim(), SPELL_GLACIAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_GLACIAL_STRIKE);
events.RescheduleEvent(EVENT_GLACIAL_STRIKE, 8000);
return;
case EVENT_FROSTBLADE:
@@ -270,7 +270,7 @@ struct mob_ymirjar_flamebearerAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -325,7 +325,7 @@ struct mob_ymirjar_deathbringerAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -372,7 +372,7 @@ struct mob_wrathbone_laborerAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -385,7 +385,7 @@ struct mob_wrathbone_laborerAI: public ScriptedAI
events.RescheduleEvent(EVENT_BLINDING_DIRT, 10000);
return;
case EVENT_PUNCTURE_WOUND:
- DoCast(m_creature->getVictim(), SPELL_PUNCTURE_WOUND);
+ DoCast(me->getVictim(), SPELL_PUNCTURE_WOUND);
events.RescheduleEvent(EVENT_PUNCTURE_WOUND, 9000);
return;
case EVENT_SHOVELLED:
@@ -427,7 +427,7 @@ struct mob_wrathbone_coldwraithAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -477,7 +477,7 @@ struct mob_stonespine_gargoyleAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -528,7 +528,7 @@ struct mob_plagueborn_horrorAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -581,7 +581,7 @@ struct mob_iceborn_protodrakeAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -589,7 +589,7 @@ struct mob_iceborn_protodrakeAI: public ScriptedAI
switch(eventId)
{
case EVENT_FROST_BREATH:
- DoCast(m_creature->getVictim(), SPELL_FROST_BREATH);
+ DoCast(me->getVictim(), SPELL_FROST_BREATH);
events.RescheduleEvent(EVENT_FROST_BREATH, 10000);
return;
}
@@ -625,7 +625,7 @@ struct mob_hungering_ghoulAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -633,7 +633,7 @@ struct mob_hungering_ghoulAI: public ScriptedAI
switch(eventId)
{
case EVENT_DEVOUR_FLESH:
- DoCast(m_creature->getVictim(), SPELL_DEVOUR_FLESH);
+ DoCast(me->getVictim(), SPELL_DEVOUR_FLESH);
events.RescheduleEvent(EVENT_DEVOUR_FLESH, 8000);
return;
}
@@ -671,7 +671,7 @@ struct mob_fallen_warriorAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -679,7 +679,7 @@ struct mob_fallen_warriorAI: public ScriptedAI
switch(eventId)
{
case EVENT_ARCING_SLICE:
- DoCast(m_creature->getVictim(), SPELL_ARCING_SLICE);
+ DoCast(me->getVictim(), SPELL_ARCING_SLICE);
events.RescheduleEvent(EVENT_ARCING_SLICE, 10000);
return;
case EVENT_DEMORALIZING_SHOUT:
@@ -687,7 +687,7 @@ struct mob_fallen_warriorAI: public ScriptedAI
events.RescheduleEvent(EVENT_DEMORALIZING_SHOUT, 20000);
return;
case EVENT_SHIELD_BLOCK:
- DoCast(m_creature->getVictim(), SPELL_SHIELD_BLOCK);
+ DoCast(me->getVictim(), SPELL_SHIELD_BLOCK);
events.RescheduleEvent(EVENT_SHIELD_BLOCK, 8000);
return;
}
@@ -724,7 +724,7 @@ struct mob_deathwhisper_torturerAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -774,7 +774,7 @@ struct mob_deathwhisper_shadowcasterAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -820,7 +820,7 @@ struct mob_deathwhisper_necrolyteAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -870,7 +870,7 @@ struct mob_wrathbone_sorcererAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -916,7 +916,7 @@ struct mob_geist_ambusherAI: public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/scripts/northrend/grizzly_hills.cpp b/src/scripts/northrend/grizzly_hills.cpp
index 3aea48e6c31..c07de861c9e 100644
--- a/src/scripts/northrend/grizzly_hills.cpp
+++ b/src/scripts/northrend/grizzly_hills.cpp
@@ -160,10 +160,10 @@ struct npc_emilyAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
- if (Creature* Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 50.0f))
+ if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 50.0f))
pSummoned->AI()->AttackStart(Mrfloppy);
else
- pSummoned->AI()->AttackStart(m_creature->getVictim());
+ pSummoned->AI()->AttackStart(me->getVictim());
}
void WaypointReached(uint32 i)
@@ -174,76 +174,76 @@ struct npc_emilyAI : public npc_escortAI
switch (i)
{
case 9:
- if (Creature *Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 100.0f))
+ if (Creature *Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f))
MrfloppyGUID = Mrfloppy->GetGUID();
break;
case 10:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
{
- DoScriptText(SAY_WORGHAGGRO1, m_creature);
- m_creature->SummonCreature(NPC_HUNGRY_WORG,m_creature->GetPositionX()+5,m_creature->GetPositionY()+2,m_creature->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
+ DoScriptText(SAY_WORGHAGGRO1, me);
+ me->SummonCreature(NPC_HUNGRY_WORG,me->GetPositionX()+5,me->GetPositionY()+2,me->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
}
break;
case 11:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
- Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
+ Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
break;
case 17:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
- Mrfloppy->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- DoScriptText(SAY_WORGRAGGRO3, m_creature);
- if (Creature *RWORG = m_creature->SummonCreature(NPC_RAVENOUS_WORG,m_creature->GetPositionX()+10,m_creature->GetPositionY()+8,m_creature->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
+ Mrfloppy->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ DoScriptText(SAY_WORGRAGGRO3, me);
+ if (Creature *RWORG = me->SummonCreature(NPC_RAVENOUS_WORG,me->GetPositionX()+10,me->GetPositionY()+8,me->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000))
{
RWORG->setFaction(35);
RWORGGUID = RWORG->GetGUID();
}
break;
case 18:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
{
- if (Creature *RWORG = Unit::GetCreature(*m_creature, RWORGGUID))
+ if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
DoCast(Mrfloppy,SPELL_MRFLOPPY);
}
break;
case 19:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
{
if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
{
- if (Creature *RWORG = Unit::GetCreature(*m_creature, RWORGGUID))
+ if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
Mrfloppy->EnterVehicle(RWORG);
}
}
break;
case 20:
- if (Creature *RWORG = Unit::GetCreature(*m_creature, RWORGGUID))
+ if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
RWORG->HandleEmoteCommand(34);
break;
case 21:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
{
- if (Creature *RWORG = Unit::GetCreature(*m_creature, RWORGGUID))
+ if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
{
RWORG->Kill(Mrfloppy);
Mrfloppy->ExitVehicle();
RWORG->setFaction(14);
RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ());
- DoScriptText(SAY_VICTORY2, m_creature);
+ DoScriptText(SAY_VICTORY2, me);
}
}
break;
case 22:
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
{
if (Mrfloppy->isDead())
{
- if (Creature *RWORG = Unit::GetCreature(*m_creature, RWORGGUID))
+ if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
RWORG->DisappearAndDie();
- m_creature->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
Mrfloppy->setDeathState(ALIVE);
- Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- DoScriptText(SAY_VICTORY3, m_creature);
+ Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ DoScriptText(SAY_VICTORY3, me);
}
}
break;
@@ -251,17 +251,17 @@ struct npc_emilyAI : public npc_escortAI
if (pPlayer)
{
Completed = true;
- pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, m_creature);
- DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me);
+ DoScriptText(SAY_QUEST_COMPLETE, me, pPlayer);
}
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 25:
- DoScriptText(SAY_VICTORY4, m_creature);
+ DoScriptText(SAY_VICTORY4, me);
break;
case 27:
- m_creature->DisappearAndDie();
- if (Creature *Mrfloppy = Unit::GetCreature(*m_creature, MrfloppyGUID))
+ me->DisappearAndDie();
+ if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
Mrfloppy->DisappearAndDie();
break;
}
@@ -269,7 +269,7 @@ struct npc_emilyAI : public npc_escortAI
void EnterCombat(Unit* Who)
{
- DoScriptText(SAY_RANDOMAGGRO, m_creature);
+ DoScriptText(SAY_RANDOMAGGRO, me);
}
void Reset()
@@ -330,7 +330,7 @@ struct npc_mrfloppyAI : public ScriptedAI
void EnterCombat(Unit* Who)
{
- if (Creature* Emily = GetClosestCreatureWithEntry(m_creature, NPC_EMILY, 50.0f))
+ if (Creature* Emily = GetClosestCreatureWithEntry(me, NPC_EMILY, 50.0f))
{
switch(Who->GetEntry())
{
@@ -407,8 +407,8 @@ struct npc_outhouse_bunnyAI : public ScriptedAI
DoCast(me, SPELL_DUST_FIELD, true);
switch (m_gender)
{
- case GENDER_FEMALE: DoPlaySoundToSet(m_creature, SOUND_FEMALE); break;
- case GENDER_MALE: DoPlaySoundToSet(m_creature, SOUND_MALE); break;
+ case GENDER_FEMALE: DoPlaySoundToSet(me, SOUND_FEMALE); break;
+ case GENDER_MALE: DoPlaySoundToSet(me, SOUND_MALE); break;
}
}
}
diff --git a/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp b/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
index 43b38561f1e..d5c7eed469d 100644
--- a/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
+++ b/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
@@ -54,11 +54,11 @@ struct boss_drakkari_colossusAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_DRAKKARI_COLOSSUS_EVENT, NOT_STARTED);
- if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
- m_creature->SetReactState(REACT_PASSIVE);
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
+ me->SetReactState(REACT_PASSIVE);
MightyBlowTimer = 10*IN_MILISECONDS;
bHealth = false;
bHealth1 = false;
@@ -79,14 +79,14 @@ struct boss_drakkari_colossusAI : public ScriptedAI
{
pWho->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
pWho->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (pWho == m_creature)
- m_creature->RemoveAura(SPELL_FREEZE_ANIM);
+ if (pWho == me)
+ me->RemoveAura(SPELL_FREEZE_ANIM);
}else
{
pWho->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pWho->addUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
- if (pWho == m_creature)
- DoCast(m_creature,SPELL_FREEZE_ANIM);
+ if (pWho == me)
+ DoCast(me,SPELL_FREEZE_ANIM);
}
}
@@ -98,27 +98,27 @@ struct boss_drakkari_colossusAI : public ScriptedAI
if (!bHealth && HealthBelowPct(50) && !HealthBelowPct(5))
{
- CreatureState(m_creature, false);
- DoCast(m_creature,SPELL_FREEZE_ANIM);
- DoCast(m_creature,SPELL_EMERGE);
+ CreatureState(me, false);
+ DoCast(me,SPELL_FREEZE_ANIM);
+ DoCast(me,SPELL_EMERGE);
bHealth = true;
}
if (!bHealth1 && HealthBelowPct(5))
{
- DoCast(m_creature,SPELL_EMERGE);
- CreatureState(m_creature, false);
+ DoCast(me,SPELL_EMERGE);
+ CreatureState(me, false);
bHealth1 = true;
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
}
if (MightyBlowTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW, true);
+ DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, true);
MightyBlowTimer = 10*IN_MILISECONDS;
} else MightyBlowTimer -= diff;
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED))
DoMeleeAttackIfReady();
}
@@ -132,7 +132,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
{
if (HealthBelowPct(5))
pSummon->DealDamage(pSummon, pSummon->GetHealth() * 0.5 , NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- pSummon->AI()->AttackStart(m_creature->getVictim());
+ pSummon->AI()->AttackStart(me->getVictim());
}
};
@@ -151,27 +151,27 @@ struct boss_drakkari_elementalAI : public ScriptedAI
void Reset()
{
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
- CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->CreatureState(m_creature, true);
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->CreatureState(me, true);
uiSurgeTimer = 7*IN_MILISECONDS;
bGoToColossus = false;
}
void EnterEvadeMode()
{
- m_creature->RemoveFromWorld();
+ me->RemoveFromWorld();
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE)
return;
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->CreatureState(pColossus, true);
CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->bHealth1 = false;
}
- m_creature->RemoveFromWorld();
+ me->RemoveFromWorld();
}
void UpdateAI(const uint32 diff)
@@ -182,11 +182,11 @@ struct boss_drakkari_elementalAI : public ScriptedAI
if (!bGoToColossus && HealthBelowPct(50))
{
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
if (!CAST_AI(boss_drakkari_colossusAI,pColossus->AI())->HealthBelowPct(6))
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
DoCast(pColossus, SPELL_MERGE);
bGoToColossus = true;
}
@@ -195,7 +195,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI
if (uiSurgeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SURGE);
+ DoCast(me->getVictim(), SPELL_SURGE);
uiSurgeTimer = 7*IN_MILISECONDS;
} else uiSurgeTimer -= diff;
@@ -204,7 +204,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI
void JustDied(Unit* killer)
{
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
pColossus->Kill(pColossus);
}
};
@@ -231,20 +231,20 @@ struct npc_living_mojoAI : public ScriptedAI
{
//Check if the npc is near of Drakkari Colossus.
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
- if (pColossus->isAlive() && m_creature->IsInRange3d(pColossus->GetHomePosition().GetPositionX(),pColossus->GetHomePosition().GetPositionY(),pColossus->GetHomePosition().GetPositionZ(),0.0f,17.0f))
- m_creature->SetReactState(REACT_PASSIVE);
+ if (pColossus->isAlive() && me->IsInRange3d(pColossus->GetHomePosition().GetPositionX(),pColossus->GetHomePosition().GetPositionY(),pColossus->GetHomePosition().GetPositionZ(),0.0f,17.0f))
+ me->SetReactState(REACT_PASSIVE);
else
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
}
}
void DamageTaken(Unit* pDone_by, uint32& uiDamage)
{
- if (m_creature->HasReactState(REACT_PASSIVE))
+ if (me->HasReactState(REACT_PASSIVE))
{
- if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
+ if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
if (pColossus->isAlive() && !pColossus->isInCombat())
{
@@ -267,13 +267,13 @@ struct npc_living_mojoAI : public ScriptedAI
if (uiMojoWaveTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MOJO_WAVE);
+ DoCast(me->getVictim(), SPELL_MOJO_WAVE);
uiMojoWaveTimer = 15*IN_MILISECONDS;
} else uiMojoWaveTimer -= diff;
if (uiMojoPuddleTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MOJO_PUDDLE);
+ DoCast(me->getVictim(), SPELL_MOJO_PUDDLE);
uiMojoPuddleTimer = 18*IN_MILISECONDS;
} else uiMojoPuddleTimer -= diff;
diff --git a/src/scripts/northrend/gundrak/boss_eck.cpp b/src/scripts/northrend/gundrak/boss_eck.cpp
index 45aa8e84720..cd329119ca8 100644
--- a/src/scripts/northrend/gundrak/boss_eck.cpp
+++ b/src/scripts/northrend/gundrak/boss_eck.cpp
@@ -73,13 +73,13 @@ struct boss_eckAI : public ScriptedAI
if (uiBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ECK_BITE);
+ DoCast(me->getVictim(), SPELL_ECK_BITE);
uiBiteTimer = urand(8*IN_MILISECONDS,12*IN_MILISECONDS);
} else uiBiteTimer -= diff;
if (uiSpitTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ECK_SPIT);
+ DoCast(me->getVictim(), SPELL_ECK_SPIT);
uiSpitTimer = urand(6*IN_MILISECONDS,14*IN_MILISECONDS);
} else uiSpitTimer -= diff;
@@ -98,7 +98,7 @@ struct boss_eckAI : public ScriptedAI
{
if (uiBerserkTimer <= diff)
{
- DoCast(m_creature, SPELL_ECK_BERSERK);
+ DoCast(me, SPELL_ECK_BERSERK);
bBerserk = true;
}
else
@@ -106,7 +106,7 @@ struct boss_eckAI : public ScriptedAI
uiBerserkTimer -= diff;
if (HealthBelowPct(20))
{
- DoCast(m_creature, SPELL_ECK_BERSERK);
+ DoCast(me, SPELL_ECK_BERSERK);
bBerserk = true;
}
}
@@ -140,9 +140,9 @@ struct npc_ruins_dwellerAI : public ScriptedAI
{
if (pInstance)
{
- pInstance->SetData64(DATA_RUIN_DWELLER_DIED,m_creature->GetGUID());
+ pInstance->SetData64(DATA_RUIN_DWELLER_DIED,me->GetGUID());
if (pInstance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0)
- m_creature->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILISECONDS);
+ me->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILISECONDS);
}
}
};
diff --git a/src/scripts/northrend/gundrak/boss_gal_darah.cpp b/src/scripts/northrend/gundrak/boss_gal_darah.cpp
index dee1b2c6d1e..a5e4bb02cf3 100644
--- a/src/scripts/northrend/gundrak/boss_gal_darah.cpp
+++ b/src/scripts/northrend/gundrak/boss_gal_darah.cpp
@@ -110,7 +110,7 @@ struct boss_gal_darahAI : public ScriptedAI
Phase = TROLL;
- m_creature->SetDisplayId(DISPLAY_TROLL);
+ me->SetDisplayId(DISPLAY_TROLL);
if (pInstance)
pInstance->SetData(DATA_GAL_DARAH_EVENT, NOT_STARTED);
@@ -118,7 +118,7 @@ struct boss_gal_darahAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_GAL_DARAH_EVENT, IN_PROGRESS);
@@ -137,14 +137,14 @@ struct boss_gal_darahAI : public ScriptedAI
{
if (uiTransformationTimer <= diff)
{
- m_creature->SetDisplayId(DISPLAY_RHINO);
+ me->SetDisplayId(DISPLAY_RHINO);
Phase = RHINO;
uiPhaseCounter = 0;
- DoScriptText(SAY_TRANSFORM_1, m_creature);
+ DoScriptText(SAY_TRANSFORM_1, me);
uiTransformationTimer = 5*IN_MILISECONDS;
bStartOfTransformation = true;
- m_creature->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->SetReactState(REACT_AGGRESSIVE);
}
else
{
@@ -153,8 +153,8 @@ struct boss_gal_darahAI : public ScriptedAI
if (bStartOfTransformation)
{
bStartOfTransformation = false;
- m_creature->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->SetReactState(REACT_PASSIVE);
}
}
}
@@ -162,14 +162,14 @@ struct boss_gal_darahAI : public ScriptedAI
{
if (uiStampedeTimer <= diff)
{
- DoCast(m_creature, SPELL_STAMPEDE);
- DoScriptText(RAND(SAY_SUMMON_RHINO_1,SAY_SUMMON_RHINO_2,SAY_SUMMON_RHINO_3),m_creature);
+ DoCast(me, SPELL_STAMPEDE);
+ DoScriptText(RAND(SAY_SUMMON_RHINO_1,SAY_SUMMON_RHINO_2,SAY_SUMMON_RHINO_3),me);
uiStampedeTimer = 15*IN_MILISECONDS;
} else uiStampedeTimer -= diff;
if (uiWhirlingSlashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLING_SLASH);
+ DoCast(me->getVictim(), SPELL_WHIRLING_SLASH);
uiWhirlingSlashTimer = 21*IN_MILISECONDS;
++uiPhaseCounter;
} else uiWhirlingSlashTimer -= diff;
@@ -180,14 +180,14 @@ struct boss_gal_darahAI : public ScriptedAI
{
if (uiTransformationTimer <= diff)
{
- m_creature->SetDisplayId(DISPLAY_TROLL);
+ me->SetDisplayId(DISPLAY_TROLL);
Phase = TROLL;
uiPhaseCounter = 0;
- DoScriptText(SAY_TRANSFORM_2, m_creature);
+ DoScriptText(SAY_TRANSFORM_2, me);
uiTransformationTimer = 9*IN_MILISECONDS;
bStartOfTransformation = true;
- m_creature->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->SetReactState(REACT_AGGRESSIVE);
}
else
{
@@ -196,8 +196,8 @@ struct boss_gal_darahAI : public ScriptedAI
if (bStartOfTransformation)
{
bStartOfTransformation = false;
- m_creature->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->SetReactState(REACT_PASSIVE);
}
}
}
@@ -205,19 +205,19 @@ struct boss_gal_darahAI : public ScriptedAI
{
if (uiPunctureTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PUNCTURE);
+ DoCast(me->getVictim(), SPELL_PUNCTURE);
uiPunctureTimer = 8*IN_MILISECONDS;
} else uiPunctureTimer -= diff;
if (uiEnrageTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENRAGE);
+ DoCast(me->getVictim(), SPELL_ENRAGE);
uiEnrageTimer = 20*IN_MILISECONDS;
} else uiEnrageTimer -= diff;
if (uiStompTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STOMP);
+ DoCast(me->getVictim(), SPELL_STOMP);
uiStompTimer = 20*IN_MILISECONDS;
} else uiStompTimer -= diff;
@@ -240,7 +240,7 @@ struct boss_gal_darahAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -265,10 +265,10 @@ struct boss_gal_darahAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/northrend/gundrak/boss_moorabi.cpp b/src/scripts/northrend/gundrak/boss_moorabi.cpp
index 9e6899408eb..bd832061dab 100644
--- a/src/scripts/northrend/gundrak/boss_moorabi.cpp
+++ b/src/scripts/northrend/gundrak/boss_moorabi.cpp
@@ -79,8 +79,8 @@ struct boss_moorabiAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_MOJO_FRENZY, true);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_MOJO_FRENZY, true);
if (pInstance)
pInstance->SetData(DATA_MOORABI_EVENT, IN_PROGRESS);
@@ -92,45 +92,45 @@ struct boss_moorabiAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!bPhase && m_creature->HasAura(SPELL_TRANSFORMATION))
+ if (!bPhase && me->HasAura(SPELL_TRANSFORMATION))
{
bPhase = true;
- m_creature->RemoveAura(SPELL_MOJO_FRENZY);
+ me->RemoveAura(SPELL_MOJO_FRENZY);
}
if (uiGroundTremorTimer <= uiDiff)
{
- DoScriptText(SAY_QUAKE, m_creature);
+ DoScriptText(SAY_QUAKE, me);
if (bPhase)
- DoCast(m_creature->getVictim(), SPELL_QUAKE, true);
+ DoCast(me->getVictim(), SPELL_QUAKE, true);
else
- DoCast(m_creature->getVictim(), SPELL_GROUND_TREMOR, true);
+ DoCast(me->getVictim(), SPELL_GROUND_TREMOR, true);
uiGroundTremorTimer = 10*IN_MILISECONDS;
} else uiGroundTremorTimer -= uiDiff;
if (uiNumblingShoutTimer <= uiDiff)
{
if (bPhase)
- DoCast(m_creature->getVictim(), SPELL_NUMBING_ROAR, true);
+ DoCast(me->getVictim(), SPELL_NUMBING_ROAR, true);
else
- DoCast(m_creature->getVictim(), SPELL_NUMBING_SHOUT, true);
+ DoCast(me->getVictim(), SPELL_NUMBING_SHOUT, true);
uiNumblingShoutTimer = 10*IN_MILISECONDS;
} else uiNumblingShoutTimer -=uiDiff;
if (uiDeterminedStabTimer <= uiDiff)
{
if (bPhase)
- DoCast(m_creature->getVictim(), SPELL_DETERMINED_GORE);
+ DoCast(me->getVictim(), SPELL_DETERMINED_GORE);
else
- DoCast(m_creature->getVictim(), SPELL_DETERMINED_STAB, true);
+ DoCast(me->getVictim(), SPELL_DETERMINED_STAB, true);
uiDeterminedStabTimer = 8*IN_MILISECONDS;
} else uiDeterminedStabTimer -=uiDiff;
if (!bPhase && uiTransformationTImer <= uiDiff)
{
- DoScriptText(EMOTE_TRANSFORM, m_creature);
- DoScriptText(SAY_TRANSFORM, m_creature);
- DoCast(m_creature, SPELL_TRANSFORMATION, false);
+ DoScriptText(EMOTE_TRANSFORM, me);
+ DoScriptText(SAY_TRANSFORM, me);
+ DoCast(me, SPELL_TRANSFORMATION, false);
uiTransformationTImer = 10*IN_MILISECONDS;
} else uiTransformationTImer -= uiDiff;
@@ -139,7 +139,7 @@ struct boss_moorabiAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -152,10 +152,10 @@ struct boss_moorabiAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- if (pVictim == m_creature)
+ if (pVictim == me)
return;
- DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/northrend/gundrak/boss_slad_ran.cpp b/src/scripts/northrend/gundrak/boss_slad_ran.cpp
index 8d8b0f84833..ccc28654d2c 100644
--- a/src/scripts/northrend/gundrak/boss_slad_ran.cpp
+++ b/src/scripts/northrend/gundrak/boss_slad_ran.cpp
@@ -100,7 +100,7 @@ struct boss_slad_ranAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_SLAD_RAN_EVENT, IN_PROGRESS);
@@ -114,19 +114,19 @@ struct boss_slad_ranAI : public ScriptedAI
if (uiPoisonNovaTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISON_NOVA);
+ DoCast(me->getVictim(), SPELL_POISON_NOVA);
uiPoisonNovaTimer = 15*IN_MILISECONDS;
} else uiPoisonNovaTimer -= diff;
if (uiPowerfullBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POWERFULL_BITE);
+ DoCast(me->getVictim(), SPELL_POWERFULL_BITE);
uiPowerfullBiteTimer = 10*IN_MILISECONDS;
} else uiPowerfullBiteTimer -= diff;
if (uiVenomBoltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VENOM_BOLT);
+ DoCast(me->getVictim(), SPELL_VENOM_BOLT);
uiVenomBoltTimer = 10*IN_MILISECONDS;
} else uiVenomBoltTimer -= diff;
@@ -136,23 +136,23 @@ struct boss_slad_ranAI : public ScriptedAI
{
if (uiPhase == 1)
for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i)
- m_creature->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
+ me->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
if (uiPhase == 2)
for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i)
- m_creature->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
+ me->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
uiSpawnTimer = 5*IN_MILISECONDS;
} else uiSpawnTimer -= diff;
}
if (uiPhase == 0 && HealthBelowPct(30))
{
- DoScriptText(SAY_SUMMON_SNAKES,m_creature);
+ DoScriptText(SAY_SUMMON_SNAKES,me);
uiPhase = 1;
}
if (uiPhase == 1 && HealthBelowPct(25))
{
- DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature);
+ DoScriptText(SAY_SUMMON_CONSTRICTORS,me);
uiPhase = 2;
}
@@ -161,7 +161,7 @@ struct boss_slad_ranAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_SLAD_RAN_EVENT, DONE);
@@ -169,12 +169,12 @@ struct boss_slad_ranAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustSummoned(Creature* summoned)
{
- summoned->GetMotionMaster()->MovePoint(0,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ summoned->GetMotionMaster()->MovePoint(0,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ());
lSummons.Summon(summoned);
}
};
@@ -196,7 +196,7 @@ struct mob_slad_ran_constrictorAI : public ScriptedAI
return;
if (uiGripOfSladRanTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GRIP_OF_SLAD_RAN);
+ DoCast(me->getVictim(), SPELL_GRIP_OF_SLAD_RAN);
uiGripOfSladRanTimer = 5*IN_MILISECONDS;
} else uiGripOfSladRanTimer -= diff;
}
@@ -224,7 +224,7 @@ struct mob_slad_ran_viperAI : public ScriptedAI
if (uiVenomousBiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VENOMOUS_BITE);
+ DoCast(me->getVictim(), SPELL_VENOMOUS_BITE);
uiVenomousBiteTimer = 10*IN_MILISECONDS;
} else uiVenomousBiteTimer -= diff;
}
diff --git a/src/scripts/northrend/howling_fjord.cpp b/src/scripts/northrend/howling_fjord.cpp
index 0e9821c5e70..6940fc310c6 100644
--- a/src/scripts/northrend/howling_fjord.cpp
+++ b/src/scripts/northrend/howling_fjord.cpp
@@ -105,26 +105,26 @@ struct npc_Apothecary_HanesAI : public npc_escortAI
break;
case 23:
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_TRAIL_OF_FIRE, m_creature);
+ pPlayer->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
me->ForcedDespawn();
break;
case 5:
- if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
+ if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
break;
case 6:
- if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
+ if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
break;
case 8:
- if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
+ if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
break;
case 9:
- if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
+ if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
break;
case 10:
@@ -134,7 +134,7 @@ struct npc_Apothecary_HanesAI : public npc_escortAI
SetRun(false);
break;
case 14:
- if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
+ if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
break;
diff --git a/src/scripts/northrend/icecrown.cpp b/src/scripts/northrend/icecrown.cpp
index eb72b7f5cbf..aa32cd957b1 100644
--- a/src/scripts/northrend/icecrown.cpp
+++ b/src/scripts/northrend/icecrown.cpp
@@ -206,18 +206,18 @@ struct npc_argent_valiantAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->setFaction(14);
+ me->setFaction(14);
}
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
- if (uiDamage > m_creature->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER)
+ if (uiDamage > me->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER)
{
uiDamage = 0;
CAST_PLR(pDoneBy)->KilledMonsterCredit(NPC_ARGENT_VALIANT_CREDIT,0);
- m_creature->setFaction(35);
- m_creature->ForcedDespawn(5000);
- m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
+ me->setFaction(35);
+ me->ForcedDespawn(5000);
+ me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
EnterEvadeMode();
}
}
@@ -265,7 +265,7 @@ struct npc_argent_tournament_postAI : public ScriptedAI
void UpdateAI(const uint32 uiDiff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
if (Creature* pTarget = me->FindNearestCreature(NPC_GORMOK_THE_IMPALER, 6.0f))
diff --git a/src/scripts/northrend/naxxramas/boss_anubrekhan.cpp b/src/scripts/northrend/naxxramas/boss_anubrekhan.cpp
index 7692dba37a5..b3bcebd6bc1 100644
--- a/src/scripts/northrend/naxxramas/boss_anubrekhan.cpp
+++ b/src/scripts/northrend/naxxramas/boss_anubrekhan.cpp
@@ -63,13 +63,13 @@ struct boss_anubrekhanAI : public BossAI
// respawn guard using home position,
// otherwise, after a wipe, they respawn where boss was at wipe moment.
- pos = m_creature->GetHomePosition();
+ pos = me->GetHomePosition();
pos.m_positionY -= 10.0f;
- m_creature->SummonCreature(MOB_CRYPT_GUARD, pos, TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(MOB_CRYPT_GUARD, pos, TEMPSUMMON_CORPSE_DESPAWN);
- pos = m_creature->GetHomePosition();
+ pos = me->GetHomePosition();
pos.m_positionY += 10.0f;
- m_creature->SummonCreature(MOB_CRYPT_GUARD, pos, TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(MOB_CRYPT_GUARD, pos, TEMPSUMMON_CORPSE_DESPAWN);
}
}
@@ -110,7 +110,7 @@ struct boss_anubrekhanAI : public BossAI
BossAI::SummonedCreatureDespawn(summon);
// check if it is an actual killed guard
- if (!m_creature->isAlive() || summon->isAlive() || summon->GetEntry() != MOB_CRYPT_GUARD)
+ if (!me->isAlive() || summon->isAlive() || summon->GetEntry() != MOB_CRYPT_GUARD)
return;
summon->CastSpell(summon, SPELL_SUMMON_CORPSE_SCARABS_MOB, true, NULL, NULL, me->GetGUID());
@@ -138,7 +138,7 @@ struct boss_anubrekhanAI : public BossAI
break;
case EVENT_LOCUST:
// TODO : Add Text
- DoCast(m_creature, RAID_MODE(SPELL_LOCUST_SWARM_10,SPELL_LOCUST_SWARM_25));
+ DoCast(me, RAID_MODE(SPELL_LOCUST_SWARM_10,SPELL_LOCUST_SWARM_25));
DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_LOCUST, 90000);
break;
@@ -147,7 +147,7 @@ struct boss_anubrekhanAI : public BossAI
DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
break;
case EVENT_BERSERK:
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoCast(me, SPELL_BERSERK, true);
events.ScheduleEvent(EVENT_BERSERK, 600000);
break;
}
diff --git a/src/scripts/northrend/naxxramas/boss_faerlina.cpp b/src/scripts/northrend/naxxramas/boss_faerlina.cpp
index ab7c5a81e78..bd88c254c58 100644
--- a/src/scripts/northrend/naxxramas/boss_faerlina.cpp
+++ b/src/scripts/northrend/naxxramas/boss_faerlina.cpp
@@ -181,8 +181,8 @@ struct mob_faerlina_addAI : public ScriptedAI
void Reset()
{
if (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) {
- m_creature->ApplySpellImmune(0, IMMUNITY_MECHANIC, SPELL_EFFECT_BIND, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, SPELL_EFFECT_BIND, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, true);
}
}
diff --git a/src/scripts/northrend/naxxramas/boss_gothik.cpp b/src/scripts/northrend/naxxramas/boss_gothik.cpp
index 82489258b4c..62180e344f6 100644
--- a/src/scripts/northrend/naxxramas/boss_gothik.cpp
+++ b/src/scripts/northrend/naxxramas/boss_gothik.cpp
@@ -243,25 +243,25 @@ struct boss_gothikAI : public BossAI
{
case MOB_LIVE_TRAINEE:
{
- if (Creature *LiveTrigger0 = Unit::GetCreature(*m_creature, LiveTriggerGUID[0]))
+ if (Creature *LiveTrigger0 = Unit::GetCreature(*me, LiveTriggerGUID[0]))
DoSummon(MOB_LIVE_TRAINEE, LiveTrigger0, 1);
- if (Creature *LiveTrigger1 = Unit::GetCreature(*m_creature, LiveTriggerGUID[1]))
+ if (Creature *LiveTrigger1 = Unit::GetCreature(*me, LiveTriggerGUID[1]))
DoSummon(MOB_LIVE_TRAINEE, LiveTrigger1, 1);
- if (Creature *LiveTrigger2 = Unit::GetCreature(*m_creature, LiveTriggerGUID[2]))
+ if (Creature *LiveTrigger2 = Unit::GetCreature(*me, LiveTriggerGUID[2]))
DoSummon(MOB_LIVE_TRAINEE, LiveTrigger2, 1);
break;
}
case MOB_LIVE_KNIGHT:
{
- if (Creature *LiveTrigger3 = Unit::GetCreature(*m_creature, LiveTriggerGUID[3]))
+ if (Creature *LiveTrigger3 = Unit::GetCreature(*me, LiveTriggerGUID[3]))
DoSummon(MOB_LIVE_KNIGHT, LiveTrigger3, 1);
- if (Creature *LiveTrigger5 = Unit::GetCreature(*m_creature, LiveTriggerGUID[5]))
+ if (Creature *LiveTrigger5 = Unit::GetCreature(*me, LiveTriggerGUID[5]))
DoSummon(MOB_LIVE_KNIGHT, LiveTrigger5, 1);
break;
}
case MOB_LIVE_RIDER:
{
- if (Creature *LiveTrigger4 = Unit::GetCreature(*m_creature, LiveTriggerGUID[4]))
+ if (Creature *LiveTrigger4 = Unit::GetCreature(*me, LiveTriggerGUID[4]))
DoSummon(MOB_LIVE_RIDER, LiveTrigger4, 1);
break;
}
@@ -273,21 +273,21 @@ struct boss_gothikAI : public BossAI
{
case MOB_LIVE_TRAINEE:
{
- if (Creature *LiveTrigger0 = Unit::GetCreature(*m_creature, LiveTriggerGUID[4]))
+ if (Creature *LiveTrigger0 = Unit::GetCreature(*me, LiveTriggerGUID[4]))
DoSummon(MOB_LIVE_TRAINEE, LiveTrigger0, 1);
- if (Creature *LiveTrigger1 = Unit::GetCreature(*m_creature, LiveTriggerGUID[4]))
+ if (Creature *LiveTrigger1 = Unit::GetCreature(*me, LiveTriggerGUID[4]))
DoSummon(MOB_LIVE_TRAINEE, LiveTrigger1, 1);
break;
}
case MOB_LIVE_KNIGHT:
{
- if (Creature *LiveTrigger5 = Unit::GetCreature(*m_creature, LiveTriggerGUID[4]))
+ if (Creature *LiveTrigger5 = Unit::GetCreature(*me, LiveTriggerGUID[4]))
DoSummon(MOB_LIVE_KNIGHT, LiveTrigger5, 1);
break;
}
case MOB_LIVE_RIDER:
{
- if (Creature *LiveTrigger4 = Unit::GetCreature(*m_creature, LiveTriggerGUID[4]))
+ if (Creature *LiveTrigger4 = Unit::GetCreature(*me, LiveTriggerGUID[4]))
DoSummon(MOB_LIVE_RIDER, LiveTrigger4, 1);
break;
}
@@ -346,7 +346,7 @@ struct boss_gothikAI : public BossAI
if (spellId && me->isInCombat())
{
me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST);
- if (Creature *pRandomDeadTrigger = Unit::GetCreature(*m_creature, DeadTriggerGUID[rand() % POS_DEAD]))
+ if (Creature *pRandomDeadTrigger = Unit::GetCreature(*me, DeadTriggerGUID[rand() % POS_DEAD]))
me->CastSpell(pRandomDeadTrigger, spellId, true);
}
}
@@ -451,8 +451,8 @@ struct boss_gothikAI : public BossAI
case EVENT_TELEPORT:
if (!thirtyPercentReached)
{
- m_creature->AttackStop();
- if (IN_LIVE_SIDE(m_creature))
+ me->AttackStop();
+ if (IN_LIVE_SIDE(me))
{
DoTeleportTo(PosGroundDeadSide);
}
@@ -461,10 +461,10 @@ struct boss_gothikAI : public BossAI
DoTeleportTo(PosGroundLiveSide);
}
- m_creature->getThreatManager().resetAggro(NotOnSameSide(m_creature));
+ me->getThreatManager().resetAggro(NotOnSameSide(me));
if (Unit *pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
{
- m_creature->getThreatManager().addThreat(pTarget, 100.0f);
+ me->getThreatManager().addThreat(pTarget, 100.0f);
AttackStart(pTarget);
}
diff --git a/src/scripts/northrend/naxxramas/boss_grobbulus.cpp b/src/scripts/northrend/naxxramas/boss_grobbulus.cpp
index 28fc676e1ca..f857adf1591 100644
--- a/src/scripts/northrend/naxxramas/boss_grobbulus.cpp
+++ b/src/scripts/northrend/naxxramas/boss_grobbulus.cpp
@@ -104,14 +104,14 @@ struct npc_grobbulus_poison_cloudAI : public Scripted_NoMovementAI
void Reset()
{
Cloud_Timer = 1000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void UpdateAI(const uint32 diff)
{
if (Cloud_Timer <= diff)
{
- DoCast(m_creature, SPELL_POISON_CLOUD_ADD);
+ DoCast(me, SPELL_POISON_CLOUD_ADD);
Cloud_Timer = 10000;
} else Cloud_Timer -= diff;
}
diff --git a/src/scripts/northrend/naxxramas/boss_kelthuzad.cpp b/src/scripts/northrend/naxxramas/boss_kelthuzad.cpp
index 65ee26e25fb..18f78f63cee 100644
--- a/src/scripts/northrend/naxxramas/boss_kelthuzad.cpp
+++ b/src/scripts/northrend/naxxramas/boss_kelthuzad.cpp
@@ -254,7 +254,7 @@ struct boss_kelthuzadAI : public BossAI
{
boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD), spawns(c)
{
- uiFaction = m_creature->getFaction();
+ uiFaction = me->getFaction();
}
uint32 Phase;
@@ -293,7 +293,7 @@ struct boss_kelthuzadAI : public BossAI
FindGameObjects();
- if (GameObject *pKTTrigger = m_creature->GetMap()->GetGameObject(KTTriggerGUID))
+ if (GameObject *pKTTrigger = me->GetMap()->GetGameObject(KTTriggerGUID))
{
pKTTrigger->ResetDoorOrButton();
pKTTrigger->SetPhaseMask(1, true);
@@ -301,7 +301,7 @@ struct boss_kelthuzadAI : public BossAI
for (uint8 i = 0; i <= 3; ++i)
{
- if (GameObject *pPortal = m_creature->GetMap()->GetGameObject(PortalsGUID[i]))
+ if (GameObject *pPortal = me->GetMap()->GetGameObject(PortalsGUID[i]))
{
if (!((pPortal->getLootState() == GO_READY) || (pPortal->getLootState() == GO_NOT_READY)))
pPortal->ResetDoorOrButton();
@@ -318,13 +318,13 @@ struct boss_kelthuzadAI : public BossAI
void KilledUnit()
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
_JustDied();
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
std::map<uint64, float>::const_iterator itr;
for (itr = chained.begin(); itr != chained.end(); ++itr)
@@ -343,7 +343,7 @@ struct boss_kelthuzadAI : public BossAI
FindGameObjects();
for (uint8 i = 0; i <= 3; ++i)
{
- if (GameObject *pPortal = m_creature->GetMap()->GetGameObject(PortalsGUID[i]))
+ if (GameObject *pPortal = me->GetMap()->GetGameObject(PortalsGUID[i]))
pPortal->ResetDoorOrButton();
}
DoCast(me, SPELL_KELTHUZAD_CHANNEL, false);
@@ -406,7 +406,7 @@ struct boss_kelthuzadAI : public BossAI
events.PopEvent();
break;
case EVENT_TRIGGER:
- if (GameObject *pKTTrigger = m_creature->GetMap()->GetGameObject(KTTriggerGUID))
+ if (GameObject *pKTTrigger = me->GetMap()->GetGameObject(KTTriggerGUID))
pKTTrigger->SetPhaseMask(2, true);
events.PopEvent();
break;
@@ -441,14 +441,14 @@ struct boss_kelthuzadAI : public BossAI
if (HealthBelowPct(45))
{
Phase = 3 ;
- DoScriptText(SAY_REQUEST_AID, m_creature);
+ DoScriptText(SAY_REQUEST_AID, me);
//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);
+ DoScriptText(SAY_ANSWER_REQUEST, me);
for (uint8 i = 0; i <= 3; ++i)
{
- if (GameObject *pPortal = m_creature->GetMap()->GetGameObject(PortalsGUID[i]))
+ if (GameObject *pPortal = me->GetMap()->GetGameObject(PortalsGUID[i]))
{
if (pPortal->getLootState() == GO_READY)
pPortal->UseDoorOrButton();
@@ -529,7 +529,7 @@ struct boss_kelthuzadAI : public BossAI
if (urand(0,1))
player->CastSpell(pTarget, SPELL_MOONFIRE, false);
else
- player->CastSpell(m_creature, SPELL_LIFEBLOOM, false);
+ player->CastSpell(me, SPELL_LIFEBLOOM, false);
break;
case CLASS_HUNTER:
player->CastSpell(pTarget, RAND(SPELL_MULTI_SHOT, SPELL_VOLLEY), false);
@@ -547,19 +547,19 @@ struct boss_kelthuzadAI : public BossAI
if (urand(0,1))
player->CastSpell(pTarget, SPELL_HAMMER_OF_JUSTICE, false);
else
- player->CastSpell(m_creature, SPELL_HOLY_SHOCK, false);
+ player->CastSpell(me, SPELL_HOLY_SHOCK, false);
break;
case CLASS_PRIEST:
if (urand(0,1))
player->CastSpell(pTarget, SPELL_VAMPIRIC_TOUCH, false);
else
- player->CastSpell(m_creature, SPELL_RENEW, false);
+ player->CastSpell(me, SPELL_RENEW, false);
break;
case CLASS_SHAMAN:
if (urand(0,1))
player->CastSpell(pTarget, SPELL_EARTH_SHOCK, false);
else
- player->CastSpell(m_creature, SPELL_HEALING_WAVE, false);
+ player->CastSpell(me, SPELL_HEALING_WAVE, false);
break;
case CLASS_ROGUE:
player->CastSpell(pTarget, RAND(SPELL_HEMORRHAGE, SPELL_MUTILATE), false);
@@ -615,7 +615,7 @@ struct boss_kelthuzadAI : public BossAI
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, RAID_MODE(1,0), 0, true))
DoCast(pTarget, SPELL_FROST_BLAST);
if (rand()%2)
- DoScriptText(SAY_FROST_BLAST, m_creature);
+ DoScriptText(SAY_FROST_BLAST, me);
events.RepeatEvent(urand(30000,90000));
break;
default:
diff --git a/src/scripts/northrend/naxxramas/boss_patchwerk.cpp b/src/scripts/northrend/naxxramas/boss_patchwerk.cpp
index 436af04438d..060cc23bfc2 100644
--- a/src/scripts/northrend/naxxramas/boss_patchwerk.cpp
+++ b/src/scripts/northrend/naxxramas/boss_patchwerk.cpp
@@ -71,7 +71,7 @@ struct boss_patchwerkAI : public BossAI
AchievementEntry const *AchievMakeQuickWerkOfHim = GetAchievementStore()->LookupEntry(ACHIEVEMENT_MAKE_QUICK_WERK_OF_HIM);
if (AchievMakeQuickWerkOfHim)
{
- Map *pMap = m_creature->GetMap();
+ Map *pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -129,12 +129,12 @@ struct boss_patchwerkAI : public BossAI
break;
}
case EVENT_BERSERK:
- DoCast(m_creature, SPELL_BERSERK, true);
- DoScriptText(EMOTE_BERSERK, m_creature);
+ DoCast(me, SPELL_BERSERK, true);
+ DoScriptText(EMOTE_BERSERK, me);
events.ScheduleEvent(EVENT_SLIME, 2000);
break;
case EVENT_SLIME:
- DoCast(m_creature->getVictim(), SPELL_SLIME_BOLT);
+ DoCast(me->getVictim(), SPELL_SLIME_BOLT);
events.ScheduleEvent(EVENT_SLIME, 2000);
break;
}
@@ -142,8 +142,8 @@ struct boss_patchwerkAI : public BossAI
if (!Enraged && HealthBelowPct(5))
{
- DoCast(m_creature, SPELL_FRENZY, true);
- DoScriptText(EMOTE_ENRAGE, m_creature);
+ DoCast(me, SPELL_FRENZY, true);
+ DoScriptText(EMOTE_ENRAGE, me);
Enraged = true;
}
diff --git a/src/scripts/northrend/naxxramas/boss_razuvious.cpp b/src/scripts/northrend/naxxramas/boss_razuvious.cpp
index 8c82ab82726..e7eb05c1ccc 100644
--- a/src/scripts/northrend/naxxramas/boss_razuvious.cpp
+++ b/src/scripts/northrend/naxxramas/boss_razuvious.cpp
@@ -82,7 +82,7 @@ struct boss_razuviousAI : public BossAI
void EnterCombat(Unit *who)
{
_EnterCombat();
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoPlaySoundToSet(me, SOUND_AGGRO);
events.ScheduleEvent(EVENT_STRIKE, 30000);
events.ScheduleEvent(EVENT_SHOUT, 25000);
events.ScheduleEvent(EVENT_COMMAND, 40000);
diff --git a/src/scripts/northrend/naxxramas/boss_sapphiron.cpp b/src/scripts/northrend/naxxramas/boss_sapphiron.cpp
index eba60190492..be5f3ac1d80 100644
--- a/src/scripts/northrend/naxxramas/boss_sapphiron.cpp
+++ b/src/scripts/northrend/naxxramas/boss_sapphiron.cpp
@@ -75,7 +75,7 @@ struct boss_sapphironAI : public BossAI
boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON)
, phase(PHASE_NULL)
{
- pMap = m_creature->GetMap();
+ pMap = me->GetMap();
}
Phases phase;
@@ -238,7 +238,7 @@ struct boss_sapphironAI : public BossAI
switch(eventId)
{
case EVENT_BERSERK:
- DoScriptText(EMOTE_ENRAGE, m_creature);
+ DoScriptText(EMOTE_ENRAGE, me);
DoCast(me, SPELL_BERSERK);
return;
case EVENT_CLEAVE:
diff --git a/src/scripts/northrend/naxxramas/boss_thaddius.cpp b/src/scripts/northrend/naxxramas/boss_thaddius.cpp
index 7d3f9d0a615..bd13aaba5fd 100644
--- a/src/scripts/northrend/naxxramas/boss_thaddius.cpp
+++ b/src/scripts/northrend/naxxramas/boss_thaddius.cpp
@@ -105,11 +105,11 @@ struct boss_thaddiusAI : public BossAI
// Moreover, the adds may not yet be spawn. So just track down the status if mob is spawn
// and each mob will send its status at reset (meaning that it is alive)
checkFeugenAlive = false;
- if (Creature *pFeugen = m_creature->GetCreature(*m_creature, instance->GetData64(DATA_FEUGEN)))
+ if (Creature *pFeugen = me->GetCreature(*me, instance->GetData64(DATA_FEUGEN)))
checkFeugenAlive = pFeugen->isAlive();
checkStalaggAlive = false;
- if (Creature *pStalagg = m_creature->GetCreature(*m_creature, instance->GetData64(DATA_STALAGG)))
+ if (Creature *pStalagg = me->GetCreature(*me, instance->GetData64(DATA_STALAGG)))
checkStalaggAlive = pStalagg->isAlive();
if (!checkFeugenAlive && !checkStalaggAlive)
@@ -198,13 +198,13 @@ struct boss_thaddiusAI : public BossAI
if (!checkStalaggAlive)
{
if (instance)
- if (Creature *pStalagg = m_creature->GetCreature(*m_creature, instance->GetData64(DATA_STALAGG)))
+ if (Creature *pStalagg = me->GetCreature(*me, instance->GetData64(DATA_STALAGG)))
pStalagg->Respawn();
}
else
{
if (instance)
- if (Creature *pFeugen = m_creature->GetCreature(*m_creature, instance->GetData64(DATA_FEUGEN)))
+ if (Creature *pFeugen = me->GetCreature(*me, instance->GetData64(DATA_FEUGEN)))
pFeugen->Respawn();
}
}
@@ -263,7 +263,7 @@ struct mob_stalaggAI : public ScriptedAI
void Reset()
{
if (pInstance)
- if (Creature *pThaddius = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_THADDIUS)))
+ if (Creature *pThaddius = me->GetCreature(*me, pInstance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_STALAGG_RESET);
powerSurgeTimer = urand(20000,25000);
@@ -278,7 +278,7 @@ struct mob_stalaggAI : public ScriptedAI
void JustDied(Unit *killer)
{
if (pInstance)
- if (Creature *pThaddius = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_THADDIUS)))
+ if (Creature *pThaddius = me->GetCreature(*me, pInstance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_STALAGG_DIED);
}
@@ -290,9 +290,9 @@ struct mob_stalaggAI : public ScriptedAI
if (magneticPullTimer <= uiDiff)
{
- if (Creature *pFeugen = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_FEUGEN)))
+ if (Creature *pFeugen = me->GetCreature(*me, pInstance->GetData64(DATA_FEUGEN)))
{
- Unit* pStalaggVictim = m_creature->getVictim();
+ Unit* pStalaggVictim = me->getVictim();
Unit* pFeugenVictim = pFeugen->getVictim();
if (pFeugenVictim && pStalaggVictim)
@@ -301,9 +301,9 @@ struct mob_stalaggAI : public ScriptedAI
// reset aggro to be sure that feugen will not follow the jump
pFeugen->getThreatManager().modifyThreatPercent(pFeugenVictim, -100);
- pFeugenVictim->JumpTo(m_creature, 0.3f);
+ pFeugenVictim->JumpTo(me, 0.3f);
- m_creature->getThreatManager().modifyThreatPercent(pStalaggVictim, -100);
+ me->getThreatManager().modifyThreatPercent(pStalaggVictim, -100);
pStalaggVictim->JumpTo(pFeugen, 0.3f);
}
}
@@ -314,7 +314,7 @@ struct mob_stalaggAI : public ScriptedAI
if (powerSurgeTimer <= uiDiff)
{
- DoCast(m_creature, RAID_MODE(SPELL_POWERSURGE, H_SPELL_POWERSURGE));
+ DoCast(me, RAID_MODE(SPELL_POWERSURGE, H_SPELL_POWERSURGE));
powerSurgeTimer = urand(15000,20000);
} else powerSurgeTimer -= uiDiff;
@@ -341,7 +341,7 @@ struct mob_feugenAI : public ScriptedAI
void Reset()
{
if (pInstance)
- if (Creature *pThaddius = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_THADDIUS)))
+ if (Creature *pThaddius = me->GetCreature(*me, pInstance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_FEUGEN_RESET);
staticFieldTimer = 5000;
@@ -355,7 +355,7 @@ struct mob_feugenAI : public ScriptedAI
void JustDied(Unit *killer)
{
if (pInstance)
- if (Creature *pThaddius = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_THADDIUS)))
+ if (Creature *pThaddius = me->GetCreature(*me, pInstance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_FEUGEN_DIED);
}
@@ -367,7 +367,7 @@ struct mob_feugenAI : public ScriptedAI
if (staticFieldTimer <= uiDiff)
{
- DoCast(m_creature, RAID_MODE(SPELL_STATICFIELD, H_SPELL_STATICFIELD));
+ DoCast(me, RAID_MODE(SPELL_STATICFIELD, H_SPELL_STATICFIELD));
staticFieldTimer = 5000;
} else staticFieldTimer -= uiDiff;
diff --git a/src/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp b/src/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp
index dc7a3c71a5c..81b9b02701f 100644
--- a/src/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp
+++ b/src/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp
@@ -98,11 +98,11 @@ struct boss_malygosAI : public ScriptedAI
void EnterCombat(Unit* who)
{
if (phase == 1)
- DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ DoScriptText(SAY_PHASE1_AGGRO, me);
if (phase == 2)
- DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ DoScriptText(SAY_PHASE1_AGGRO, me);
if (phase == 3)
- DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ DoScriptText(SAY_PHASE1_AGGRO, me);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
@@ -113,7 +113,7 @@ struct boss_malygosAI : public ScriptedAI
if (!UpdateVictim())
return;
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 50){
phase = 2;
//spawn adds
//set malygos unatackable untill all adds spawned dead
@@ -124,19 +124,19 @@ struct boss_malygosAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
if (phase == 1)
- DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), me);
if (phase == 2)
- DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), me);
if (phase == 3)
- DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), me);
}
};
diff --git a/src/scripts/northrend/nexus/nexus/boss_anomalus.cpp b/src/scripts/northrend/nexus/nexus/boss_anomalus.cpp
index 837d0fde41b..5f936ac0374 100644
--- a/src/scripts/northrend/nexus/nexus/boss_anomalus.cpp
+++ b/src/scripts/northrend/nexus/nexus/boss_anomalus.cpp
@@ -88,7 +88,7 @@ struct boss_anomalusAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
@@ -96,7 +96,7 @@ struct boss_anomalusAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -111,21 +111,21 @@ struct boss_anomalusAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->GetDistance(m_creature->GetHomePosition()) > 60.0f)
+ if (me->GetDistance(me->GetHomePosition()) > 60.0f)
{
//Not blizzlike, hack to avoid an exploit
EnterEvadeMode();
return;
}
- if (m_creature->HasAura(SPELL_RIFT_SHIELD))
+ if (me->HasAura(SPELL_RIFT_SHIELD))
{
if (uiChaoticRiftGUID)
{
- Unit* Rift = Unit::GetUnit((*m_creature), uiChaoticRiftGUID);
+ Unit* Rift = Unit::GetUnit((*me), uiChaoticRiftGUID);
if (Rift && Rift->isDead())
{
- m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
+ me->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
uiChaoticRiftGUID = 0;
}
return;
@@ -136,16 +136,16 @@ struct boss_anomalusAI : public ScriptedAI
if ((Phase == 0) && HealthBelowPct(50))
{
Phase = 1;
- DoScriptText(SAY_SHIELD, m_creature);
- DoCast(m_creature, SPELL_RIFT_SHIELD);
- Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
+ DoScriptText(SAY_SHIELD, me);
+ DoCast(me, SPELL_RIFT_SHIELD);
+ Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget);
uiChaoticRiftGUID = Rift->GetGUID();
- DoScriptText(SAY_RIFT , m_creature);
+ DoScriptText(SAY_RIFT , me);
}
}
@@ -189,15 +189,15 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
{
uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS;
uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
- //m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
+ //me->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
//Model for ally (1126) does not show auras. Horde model works perfect.
//Set model to horde number
- DoCast(m_creature, SPELL_ARCANEFORM, false);
+ DoCast(me, SPELL_ARCANEFORM, false);
}
void JustDied(Unit *killer)
{
- if (Creature* pAnomalus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0))
+ if (Creature* pAnomalus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0))
CAST_AI(boss_anomalusAI,pAnomalus->AI())->bDeadChaoticRift = true;
}
@@ -208,7 +208,7 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
if (uiChaoticEnergyBurstTimer <= diff)
{
- Unit* pAnomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
+ Unit* pAnomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD))
DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
@@ -219,11 +219,11 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
if (uiSummonCrazedManaWraithTimer <= diff)
{
- Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
+ Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
if (Wraith)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Wraith->AI()->AttackStart(pTarget);
- Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
+ Unit* Anomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
else
diff --git a/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp
index d907f8f8d6e..10ccc80035c 100644
--- a/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp
+++ b/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp
@@ -78,7 +78,7 @@ struct boss_keristraszaAI : public ScriptedAI
uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
bMoreThanTwoIntenseCold = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
RemovePrison(CheckContainmentSpheres());
@@ -88,7 +88,7 @@ struct boss_keristraszaAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoCastAOE(SPELL_INTENSE_COLD);
if (pInstance)
@@ -97,7 +97,7 @@ struct boss_keristraszaAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -109,7 +109,7 @@ struct boss_keristraszaAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_SLAY, m_creature);
+ DoScriptText(SAY_SLAY, me);
}
bool CheckContainmentSpheres(bool remove_prison = false)
@@ -140,16 +140,16 @@ struct boss_keristraszaAI : public ScriptedAI
{
if (remove)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (m_creature->HasAura(SPELL_FROZEN_PRISON))
- m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (me->HasAura(SPELL_FROZEN_PRISON))
+ me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
}
else
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature, SPELL_FROZEN_PRISON, false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(me, SPELL_FROZEN_PRISON, false);
}
}
@@ -160,10 +160,10 @@ struct boss_keristraszaAI : public ScriptedAI
if (uiCheckIntenseColdTimer < diff && !bMoreThanTwoIntenseCold)
{
- std::list<HostileReference*> ThreatList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER)
continue;
@@ -179,28 +179,28 @@ struct boss_keristraszaAI : public ScriptedAI
if (!bEnrage && HealthBelowPct(25))
{
- DoScriptText(SAY_ENRAGE, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ DoScriptText(SAY_ENRAGE, me);
+ DoCast(me, SPELL_ENRAGE);
bEnrage = true;
}
if (uiCrystalfireBreathTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CRYSTALFIRE_BREATH);
+ DoCast(me->getVictim(), SPELL_CRYSTALFIRE_BREATH);
uiCrystalfireBreathTimer = 14*IN_MILISECONDS;
} else uiCrystalfireBreathTimer -= diff;
if (uiTailSweepTimer <= diff)
{
- DoCast(m_creature, SPELL_TAIL_SWEEP);
+ DoCast(me, SPELL_TAIL_SWEEP);
uiTailSweepTimer = 5*IN_MILISECONDS;
} else uiTailSweepTimer -= diff;
if (uiCrystalChainsCrystalizeTimer <= diff)
{
- DoScriptText(SAY_CRYSTAL_NOVA, m_creature);
+ DoScriptText(SAY_CRYSTAL_NOVA, me);
if (IsHeroic())
- DoCast(m_creature, SPELL_CRYSTALIZE);
+ DoCast(me, SPELL_CRYSTALIZE);
else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CRYSTAL_CHAINS);
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS);
diff --git a/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp b/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp
index 661deb1d73d..7441087382d 100644
--- a/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp
+++ b/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp
@@ -102,8 +102,8 @@ struct boss_magus_telestraAI : public ScriptedAI
bIsAchievementTimerRunning = false;
bIsWaitingToAppear = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
@@ -111,7 +111,7 @@ struct boss_magus_telestraAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS);
@@ -119,7 +119,7 @@ struct boss_magus_telestraAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -131,12 +131,12 @@ struct boss_magus_telestraAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
uint64 SplitPersonality(uint32 entry)
{
- if (Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS))
+ if (Creature* Summoned = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS))
{
switch (entry)
{
@@ -193,11 +193,11 @@ struct boss_magus_telestraAI : public ScriptedAI
if (bIsWaitingToAppear)
{
- m_creature->StopMoving();
- m_creature->AttackStop();
+ me->StopMoving();
+ me->AttackStop();
if (uiIsWaitingToAppearTimer <= diff)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
bIsWaitingToAppear = false;
} else uiIsWaitingToAppearTimer -= diff;
return;
@@ -211,10 +211,10 @@ struct boss_magus_telestraAI : public ScriptedAI
{
if (uiAchievementTimer <= ACHIEV_TIMER)
uiAchievementProgress +=1;
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
- DoCast(m_creature, SPELL_TELESTRA_BACK);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->GetMotionMaster()->Clear();
+ me->GetMap()->CreatureRelocation(me, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
+ DoCast(me, SPELL_TELESTRA_BACK);
+ me->SetVisibility(VISIBILITY_ON);
if (Phase == 1)
Phase = 2;
if (Phase == 3)
@@ -224,7 +224,7 @@ struct boss_magus_telestraAI : public ScriptedAI
uiArcaneMagusGUID = 0;
bIsWaitingToAppear = true;
uiIsWaitingToAppearTimer = 4*IN_MILISECONDS;
- DoScriptText(SAY_MERGE, m_creature);
+ DoScriptText(SAY_MERGE, me);
bIsAchievementTimerRunning = false;
uiAchievementTimer = 0;
}
@@ -235,34 +235,34 @@ struct boss_magus_telestraAI : public ScriptedAI
if ((Phase == 0) && HealthBelowPct(50))
{
Phase = 1;
- m_creature->CastStop();
- m_creature->RemoveAllAuras();
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->CastStop();
+ me->RemoveAllAuras();
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
bFireMagusDead = false;
bFrostMagusDead = false;
bArcaneMagusDead = false;
- DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
+ DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
return;
}
if (IsHeroic() && (Phase == 2) && HealthBelowPct(10))
{
Phase = 3;
- m_creature->CastStop();
- m_creature->RemoveAllAuras();
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->CastStop();
+ me->RemoveAllAuras();
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
bFireMagusDead = false;
bFrostMagusDead = false;
bArcaneMagusDead = false;
- DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
+ DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
return;
}
@@ -289,7 +289,7 @@ struct boss_magus_telestraAI : public ScriptedAI
if (uiGravityWellTimer <= diff)
{
- if (Unit *pTarget = m_creature->getVictim())
+ if (Unit *pTarget = me->getVictim())
{
DoCast(pTarget, SPELL_GRAVITY_WELL);
uiCooldown = 6*IN_MILISECONDS;
diff --git a/src/scripts/northrend/nexus/nexus/boss_ormorok.cpp b/src/scripts/northrend/nexus/nexus/boss_ormorok.cpp
index d62d9404886..aabf8eaa71d 100644
--- a/src/scripts/northrend/nexus/nexus/boss_ormorok.cpp
+++ b/src/scripts/northrend/nexus/nexus/boss_ormorok.cpp
@@ -88,7 +88,7 @@ struct boss_ormorokAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS);
@@ -96,7 +96,7 @@ struct boss_ormorokAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, DONE);
@@ -104,7 +104,7 @@ struct boss_ormorokAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -125,47 +125,47 @@ struct boss_ormorokAI : public ScriptedAI
fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
for (uint8 i = 0; i < 4; ++i)
- Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILISECONDS);
+ Creature* Spike = me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILISECONDS);
if (++uiCrystalSpikesCount >= 13)
bCrystalSpikes = false;
uiCrystalSpikesTimer2 = 200;
} else uiCrystalSpikesTimer2 -= diff;
- if (!bFrenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
+ if (!bFrenzy && (me->GetHealth() < me->GetMaxHealth() * 0.25))
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
bFrenzy = true;
}
if (uiTrampleTimer <= diff)
{
- DoCast(m_creature, SPELL_TRAMPLE);
+ DoCast(me, SPELL_TRAMPLE);
uiTrampleTimer = 10*IN_MILISECONDS;
} else uiTrampleTimer -= diff;
if (uiSpellReflectionTimer <= diff)
{
- DoScriptText(SAY_REFLECT, m_creature);
- DoCast(m_creature, SPELL_SPELL_REFLECTION);
+ DoScriptText(SAY_REFLECT, me);
+ DoCast(me, SPELL_SPELL_REFLECTION);
uiSpellReflectionTimer = 30*IN_MILISECONDS;
} else uiSpellReflectionTimer -= diff;
if (uiCrystalSpikesTimer <= diff)
{
- DoScriptText(SAY_CRYSTAL_SPIKES, m_creature);
+ DoScriptText(SAY_CRYSTAL_SPIKES, me);
bCrystalSpikes = true;
uiCrystalSpikesCount = 1;
uiCrystalSpikesTimer2 = 0;
- fBaseX = m_creature->GetPositionX();
- fBaseY = m_creature->GetPositionY();
- fBaseZ = m_creature->GetPositionZ();
- fBaseO = m_creature->GetOrientation();
+ fBaseX = me->GetPositionX();
+ fBaseY = me->GetPositionY();
+ fBaseZ = me->GetPositionZ();
+ fBaseO = me->GetOrientation();
uiCrystalSpikesTimer = 20*IN_MILISECONDS;
} else uiCrystalSpikesTimer -= diff;
if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff))
{
- Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
+ Creature* Crystalline_Tangler = me->SummonCreature(MOB_CRYSTALLINE_TANGLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Crystalline_Tangler)
{
Unit *pTarget = NULL;
@@ -179,10 +179,10 @@ struct boss_ormorokAI : public ScriptedAI
case 3: Healer = CLASS_DRUID; break;
case 4: Healer = CLASS_SHAMAN; break;
}
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
+ for (; i != me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ Unit* pTemp = Unit::GetUnit((*me),(*i)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer)
{
pTarget = pTemp;
@@ -226,13 +226,13 @@ struct mob_crystal_spikeAI : public Scripted_NoMovementAI
{
if (SpellCrystalSpikePrevisualTimer <= diff)
{
- DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL);
+ DoCast(me, SPELL_CRYSTAL_SPIKE_PREVISUAL);
SpellCrystalSpikePrevisualTimer = 10*IN_MILISECONDS;
} else SpellCrystalSpikePrevisualTimer -= diff;
if (SpellCrystalSpikeDamageTimer <= diff)
{
- DoCast(m_creature, SPELL_CRYSTALL_SPIKE_DAMAGE);
+ DoCast(me, SPELL_CRYSTALL_SPIKE_DAMAGE);
SpellCrystalSpikeDamageTimer = 10*IN_MILISECONDS;
} else SpellCrystalSpikeDamageTimer -= diff;
}
@@ -253,9 +253,9 @@ struct mob_crystalline_tanglerAI : public ScriptedAI
{
if (uiRootsTimer <= diff)
{
- if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false))
+ if (me->IsWithinDist(me->getVictim(), 5.0f, false))
{
- DoCast(m_creature->getVictim(), SPELL_ROOTS);
+ DoCast(me->getVictim(), SPELL_ROOTS);
uiRootsTimer = 15*IN_MILISECONDS;
}
} else uiRootsTimer -= diff;
diff --git a/src/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp b/src/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp
index 06267061322..8dacef04c91 100644
--- a/src/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp
+++ b/src/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp
@@ -30,7 +30,7 @@ struct boss_commander_stoutbeardAI : public ScriptedAI
void Reset() {}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
@@ -44,7 +44,7 @@ struct boss_commander_stoutbeardAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
};
diff --git a/src/scripts/northrend/nexus/oculus/boss_drakos.cpp b/src/scripts/northrend/nexus/oculus/boss_drakos.cpp
index 4521782a883..f4826702b5c 100644
--- a/src/scripts/northrend/nexus/oculus/boss_drakos.cpp
+++ b/src/scripts/northrend/nexus/oculus/boss_drakos.cpp
@@ -76,7 +76,7 @@ struct boss_drakosAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_DRAKOS_EVENT, IN_PROGRESS);
@@ -96,11 +96,11 @@ struct boss_drakosAI : public ScriptedAI
{
if (bPostPull)
{
- m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
else
- m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
uiBombSummonTimer = 2*IN_MILISECONDS;
} else uiBombSummonTimer -= diff;
@@ -121,7 +121,7 @@ struct boss_drakosAI : public ScriptedAI
}
else
{
- DoScriptText(RAND(SAY_PULL_1,SAY_PULL_2,SAY_PULL_3,SAY_PULL_4), m_creature);
+ DoScriptText(RAND(SAY_PULL_1,SAY_PULL_2,SAY_PULL_3,SAY_PULL_4), me);
DoCast(SPELL_MAGIC_PULL);
uiMagicPullTimer = 2*IN_MILISECONDS;
bIsPulling = true;
@@ -137,7 +137,7 @@ struct boss_drakosAI : public ScriptedAI
if (uiStompTimer < diff)
{
- DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2,SAY_STOMP_3), m_creature);
+ DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2,SAY_STOMP_3), me);
DoCast(SPELL_THUNDERING_STOMP);
uiStompTimer = urand(15*IN_MILISECONDS, 18*IN_MILISECONDS);
} else uiStompTimer -= diff ;
@@ -146,14 +146,14 @@ struct boss_drakosAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_DRAKOS_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
}
};
@@ -171,12 +171,12 @@ struct npc_unstable_sphereAI : public ScriptedAI
void Reset()
{
- m_creature->SetReactState(REACT_PASSIVE) ;
- m_creature->GetMotionMaster()->MoveRandom(40.0f);
- m_creature->SetSpeed(MOVE_RUN, 2, true);
- m_creature->setFaction(14);
- m_creature->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, m_creature);
- m_creature->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, m_creature);
+ me->SetReactState(REACT_PASSIVE) ;
+ me->GetMotionMaster()->MoveRandom(40.0f);
+ me->SetSpeed(MOVE_RUN, 2, true);
+ me->setFaction(14);
+ me->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, me);
+ me->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, me);
uiPulseTimer = 3*IN_MILISECONDS;
uiDeathTimer = 19*IN_MILISECONDS;
}
@@ -190,7 +190,7 @@ struct npc_unstable_sphereAI : public ScriptedAI
} else uiPulseTimer -= diff;
if (uiDeathTimer < diff)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else uiDeathTimer -= diff;
}
};
diff --git a/src/scripts/northrend/nexus/oculus/boss_urom.cpp b/src/scripts/northrend/nexus/oculus/boss_urom.cpp
index 6b312232bc9..0c9e85f7641 100644
--- a/src/scripts/northrend/nexus/oculus/boss_urom.cpp
+++ b/src/scripts/northrend/nexus/oculus/boss_urom.cpp
@@ -61,7 +61,7 @@ struct boss_uromAI : public ScriptedAI
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_UROM_EVENT, IN_PROGRESS);
@@ -79,16 +79,16 @@ struct boss_uromAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_UROM_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
}
};
diff --git a/src/scripts/northrend/nexus/oculus/boss_varos.cpp b/src/scripts/northrend/nexus/oculus/boss_varos.cpp
index fb640040d43..cd1132a030b 100644
--- a/src/scripts/northrend/nexus/oculus/boss_varos.cpp
+++ b/src/scripts/northrend/nexus/oculus/boss_varos.cpp
@@ -59,7 +59,7 @@ struct boss_varosAI : public ScriptedAI
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VAROS_EVENT, IN_PROGRESS);
@@ -76,16 +76,16 @@ struct boss_varosAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_VAROS_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
};
diff --git a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
index fc469ea0f95..dff310ccb7b 100644
--- a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
+++ b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
@@ -258,10 +258,10 @@ struct boss_sartharionAI : public ScriptedAI
m_bHasCalledShadron = false;
m_bHasCalledVesperon = false;
- if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE))
- m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE);
+ if (me->HasAura(SPELL_TWILIGHT_REVENGE))
+ me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE);
- m_creature->ResetLootMode();
+ me->ResetLootMode();
achievProgress = 0;
}
@@ -274,7 +274,7 @@ struct boss_sartharionAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_SARTHARION_AGGRO,m_creature);
+ DoScriptText(SAY_SARTHARION_AGGRO,me);
DoZoneInCombat();
if (pInstance)
@@ -286,7 +286,7 @@ struct boss_sartharionAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_SARTHARION_DEATH,m_creature);
+ DoScriptText(SAY_SARTHARION_DEATH,me);
if (pInstance)
{
@@ -303,28 +303,28 @@ struct boss_sartharionAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SARTHARION_SLAY_1,SAY_SARTHARION_SLAY_2,SAY_SARTHARION_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SARTHARION_SLAY_1,SAY_SARTHARION_SLAY_2,SAY_SARTHARION_SLAY_3), me);
}
- // m_creature->ResetLootMode() is called from Reset()
+ // me->ResetLootMode() is called from Reset()
// AddDrakeLootMode() should only ever be called from FetchDragons(), which is called from Aggro()
void AddDrakeLootMode()
{
- if (m_creature->HasLootMode(LOOT_MODE_HARD_MODE_2)) // Has two Drake loot modes
- m_creature->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode
- else if (m_creature->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode
- m_creature->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode
+ if (me->HasLootMode(LOOT_MODE_HARD_MODE_2)) // Has two Drake loot modes
+ me->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode
+ else if (me->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode
+ me->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode
else // Has no Drake loot modes
- m_creature->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
+ me->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
}
void FetchDragons()
{
if (!pInstance)
return;
- Creature* pFetchTene = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_TENEBRON));
- Creature* pFetchShad = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON));
- Creature* pFetchVesp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_VESPERON));
+ Creature* pFetchTene = Unit::GetCreature(*me, pInstance->GetData64(DATA_TENEBRON));
+ Creature* pFetchShad = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON));
+ Creature* pFetchVesp = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON));
//if at least one of the dragons are alive and are being called
bool bCanUseWill = false;
@@ -357,14 +357,14 @@ struct boss_sartharionAI : public ScriptedAI
}
if (bCanUseWill)
- DoCast(m_creature, SPELL_WILL_OF_SARTHARION);
+ DoCast(me, SPELL_WILL_OF_SARTHARION);
}
void CallDragon(uint32 uiDataId)
{
if (pInstance)
{
- if (Creature *pTemp = Unit::GetCreature(*m_creature,pInstance->GetData64(uiDataId)))
+ if (Creature *pTemp = Unit::GetCreature(*me,pInstance->GetData64(uiDataId)))
{
if (pTemp->isAlive() && !pTemp->getVictim())
{
@@ -395,7 +395,7 @@ struct boss_sartharionAI : public ScriptedAI
break;
}
- DoScriptText(iTextId, m_creature);
+ DoScriptText(iTextId, me);
}
}
}
@@ -403,7 +403,7 @@ struct boss_sartharionAI : public ScriptedAI
void SendFlameTsunami()
{
- if (Map* pMap = m_creature->GetMap())
+ if (Map* pMap = me->GetMap())
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -411,7 +411,7 @@ struct boss_sartharionAI : public ScriptedAI
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->getSource() && i->getSource()->isAlive())
- DoScriptText(WHISPER_LAVA_CHURN, m_creature, i->getSource());
+ DoScriptText(WHISPER_LAVA_CHURN, me, i->getSource());
}
}
@@ -421,21 +421,21 @@ struct boss_sartharionAI : public ScriptedAI
if (!UpdateVictim())
return;
- Unit* pTene = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_TENEBRON) : 0);
- Unit* pShad = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_SHADRON) : 0);
- Unit* pVesp = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_VESPERON) : 0);
+ Unit* pTene = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_TENEBRON) : 0);
+ Unit* pShad = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_SHADRON) : 0);
+ Unit* pVesp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_VESPERON) : 0);
//spell will target dragons, if they are still alive at 35%
- if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35
+ if (!m_bIsBerserk && (me->GetHealth()*100 / me->GetMaxHealth()) <= 35
&& ((pTene && pTene->isAlive()) || (pShad && pShad->isAlive()) || (pVesp && pVesp->isAlive())))
{
- DoScriptText(SAY_SARTHARION_BERSERK, m_creature);
- DoCast(m_creature, SPELL_BERSERK);
+ DoScriptText(SAY_SARTHARION_BERSERK, me);
+ DoCast(me, SPELL_BERSERK);
m_bIsBerserk = true;
}
//soft enrage
- if (!m_bIsSoftEnraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10)
+ if (!m_bIsSoftEnraged && (me->GetHealth()*100 / me->GetMaxHealth()) <= 10)
{
// TODO
m_bIsSoftEnraged = true;
@@ -446,7 +446,7 @@ struct boss_sartharionAI : public ScriptedAI
{
if (m_uiEnrageTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_PYROBUFFET, true);
+ DoCast(me, SPELL_PYROBUFFET, true);
m_bIsHardEnraged = true;
}
else
@@ -461,17 +461,17 @@ struct boss_sartharionAI : public ScriptedAI
{
case 0:
{
- if (Creature *Right1 = m_creature->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y , FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
+ if (Creature *Right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y , FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
Right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction.x, FlameRight1Direction.y, FlameRight1Direction.z);
- if (Creature *Right2 = m_creature->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y , FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
+ if (Creature *Right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y , FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
Right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction.x, FlameRight2Direction.y, FlameRight2Direction.z);
break;
}
case 1:
{
- if (Creature *Left1 = m_creature->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y , FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
+ if (Creature *Left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y , FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
Left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction.x, FlameLeft1Direction.y, FlameLeft1Direction.z);
- if (Creature *Left2 = m_creature->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y , FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
+ if (Creature *Left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y , FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000))
Left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction.x, FlameLeft2Direction.y, FlameLeft2Direction.z);
break;
}
@@ -485,8 +485,8 @@ struct boss_sartharionAI : public ScriptedAI
// flame breath
if (m_uiFlameBreathTimer <= uiDiff)
{
- DoScriptText(SAY_SARTHARION_BREATH, m_creature);
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_FLAME_BREATH, SPELL_FLAME_BREATH_H));
+ DoScriptText(SAY_SARTHARION_BREATH, me);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_FLAME_BREATH, SPELL_FLAME_BREATH_H));
m_uiFlameBreathTimer = urand(25000,35000);
}
else
@@ -495,7 +495,7 @@ struct boss_sartharionAI : public ScriptedAI
// Tail Sweep
if (m_uiTailSweepTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_TAIL_LASH, SPELL_TAIL_LASH_H));
+ DoCast(me->getVictim(), RAID_MODE(SPELL_TAIL_LASH, SPELL_TAIL_LASH_H));
m_uiTailSweepTimer = urand(15000,20000);
}
else
@@ -504,7 +504,7 @@ struct boss_sartharionAI : public ScriptedAI
// Cleave
if (m_uiCleaveTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleaveTimer = urand(7000,10000);
}
else
@@ -518,7 +518,7 @@ struct boss_sartharionAI : public ScriptedAI
DoCast(pTarget, SPELL_LAVA_STRIKE);
if (urand(0,4) == 4)
- DoScriptText(RAND(SAY_SARTHARION_SPECIAL_1,SAY_SARTHARION_SPECIAL_2,SAY_SARTHARION_SPECIAL_3), m_creature);
+ DoScriptText(RAND(SAY_SARTHARION_SPECIAL_1,SAY_SARTHARION_SPECIAL_2,SAY_SARTHARION_SPECIAL_3), me);
}
m_uiLavaStrikeTimer = urand(5000,20000);
}
@@ -616,10 +616,10 @@ struct dummy_dragonAI : public ScriptedAI
void Reset()
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (GameObject* TwilightPortal = GameObject::GetGameObject((*m_creature), pInstance->GetData64(GO_TWILIGHT_PORTAL)))
+ if (GameObject* TwilightPortal = GameObject::GetGameObject((*me), pInstance->GetData64(GO_TWILIGHT_PORTAL)))
TwilightPortal->SetGoState(GO_STATE_READY);
m_uiWaypointId = 0;
@@ -633,7 +633,7 @@ struct dummy_dragonAI : public ScriptedAI
if (!pInstance || uiType != POINT_MOTION_TYPE)
return;
- debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId);
+ debug_log("dummy_dragonAI: %s reached point %u", me->GetName(), uiPointId);
//if healers messed up the raid and we was already initialized
if (pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
@@ -645,7 +645,7 @@ struct dummy_dragonAI : public ScriptedAI
//this is end, if we reach this, don't do much
if (uiPointId == POINT_ID_LAND)
{
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
m_bCanMoveFree = false;
return;
}
@@ -671,7 +671,7 @@ struct dummy_dragonAI : public ScriptedAI
//used when open portal and spawn mobs in phase
void DoRaidWhisper(int32 iTextId)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
@@ -680,7 +680,7 @@ struct dummy_dragonAI : public ScriptedAI
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- DoScriptText(iTextId, m_creature, i->getSource());
+ DoScriptText(iTextId, me, i->getSource());
}
}
}
@@ -694,37 +694,37 @@ struct dummy_dragonAI : public ScriptedAI
//using a grid search here seem to be more efficient than caching all four guids
//in instance script and calculate range to each.
- GameObject* pPortal = m_creature->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f);
- if (GameObject* TwilightPortal = GameObject::GetGameObject((*m_creature), pInstance->GetData64(GO_TWILIGHT_PORTAL)))
+ GameObject* pPortal = me->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f);
+ if (GameObject* TwilightPortal = GameObject::GetGameObject((*me), pInstance->GetData64(GO_TWILIGHT_PORTAL)))
TwilightPortal->SetGoState(GO_STATE_ACTIVE);
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case NPC_TENEBRON:
{
iTextId = WHISPER_HATCH_EGGS;
if (pInstance && pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- m_creature->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[0].x, TwilightEggs[0].y, TwilightEggs[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[0].x, TwilightEggs[0].y, TwilightEggs[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
else
- m_creature->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggsSarth[0].x, TwilightEggsSarth[0].y, TwilightEggsSarth[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggsSarth[0].x, TwilightEggsSarth[0].y, TwilightEggsSarth[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
break;
}
case NPC_SHADRON:
{
iTextId = WHISPER_OPEN_PORTAL;
if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- m_creature->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y , AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y , AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
else
- m_creature->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y , AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y , AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
break;
}
case NPC_VESPERON:
{
if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- Creature* Acolyte = m_creature->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y , AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y , AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
else
- Creature* Acolyte = m_creature->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y , AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y , AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
iTextId = WHISPER_OPEN_PORTAL;
break;
@@ -747,7 +747,7 @@ struct dummy_dragonAI : public ScriptedAI
int32 iTextId = 0;
uint32 uiSpellId = 0;
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case NPC_TENEBRON:
iTextId = SAY_TENEBRON_DEATH;
@@ -763,9 +763,9 @@ struct dummy_dragonAI : public ScriptedAI
break;
}
- DoScriptText(iTextId, m_creature);
+ DoScriptText(iTextId, me);
- m_creature->RemoveOwnedAura(uiSpellId);
+ me->RemoveOwnedAura(uiSpellId);
if (pInstance)
{
@@ -774,7 +774,7 @@ struct dummy_dragonAI : public ScriptedAI
return;
// Twilight Revenge to main boss
- if (Unit* pSartharion = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SARTHARION)))
+ if (Unit* pSartharion = Unit::GetUnit((*me), pInstance->GetData64(DATA_SARTHARION)))
if (pSartharion->isAlive())
DoCast(pSartharion, SPELL_TWILIGHT_REVENGE, true);
}
@@ -787,10 +787,10 @@ struct dummy_dragonAI : public ScriptedAI
if (m_uiMoveNextTimer <= uiDiff)
{
if (m_uiWaypointId < MAX_WAYPOINT)
- m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId,
+ me->GetMotionMaster()->MovePoint(m_uiWaypointId,
m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ);
- debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId);
+ debug_log("dummy_dragonAI: %s moving to point %u", me->GetName(), m_uiWaypointId);
m_uiMoveNextTimer = 0;
}
else
@@ -820,14 +820,14 @@ struct mob_tenebronAI : public dummy_dragonAI
void Aggro(Unit* pWho)
{
- DoScriptText(SAY_TENEBRON_AGGRO, m_creature);
+ DoScriptText(SAY_TENEBRON_AGGRO, me);
DoZoneInCombat();
- DoCast(m_creature, SPELL_POWER_OF_TENEBRON);
+ DoCast(me, SPELL_POWER_OF_TENEBRON);
}
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_TENEBRON_SLAY_1,SAY_TENEBRON_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_TENEBRON_SLAY_1,SAY_TENEBRON_SLAY_2), me);
/*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
achievProgress = 1;*/
}
@@ -864,8 +864,8 @@ struct mob_tenebronAI : public dummy_dragonAI
// shadow breath
if (m_uiShadowBreathTimer <= uiDiff)
{
- DoScriptText(SAY_TENEBRON_BREATH, m_creature);
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
+ DoScriptText(SAY_TENEBRON_BREATH, me);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
m_uiShadowBreathTimer = urand(20000,25000);
}
else
@@ -898,23 +898,23 @@ struct mob_shadronAI : public dummy_dragonAI
m_uiShadowFissureTimer = 5000;
m_uiAcolyteShadronTimer = 60000;
- if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
- m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
+ if (me->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
+ me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
- if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
- m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
+ if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
+ me->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
}
void Aggro(Unit* pWho)
{
- DoScriptText(SAY_SHADRON_AGGRO,m_creature);
+ DoScriptText(SAY_SHADRON_AGGRO,me);
DoZoneInCombat();
- DoCast(m_creature, SPELL_POWER_OF_SHADRON);
+ DoCast(me, SPELL_POWER_OF_SHADRON);
}
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SHADRON_SLAY_1,SAY_SHADRON_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SHADRON_SLAY_1,SAY_SHADRON_SLAY_2), me);
/*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
achievProgress = 2;*/
}
@@ -942,7 +942,7 @@ struct mob_shadronAI : public dummy_dragonAI
// Portal Event
if (m_uiAcolyteShadronTimer <= uiDiff)
{
- if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
+ if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
return;
OpenPortal();
@@ -954,8 +954,8 @@ struct mob_shadronAI : public dummy_dragonAI
// shadow breath
if (m_uiShadowBreathTimer <= uiDiff)
{
- DoScriptText(SAY_SHADRON_BREATH, m_creature);
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
+ DoScriptText(SAY_SHADRON_BREATH, me);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
m_uiShadowBreathTimer = urand(20000,25000);
}
else
@@ -991,14 +991,14 @@ struct mob_vesperonAI : public dummy_dragonAI
void Aggro(Unit* pWho)
{
- DoScriptText(SAY_VESPERON_AGGRO,m_creature);
+ DoScriptText(SAY_VESPERON_AGGRO,me);
DoZoneInCombat();
- DoCast(m_creature, SPELL_POWER_OF_VESPERON);
+ DoCast(me, SPELL_POWER_OF_VESPERON);
}
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_VESPERON_SLAY_1,SAY_VESPERON_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_VESPERON_SLAY_1,SAY_VESPERON_SLAY_2), me);
/*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
achievProgress = 3;*/
}
@@ -1027,7 +1027,7 @@ struct mob_vesperonAI : public dummy_dragonAI
if (m_uiAcolyteVesperonTimer <= uiDiff)
{
OpenPortal();
- DoCast(m_creature->getVictim(), SPELL_TWILIGHT_TORMENT_VESP);
+ DoCast(me->getVictim(), SPELL_TWILIGHT_TORMENT_VESP);
m_uiAcolyteVesperonTimer = urand(60000,70000);
}
else
@@ -1036,8 +1036,8 @@ struct mob_vesperonAI : public dummy_dragonAI
// shadow breath
if (m_uiShadowBreathTimer <= uiDiff)
{
- DoScriptText(SAY_VESPERON_BREATH, m_creature);
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
+ DoScriptText(SAY_VESPERON_BREATH, me);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
m_uiShadowBreathTimer = urand(20000,25000);
}
else
@@ -1073,19 +1073,19 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI
{
Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true);
Creature* pShadron = NULL;
- Creature* pSartharion = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SARTHARION));
- if (Creature* pShadron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON)))
+ Creature* pSartharion = Unit::GetCreature(*me, pInstance->GetData64(DATA_SARTHARION));
+ if (Creature* pShadron = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)))
//if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT
if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- pSartharion->CastSpell(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR, true);
+ pSartharion->CastSpell(me, SPELL_GIFT_OF_TWILIGTH_SAR, true);
else
{
- pShadron->CastSpell(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA,true);
+ pShadron->CastSpell(me, SPELL_GIFT_OF_TWILIGTH_SHA,true);
pShadron->AddThreat(pTarget, 100.0f);
AttackStart(pShadron->getVictim());
}
}
- m_creature->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,m_creature);
+ me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me);
}
void JustDied(Unit* killer)
@@ -1093,7 +1093,7 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI
if (pInstance)
{
Creature* pDebuffTarget = NULL;
- Map *map = m_creature->GetMap();
+ Map *map = me->GetMap();
if (map->IsDungeon())
{
Map::PlayerList const &PlayerList = map->GetPlayers();
@@ -1116,14 +1116,14 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI
if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
{
//not solo fight, so main boss has deduff
- Creature* pDebuffTarget = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SARTHARION));
+ Creature* pDebuffTarget = Unit::GetCreature(*me, pInstance->GetData64(DATA_SARTHARION));
if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR))
pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR);
}
else
{
//event not in progress, then solo fight and must remove debuff mini-boss
- Creature* pDebuffTarget = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON));
+ Creature* pDebuffTarget = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON));
if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
}
@@ -1161,9 +1161,9 @@ struct mob_acolyte_of_vesperonAI : public ScriptedAI
{
if (pInstance)
{
- m_creature->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,m_creature);
+ me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me);
}
- DoCast(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO);
+ DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO);
}
void JustDied(Unit* pKiller)
@@ -1171,12 +1171,12 @@ struct mob_acolyte_of_vesperonAI : public ScriptedAI
// remove twilight torment on Vesperon
if (pInstance)
{
- Creature* pVesperon = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_VESPERON));
+ Creature* pVesperon = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON));
if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
- Map *map = m_creature->GetMap();
+ Map *map = me->GetMap();
if (map->IsDungeon())
{
Map::PlayerList const &PlayerList = map->GetPlayers();
@@ -1238,10 +1238,10 @@ struct mob_twilight_eggsAI : public Scripted_NoMovementAI
void SpawnWhelps()
{
if (!pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- m_creature->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ me->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
else
- m_creature->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- m_creature->DealDamage(m_creature, m_creature->GetHealth());
+ me->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ me->DealDamage(me, me->GetHealth());
}
void UpdateAI(const uint32 uiDiff)
{
@@ -1268,8 +1268,8 @@ struct npc_flame_tsunamiAI : public ScriptedAI
{
npc_flame_tsunamiAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- m_creature->HasAura(SPELL_FLAME_TSUNAMI_DMG_AURA);
- DoCast(m_creature, SPELL_FLAME_TSUNAMI);
+ me->HasAura(SPELL_FLAME_TSUNAMI_DMG_AURA);
+ DoCast(me, SPELL_FLAME_TSUNAMI);
}
uint32 Tsunami_Timer;
@@ -1277,14 +1277,14 @@ struct npc_flame_tsunamiAI : public ScriptedAI
void Reset()
{
Tsunami_Timer = 100;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void UpdateAI(const uint32 diff)
{
if (Tsunami_Timer <= diff)
{
- DoCast(m_creature, SPELL_FLAME_TSUNAMI_DMG_AURA);
+ DoCast(me, SPELL_FLAME_TSUNAMI_DMG_AURA);
Tsunami_Timer = 1000;
} else Tsunami_Timer -= diff;
}
@@ -1308,9 +1308,9 @@ struct npc_twilight_fissureAI : public Scripted_NoMovementAI
{
if (VoidBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H));
+ DoCast(me->getVictim(), RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H));
VoidBlast_Timer = 9000;
- m_creature->Kill(m_creature);
+ me->Kill(me);
} else VoidBlast_Timer -= diff;
}
};
@@ -1350,7 +1350,7 @@ struct mob_twilight_whelpAI : public ScriptedAI
// twilight torment
if (m_uiFadeArmorTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_FADE_ARMOR);
+ DoCast(me->getVictim(), SPELL_FADE_ARMOR);
m_uiFadeArmorTimer = urand(5000,10000);
}
else
diff --git a/src/scripts/northrend/sholazar_basin.cpp b/src/scripts/northrend/sholazar_basin.cpp
index fb820b4667e..4364caebfc4 100644
--- a/src/scripts/northrend/sholazar_basin.cpp
+++ b/src/scripts/northrend/sholazar_basin.cpp
@@ -84,19 +84,19 @@ struct npc_injured_rainspeaker_oracleAI : public npc_escortAI
case 16:
case 17:
case 18:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING);
- m_creature->SetSpeed(MOVE_SWIM, 0.85f, true);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING);
+ me->SetSpeed(MOVE_SWIM, 0.85f, true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
break;
case 19:
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
break;
case 28:
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, m_creature);
+ pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me);
// me->RestoreFaction();
- DoScriptText(SAY_END_IRO,m_creature);
+ DoScriptText(SAY_END_IRO,me);
SetRun(false);
break;
}
@@ -278,10 +278,10 @@ struct npc_bushwhackerAI : public ScriptedAI
void MoveToSummoner()
{
- if (m_creature->isSummon())
- if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
if (pSummoner)
- m_creature->GetMotionMaster()->MovePoint(0,pSummoner->GetPositionX(),pSummoner->GetPositionY(),pSummoner->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(0,pSummoner->GetPositionX(),pSummoner->GetPositionY(),pSummoner->GetPositionZ());
}
void UpdateAI(const uint32 uiDiff)
diff --git a/src/scripts/northrend/storm_peaks.cpp b/src/scripts/northrend/storm_peaks.cpp
index b439a76d5a8..e9261e9b837 100644
--- a/src/scripts/northrend/storm_peaks.cpp
+++ b/src/scripts/northrend/storm_peaks.cpp
@@ -184,9 +184,9 @@ struct npc_goblin_prisonerAI : public ScriptedAI
void Reset()
{
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
- if (GameObject* pGO = m_creature->FindNearestGameObject(GO_RUSTY_CAGE,5.0f))
+ if (GameObject* pGO = me->FindNearestGameObject(GO_RUSTY_CAGE,5.0f))
{
if (pGO->GetGoState() == GO_STATE_ACTIVE)
pGO->SetGoState(GO_STATE_READY);
@@ -224,7 +224,7 @@ struct npc_victorious_challengerAI : public ScriptedAI
void Reset()
{
- m_creature->RestoreFaction();
+ me->RestoreFaction();
SunderArmorTimer = 10000;
RendTimer = 15000;
@@ -238,13 +238,13 @@ struct npc_victorious_challengerAI : public ScriptedAI
if (RendTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_REND_VC, true);
+ DoCast(me->getVictim(), SPELL_REND_VC, true);
RendTimer = 15000;
}else RendTimer -= diff;
if (SunderArmorTimer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR, true);
+ DoCast(me->getVictim(), SPELL_SUNDER_ARMOR, true);
SunderArmorTimer = 10000;
}else SunderArmorTimer -= diff;
@@ -253,7 +253,7 @@ struct npc_victorious_challengerAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- m_creature->RestoreFaction();
+ me->RestoreFaction();
}
};
diff --git a/src/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp
index ef3e4af3865..f4a8be0edff 100644
--- a/src/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp
@@ -135,7 +135,7 @@ struct boss_bjarngrimAI : public ScriptedAI
for (uint8 i = 0; i < 2; ++i)
{
- if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_auiStormforgedLieutenantGUID[i])))
+ if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*me), m_auiStormforgedLieutenantGUID[i])))
{
if (!pStormforgedLieutenant->isAlive())
pStormforgedLieutenant->Respawn();
@@ -145,7 +145,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiStance != STANCE_DEFENSIVE)
{
DoRemoveStanceAura(m_uiStance);
- DoCast(m_creature, SPELL_DEFENSIVE_STANCE);
+ DoCast(me, SPELL_DEFENSIVE_STANCE);
m_uiStance = STANCE_DEFENSIVE;
}
@@ -157,10 +157,10 @@ struct boss_bjarngrimAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
//must get both lieutenants here and make sure they are with him
- m_creature->CallForHelp(30.0f);
+ me->CallForHelp(30.0f);
if (m_pInstance)
m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS);
@@ -168,12 +168,12 @@ struct boss_bjarngrimAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_BJARNGRIM, DONE);
@@ -185,13 +185,13 @@ struct boss_bjarngrimAI : public ScriptedAI
switch(uiStance)
{
case STANCE_DEFENSIVE:
- m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE);
+ me->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE);
break;
case STANCE_BERSERKER:
- m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE);
+ me->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE);
break;
case STANCE_BATTLE:
- m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE);
+ me->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE);
break;
}
}
@@ -206,7 +206,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiChangeStance_Timer <= uiDiff)
{
//wait for current spell to finish before change stance
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
DoRemoveStanceAura(m_uiStance);
@@ -221,21 +221,21 @@ struct boss_bjarngrimAI : public ScriptedAI
switch(m_uiStance)
{
case STANCE_DEFENSIVE:
- DoScriptText(SAY_DEFENSIVE_STANCE, m_creature);
- DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature);
- DoCast(m_creature, SPELL_DEFENSIVE_STANCE);
+ DoScriptText(SAY_DEFENSIVE_STANCE, me);
+ DoScriptText(EMOTE_DEFENSIVE_STANCE, me);
+ DoCast(me, SPELL_DEFENSIVE_STANCE);
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE);
break;
case STANCE_BERSERKER:
- DoScriptText(SAY_BERSEKER_STANCE, m_creature);
- DoScriptText(EMOTE_BERSEKER_STANCE, m_creature);
- DoCast(m_creature, SPELL_BERSEKER_STANCE);
+ DoScriptText(SAY_BERSEKER_STANCE, me);
+ DoScriptText(EMOTE_BERSEKER_STANCE, me);
+ DoCast(me, SPELL_BERSEKER_STANCE);
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE);
break;
case STANCE_BATTLE:
- DoScriptText(SAY_BATTLE_STANCE, m_creature);
- DoScriptText(EMOTE_BATTLE_STANCE, m_creature);
- DoCast(m_creature, SPELL_BATTLE_STANCE);
+ DoScriptText(SAY_BATTLE_STANCE, me);
+ DoScriptText(EMOTE_BATTLE_STANCE, me);
+ DoCast(me, SPELL_BATTLE_STANCE);
SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
break;
}
@@ -252,7 +252,7 @@ struct boss_bjarngrimAI : public ScriptedAI
{
if (m_uiReflection_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_SPELL_REFLECTION);
+ DoCast(me, SPELL_SPELL_REFLECTION);
m_uiReflection_Timer = 8000 + rand()%1000;
}
else
@@ -260,7 +260,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiKnockAway_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_KNOCK_AWAY);
+ DoCast(me, SPELL_KNOCK_AWAY);
m_uiKnockAway_Timer = 20000 + rand()%1000;
}
else
@@ -268,7 +268,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiPummel_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_PUMMEL);
+ DoCast(me->getVictim(), SPELL_PUMMEL);
m_uiPummel_Timer = 10000 + rand()%1000;
}
else
@@ -276,7 +276,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiIronform_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_IRONFORM);
+ DoCast(me, SPELL_IRONFORM);
m_uiIronform_Timer = 25000 + rand()%1000;
}
else
@@ -289,7 +289,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiIntercept_Timer <= uiDiff)
{
//not much point is this, better random target and more often?
- DoCast(m_creature->getVictim(), SPELL_INTERCEPT);
+ DoCast(me->getVictim(), SPELL_INTERCEPT);
m_uiIntercept_Timer = 45000 + rand()%1000;
}
else
@@ -297,7 +297,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiWhirlwind_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
m_uiWhirlwind_Timer = 10000 + rand()%1000;
}
else
@@ -305,7 +305,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiCleave_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleave_Timer = 8000 + rand()%1000;
}
else
@@ -317,7 +317,7 @@ struct boss_bjarngrimAI : public ScriptedAI
{
if (m_uiMortalStrike_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
m_uiMortalStrike_Timer = 20000 + rand()%1000;
}
else
@@ -325,7 +325,7 @@ struct boss_bjarngrimAI : public ScriptedAI
if (m_uiSlam_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_SLAM);
+ DoCast(me->getVictim(), SPELL_SLAM);
m_uiSlam_Timer = 15000 + rand()%1000;
}
else
@@ -381,7 +381,7 @@ struct mob_stormforged_lieutenantAI : public ScriptedAI
if (m_uiArcWeld_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_ARC_WELD);
+ DoCast(me->getVictim(), SPELL_ARC_WELD);
m_uiArcWeld_Timer = 20000 + rand()%1000;
}
else
diff --git a/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp b/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp
index d2492abad09..8ed7f1294d2 100644
--- a/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp
@@ -100,10 +100,10 @@ struct boss_ionarAI : public ScriptedAI
uiDisperseHealth = 45 + urand(0,10);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
- if (m_creature->GetVisibility() == VISIBILITY_OFF)
- m_creature->SetVisibility(VISIBILITY_ON);
+ if (me->GetVisibility() == VISIBILITY_OFF)
+ me->SetVisibility(VISIBILITY_ON);
if (pInstance)
pInstance->SetData(TYPE_IONAR, NOT_STARTED);
@@ -111,7 +111,7 @@ struct boss_ionarAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(TYPE_IONAR, IN_PROGRESS);
@@ -119,7 +119,7 @@ struct boss_ionarAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
lSparkList.DespawnAll();
@@ -129,7 +129,7 @@ struct boss_ionarAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
//make sparks come back
@@ -140,11 +140,11 @@ struct boss_ionarAI : public ScriptedAI
return;
Position pos;
- m_creature->GetPosition(&pos);
+ me->GetPosition(&pos);
for (std::list<uint64>::const_iterator itr = lSparkList.begin(); itr != lSparkList.end(); ++itr)
{
- if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pSpark = Unit::GetCreature(*me, *itr))
{
if (pSpark->isAlive())
{
@@ -160,7 +160,7 @@ struct boss_ionarAI : public ScriptedAI
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
{
- if (m_creature->GetVisibility() == VISIBILITY_OFF)
+ if (me->GetVisibility() == VISIBILITY_OFF)
uiDamage = 0;
}
@@ -195,7 +195,7 @@ struct boss_ionarAI : public ScriptedAI
return;
// Splitted
- if (m_creature->GetVisibility() == VISIBILITY_OFF)
+ if (me->GetVisibility() == VISIBILITY_OFF)
{
if (uiSplitTimer <= uiDiff)
{
@@ -210,16 +210,16 @@ struct boss_ionarAI : public ScriptedAI
// Lightning effect and restore Ionar
else if (lSparkList.empty())
{
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
- DoCast(m_creature, SPELL_SPARK_DESPAWN, false);
+ DoCast(me, SPELL_SPARK_DESPAWN, false);
uiSplitTimer = 25*IN_MILISECONDS;
bIsSplitPhase = true;
- if (m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ if (me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
}
else
@@ -240,7 +240,7 @@ struct boss_ionarAI : public ScriptedAI
if (uiBallLightningTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_BALL_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_BALL_LIGHTNING);
uiBallLightningTimer = urand(10*IN_MILISECONDS, 11*IN_MILISECONDS);
}
else
@@ -251,12 +251,12 @@ struct boss_ionarAI : public ScriptedAI
{
bHasDispersed = true;
- DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
+ DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_DISPERSE, true);
+ DoCast(me, SPELL_DISPERSE, true);
}
DoMeleeAttackIfReady();
@@ -310,7 +310,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
void Reset()
{
uiCheckTimer = 2*IN_MILISECONDS;
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
@@ -319,7 +319,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
return;
if (uiPointId == DATA_POINT_CALLBACK)
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
@@ -332,7 +332,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
// Despawn if the encounter is not running
if (pInstance && pInstance->GetData(TYPE_IONAR) != IN_PROGRESS)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
@@ -344,18 +344,18 @@ struct mob_spark_of_ionarAI : public ScriptedAI
Creature* pIonar = pInstance->instance->GetCreature(pInstance->GetData64(DATA_IONAR));
if (pIonar && pIonar->isAlive())
{
- if (m_creature->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
+ if (me->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
{
Position pos;
pIonar->GetPosition(&pos);
- m_creature->SetSpeed(MOVE_RUN, 2.0f);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
+ me->SetSpeed(MOVE_RUN, 2.0f);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
}
}
else
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
uiCheckTimer = 2*IN_MILISECONDS;
}
diff --git a/src/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp b/src/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp
index ed795076b61..f97cf3f6893 100644
--- a/src/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp
@@ -95,7 +95,7 @@ struct boss_lokenAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
EncounterTime = 0;
@@ -105,14 +105,14 @@ struct boss_lokenAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (IsHeroic() && EncounterTime <= MAX_ENCOUNTER_TIME)
{
AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH);
if (AchievTimelyDeath)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -128,7 +128,7 @@ struct boss_lokenAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void UpdateAI(const uint32 uiDiff)
@@ -144,7 +144,7 @@ struct boss_lokenAI : public ScriptedAI
// workaround for PULSING_SHOCKWAVE
if (m_uiPulsingShockwave_Timer <= uiDiff)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -156,13 +156,13 @@ struct boss_lokenAI : public ScriptedAI
if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack())
{
int32 dmg;
- float m_fDist = m_creature->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
+ float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
dmg = DUNGEON_MODE(100, 150); // need to correct damage
if (m_fDist > 1.0f) // Further from 1 yard
dmg *= m_fDist;
- m_creature->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
+ me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
}
}
m_uiPulsingShockwave_Timer = 2000;
@@ -173,9 +173,9 @@ struct boss_lokenAI : public ScriptedAI
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
{
//breaks at movement, can we assume when it's time, this spell is casted and also must stop movement?
- DoCast(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true);
+ DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
- DoCast(m_creature, SPELL_PULSING_SHOCKWAVE_N); // need core support
+ DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support
m_bIsAura = true;
m_uiResumePulsingShockwave_Timer = 0;
}
@@ -195,9 +195,9 @@ struct boss_lokenAI : public ScriptedAI
if (m_uiLightningNova_Timer <= uiDiff)
{
- DoScriptText(RAND(SAY_NOVA_1,SAY_NOVA_2,SAY_NOVA_3), m_creature);
- DoScriptText(EMOTE_NOVA, m_creature);
- DoCast(m_creature, SPELL_LIGHTNING_NOVA_N);
+ DoScriptText(RAND(SAY_NOVA_1,SAY_NOVA_2,SAY_NOVA_3), me);
+ DoScriptText(EMOTE_NOVA, me);
+ DoCast(me, SPELL_LIGHTNING_NOVA_N);
m_bIsAura = false;
m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura
@@ -207,13 +207,13 @@ struct boss_lokenAI : public ScriptedAI
m_uiLightningNova_Timer -= uiDiff;
// Health check
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier)))
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier)))
{
switch(m_uiHealthAmountModifier)
{
- case 1: DoScriptText(SAY_75HEALTH, m_creature); break;
- case 2: DoScriptText(SAY_50HEALTH, m_creature); break;
- case 3: DoScriptText(SAY_25HEALTH, m_creature); break;
+ case 1: DoScriptText(SAY_75HEALTH, me); break;
+ case 2: DoScriptText(SAY_50HEALTH, me); break;
+ case 3: DoScriptText(SAY_25HEALTH, me); break;
}
++m_uiHealthAmountModifier;
diff --git a/src/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp
index 2546d323a7f..824485cd34f 100644
--- a/src/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp
@@ -116,7 +116,7 @@ struct boss_volkhanAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS);
@@ -124,20 +124,20 @@ struct boss_volkhanAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
if (!m_bHasTemper)
- m_creature->GetMotionMaster()->MoveChase(pWho);
+ me->GetMotionMaster()->MoveChase(pWho);
}
}
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
DespawnGolem();
if (m_pInstance)
@@ -148,7 +148,7 @@ struct boss_volkhanAI : public ScriptedAI
AchievementEntry const *AchievShatterResistant = GetAchievementStore()->LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT);
if (AchievShatterResistant)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -161,7 +161,7 @@ struct boss_volkhanAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void DespawnGolem()
@@ -171,7 +171,7 @@ struct boss_volkhanAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
{
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
{
if (pTemp->isAlive())
pTemp->ForcedDespawn();
@@ -188,7 +188,7 @@ struct boss_volkhanAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
{
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
{
// only shatter brittle golems
if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM)
@@ -216,7 +216,7 @@ struct boss_volkhanAI : public ScriptedAI
pSummoned->AI()->AttackStart(pTarget);
//why healing when just summoned?
- pSummoned->CastSpell(pSummoned, DUNGEON_MODE(SPELL_HEAT_N, SPELL_HEAT_H), false, NULL, NULL, m_creature->GetGUID());
+ pSummoned->CastSpell(pSummoned, DUNGEON_MODE(SPELL_HEAT_N, SPELL_HEAT_H), false, NULL, NULL, me->GetGUID());
}
}
@@ -230,10 +230,10 @@ struct boss_volkhanAI : public ScriptedAI
{
if (m_uiPause_Timer <= uiDiff)
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
{
- if (m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ if (me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
m_bHasTemper = false;
@@ -253,11 +253,11 @@ struct boss_volkhanAI : public ScriptedAI
{
//should he stomp even if he has no brittle golem to shatter?
- DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), m_creature);
+ DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), me);
- DoCast(m_creature, SPELL_SHATTERING_STOMP_N);
+ DoCast(me, SPELL_SHATTERING_STOMP_N);
- DoScriptText(EMOTE_SHATTER, m_creature);
+ DoScriptText(EMOTE_SHATTER, me);
m_uiShatteringStomp_Timer = 30000;
m_bCanShatterGolem = true;
@@ -280,18 +280,18 @@ struct boss_volkhanAI : public ScriptedAI
}
// Health check
- if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier)))
+ if (!m_bCanShatterGolem && (me->GetHealth()*100 / me->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier)))
{
++m_uiHealthAmountModifier;
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), m_creature);
+ DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), me);
m_bHasTemper = true;
- DoCast(m_creature, SPELL_TEMPER, false);
+ DoCast(me, SPELL_TEMPER, false);
}
DoMeleeAttackIfReady();
@@ -386,31 +386,31 @@ struct mob_molten_golemAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
if (!m_bIsFrozen)
- m_creature->GetMotionMaster()->MoveChase(pWho);
+ me->GetMotionMaster()->MoveChase(pWho);
}
}
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
- if (uiDamage > m_creature->GetHealth())
+ if (uiDamage > me->GetHealth())
{
- m_creature->UpdateEntry(NPC_BRITTLE_GOLEM);
- m_creature->SetHealth(1);
+ me->UpdateEntry(NPC_BRITTLE_GOLEM);
+ me->SetHealth(1);
uiDamage = 0;
- m_creature->RemoveAllAuras();
- m_creature->AttackStop();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- m_creature->GetMotionMaster()->MovementExpired();
+ me->RemoveAllAuras();
+ me->AttackStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
m_bIsFrozen = true;
}
}
@@ -420,8 +420,8 @@ struct mob_molten_golemAI : public ScriptedAI
//this is the dummy effect of the spells
if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H)
{
- if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM)
- m_creature->ForcedDespawn();
+ if (me->GetEntry() == NPC_BRITTLE_GOLEM)
+ me->ForcedDespawn();
}
}
@@ -433,7 +433,7 @@ struct mob_molten_golemAI : public ScriptedAI
if (m_uiBlast_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_BLAST_WAVE);
+ DoCast(me, SPELL_BLAST_WAVE);
m_uiBlast_Timer = 20000;
}
else
@@ -441,7 +441,7 @@ struct mob_molten_golemAI : public ScriptedAI
if (m_uiImmolation_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_IMMOLATION_STRIKE_N);
+ DoCast(me->getVictim(), SPELL_IMMOLATION_STRIKE_N);
m_uiImmolation_Timer = 5000;
}
else
diff --git a/src/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp b/src/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp
index a55c3a6038f..574e39f71a4 100644
--- a/src/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp
@@ -64,7 +64,7 @@ struct boss_krystallusAI : public ScriptedAI
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_KRYSTALLUS_EVENT, IN_PROGRESS);
@@ -92,13 +92,13 @@ struct boss_krystallusAI : public ScriptedAI
if (uiStompTimer <= diff)
{
- DoCast(m_creature, SPELL_STOMP);
+ DoCast(me, SPELL_STOMP);
uiStompTimer = 20000 + rand()%9000;
} else uiStompTimer -= diff;
if (uiGroundSlamTimer <= diff)
{
- DoCast(m_creature, SPELL_GROUND_SLAM);
+ DoCast(me, SPELL_GROUND_SLAM);
bIsSlam = true;
uiShatterTimer = 10000;
uiGroundSlamTimer = 15000 + rand()%3000;
@@ -108,7 +108,7 @@ struct boss_krystallusAI : public ScriptedAI
{
if (uiShatterTimer <= diff)
{
- DoCast(m_creature, SPELL_SHATTER);
+ DoCast(me, SPELL_SHATTER);
bIsSlam = false;
} else uiShatterTimer -= diff;
}
@@ -118,7 +118,7 @@ struct boss_krystallusAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_KRYSTALLUS_EVENT, DONE);
@@ -126,9 +126,9 @@ struct boss_krystallusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
};
diff --git a/src/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
index 2232059d576..b4544cfc129 100644
--- a/src/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
@@ -43,7 +43,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
{
boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c)
{
- pInstance = m_creature->GetInstanceData();
+ pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -68,7 +68,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
@@ -109,15 +109,15 @@ struct boss_maiden_of_griefAI : public ScriptedAI
if (StormOfGriefTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STORM_OF_GRIEF_N, true);
+ DoCast(me->getVictim(), SPELL_STORM_OF_GRIEF_N, true);
StormOfGriefTimer = 15000 + rand()%5000;
} else StormOfGriefTimer -= diff;
if (ShockOfSorrowTimer <= diff)
{
DoResetThreat();
- DoScriptText(SAY_STUN, m_creature);
- DoCast(m_creature, SPELL_SHOCK_OF_SORROW_N);
+ DoScriptText(SAY_STUN, me);
+ DoCast(me, SPELL_SHOCK_OF_SORROW_N);
ShockOfSorrowTimer = 20000 + rand()%10000;
} else ShockOfSorrowTimer -= diff;
@@ -128,7 +128,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
if (pTarget)
DoCast(pTarget, SPELL_PILLAR_OF_WOE_N);
else
- DoCast(m_creature->getVictim(), SPELL_PILLAR_OF_WOE_N);
+ DoCast(me->getVictim(), SPELL_PILLAR_OF_WOE_N);
PillarOfWoeTimer = 5000 + rand()%20000;
} else PillarOfWoeTimer -= diff;
@@ -137,13 +137,13 @@ struct boss_maiden_of_griefAI : public ScriptedAI
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, DONE);
AchievementEntry const *AchievGoodGrief = GetAchievementStore()->LookupEntry(ACHIEVEMENT_GOOD_GRIEF);
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (IsHeroic() && AchievTimer < 60000 && pMap && pMap->IsDungeon() && AchievGoodGrief)
{
@@ -154,10 +154,10 @@ struct boss_maiden_of_griefAI : public ScriptedAI
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
};
diff --git a/src/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp
index fc711d97ae5..6dc338b0f93 100644
--- a/src/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp
@@ -108,7 +108,7 @@ struct boss_sjonnirAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
uiEncounterTimer = 0;
@@ -140,28 +140,28 @@ struct boss_sjonnirAI : public ScriptedAI
if (uiLightningShieldTimer <= diff)
{
- DoCast(m_creature, SPELL_LIGHTING_SHIELD);
+ DoCast(me, SPELL_LIGHTING_SHIELD);
uiLightningShieldTimer -= diff;
}
if (uiStaticChargeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STATIC_CHARGE);
+ DoCast(me->getVictim(), SPELL_STATIC_CHARGE);
uiStaticChargeTimer = 20000 + rand()%5000;
} uiStaticChargeTimer -= diff;
if (uiLightningRingTimer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_LIGHTING_RING);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_LIGHTING_RING);
uiLightningRingTimer = 30000 + rand()%5000;
} else uiLightningRingTimer -= diff;
if (uiSummonTimer <= diff)
{
uint32 uiSummonPipe = rand()%2;
- m_creature->SummonCreature(uiEncounterTimer > DATA_TIME_BEFORE_OOZE ? CREATURE_MALFORMED_OOZE :
+ me->SummonCreature(uiEncounterTimer > DATA_TIME_BEFORE_OOZE ? CREATURE_MALFORMED_OOZE :
RAND(CREATURE_FORGED_IRON_DWARF,CREATURE_FORGED_IRON_TROGG),
PipeLocations[uiSummonPipe].x, PipeLocations[uiSummonPipe].y, PipeLocations[uiSummonPipe].z, 0.0f,
TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
@@ -172,7 +172,7 @@ struct boss_sjonnirAI : public ScriptedAI
{
if (uiFrenzyTimer <= diff)
{
- DoCast(m_creature, SPELL_FRENZY);
+ DoCast(me, SPELL_FRENZY);
bIsFrenzy = true;
}
else uiFrenzyTimer -= diff;
@@ -193,7 +193,7 @@ struct boss_sjonnirAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
lSummons.DespawnAll();
if (pInstance)
@@ -205,9 +205,9 @@ struct boss_sjonnirAI : public ScriptedAI
}
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void KilledIronSludge()
@@ -236,11 +236,11 @@ struct mob_malformed_oozeAI : public ScriptedAI
{
if (uiMergeTimer <= diff)
{
- if (Creature* pTemp = m_creature->FindNearestCreature(CREATURE_MALFORMED_OOZE, 3.0f, true))
+ if (Creature* pTemp = me->FindNearestCreature(CREATURE_MALFORMED_OOZE, 3.0f, true))
{
DoSpawnCreature(CREATURE_IRON_SLUDGE, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
pTemp->DisappearAndDie();
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
uiMergeTimer = 3000;
} else uiMergeTimer -= diff;
@@ -269,7 +269,7 @@ struct mob_iron_sludgeAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
if (pInstance)
- if (Creature* pSjonnir = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SJONNIR)))
+ if (Creature* pSjonnir = Unit::GetCreature(*me, pInstance->GetData64(DATA_SJONNIR)))
CAST_AI(boss_sjonnirAI, pSjonnir->AI())->KilledIronSludge();
}
};
diff --git a/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp b/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
index 1725c32fdf3..a04f2ce203b 100644
--- a/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
@@ -158,7 +158,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
void UpdateFacesList()
{
- /*GetCreatureListWithEntryInGrid(lKaddrakGUIDList, m_creature, CREATURE_KADDRAK, 50.0f);
+ /*GetCreatureListWithEntryInGrid(lKaddrakGUIDList, me, CREATURE_KADDRAK, 50.0f);
if (!lKaddrakGUIDList.empty())
{
uint32 uiPositionCounter = 0;
@@ -192,7 +192,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
if (!KaddrakGUIDList.empty())
for (std::list<uint64>::const_iterator itr = KaddrakGUIDList.begin(); itr != KaddrakGUIDList.end(); ++itr)
{
- if (Creature *pKaddrak = Unit::GetCreature(*m_creature, *itr))
+ if (Creature *pKaddrak = Unit::GetCreature(*me, *itr))
{
if (pKaddrak->isAlive())
pKaddrak->CastSpell(pTarget, DUNGEON_MODE(SPELL_GLARE_OF_THE_TRIBUNAL, H_SPELL_GLARE_OF_THE_TRIBUNAL), true);
@@ -207,7 +207,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- if (Creature* pSummon = m_creature->SummonCreature(CREATURE_DARK_MATTER_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
+ if (Creature* pSummon = me->SummonCreature(CREATURE_DARK_MATTER_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
{
pSummon->SetDisplayId(11686);
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -223,7 +223,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- if (Creature* pSummon = m_creature->SummonCreature(CREATURE_SEARING_GAZE_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
+ if (Creature* pSummon = me->SummonCreature(CREATURE_SEARING_GAZE_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
{
pSummon->SetDisplayId(11686);
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -279,7 +279,7 @@ struct npc_brann_hosAI : public npc_escortAI
return;
for (std::list<uint64>::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
{
- Creature* pTemp = Unit::GetCreature(*m_creature, pInstance ? (*itr) : 0);
+ Creature* pTemp = Unit::GetCreature(*me, pInstance ? (*itr) : 0);
if (pTemp && pTemp->isAlive())
pTemp->ForcedDespawn();
}
@@ -291,7 +291,7 @@ struct npc_brann_hosAI : public npc_escortAI
switch(uiPointId)
{
case 7:
- if (Creature* pCreature = GetClosestCreatureWithEntry(m_creature, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
+ if (Creature* pCreature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
{
if (!pCreature->isAlive())
pCreature->Respawn();
@@ -300,15 +300,15 @@ struct npc_brann_hosAI : public npc_escortAI
}
break;
case 13:
- DoScriptText(SAY_EVENT_INTRO_1, m_creature);
+ DoScriptText(SAY_EVENT_INTRO_1, me);
SetEscortPaused(true);
JumpToNextStep(20000);
break;
case 17:
- DoScriptText(SAY_EVENT_INTRO_2, m_creature);
+ DoScriptText(SAY_EVENT_INTRO_2, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_TRIBUNAL_CONSOLE),true);
- m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
SetEscortPaused(true);
JumpToNextStep(8500);
break;
@@ -326,16 +326,16 @@ struct npc_brann_hosAI : public npc_escortAI
{
uint32 uiSpawnNumber = DUNGEON_MODE(2,3);
for (uint8 i = 0; i < uiSpawnNumber; ++i)
- m_creature->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
- m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ me->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ me->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
case 2:
for (uint8 i = 0; i < 2; ++i)
- m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ me->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
case 3:
- m_creature->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ me->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
}
@@ -343,8 +343,8 @@ struct npc_brann_hosAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
lDwarfGUIDList.push_back(pSummoned->GetGUID());
- pSummoned->AddThreat(m_creature, 0.0f);
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AddThreat(me, 0.0f);
+ pSummoned->AI()->AttackStart(me);
}
void JumpToNextStep(uint32 uiTimer)
@@ -355,7 +355,7 @@ struct npc_brann_hosAI : public npc_escortAI
void StartWP()
{
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(false);
uiStep = 1;
Start();
@@ -381,7 +381,7 @@ struct npc_brann_hosAI : public npc_escortAI
pInstance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
}
bIsBattle = false;
- DoScriptText(SAY_ESCORT_START, m_creature);
+ DoScriptText(SAY_ESCORT_START, me);
SetRun(true);
JumpToNextStep(0);
break;
@@ -391,49 +391,49 @@ struct npc_brann_hosAI : public npc_escortAI
break;
case 5:
if (pInstance)
- if (Creature* pTemp = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM))))
+ if (Creature* pTemp = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM))))
DoScriptText(SAY_EVENT_INTRO_3_ABED, pTemp);
JumpToNextStep(8500);
break;
case 6:
- DoScriptText(SAY_EVENT_A_1, m_creature);
+ DoScriptText(SAY_EVENT_A_1, me);
JumpToNextStep(6500);
break;
case 7:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_A_2_KADD, pTemp);
JumpToNextStep(12500);
break;
case 8:
- DoScriptText(SAY_EVENT_A_3, m_creature);
+ DoScriptText(SAY_EVENT_A_3, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),true);
- if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
+ if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bKaddrakActivated = true;
JumpToNextStep(5000);
break;
case 9:
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 10:
- DoScriptText(SAY_EVENT_B_1, m_creature);
+ DoScriptText(SAY_EVENT_B_1, me);
JumpToNextStep(6000);
break;
case 11:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_B_2_MARN, pTemp);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 12:
- DoScriptText(SAY_EVENT_B_3, m_creature);
+ DoScriptText(SAY_EVENT_B_3, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),true);
- if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
+ if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bMarnakActivated = true;
JumpToNextStep(10000);
break;
@@ -446,7 +446,7 @@ struct npc_brann_hosAI : public npc_escortAI
JumpToNextStep(20000);
break;
case 15:
- DoScriptText(SAY_EVENT_C_1, m_creature);
+ DoScriptText(SAY_EVENT_C_1, me);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
@@ -456,16 +456,16 @@ struct npc_brann_hosAI : public npc_escortAI
break;
case 17:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_C_2_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 18:
- DoScriptText(SAY_EVENT_C_3, m_creature);
+ DoScriptText(SAY_EVENT_C_3, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),true);
- if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
+ if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bAbedneumActivated = true;
JumpToNextStep(5000);
break;
@@ -478,13 +478,13 @@ struct npc_brann_hosAI : public npc_escortAI
JumpToNextStep(15000);
break;
case 21:
- DoScriptText(SAY_EVENT_D_1, m_creature);
+ DoScriptText(SAY_EVENT_D_1, me);
SpawnDwarf(3);
JumpToNextStep(20000);
break;
case 22:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_D_2_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(5000);
@@ -494,7 +494,7 @@ struct npc_brann_hosAI : public npc_escortAI
JumpToNextStep(15000);
break;
case 24:
- DoScriptText(SAY_EVENT_D_3, m_creature);
+ DoScriptText(SAY_EVENT_D_3, me);
SpawnDwarf(3);
JumpToNextStep(5000);
break;
@@ -508,25 +508,25 @@ struct npc_brann_hosAI : public npc_escortAI
break;
case 27:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_D_4_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 28:
- m_creature->SetReactState(REACT_DEFENSIVE);
- DoScriptText(SAY_EVENT_END_01, m_creature);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetReactState(REACT_DEFENSIVE);
+ DoScriptText(SAY_EVENT_END_01, me);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),true);
- if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
+ if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
bIsBattle = true;
SetEscortPaused(false);
JumpToNextStep(6500);
break;
case 29:
- DoScriptText(SAY_EVENT_END_02, m_creature);
+ DoScriptText(SAY_EVENT_END_02, me);
if (pInstance)
{
pInstance->SetData(DATA_BRANN_EVENT, DONE);
@@ -543,97 +543,97 @@ struct npc_brann_hosAI : public npc_escortAI
break;
case 30:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_03_ABED, pTemp);
JumpToNextStep(8500);
break;
case 31:
- DoScriptText(SAY_EVENT_END_04, m_creature);
+ DoScriptText(SAY_EVENT_END_04, me);
JumpToNextStep(11500);
break;
case 32:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_05_ABED, pTemp);
JumpToNextStep(11500);
break;
case 33:
- DoScriptText(SAY_EVENT_END_06, m_creature);
+ DoScriptText(SAY_EVENT_END_06, me);
JumpToNextStep(4500);
break;
case 34:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_07_ABED, pTemp);
JumpToNextStep(22500);
break;
case 35:
- DoScriptText(SAY_EVENT_END_08, m_creature);
+ DoScriptText(SAY_EVENT_END_08, me);
JumpToNextStep(7500);
break;
case 36:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_09_KADD, pTemp);
JumpToNextStep(18500);
break;
case 37:
- DoScriptText(SAY_EVENT_END_10, m_creature);
+ DoScriptText(SAY_EVENT_END_10, me);
JumpToNextStep(5500);
break;
case 38:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_11_KADD, pTemp);
JumpToNextStep(20500);
break;
case 39:
- DoScriptText(SAY_EVENT_END_12, m_creature);
+ DoScriptText(SAY_EVENT_END_12, me);
JumpToNextStep(2500);
break;
case 40:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_13_KADD, pTemp);
JumpToNextStep(19500);
break;
case 41:
- DoScriptText(SAY_EVENT_END_14, m_creature);
+ DoScriptText(SAY_EVENT_END_14, me);
JumpToNextStep(10500);
break;
case 42:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_15_MARN, pTemp);
JumpToNextStep(6500);
break;
case 43:
- DoScriptText(SAY_EVENT_END_16, m_creature);
+ DoScriptText(SAY_EVENT_END_16, me);
JumpToNextStep(6500);
break;
case 44:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_17_MARN, pTemp);
JumpToNextStep(25500);
break;
case 45:
- DoScriptText(SAY_EVENT_END_18, m_creature);
+ DoScriptText(SAY_EVENT_END_18, me);
JumpToNextStep(23500);
break;
case 46:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_19_MARN, pTemp);
JumpToNextStep(3500);
break;
case 47:
- DoScriptText(SAY_EVENT_END_20, m_creature);
+ DoScriptText(SAY_EVENT_END_20, me);
JumpToNextStep(8500);
break;
case 48:
if (pInstance)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
+ if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_21_ABED, pTemp);
JumpToNextStep(5500);
break;
@@ -648,8 +648,8 @@ struct npc_brann_hosAI : public npc_escortAI
}
Player* pPlayer = GetPlayerForEscort();
if (pPlayer)
- pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, m_creature);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
JumpToNextStep(180000);
break;
}
@@ -661,7 +661,7 @@ struct npc_brann_hosAI : public npc_escortAI
if (!bIsLowHP && HealthBelowPct(30))
{
- DoScriptText(SAY_LOW_HEALTH, m_creature);
+ DoScriptText(SAY_LOW_HEALTH, me);
bIsLowHP = true;
}
else if (bIsLowHP && !HealthBelowPct(30))
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
index 0d174800eed..af45b5c857c 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
@@ -114,14 +114,14 @@ struct boss_algalonAI : public ScriptedAI
{
if (Summon)
{
- DoScriptText(SAY_AGGRO, m_creature);
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ DoScriptText(SAY_AGGRO, me);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
DoZoneInCombat(who->ToCreature());
}
else
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
uiStep = 1;
}
@@ -131,14 +131,14 @@ struct boss_algalonAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void Reset()
{
Phase = 1;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (pInstance)
pInstance->SetData(TYPE_ALGALON, NOT_STARTED);
@@ -168,7 +168,7 @@ struct boss_algalonAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr)
{
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
{
if (pTemp->isAlive())
pTemp->ForcedDespawn();
@@ -182,17 +182,17 @@ struct boss_algalonAI : public ScriptedAI
if (pSummoned->GetEntry() == CREATURE_COLLAPSING_STAR)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (m_creature->getVictim())
- pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim());
+ if (me->getVictim())
+ pSummoned->AI()->AttackStart(pTarget ? pTarget : me->getVictim());
m_lCollapsingStarGUIDList.push_back(pSummoned->GetGUID());
}
}
void SummonCollapsingStar(Unit* target)
{
- DoScriptText(SAY_SUMMON_COLLAPSING_STAR, m_creature);
- m_creature->SummonCreature(CREATURE_COLLAPSING_STAR,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 100000);
- m_creature->SummonCreature(CREATURE_BLACK_HOLE,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 27000);
+ DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me);
+ me->SummonCreature(CREATURE_COLLAPSING_STAR,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 100000);
+ me->SummonCreature(CREATURE_BLACK_HOLE,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 27000);
}
void UpdateAI(const uint32 diff)
@@ -204,21 +204,21 @@ struct boss_algalonAI : public ScriptedAI
if (Phase == 1 && HealthBelowPct(20))
{
Phase = 2;
- DoScriptText(SAY_PHASE_2, m_creature);
+ DoScriptText(SAY_PHASE_2, me);
}
if (HealthBelowPct(2))
{
- m_creature->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);
+ me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);
// All of them. or random?
- DoScriptText(SAY_DEATH_1, m_creature);
- DoScriptText(SAY_DEATH_2, m_creature);
- DoScriptText(SAY_DEATH_3, m_creature);
- DoScriptText(SAY_DEATH_4, m_creature);
- DoScriptText(SAY_DEATH_5, m_creature);
+ DoScriptText(SAY_DEATH_1, me);
+ DoScriptText(SAY_DEATH_2, me);
+ DoScriptText(SAY_DEATH_3, me);
+ DoScriptText(SAY_DEATH_4, me);
+ DoScriptText(SAY_DEATH_5, me);
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
if (pInstance)
pInstance->SetData(TYPE_ALGALON, DONE);
@@ -235,24 +235,24 @@ struct boss_algalonAI : public ScriptedAI
switch(uiStep)
{
case 1:
- DoScriptText(SAY_SUMMON_1, m_creature);
+ DoScriptText(SAY_SUMMON_1, me);
JumpToNextStep(3000);
break;
case 2:
- DoScriptText(SAY_SUMMON_2, m_creature);
+ DoScriptText(SAY_SUMMON_2, me);
JumpToNextStep(3000);
break;
case 3:
- DoScriptText(SAY_SUMMON_3, m_creature);
+ DoScriptText(SAY_SUMMON_3, me);
JumpToNextStep(3000);
break;
case 4:
- DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, m_creature);
+ DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me);
JumpToNextStep(3000);
break;
case 5:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_AGGRESSIVE);
Summon = true;
break;
}
@@ -263,29 +263,29 @@ struct boss_algalonAI : public ScriptedAI
if (QuantumStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE,H_SPELL_QUANTUM_STRIKE), true);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE,H_SPELL_QUANTUM_STRIKE), true);
QuantumStrike_Timer = urand(4000, 14000);
} else QuantumStrike_Timer -= diff;
if (BigBang_Timer <= diff)
{
- DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), m_creature);
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_BIG_BANG,H_SPELL_BIG_BANG), true);
+ DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), me);
+ DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG,H_SPELL_BIG_BANG), true);
BigBang_Timer = 90000;
} else BigBang_Timer -= diff;
if (Ascend_Timer <= diff)
{
- DoCast(m_creature->getVictim(),SPELL_ASCEND, true);
+ DoCast(me->getVictim(),SPELL_ASCEND, true);
Ascend_Timer = 480000;
} else Ascend_Timer -= diff;
if (PhasePunch_Timer <= diff)
{
- DoCast(m_creature->getVictim(),SPELL_PHASE_PUNCH, true);
+ DoCast(me->getVictim(),SPELL_PHASE_PUNCH, true);
PhasePunch_Timer = 8000;
} else PhasePunch_Timer -= diff;
@@ -299,8 +299,8 @@ struct boss_algalonAI : public ScriptedAI
if (Berserk_Timer <= diff)
{
- DoScriptText(SAY_BERSERK, m_creature);
- DoCast(m_creature->getVictim(),SPELL_BERSERK, true);
+ DoScriptText(SAY_BERSERK, me);
+ DoCast(me->getVictim(),SPELL_BERSERK, true);
Berserk_Timer = 360000;
} else Berserk_Timer -= diff;
@@ -316,8 +316,8 @@ struct boss_algalonAI : public ScriptedAI
{
if (Ascend_Timer <= diff)
{
- DoCast(m_creature, SPELL_ASCEND);
- DoScriptText(SAY_BERSERK, m_creature);
+ DoCast(me, SPELL_ASCEND);
+ DoScriptText(SAY_BERSERK, me);
Ascend_Timer = urand(360000,365000);
Enrage = false;
} else Ascend_Timer -= diff;
@@ -352,7 +352,7 @@ struct mob_collapsing_starAI : public ScriptedAI
if (BlackHoleExplosion_Timer <= diff)
{
- m_creature->CastSpell(m_creature, SPELL_BLACK_HOLE_EXPLOSION, false);
+ me->CastSpell(me, SPELL_BLACK_HOLE_EXPLOSION, false);
BlackHoleExplosion_Timer = 0;
} else BlackHoleExplosion_Timer -= diff;
}
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp b/src/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp
index 18dcbe1b1da..4d26ab19332 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp
@@ -113,9 +113,9 @@ enum Yells
SAY_BRUNDIR_BERSERK = -1603047,
};
-bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* m_creature)
+bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* me)
{
- if (!pInstance || !m_creature)
+ if (!pInstance || !me)
return false;
for (uint8 i = 0; i < 3; ++i)
@@ -124,7 +124,7 @@ bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* m_creature)
if (!guid)
return false;
- if (Creature *boss = Unit::GetCreature(*m_creature, guid))
+ if (Creature *boss = Unit::GetCreature(*me, guid))
{
if (boss->isAlive())
return false;
@@ -146,7 +146,7 @@ struct boss_steelbreakerAI : public ScriptedAI
{
events.Reset();
phase = 0;
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
if (pInstance)
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
}
@@ -157,9 +157,9 @@ struct boss_steelbreakerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_STEELBREAKER_AGGRO, m_creature);
+ DoScriptText(SAY_STEELBREAKER_AGGRO, me);
DoZoneInCombat();
- DoCast(m_creature, RAID_MODE(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H));
+ DoCast(me, RAID_MODE(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H));
events.ScheduleEvent(EVENT_ENRAGE, 900000);
UpdatePhase();
}
@@ -177,13 +177,13 @@ struct boss_steelbreakerAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
- if (Creature* Brundir = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
+ if (Creature* Brundir = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
if (Brundir->isAlive())
Brundir->SetHealth(Brundir->GetMaxHealth());
- if (Creature* Molgeim = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
+ if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
if (Molgeim->isAlive())
Molgeim->SetHealth(Molgeim->GetMaxHealth());
@@ -193,17 +193,17 @@ struct boss_steelbreakerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1,SAY_STEELBREAKER_DEATH_2), m_creature);
- if (IsEncounterComplete(pInstance, m_creature) && pInstance)
+ DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1,SAY_STEELBREAKER_DEATH_2), me);
+ if (IsEncounterComplete(pInstance, me) && pInstance)
pInstance->SetData(TYPE_ASSEMBLY, DONE);
}
void KilledUnit(Unit *who)
{
- DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1,SAY_STEELBREAKER_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1,SAY_STEELBREAKER_SLAY_2), me);
if (phase == 3)
- DoCast(m_creature, SPELL_ELECTRICAL_CHARGE);
+ DoCast(me, SPELL_ELECTRICAL_CHARGE);
}
void SpellHit(Unit *from, const SpellEntry *spell)
@@ -224,7 +224,7 @@ struct boss_steelbreakerAI : public ScriptedAI
switch(eventId)
{
case EVENT_ENRAGE:
- DoScriptText(SAY_STEELBREAKER_BERSERK, m_creature);
+ DoScriptText(SAY_STEELBREAKER_BERSERK, me);
DoCast(SPELL_BERSERK);
break;
case EVENT_FUSION_PUNCH:
@@ -237,7 +237,7 @@ struct boss_steelbreakerAI : public ScriptedAI
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(20000, 40000));
break;
case EVENT_OVERWHELMING_POWER:
- DoScriptText(SAY_STEELBREAKER_POWER, m_creature);
+ DoScriptText(SAY_STEELBREAKER_POWER, me);
DoCast(me->getVictim(), RAID_MODE(SPELL_OVERWHELMING_POWER, SPELL_OVERWHELMING_POWER_H));
events.ScheduleEvent(EVENT_OVERWHELMING_POWER, RAID_MODE(60000, 35000));
break;
@@ -260,7 +260,7 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
if (pInstance)
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
events.Reset();
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
phase = 0;
}
@@ -270,7 +270,7 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_MOLGEIM_AGGRO, m_creature);
+ DoScriptText(SAY_MOLGEIM_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_ENRAGE, 900000);
UpdatePhase();
@@ -290,30 +290,30 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
- if (Creature* Steelbreaker = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
+ if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
if (Steelbreaker->isAlive())
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
- if (Creature* Brundir = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
+ if (Creature* Brundir = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
if (Brundir->isAlive())
Brundir->SetHealth(Brundir->GetMaxHealth());
- DoCast(m_creature, SPELL_SUPERCHARGE);
+ DoCast(me, SPELL_SUPERCHARGE);
}
}
void JustDied(Unit* Killer)
{
- DoScriptText(RAND(SAY_MOLGEIM_DEATH_1,SAY_MOLGEIM_DEATH_2), m_creature);
- if (IsEncounterComplete(pInstance, m_creature) && pInstance)
+ DoScriptText(RAND(SAY_MOLGEIM_DEATH_1,SAY_MOLGEIM_DEATH_2), me);
+ if (IsEncounterComplete(pInstance, me) && pInstance)
pInstance->SetData(TYPE_ASSEMBLY, DONE);
}
void KilledUnit(Unit *who)
{
- DoScriptText(RAND(SAY_MOLGEIM_SLAY_1,SAY_MOLGEIM_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_MOLGEIM_SLAY_1,SAY_MOLGEIM_SLAY_2), me);
}
void SpellHit(Unit *from, const SpellEntry *spell)
@@ -334,30 +334,30 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
switch(eventId)
{
case EVENT_ENRAGE:
- DoScriptText(SAY_MOLGEIM_BERSERK, m_creature);
+ DoScriptText(SAY_MOLGEIM_BERSERK, me);
DoCast(SPELL_BERSERK);
break;
case EVENT_RUNE_OF_POWER: // Improve target selection; random alive friendly
{
Unit *pTarget = DoSelectLowestHpFriendly(60);
if (!pTarget || (pTarget && !pTarget->isAlive()))
- pTarget = m_creature;
+ pTarget = me;
DoCast(pTarget, SPELL_RUNE_OF_POWER);
events.ScheduleEvent(EVENT_RUNE_OF_POWER, 60000);
break;
}
case EVENT_SHIELD_OF_RUNES:
- DoCast(m_creature, RAID_MODE(SPELL_SHIELD_OF_RUNES, SPELL_SHIELD_OF_RUNES_H));
+ DoCast(me, RAID_MODE(SPELL_SHIELD_OF_RUNES, SPELL_SHIELD_OF_RUNES_H));
events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000,34000));
break;
case EVENT_RUNE_OF_DEATH:
- DoScriptText(SAY_MOLGEIM_RUNE_DEATH, m_creature);
+ DoScriptText(SAY_MOLGEIM_RUNE_DEATH, me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(pTarget, SPELL_RUNE_OF_DEATH);
events.ScheduleEvent(EVENT_RUNE_OF_DEATH, urand(30000,40000));
break;
case EVENT_RUNE_OF_SUMMONING:
- DoScriptText(SAY_MOLGEIM_SUMMON, m_creature);
+ DoScriptText(SAY_MOLGEIM_SUMMON, me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(pTarget, SPELL_RUNE_OF_SUMMONING);
events.ScheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(20000,30000));
@@ -378,26 +378,26 @@ struct mob_lightning_elementalAI : public ScriptedAI
void Charge()
{
- Unit* pTarget = m_creature->SelectNearestTarget();
- m_creature->AddThreat(pTarget, 5000000.0f);
+ Unit* pTarget = me->SelectNearestTarget();
+ me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return;
if (!UpdateVictim())
return;
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_LIGHTNING_BLAST, SPELL_LIGHTNING_BLAST_H));
- m_creature->Kill(m_creature); // hack until spell works
+ DoCast(me->getVictim(), RAID_MODE(SPELL_LIGHTNING_BLAST, SPELL_LIGHTNING_BLAST_H));
+ me->Kill(me); // hack until spell works
}
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); // needed at every update?
+ me->GetMotionMaster()->MoveChase(me->getVictim()); // needed at every update?
}
};
@@ -410,8 +410,8 @@ struct mob_rune_of_summoningAI : public ScriptedAI
void SummonLightningElemental()
{
- m_creature->SummonCreature(CREATURE_RUNE_OF_SUMMONING, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN);
- m_creature->DealDamage(m_creature, m_creature->GetHealth());
+ me->SummonCreature(CREATURE_RUNE_OF_SUMMONING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN);
+ me->DealDamage(me, me->GetHealth());
}
};
@@ -426,7 +426,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
events.Reset();
phase = 0;
}
@@ -437,7 +437,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_BRUNDIR_AGGRO, m_creature);
+ DoScriptText(SAY_BRUNDIR_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_ENRAGE, 900000);
UpdatePhase();
@@ -453,20 +453,20 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
events.RescheduleEvent(EVENT_LIGHTNING_WHIRL, urand(20000,40000));
if (phase >= 3)
{
- DoCast(m_creature, SPELL_STORMSHIELD);
+ DoCast(me, SPELL_STORMSHIELD);
events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, urand(40000,80000));
}
}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
- if (Creature* Steelbreaker = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
+ if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
if (Steelbreaker->isAlive())
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
- if (Creature* Molgeim = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
+ if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
if (Molgeim->isAlive())
Molgeim->SetHealth(Molgeim->GetMaxHealth());
@@ -476,14 +476,14 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(RAND(SAY_BRUNDIR_DEATH_1,SAY_BRUNDIR_DEATH_2), m_creature);
- if (IsEncounterComplete(pInstance, m_creature) && pInstance)
+ DoScriptText(RAND(SAY_BRUNDIR_DEATH_1,SAY_BRUNDIR_DEATH_2), me);
+ if (IsEncounterComplete(pInstance, me) && pInstance)
pInstance->SetData(TYPE_ASSEMBLY, DONE);
}
void KilledUnit(Unit *who)
{
- DoScriptText(RAND(SAY_BRUNDIR_SLAY_1,SAY_BRUNDIR_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_BRUNDIR_SLAY_1,SAY_BRUNDIR_SLAY_2), me);
}
void SpellHit(Unit *from, const SpellEntry *spell)
@@ -504,7 +504,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
switch(eventId)
{
case EVENT_ENRAGE:
- DoScriptText(SAY_BRUNDIR_BERSERK, m_creature);
+ DoScriptText(SAY_BRUNDIR_BERSERK, me);
DoCast(SPELL_BERSERK);
break;
case EVENT_CHAIN_LIGHTNING:
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp b/src/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp
index c9103d3b82d..f0864f4a212 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp
@@ -53,17 +53,17 @@ struct boss_auriaya_AI : public BossAI
void EnterCombat(Unit* who)
{
_EnterCombat();
- DoScriptText(SAY_AGGRO,m_creature);
+ DoScriptText(SAY_AGGRO,me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp b/src/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp
index 31c03816c6f..8dfd0630e39 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp
@@ -99,14 +99,14 @@ struct boss_flame_leviathanAI : public BossAI
void Reset()
{
_Reset();
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
}
void EnterCombat(Unit *who)
{
_EnterCombat();
- DoScriptText(SAY_AGGRO, m_creature);
- m_creature->SetReactState(REACT_DEFENSIVE);
+ DoScriptText(SAY_AGGRO, me);
+ me->SetReactState(REACT_DEFENSIVE);
events.ScheduleEvent(EVENT_PURSUE, 0);
events.ScheduleEvent(EVENT_MISSILE, 1500);
events.ScheduleEvent(EVENT_VENT, 20000);
@@ -127,7 +127,7 @@ struct boss_flame_leviathanAI : public BossAI
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
@@ -136,15 +136,15 @@ struct boss_flame_leviathanAI : public BossAI
if (spell->Id == 62472)
vehicle->InstallAllAccessories();
else if (spell->Id == SPELL_ELECTROSHOCK)
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return;
- if (m_creature->getThreatManager().isThreatListEmpty())
+ if (me->getThreatManager().isThreatListEmpty())
{
EnterEvadeMode();
return;
@@ -152,11 +152,11 @@ struct boss_flame_leviathanAI : public BossAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
uint32 eventId = events.GetEvent();
- if (!m_creature->getVictim())
+ if (!me->getVictim())
eventId = EVENT_PURSUE;
switch(eventId)
@@ -166,7 +166,7 @@ struct boss_flame_leviathanAI : public BossAI
DoCastAOE(SPELL_PURSUED, true);
//events.RepeatEvent(35000); // this should not be used because eventId may be overriden
events.RescheduleEvent(EVENT_PURSUE, 35000);
- if (!m_creature->getVictim()) // all siege engines and demolishers are dead
+ if (!me->getVictim()) // all siege engines and demolishers are dead
UpdateVictim(); // begin to kill other things
return;
case EVENT_MISSILE:
@@ -189,11 +189,11 @@ struct boss_flame_leviathanAI : public BossAI
events.RepeatEvent(2000);
return;
case EVENT_MIMIRON_INFERNO: // Not Blizzlike
- DoCast(m_creature->getVictim(), SPELL_MIMIRON_INFERNO);
+ DoCast(me->getVictim(), SPELL_MIMIRON_INFERNO);
events.RepeatEvent(urand(60000, 120000));
return;
case EVENT_HODIR_FURY: // Not Blizzlike
- DoCast(m_creature->getVictim(), SPELL_HODIR_FURY);
+ DoCast(me->getVictim(), SPELL_HODIR_FURY);
events.RepeatEvent(urand(60000, 120000));
return;
default:
@@ -213,7 +213,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
{
assert(vehicle);
#ifdef BOSS_DEBUG
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
#endif
}
@@ -230,7 +230,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
{
- if (!m_creature->GetVehicle())
+ if (!me->GetVehicle())
return;
if (seatId == SEAT_PLAYER)
@@ -240,7 +240,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
if (Creature *turret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET)))
{
- turret->setFaction(m_creature->GetVehicleBase()->getFaction());
+ turret->setFaction(me->GetVehicleBase()->getFaction());
turret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
turret->AI()->AttackStart(who);
}
@@ -290,15 +290,15 @@ struct boss_flame_leviathan_overload_deviceAI : public PassiveAI
{
if (param == EVENT_SPELLCLICK)
{
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if (m_creature->GetVehicle())
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if (me->GetVehicle())
{
- if (Unit *player = m_creature->GetVehicle()->GetPassenger(SEAT_PLAYER))
+ if (Unit *player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
{
player->ExitVehicle();
- m_creature->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
- if (Unit *leviathan = m_creature->GetVehicleBase()->GetVehicleBase())
+ me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
+ if (Unit *leviathan = me->GetVehicleBase()->GetVehicleBase())
player->GetMotionMaster()->MoveKnockbackFrom(leviathan->GetPositionX(), leviathan->GetPositionY(), 30, 30);
}
}
@@ -312,18 +312,18 @@ struct boss_flame_leviathan_safety_containerAI : public PassiveAI
void MovementInform(uint32 type, uint32 id)
{
- if (id == m_creature->GetEntry())
+ if (id == me->GetEntry())
{
if (Creature *liquid = DoSummon(MOB_LIQUID, me, 0))
liquid->CastSpell(liquid, 62494, true);
- m_creature->DisappearAndDie(); // this will relocate creature to sky
+ me->DisappearAndDie(); // this will relocate creature to sky
}
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->GetVehicle() && m_creature->isSummon() && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
- m_creature->GetMotionMaster()->MoveFall(409.8f, m_creature->GetEntry());
+ if (!me->GetVehicle() && me->isSummon() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
+ me->GetMotionMaster()->MoveFall(409.8f, me->GetEntry());
}
};
@@ -331,7 +331,7 @@ struct spell_pool_of_tarAI : public TriggerAI
{
spell_pool_of_tarAI(Creature *c) : TriggerAI(c)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void DamageTaken(Unit *who, uint32 &damage)
@@ -341,8 +341,8 @@ struct spell_pool_of_tarAI : public TriggerAI
void SpellHit(Unit* caster, const SpellEntry *spell)
{
- if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !m_creature->HasAura(SPELL_BLAZE))
- m_creature->CastSpell(me, SPELL_BLAZE, true);
+ if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE))
+ me->CastSpell(me, SPELL_BLAZE, true);
}
};
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp
index 9e5dcc1eb55..3b06f0d72e4 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp
@@ -64,18 +64,18 @@ struct boss_freyaAI : public BossAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
_EnterCombat();
}
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_hodir.cpp b/src/scripts/northrend/ulduar/ulduar/boss_hodir.cpp
index 4feb2168f97..4b6664990b2 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_hodir.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_hodir.cpp
@@ -45,18 +45,18 @@ struct boss_hodirAI : public BossAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
_EnterCombat();
}
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_ignis.cpp b/src/scripts/northrend/ulduar/ulduar/boss_ignis.cpp
index 3e51b7d39cc..40d91b94945 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_ignis.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_ignis.cpp
@@ -54,18 +54,18 @@ struct boss_ignis_AI : public BossAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO,m_creature);
+ DoScriptText(SAY_AGGRO,me);
_EnterCombat();
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
@@ -76,12 +76,12 @@ struct boss_ignis_AI : public BossAI
if (!UpdateVictim())
return;
- if (m_creature->GetPositionY() < 150 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
+ if (me->GetPositionY() < 150 || me->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(false);
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(false);
+ me->GetMotionMaster()->MoveTargetedHome();
}
if (uiFlameJetsTimer <= diff)
@@ -92,7 +92,7 @@ struct boss_ignis_AI : public BossAI
if (uiScorchTimer <= diff)
{
- DoScriptText(RAND(SAY_SCORCH_1,SAY_SCORCH_2), m_creature);
+ DoScriptText(RAND(SAY_SCORCH_1,SAY_SCORCH_2), me);
DoCast(SPELL_SCORCH);
uiScorchTimer = 20000;
} else uiScorchTimer -= diff;
@@ -101,7 +101,7 @@ struct boss_ignis_AI : public BossAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- DoScriptText(SAY_SLAG_POT, m_creature);
+ DoScriptText(SAY_SLAG_POT, me);
DoCast(pTarget, SPELL_SLAG_POT);
}
uiSlagPotTimer = 30000;
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp b/src/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp
index dd2518fb783..3267d884dde 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp
@@ -70,13 +70,13 @@ struct boss_kologarnAI : public BossAI
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
void KilledUnit(Unit* who)
{
- DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_2), me);
}
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
@@ -94,7 +94,7 @@ struct boss_kologarnAI : public BossAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
_EnterCombat();
events.ScheduleEvent(EVENT_SMASH, 5000);
events.ScheduleEvent(EVENT_SWEEP, 10000);
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
index 7dba5317d57..0c06e582838 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
@@ -86,13 +86,13 @@ struct boss_razorscaleAI : public BossAI
InitialSpawn = true;
IsFlying = true;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
}
@@ -102,7 +102,7 @@ struct boss_razorscaleAI : public BossAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -110,28 +110,28 @@ struct boss_razorscaleAI : public BossAI
if (!UpdateVictim())
return;
- if (m_creature->GetPositionY() > -60 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
+ if (me->GetPositionY() > -60 || me->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(false);
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(false);
+ me->GetMotionMaster()->MoveTargetedHome();
}
// Victim is not controlled by a player (should never happen)
- if (m_creature->getVictim() && !m_creature->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
- m_creature->Kill(m_creature->getVictim());
+ if (me->getVictim() && !me->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
+ me->Kill(me->getVictim());
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
{
Phase = 2;
- DoScriptText(SAY_PHASE_2_TRANS, m_creature); // Audio: "Move quickly! She won't remain grounded for long!"
+ DoScriptText(SAY_PHASE_2_TRANS, me); // Audio: "Move quickly! She won't remain grounded for long!"
}
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 33 && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 33 && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
{
Phase = 3;
- DoScriptText(SAY_PHASE_3_TRANS, m_creature); // "Razorscale lands permanently!"
+ DoScriptText(SAY_PHASE_3_TRANS, me); // "Razorscale lands permanently!"
// TODO: Cast Devouring Flame on all harpoon guns simultaneously, briefly after Phase 3 starts (lasts until the harpoon guns are destroyed)
}
@@ -164,7 +164,7 @@ struct boss_razorscaleAI : public BossAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
{
- m_creature->SetInFront(pTarget);
+ me->SetInFront(pTarget);
DoCast(pTarget, SPELL_FIREBALL);
}
@@ -173,7 +173,7 @@ struct boss_razorscaleAI : public BossAI
if (FlameBreathTimer <= diff)
{
- DoScriptText(EMOTE_BREATH, m_creature); // TODO: "Razorscale takes a deep breath..."
+ DoScriptText(EMOTE_BREATH, me); // TODO: "Razorscale takes a deep breath..."
DoCastVictim(SPELL_FLAMEBREATH);
FlameBreathTimer = 15000;
WingBuffetTimer = 0;
@@ -183,13 +183,13 @@ struct boss_razorscaleAI : public BossAI
{
if (FlameBuffetTimer <= diff)
{
- DoScriptText(EMOTE_BREATH, m_creature);
+ DoScriptText(EMOTE_BREATH, me);
std::list<Unit*> pTargets;
SelectTargetList(pTargets, RAID_MODE(3,9), SELECT_TARGET_RANDOM, 100, true);
uint8 i = 0;
for (std::list<Unit*>::const_iterator itr = pTargets.begin(); itr != pTargets.end();)
{
- if (m_creature->HasInArc(M_PI, *itr))
+ if (me->HasInArc(M_PI, *itr))
{
DoCast(*itr, SPELL_FLAMEBUFFET, true);
++i;
@@ -217,7 +217,7 @@ struct boss_razorscaleAI : public BossAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
{
- m_creature->SetInFront(pTarget);
+ me->SetInFront(pTarget);
DoCast(pTarget, SPELL_FIREBALL);
}
@@ -228,7 +228,7 @@ struct boss_razorscaleAI : public BossAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
{
- m_creature->SetInFront(pTarget);
+ me->SetInFront(pTarget);
DoCast(pTarget, SPELL_DEVOURINGFLAME);
}
@@ -252,9 +252,9 @@ struct boss_razorscaleAI : public BossAI
{
float x = std::max(500.0f, std::min(650.0f, pTarget->GetPositionX() + irand(-20,20))); // Safe range is between 500 and 650
float y = std::max(-235.0f, std::min(-145.0f, pTarget->GetPositionY() + irand(-20,20))); // Safe range is between -235 and -145
- float z = m_creature->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT); // Ground level
+ float z = me->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT); // Ground level
// TODO: Spawn drillers, then spawn adds 5 seconds later
- if (Creature *pAdd = m_creature->SummonCreature(NPC_DARK_RUNE_SENTINEL, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
+ if (Creature *pAdd = me->SummonCreature(NPC_DARK_RUNE_SENTINEL, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
pAdd->AI()->AttackStart(pTarget);
}
}
@@ -265,34 +265,34 @@ struct boss_razorscaleAI : public BossAI
{
const float x = 587.54;
const float y = -174.92;
- const float GroundLevel = m_creature->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT);
+ const float GroundLevel = me->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT);
const float FlightHeight = GroundLevel + 4.0f; // TODO: Fly out of range of attacks (442 is sufficient height for this), minus ~(10*number of harpoon gun chains attached to Razorscale)
if (Phase == 1) // Always flying during Phase 1
IsFlying = true;
- m_creature->SetFlying(IsFlying);
- m_creature->SendMovementFlagUpdate();
- m_creature->SetSpeed(MOVE_WALK, IsFlying ? 7.0f : 2.5f, IsFlying);
+ me->SetFlying(IsFlying);
+ me->SendMovementFlagUpdate();
+ me->SetSpeed(MOVE_WALK, IsFlying ? 7.0f : 2.5f, IsFlying);
if (Phase == 1) // Flying Phase
{
- if (m_creature->GetPositionZ() > FlightHeight) // Correct height, stop moving
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ if (me->GetPositionZ() > FlightHeight) // Correct height, stop moving
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
else // Incorrect height
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, FlightHeight + 0.5f); // Fly to slightly above (x, y, FlightHeight)
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->GetMotionMaster()->MovePoint(0, x, y, FlightHeight + 0.5f); // Fly to slightly above (x, y, FlightHeight)
}
}
else // Ground Phases
{
- const float CurrentGroundLevel = m_creature->GetBaseMap()->GetHeight(m_creature->GetPositionX(), m_creature->GetPositionY(), MAX_HEIGHT);
+ const float CurrentGroundLevel = me->GetBaseMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT);
//if (StunTimer == 30000) // Only fly around if not stunned.
//{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- if (IsFlying && m_creature->GetPositionZ() > CurrentGroundLevel) // Fly towards the ground
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), CurrentGroundLevel);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ if (IsFlying && me->GetPositionZ() > CurrentGroundLevel) // Fly towards the ground
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), CurrentGroundLevel);
// TODO: Swoop up just before landing
else
IsFlying = false; // Landed, no longer flying
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_thorim.cpp b/src/scripts/northrend/ulduar/ulduar/boss_thorim.cpp
index 40112eb3a3d..2d081093985 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_thorim.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_thorim.cpp
@@ -54,24 +54,24 @@ struct boss_thorimAI : public BossAI
void EnterEvadeMode()
{
- DoScriptText(SAY_WIPE, m_creature);
+ DoScriptText(SAY_WIPE, me);
_EnterEvadeMode();
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me);
_EnterCombat();
}
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_xt002.cpp b/src/scripts/northrend/ulduar/ulduar/boss_xt002.cpp
index 21dbe4bf6cd..7828c4ec1ff 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_xt002.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_xt002.cpp
@@ -191,7 +191,7 @@ struct boss_xt002_AI : public BossAI
void Reset()
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
//Makes XT-002 to cast a light bomb 10 seconds after aggro.
uiSearingLightTimer = TIMER_SEARING_LIGHT/2;
@@ -217,7 +217,7 @@ struct boss_xt002_AI : public BossAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
_EnterCombat();
}
@@ -234,10 +234,10 @@ struct boss_xt002_AI : public BossAI
enterHardMode = true;
// set max health
- m_creature->SetHealth(m_creature->GetMaxHealth());
+ me->SetHealth(me->GetMaxHealth());
// Get his heartbreak buff
- m_creature->CastSpell(m_creature, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
+ me->CastSpell(me, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
}
break;
}
@@ -255,12 +255,12 @@ struct boss_xt002_AI : public BossAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
_JustDied();
}
@@ -304,7 +304,7 @@ struct boss_xt002_AI : public BossAI
if (uiTympanicTantrumTimer <= 0)
{
- DoScriptText(SAY_TYMPANIC_TANTRUM, m_creature);
+ DoScriptText(SAY_TYMPANIC_TANTRUM, me);
DoCast(SPELL_TYMPANIC_TANTRUM);
uiTympanicTantrumTimer = urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX);
} else uiTympanicTantrumTimer -= diff;
@@ -332,20 +332,20 @@ struct boss_xt002_AI : public BossAI
else
{
//Stop moving
- m_creature->StopMoving();
+ me->StopMoving();
//Start summoning adds
if (uiSpawnAddTimer <= diff)
{
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
// Spawn Pummeller
switch (rand() % 4)
{
- case 0: m_creature->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 1: m_creature->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 2: m_creature->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 3: m_creature->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
}
// Spawn 5 Bombs
@@ -354,20 +354,20 @@ struct boss_xt002_AI : public BossAI
//Some randomes are added so they wont spawn in a pile
switch(rand() % 4)
{
- case 0: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 1: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 2: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 3: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
}
}
//Spawn 5 Scrapbots
switch (rand() % 4)
{
- case 0: m_creature->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 1: m_creature->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 2: m_creature->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
- case 3: m_creature->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
+ case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
}
uiSpawnAddTimer = TIMER_SPAWN_ADD;
@@ -376,7 +376,7 @@ struct boss_xt002_AI : public BossAI
// Is the phase over?
if (uiHeartPhaseTimer <= diff)
{
- DoScriptText(SAY_HEART_CLOSED, m_creature);
+ DoScriptText(SAY_HEART_CLOSED, me);
SetPhaseOne();
}
else
@@ -390,7 +390,7 @@ struct boss_xt002_AI : public BossAI
{
if (uiSpawnLifeSparkTimer <= diff)
{
- if (Unit *pSearingLightTarget = m_creature->GetUnit(*m_creature, uiSearingLightTarget))
+ if (Unit *pSearingLightTarget = me->GetUnit(*me, uiSearingLightTarget))
pSearingLightTarget->SummonCreature(NPC_LIFE_SPARK, pSearingLightTarget->GetPositionX(), pSearingLightTarget->GetPositionY(), pSearingLightTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
searing_light_active = false;
@@ -404,7 +404,7 @@ struct boss_xt002_AI : public BossAI
{
if (uiGravityBombAuraTimer <= diff)
{
- if (Unit *pGravityBombTarget = m_creature->GetUnit(*m_creature, uiGravityBombTarget))
+ if (Unit *pGravityBombTarget = me->GetUnit(*me, uiGravityBombTarget))
{
pGravityBombTarget->RemoveAurasDueToSpell(RAID_MODE(SPELL_GRAVITY_BOMB_10,SPELL_GRAVITY_BOMB_25));
if (hardMode)
@@ -424,8 +424,8 @@ struct boss_xt002_AI : public BossAI
if (!enraged)
if (uiEnrageTimer <= diff)
{
- DoScriptText(SAY_BERSERK, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ DoScriptText(SAY_BERSERK, me);
+ DoCast(me, SPELL_ENRAGE);
enraged = true;
} else uiEnrageTimer -= diff;
}
@@ -433,10 +433,10 @@ struct boss_xt002_AI : public BossAI
void exposeHeart()
{
//Make untargetable
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
//Summon the heart npc
- m_creature->SummonCreature(NPC_XT002_HEART, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0, TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE);
+ me->SummonCreature(NPC_XT002_HEART, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 7, 0, TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE);
// Start "end of phase 2 timer"
uiHeartPhaseTimer = TIMER_HEART_PHASE;
@@ -448,7 +448,7 @@ struct boss_xt002_AI : public BossAI
//Reset the add spawning timer
uiSpawnAddTimer = TIMER_SPAWN_ADD;
- DoScriptText(SAY_HEART_OPENED, m_creature);
+ DoScriptText(SAY_HEART_OPENED, me);
}
void SetPhaseOne()
@@ -459,9 +459,9 @@ struct boss_xt002_AI : public BossAI
uiSpawnAddTimer = TIMER_SPAWN_ADD;
if (!hardMode)
- m_creature->ModifyHealth(-((int32)transferHealth));
+ me->ModifyHealth(-((int32)transferHealth));
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
phase = 1;
}
@@ -484,7 +484,7 @@ struct boss_xt002_AI : public BossAI
// //Deal damage to the victim
// int32 damage = urand(minDamage, maxDamage);
// i->getSource()->ModifyHealth(-damage);
- // m_creature->SendSpellNonMeleeDamageLog(i->getSource(), SPELL_GRAVITY_BOMB_AURA_10, damage, SPELL_SCHOOL_MASK_SHADOW, 0, 0, false, 0);
+ // me->SendSpellNonMeleeDamageLog(i->getSource(), SPELL_GRAVITY_BOMB_AURA_10, damage, SPELL_SCHOOL_MASK_SHADOW, 0, 0, false, 0);
// //Replacing the tractor beam effect
// i->getSource()->JumpTo(pGravityBombTarget, 5);
@@ -509,9 +509,9 @@ struct mob_xt002_heartAI : public ScriptedAI
mob_xt002_heartAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = pCreature->GetInstanceData();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_EXPOSED_HEART);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_EXPOSED_HEART);
}
ScriptedInstance* m_pInstance;
@@ -519,25 +519,25 @@ struct mob_xt002_heartAI : public ScriptedAI
void JustDied(Unit *victim)
{
if (m_pInstance)
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
if (pXT002->AI())
pXT002->AI()->DoAction(ACTION_ENTER_HARD_MODE);
//removes the aura
- m_creature->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART);
+ me->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART);
}
void DamageTaken(Unit *pDone, uint32 &damage)
{
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
if (pXT002->AI())
{
- uint32 health = m_creature->GetHealth();
+ uint32 health = me->GetHealth();
health -= damage;
if (health < 0)
health = 0;
- pXT002->AI()->SetData(DATA_TRANSFERED_HEALTH, m_creature->GetMaxHealth() - health);
+ pXT002->AI()->SetData(DATA_TRANSFERED_HEALTH, me->GetMaxHealth() - health);
}
}
};
@@ -556,24 +556,24 @@ struct mob_scrapbotAI : public ScriptedAI
{
mob_scrapbotAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- m_pInstance = m_creature->GetInstanceData();
+ m_pInstance = me->GetInstanceData();
}
ScriptedInstance* m_pInstance;
void Reset()
{
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
- m_creature->GetMotionMaster()->MoveChase(pXT002);
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
+ me->GetMotionMaster()->MoveChase(pXT002);
}
void UpdateAI(const uint32 diff)
{
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
{
- if (m_creature->GetDistance2d(pXT002) <= 0.5)
+ if (me->GetDistance2d(pXT002) <= 0.5)
{
// TODO Send raid message
@@ -581,7 +581,7 @@ struct mob_scrapbotAI : public ScriptedAI
pXT002->ModifyHealth(pXT002->GetMaxHealth() * 0.01);
// Despawns the scrapbot
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
}
}
@@ -621,23 +621,23 @@ struct mob_pummellerAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
if (uiArcingSmashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ DoCast(me->getVictim(), SPELL_ARCING_SMASH);
uiArcingSmashTimer = TIMER_ARCING_SMASH;
} else uiArcingSmashTimer -= diff;
if (uiTrampleTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
+ DoCast(me->getVictim(), SPELL_TRAMPLE);
uiTrampleTimer = TIMER_TRAMPLE;
} else uiTrampleTimer -= diff;
if (uiUppercutTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
uiUppercutTimer = TIMER_UPPERCUT;
} else uiUppercutTimer -= diff;
}
@@ -667,10 +667,10 @@ struct mob_boombotAI : public ScriptedAI
void Reset()
{
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
- m_creature->GetMotionMaster()->MoveChase(pXT002);
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
+ me->GetMotionMaster()->MoveChase(pXT002);
}
void JustDied(Unit *killer)
@@ -680,15 +680,15 @@ struct mob_boombotAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
+ if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
{
- if (m_creature->GetDistance2d(pXT002) <= 0.5)
+ if (me->GetDistance2d(pXT002) <= 0.5)
{
//Explosion
- DoCast(m_creature, SPELL_BOOM);
+ DoCast(me, SPELL_BOOM);
//Despawns the boombot
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
}
}
@@ -709,7 +709,7 @@ struct mob_void_zoneAI : public ScriptedAI
mob_void_zoneAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = pCreature->GetInstanceData();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
ScriptedInstance* m_pInstance;
@@ -739,11 +739,11 @@ struct mob_void_zoneAI : public ScriptedAI
// for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
// {
// // If a player is within the range of the spell
- // if (i->getSource() && i->getSource()->GetDistance2d(m_creature) <= 16)
+ // if (i->getSource() && i->getSource()->GetDistance2d(me) <= 16)
// {
// // Deal damage to the victim
// int32 damage = RAID_MODE(VOID_ZONE_DMG_10, VOID_ZONE_DMG_25);
- // m_creature->DealDamage(i->getSource(), damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
+ // me->DealDamage(i->getSource(), damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
// }
// }
// }
@@ -772,7 +772,7 @@ struct mob_life_sparkAI : public ScriptedAI
void Reset()
{
- DoCast(m_creature, RAID_MODE(SPELL_STATIC_CHARGED_10, SPELL_STATIC_CHARGED_25));
+ DoCast(me, RAID_MODE(SPELL_STATIC_CHARGED_10, SPELL_STATIC_CHARGED_25));
uiShockTimer = 0; // first one is immediate.
}
@@ -783,9 +783,9 @@ struct mob_life_sparkAI : public ScriptedAI
if (uiShockTimer <= diff)
{
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- DoCast(m_creature->getVictim(), SPELL_SHOCK);
+ DoCast(me->getVictim(), SPELL_SHOCK);
uiShockTimer = TIMER_SHOCK;
}
}
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
index 57a39947477..969d74f9867 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
@@ -93,13 +93,13 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
void Reset()
{
if (bIsUndead)
- m_creature->UpdateEntry(MOB_INGVAR_HUMAN);
+ me->UpdateEntry(MOB_INGVAR_HUMAN);
bIsUndead = false;
bEventInProgress = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
uiCleaveTimer = 2000;
uiSmashTimer = 5000;
@@ -114,23 +114,23 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && !bIsUndead)
+ if (damage >= me->GetHealth() && !bIsUndead)
{
- //DoCast(m_creature, SPELL_INGVAR_FEIGN_DEATH, true); // Dont work ???
+ //DoCast(me, 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_OOC_NOT_ATTACKABLE);
- m_creature->GetMotionMaster()->MovementExpired(false);
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetHealth(0);
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->GetMotionMaster()->MovementExpired(false);
+ me->GetMotionMaster()->MoveIdle();
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
// visuel hack end
bEventInProgress = true;
bIsUndead = true;
- DoScriptText(YELL_DEAD_1,m_creature);
+ DoScriptText(YELL_DEAD_1,me);
}
if (bEventInProgress)
@@ -143,17 +143,17 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
{
bIsUndead = true;
bEventInProgress = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->UpdateEntry(MOB_INGVAR_UNDEAD);
- m_creature->SetInCombatWith(m_creature->getVictim());
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->UpdateEntry(MOB_INGVAR_UNDEAD);
+ me->SetInCombatWith(me->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
- DoScriptText(YELL_AGGRO_2,m_creature);
+ DoScriptText(YELL_AGGRO_2,me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(YELL_AGGRO_1,m_creature);
+ DoScriptText(YELL_AGGRO_1,me);
if (pInstance)
pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS);
@@ -161,7 +161,7 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(YELL_DEAD_2,m_creature);
+ DoScriptText(YELL_DEAD_2,me);
if (pInstance)
pInstance->SetData(DATA_INGVAR_EVENT, DONE);
@@ -170,9 +170,9 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (bIsUndead)
- DoScriptText(YELL_KILL_1,m_creature);
+ DoScriptText(YELL_KILL_1,me);
else
- DoScriptText(YELL_KILL_2,m_creature);
+ DoScriptText(YELL_KILL_2,me);
}
void UpdateAI(const uint32 diff)
@@ -185,8 +185,8 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (uiSpawnResTimer)
if (uiSpawnResTimer <= diff)
{
- DoCast(m_creature, SPELL_SUMMON_BANSHEE); // Summons directly on caster position
- // DoCast(m_creature, SPELL_SCOURG_RESURRECTION, true); // Not needed ?
+ DoCast(me, SPELL_SUMMON_BANSHEE); // Summons directly on caster position
+ // DoCast(me, SPELL_SCOURG_RESURRECTION, true); // Not needed ?
uiSpawnResTimer = 0;
} else uiSpawnResTimer -= diff;
@@ -195,24 +195,24 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (uiCleaveTimer <= diff)
{
- if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (!me->hasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
- DoCast(m_creature->getVictim(), SPELL_WOE_STRIKE);
+ DoCast(me->getVictim(), SPELL_WOE_STRIKE);
else
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = rand()%5000 + 2000;
}
} else uiCleaveTimer -= diff;
if (uiSmashTimer <= diff)
{
- if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (!me->hasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
- DoCast(m_creature->getVictim(), SPELL_DARK_SMASH);
+ DoCast(me->getVictim(), SPELL_DARK_SMASH);
else
- DoCast(m_creature->getVictim(), SPELL_SMASH);
+ DoCast(me->getVictim(), SPELL_SMASH);
uiSmashTimer = 10000;
}
} else uiSmashTimer -= diff;
@@ -221,22 +221,22 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
{
if (uiEnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
uiEnrageTimer = 10000;
} else uiEnrageTimer -= diff;
} else // In Undead form used to summon weapon
{
if (uiEnrageTimer <= diff)
{
- if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (!me->hasUnitState(UNIT_STAT_CASTING))
{
// Spawn target for Axe
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
if (pTarget)
{
- Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000);
+ Creature* temp = me->SummonCreature(ENTRY_THROW_TARGET,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000);
- DoCast(m_creature, SPELL_SHADOW_AXE_SUMMON);
+ DoCast(me, SPELL_SHADOW_AXE_SUMMON);
}
uiEnrageTimer = 30000;
}
@@ -245,12 +245,12 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (uiRoarTimer <= diff)
{
- if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (!me->hasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
- DoCast(m_creature, SPELL_DREADFUL_ROAR);
+ DoCast(me, SPELL_DREADFUL_ROAR);
else
- DoCast(m_creature, SPELL_STAGGERING_ROAR);
+ DoCast(me, SPELL_STAGGERING_ROAR);
uiRoarTimer = 10000;
}
} else uiRoarTimer -= diff;
@@ -290,21 +290,21 @@ struct mob_annhylde_the_callerAI : public ScriptedAI
void Reset()
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_HOVER);
- m_creature->SetSpeed(MOVE_SWIM , 1.0f);
- m_creature->SetSpeed(MOVE_RUN , 1.0f);
- m_creature->SetSpeed(MOVE_WALK , 1.0f);
- //m_creature->SetSpeed(MOVE_FLIGHT , 1.0f);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_HOVER);
+ me->SetSpeed(MOVE_SWIM , 1.0f);
+ me->SetSpeed(MOVE_RUN , 1.0f);
+ me->SetSpeed(MOVE_WALK , 1.0f);
+ //me->SetSpeed(MOVE_FLIGHT , 1.0f);
- m_creature->GetPosition(x,y,z);
+ me->GetPosition(x,y,z);
DoTeleportTo(x+1,y,z+30);
- Unit* ingvar = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
+ Unit* ingvar = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
if (ingvar)
{
- m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15);
+ me->GetMotionMaster()->MovePoint(1,x,y,z+15);
-// DoScriptText(YELL_RESSURECT,m_creature);
+// DoScriptText(YELL_RESSURECT,me);
}
}
@@ -312,7 +312,7 @@ struct mob_annhylde_the_callerAI : public ScriptedAI
{
if (type != POINT_MOTION_TYPE)
return;
- Unit* ingvar = Unit::GetUnit((*m_creature), pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
+ Unit* ingvar = Unit::GetUnit((*me), pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
if (ingvar)
{
switch (id)
@@ -325,9 +325,9 @@ struct mob_annhylde_the_callerAI : public ScriptedAI
uiResurectPhase = 1;
break;
case 2:
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->DealDamage(m_creature,m_creature->GetHealth());
- m_creature->RemoveCorpse();
+ me->SetVisibility(VISIBILITY_OFF);
+ me->DealDamage(me,me->GetHealth());
+ me->RemoveCorpse();
break;
}
}
@@ -343,7 +343,7 @@ struct mob_annhylde_the_callerAI : public ScriptedAI
{
if (uiResurectPhase == 1)
{
- Unit* ingvar = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
+ Unit* ingvar = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
if (ingvar)
{
ingvar->SetStandState(UNIT_STAND_STATE_STAND);
@@ -354,14 +354,14 @@ struct mob_annhylde_the_callerAI : public ScriptedAI
}
else if (uiResurectPhase == 2)
{
- if (Creature* ingvar = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0))
+ if (Creature* ingvar = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0))
{
ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
if (boss_ingvar_the_plundererAI* pAI = CAST_AI(boss_ingvar_the_plundererAI, ingvar->AI()))
pAI->StartZombiePhase();
- m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30);
+ me->GetMotionMaster()->MovePoint(2,x+1,y,z+30);
++uiResurectPhase;
uiResurectTimer = 0;
}
@@ -392,13 +392,13 @@ struct mob_ingvar_throw_dummyAI : public ScriptedAI
void Reset()
{
- Unit *pTarget = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50);
+ Unit *pTarget = me->FindNearestCreature(ENTRY_THROW_TARGET,50);
if (pTarget)
{
- DoCast(m_creature, SPELL_SHADOW_AXE_DAMAGE);
+ DoCast(me, SPELL_SHADOW_AXE_DAMAGE);
float x,y,z;
pTarget->GetPosition(x,y,z);
- m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z);
}
uiDespawnTimer = 7000;
}
@@ -409,8 +409,8 @@ struct mob_ingvar_throw_dummyAI : public ScriptedAI
{
if (uiDespawnTimer <= diff)
{
- m_creature->DealDamage(m_creature,m_creature->GetHealth());
- m_creature->RemoveCorpse();
+ me->DealDamage(me,me->GetHealth());
+ me->RemoveCorpse();
uiDespawnTimer = 0;
} else uiDespawnTimer -= diff;
}
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp
index 2f4bfbc5225..9fbb1121d24 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp
@@ -82,12 +82,12 @@ struct mob_frost_tombAI : public ScriptedAI
void JustDied(Unit *killer)
{
- if (killer->GetGUID() != m_creature->GetGUID())
+ if (killer->GetGUID() != me->GetGUID())
ShatterFrostTomb = true;
if (FrostTombGUID)
{
- Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID);
+ Unit* FrostTomb = Unit::GetUnit((*me),FrostTombGUID);
if (FrostTomb)
FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
}
@@ -95,9 +95,9 @@ struct mob_frost_tombAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID);
+ Unit* temp = Unit::GetUnit((*me),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);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
};
@@ -133,22 +133,22 @@ struct boss_kelesethAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(SAY_KILL, m_creature);
+ DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (IsHeroic() && !ShatterFrostTomb)
{
AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
if (AchievOnTheRocks)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -164,7 +164,7 @@ struct boss_kelesethAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
@@ -186,7 +186,7 @@ struct boss_kelesethAI : public ScriptedAI
{
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
- m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true);
+ me->CastSpell(pTarget, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true);
ShadowboltTimer = 10000;
} else ShadowboltTimer -= diff;
@@ -194,14 +194,14 @@ struct boss_kelesethAI : public ScriptedAI
if ((SummonSkeletonsTimer <= diff))
{
Creature* Skeleton;
- DoScriptText(SAY_SKELETONS, m_creature);
+ DoScriptText(SAY_SKELETONS, me);
for (uint8 i = 0; i < 5; ++i)
{
- if (Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ if (Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
{
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);
+ Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY() , me->GetPositionZ());
+ Skeleton->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Skeleton);
}
}
@@ -214,12 +214,12 @@ struct boss_kelesethAI : public ScriptedAI
if (pTarget->isAlive())
{
//DoCast(pTarget, SPELL_FROST_TOMB_SUMMON, true);
- if (Creature *pChains = m_creature->SummonCreature(CREATURE_FROSTTOMB, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
+ if (Creature *pChains = me->SummonCreature(CREATURE_FROSTTOMB, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
{
CAST_AI(mob_frost_tombAI, pChains->AI())->SetPrisoner(pTarget);
pChains->CastSpell(pTarget, SPELL_FROST_TOMB, true);
- DoScriptText(SAY_FROST_TOMB, m_creature);
+ DoScriptText(SAY_FROST_TOMB, me);
}
}
FrostTombTimer = 15000;
@@ -253,10 +253,10 @@ struct mob_vrykul_skeletonAI : public ScriptedAI
void EnterCombat(Unit *who){}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (done_by->GetGUID() == m_creature->GetGUID())
+ if (done_by->GetGUID() == me->GetGUID())
return;
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
PretendToDie();
damage = 0;
@@ -266,28 +266,28 @@ struct mob_vrykul_skeletonAI : public ScriptedAI
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);
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->GetMotionMaster()->MovementExpired(false);
+ me->GetMotionMaster()->MoveIdle();
+ me->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);
- DoCast(m_creature, SPELL_SCOURGE_RESSURRECTION, true);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_SCOURGE_RESSURRECTION, true);
- if (m_creature->getVictim())
+ if (me->getVictim())
{
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- m_creature->AI()->AttackStart(m_creature->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ me->AI()->AttackStart(me->getVictim());
}
else
- m_creature->GetMotionMaster()->Initialize();
+ me->GetMotionMaster()->Initialize();
};
void UpdateAI(const uint32 diff)
@@ -309,7 +309,7 @@ struct mob_vrykul_skeletonAI : public ScriptedAI
if (Decrepify_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DECREPIFY);
+ DoCast(me->getVictim(), SPELL_DECREPIFY);
Decrepify_Timer = 30000;
} else Decrepify_Timer -= diff;
@@ -317,8 +317,8 @@ struct mob_vrykul_skeletonAI : public ScriptedAI
}
}else
{
- if (m_creature->isAlive())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ if (me->isAlive())
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
index ebbe8d576ee..4e93da95a4d 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
@@ -81,10 +81,10 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
Dalronn_isDead = false;
Check_Timer = 5000;
- ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST);
+ ghost = (me->GetEntry() == MOB_SKARVALD_GHOST);
if (!ghost && pInstance)
{
- Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ Unit* dalronn = Unit::GetUnit((*me),pInstance->GetData64(DATA_DALRONN));
if (dalronn && dalronn->isDead())
CAST_CRE(dalronn)->Respawn();
@@ -96,9 +96,9 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
{
if (!ghost && pInstance)
{
- DoScriptText(YELL_SKARVALD_AGGRO,m_creature);
+ DoScriptText(YELL_SKARVALD_AGGRO,me);
- Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ Unit* dalronn = Unit::GetUnit((*me),pInstance->GetData64(DATA_DALRONN));
if (dalronn && dalronn->isAlive() && !dalronn->getVictim())
dalronn->getThreatManager().addThreat(who,0.0f);
@@ -110,22 +110,22 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
{
if (!ghost && pInstance)
{
- Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ Unit* dalronn = Unit::GetUnit((*me),pInstance->GetData64(DATA_DALRONN));
if (dalronn)
{
if (dalronn->isDead())
{
- DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature);
+ DoScriptText(YELL_SKARVALD_DAL_DIED,me);
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
}
else
{
- DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature);
+ DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,me);
- 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);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ //DoCast(me, SPELL_SUMMON_SKARVALD_GHOST, true);
+ Creature* temp = me->SummonCreature(MOB_SKARVALD_GHOST,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
if (temp)
{
temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
@@ -140,7 +140,7 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
{
if (!ghost)
{
- DoScriptText(YELL_SKARVALD_KILL,m_creature);
+ DoScriptText(YELL_SKARVALD_KILL,me);
}
}
@@ -149,7 +149,7 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
if (ghost)
{
if (pInstance && 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);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
if (!UpdateVictim())
@@ -161,7 +161,7 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
if (Check_Timer <= diff)
{
Check_Timer = 5000;
- Unit* dalronn = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_DALRONN) : 0);
+ Unit* dalronn = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_DALRONN) : 0);
if (dalronn && dalronn->isDead())
{
Dalronn_isDead = true;
@@ -174,7 +174,7 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
if (Dalronn_isDead)
if (Response_Timer <= diff)
{
- DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature);
+ DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,me);
Response_Timer = 0;
} else Response_Timer -= diff;
@@ -188,7 +188,7 @@ struct boss_skarvald_the_constructorAI : public ScriptedAI
if (StoneStrike_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE);
+ DoCast(me->getVictim(), SPELL_STONE_STRIKE);
StoneStrike_Timer = 5000+rand()%5000;
} else StoneStrike_Timer -= diff;
@@ -229,10 +229,10 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
Skarvald_isDead = false;
AggroYell_Timer = 0;
- ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST;
+ ghost = me->GetEntry() == MOB_DALRONN_GHOST;
if (!ghost && pInstance)
{
- Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ Unit* skarvald = Unit::GetUnit((*me),pInstance->GetData64(DATA_SKARVALD));
if (skarvald && skarvald->isDead())
CAST_CRE(skarvald)->Respawn();
@@ -244,7 +244,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
{
if (!ghost && pInstance)
{
- Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ Unit* skarvald = Unit::GetUnit((*me),pInstance->GetData64(DATA_SKARVALD));
if (skarvald && skarvald->isAlive() && !skarvald->getVictim())
skarvald->getThreatManager().addThreat(who,0.0f);
@@ -259,22 +259,22 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
{
if (!ghost && pInstance)
{
- Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ Unit* skarvald = Unit::GetUnit((*me),pInstance->GetData64(DATA_SKARVALD));
if (skarvald)
if (skarvald->isDead())
{
- DoScriptText(YELL_DALRONN_SKA_DIED,m_creature);
+ DoScriptText(YELL_DALRONN_SKA_DIED,me);
if (pInstance)
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
}
else
{
- DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature);
+ DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,me);
- 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);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ //DoCast(me, SPELL_SUMMON_DALRONN_GHOST, true);
+ Creature* temp = me->SummonCreature(MOB_DALRONN_GHOST,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
if (temp)
{
temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
@@ -288,7 +288,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
{
if (!ghost)
{
- DoScriptText(YELL_DALRONN_KILL,m_creature);
+ DoScriptText(YELL_DALRONN_KILL,me);
}
}
@@ -297,7 +297,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (ghost)
{
if (pInstance && 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);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
if (!UpdateVictim())
@@ -306,7 +306,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (AggroYell_Timer)
if (AggroYell_Timer <= diff)
{
- DoScriptText(YELL_DALRONN_AGGRO,m_creature);
+ DoScriptText(YELL_DALRONN_AGGRO,me);
AggroYell_Timer = 0;
} else AggroYell_Timer -= diff;
@@ -317,7 +317,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (Check_Timer <= diff)
{
Check_Timer = 5000;
- Unit* skarvald = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_SKARVALD) : 0);
+ Unit* skarvald = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_SKARVALD) : 0);
if (skarvald && skarvald->isDead())
{
Skarvald_isDead = true;
@@ -330,7 +330,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (Skarvald_isDead)
if (Response_Timer <= diff)
{
- DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature);
+ DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,me);
Response_Timer = 0;
} else Response_Timer -= diff;
@@ -338,7 +338,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (ShadowBolt_Timer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOW_BOLT);
ShadowBolt_Timer = 2100;//give a 100ms pause to try cast other spells
@@ -347,7 +347,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (Debilitate_Timer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEBILITATE);
Debilitate_Timer = 5000+rand()%5000;
@@ -357,9 +357,9 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
if (IsHeroic())
if (Summon_Timer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, H_SPELL_SUMMON_SKELETONS);
+ DoCast(me, H_SPELL_SUMMON_SKELETONS);
Summon_Timer = (rand()%10000) + 20000;
}
} else Summon_Timer -= diff;
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp
index 65e644f00ec..b5b064db86a 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp
@@ -50,13 +50,13 @@ struct npc_dragonflayer_forge_masterAI : public ScriptedAI
switch(fm_Type)
{
case 1:
- pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE);
+ pInstance->SetData(EVENT_FORGE_1,me->isAlive() ? NOT_STARTED : DONE);
break;
case 2:
- pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE);
+ pInstance->SetData(EVENT_FORGE_2,me->isAlive() ? NOT_STARTED : DONE);
break;
case 3:
- pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE);
+ pInstance->SetData(EVENT_FORGE_3,me->isAlive() ? NOT_STARTED : DONE);
break;
}
}
@@ -100,7 +100,7 @@ struct npc_dragonflayer_forge_masterAI : public ScriptedAI
break;
}
}
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE);
}
uint8 GetForgeMasterType()
@@ -111,13 +111,13 @@ struct npc_dragonflayer_forge_masterAI : public ScriptedAI
for (uint8 i = 0; i < 3 ; ++i)
{
GameObject* temp;
- temp = m_creature->FindNearestGameObject(entry_search[i],30);
+ temp = me->FindNearestGameObject(entry_search[i],30);
if (temp)
{
- if (m_creature->IsWithinDist(temp,diff,false))
+ if (me->IsWithinDist(temp,diff,false))
{
near_f = i + 1;
- diff = m_creature->GetDistance2d(temp);
+ diff = me->GetDistance2d(temp);
}
}
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
index 7bc397f158d..d30520f2c1b 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
@@ -91,7 +91,7 @@ struct boss_palehoofAI : public ScriptedAI
uiImpaleTimer = 12000;
uiWhiteringRoarTimer = 10000;
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
for (uint32 i=0;i<4;i++)
DoneAdds[i]=false;
@@ -104,13 +104,13 @@ struct boss_palehoofAI : public ScriptedAI
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, NOT_STARTED);
Creature* pTemp;
- if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN))) && !pTemp->isAlive())
+ if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN))) && !pTemp->isAlive())
pTemp->Respawn();
- if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO))) && !pTemp->isAlive())
+ if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO))) && !pTemp->isAlive())
pTemp->Respawn();
- if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR))) && !pTemp->isAlive())
+ if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR))) && !pTemp->isAlive())
pTemp->Respawn();
- if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG))) && !pTemp->isAlive())
+ if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG))) && !pTemp->isAlive())
pTemp->Respawn();
if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE)))
@@ -123,7 +123,7 @@ struct boss_palehoofAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void AttackStart(Unit* who)
@@ -131,14 +131,14 @@ struct boss_palehoofAI : public ScriptedAI
if (!who)
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartMovement(who);
}
}
@@ -151,13 +151,13 @@ struct boss_palehoofAI : public ScriptedAI
if (!UpdateVictim())
return;
- Creature* pTemp = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
+ Creature* pTemp = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
if (pTemp && pTemp->isAlive())
pTemp->DisappearAndDie();
if (uiArcingSmashTimer <= diff)
{
- DoCast(m_creature, SPELL_ARCING_SMASH);
+ DoCast(me, SPELL_ARCING_SMASH);
uiArcingSmashTimer = urand(13000,17000);
} else uiArcingSmashTimer -= diff;
@@ -170,7 +170,7 @@ struct boss_palehoofAI : public ScriptedAI
if (uiWhiteringRoarTimer <= diff)
{
- DoCast(m_creature, SPELL_WITHERING_ROAR);
+ DoCast(me, SPELL_WITHERING_ROAR);
uiWhiteringRoarTimer = urand(8000,12000);
} else uiWhiteringRoarTimer -= diff;
@@ -179,17 +179,17 @@ struct boss_palehoofAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
- Creature* pTemp = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
+ Creature* pTemp = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
if (pTemp && pTemp->isAlive())
pTemp->DisappearAndDie();
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void NextPhase()
@@ -197,7 +197,7 @@ struct boss_palehoofAI : public ScriptedAI
if (currentPhase == PHASE_NONE)
{
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
- m_creature->SummonCreature(MOB_STASIS_CONTROLLER,moveLocs[5].x,moveLocs[5].y,moveLocs[5].z,0,TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(MOB_STASIS_CONTROLLER,moveLocs[5].x,moveLocs[5].y,moveLocs[5].z,0,TEMPSUMMON_CORPSE_DESPAWN);
}
Phase move = PHASE_NONE;
if (AddCount >= DUNGEON_MODE(2,4))
@@ -220,11 +220,11 @@ struct boss_palehoofAI : public ScriptedAI
move = (Phase)(move%4);
}
//send orb to summon spot
- Creature *pOrb = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
+ Creature *pOrb = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
if (pOrb && pOrb->isAlive())
{
if (currentPhase == PHASE_NONE)
- pOrb->CastSpell(m_creature,SPELL_ORB_VISUAL,true);
+ pOrb->CastSpell(me,SPELL_ORB_VISUAL,true);
pOrb->GetMotionMaster()->MovePoint(move,moveLocs[move].x,moveLocs[move].y,moveLocs[move].z);
}
currentPhase = move;
@@ -232,9 +232,9 @@ struct boss_palehoofAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_FREEZE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_FREEZE);
}
};
@@ -271,12 +271,12 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
uiCrazedTimer = 10000;
uiTerrifyingRoarTimer = 15000;
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
}
@@ -290,19 +290,19 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
if (uiChainLightingTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTING);
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTING);
uiChainLightingTimer = 5000 + rand()%5000;
} else uiChainLightingTimer -= diff;
if (uiCrazedTimer <= diff)
{
- DoCast(m_creature, SPELL_CRAZED);
+ DoCast(me, SPELL_CRAZED);
uiCrazedTimer = 8000 + rand()%4000;
} else uiCrazedTimer -= diff;
if (uiTerrifyingRoarTimer <= diff)
{
- DoCast(m_creature, SPELL_TERRIFYING_ROAR);
+ DoCast(me, SPELL_TERRIFYING_ROAR);
uiTerrifyingRoarTimer = 10000 + rand()%10000;
} else uiTerrifyingRoarTimer -= diff;
@@ -314,14 +314,14 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
if (!who)
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartMovement(who);
}
}
@@ -330,7 +330,7 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
{
if (pInstance)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof)
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
}
@@ -338,9 +338,9 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_FREEZE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_FREEZE);
}
};
@@ -377,12 +377,12 @@ struct mob_frenzied_worgenAI : public ScriptedAI
uint32 uiEnrage1Timer = 15000;
uint32 uiEnrage2Timer = 10000;
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
}
@@ -396,19 +396,19 @@ struct mob_frenzied_worgenAI : public ScriptedAI
if (uiMortalWoundTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_WOUND);
+ DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
uiMortalWoundTimer = 3000 + rand()%4000;
} else uiMortalWoundTimer -= diff;
if (uiEnrage1Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE_1);
+ DoCast(me, SPELL_ENRAGE_1);
uiEnrage1Timer = 15000;
} else uiEnrage1Timer -= diff;
if (uiEnrage2Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE_2);
+ DoCast(me, SPELL_ENRAGE_2);
uiEnrage2Timer = 10000;
} else uiEnrage2Timer -= diff;
@@ -420,14 +420,14 @@ struct mob_frenzied_worgenAI : public ScriptedAI
if (!who)
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartMovement(who);
}
if (pInstance)
@@ -438,7 +438,7 @@ struct mob_frenzied_worgenAI : public ScriptedAI
{
if (pInstance)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_GORTOK_PALEHOOF));
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance->GetData64(DATA_GORTOK_PALEHOOF));
if (pPalehoof)
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
}
@@ -446,9 +446,9 @@ struct mob_frenzied_worgenAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_FREEZE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_FREEZE);
}
};
@@ -486,12 +486,12 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
uiGoreTimer = 15000;
uiGrievousWoundTimer = 20000;
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
}
@@ -505,13 +505,13 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
if (uiStompTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STOMP);
+ DoCast(me->getVictim(), SPELL_STOMP);
uiStompTimer = 8000 + rand()%4000;
} else uiStompTimer -= diff;
if (uiGoreTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GORE);
+ DoCast(me->getVictim(), SPELL_GORE);
uiGoreTimer = 13000 + rand()%4000;
} else uiGoreTimer -= diff;
@@ -530,14 +530,14 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
if (!who)
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartMovement(who);
}
}
@@ -546,7 +546,7 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
{
if (pInstance)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof)
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
}
@@ -554,9 +554,9 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_FREEZE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_FREEZE);
}
};
@@ -599,12 +599,12 @@ struct mob_massive_jormungarAI : public ScriptedAI
uiAcidSplatterTimer = 12000;
uiPoisonBreathTimer = 10000;
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
}
@@ -625,7 +625,7 @@ struct mob_massive_jormungarAI : public ScriptedAI
if (uiAcidSplatterTimer <= diff)
{
- DoCast(m_creature, SPELL_POISON_BREATH);
+ DoCast(me, SPELL_POISON_BREATH);
uiAcidSplatterTimer = 10000 + rand()%4000;
} else uiAcidSplatterTimer -= diff;
@@ -644,14 +644,14 @@ struct mob_massive_jormungarAI : public ScriptedAI
if (!who)
return;
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartMovement(who);
}
}
@@ -660,7 +660,7 @@ struct mob_massive_jormungarAI : public ScriptedAI
{
if (pInstance)
{
- Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
+ Creature *pPalehoof = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof)
CAST_AI(boss_palehoofAI,pPalehoof->AI())->NextPhase();
}
@@ -668,9 +668,9 @@ struct mob_massive_jormungarAI : public ScriptedAI
void JustReachedHome()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_FREEZE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoCast(me, SPELL_FREEZE);
}
};
@@ -695,9 +695,9 @@ struct mob_palehoof_orbAI : public ScriptedAI
{
currentPhase=PHASE_NONE;
SummonTimer=5000;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
- m_creature->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
- m_creature->SetSpeed(MOVE_FLIGHT , 0.5f);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
+ me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
+ me->SetSpeed(MOVE_FLIGHT , 0.5f);
}
void UpdateAI(const uint32 diff)
@@ -712,11 +712,11 @@ struct mob_palehoof_orbAI : public ScriptedAI
Creature *pNext;
switch(currentPhase)
{
- case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
- case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
- case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
- case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
- case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
+ case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
+ case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
+ case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
+ case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
+ case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
}
if (pNext)
@@ -742,11 +742,11 @@ struct mob_palehoof_orbAI : public ScriptedAI
Creature *pNext;
switch(id)
{
- case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
- case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
- case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
- case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
- case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
+ case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
+ case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
+ case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
+ case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
+ case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
}
if (pNext)
DoCast(pNext, SPELL_ORB_CHANNEL, false);
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
index 71ed8412428..7570af83f9f 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
@@ -96,9 +96,9 @@ struct boss_skadiAI : public ScriptedAI
Phase = SKADI;
- m_creature->Unmount();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->Unmount();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (pInstance)
pInstance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED);
@@ -106,12 +106,12 @@ struct boss_skadiAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
- m_creature->Mount(DATA_MOUNT);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869);
+ me->Mount(DATA_MOUNT);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869);
Phase = FLYING;
@@ -128,14 +128,14 @@ struct boss_skadiAI : public ScriptedAI
{
switch(uiWaypointId)
{
- case 0: m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869); break;
- case 1: m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 472.977, -513.636, 120.869); break;
+ case 0: me->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869); break;
+ case 1: me->GetMotionMaster()->MovePoint(uiWaypointId, 472.977, -513.636, 120.869); break;
case 200:
- m_creature->GetMotionMaster()->Clear();
- m_creature->Unmount();
+ me->GetMotionMaster()->Clear();
+ me->Unmount();
Phase = SKADI;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
AttackStart(pTarget);
break;
@@ -149,7 +149,7 @@ struct boss_skadiAI : public ScriptedAI
if (uiCrushTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CRUSH);
+ DoCast(me->getVictim(), SPELL_CRUSH);
uiCrushTimer = 8000;
} else uiCrushTimer -= diff;
@@ -163,7 +163,7 @@ struct boss_skadiAI : public ScriptedAI
if (uiWhirlwindTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_WHIRLWIND, H_SPELL_WHIRLWIND), false);
+ me->CastSpell(pTarget, DUNGEON_MODE(SPELL_WHIRLWIND, H_SPELL_WHIRLWIND), false);
} else uiWhirlwindTimer = 20000;
DoMeleeAttackIfReady();
@@ -173,7 +173,7 @@ struct boss_skadiAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE);
@@ -181,7 +181,7 @@ struct boss_skadiAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
}
void MovementInform(uint32 type, uint32 id)
@@ -222,9 +222,9 @@ struct boss_skadiAI : public ScriptedAI
Creature* pTemp;
switch (urand(0,2))
{
- case 0: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
- case 1: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
- case 2: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
+ case 0: pTemp = me->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
+ case 1: pTemp = me->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
+ case 2: pTemp = me->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
}
if (pTemp)
{
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
index 40ae9c95ebc..3015cc3b174 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
@@ -117,12 +117,12 @@ struct boss_svalaAI : public ScriptedAI
if (!pWho)
return;
- if (Phase == IDLE && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && m_creature->IsWithinDistInMap(pWho, 40))
+ if (Phase == IDLE && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && me->IsWithinDistInMap(pWho, 40))
{
Phase = INTRO;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (Creature *pArthas = m_creature->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
+ if (Creature *pArthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
pArthas->SetFloatValue(OBJECT_FIELD_SCALE_X, 5);
@@ -140,14 +140,14 @@ struct boss_svalaAI : public ScriptedAI
if (uiIntroTimer <= diff)
{
- Creature *pArthas = Unit::GetCreature(*m_creature, uiArthasGUID);
+ Creature *pArthas = Unit::GetCreature(*me, uiArthasGUID);
if (!pArthas)
return;
switch (uiIntroPhase)
{
case 0:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, m_creature);
+ DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me);
++uiIntroPhase;
uiIntroTimer = 3.5*IN_MILISECONDS;
break;
@@ -157,7 +157,7 @@ struct boss_svalaAI : public ScriptedAI
uiIntroTimer = 3.5*IN_MILISECONDS;
break;
case 2:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, m_creature);
+ DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me);
++uiIntroPhase;
uiIntroTimer = 3.5*IN_MILISECONDS;
break;
@@ -167,21 +167,21 @@ struct boss_svalaAI : public ScriptedAI
uiIntroTimer = 3.5*IN_MILISECONDS;
break;
case 4:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, m_creature);
- DoCast(m_creature, SPELL_SVALA_TRANSFORMING1);
+ DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me);
+ DoCast(me, SPELL_SVALA_TRANSFORMING1);
++uiIntroPhase;
uiIntroTimer = 2.8*IN_MILISECONDS;
break;
case 5:
- DoCast(m_creature, SPELL_SVALA_TRANSFORMING2);
+ DoCast(me, SPELL_SVALA_TRANSFORMING2);
++uiIntroPhase;
uiIntroTimer = 200;
break;
case 6:
- if (Creature* pSvalaSorrowgrave = m_creature->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILISECONDS))
+ if (Creature* pSvalaSorrowgrave = me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILISECONDS))
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(DATA_SVALA_DISPLAY_ID);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
pArthas->ToTempSummon()->UnSummon();
uiArthasGUID = 0;
Phase = FINISHED;
@@ -205,14 +205,14 @@ struct mob_ritual_channelerAI : public Scripted_NoMovementAI
void Reset()
{
- DoCast(m_creature, SPELL_SHADOWS_IN_THE_DARK);
+ DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
}
// called by svala sorrowgrave to set guid of victim
void DoAction(uint32 action)
{
if (pInstance)
- if (Unit *pVictim = m_creature->GetUnit(*m_creature, pInstance->GetData64(DATA_SACRIFICED_PLAYER)))
+ if (Unit *pVictim = me->GetUnit(*me, pInstance->GetData64(DATA_SACRIFICED_PLAYER)))
DoCast(pVictim, SPELL_PARALYZE);
}
@@ -253,7 +253,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
Phase = NORMAL;
DoTeleportTo(296.632, -346.075, 90.6307);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
summons.DespawnAll();
@@ -266,7 +266,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
@@ -292,7 +292,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
if (uiSinsterStrikeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SINSTER_STRIKE);
+ DoCast(me->getVictim(), SPELL_SINSTER_STRIKE);
uiSinsterStrikeTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS);
} else uiSinsterStrikeTimer -= diff;
@@ -310,11 +310,11 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
{
if (Unit* pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1,SAY_SACRIFICE_PLAYER_2,SAY_SACRIFICE_PLAYER_3,SAY_SACRIFICE_PLAYER_4,SAY_SACRIFICE_PLAYER_5),m_creature);
+ DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1,SAY_SACRIFICE_PLAYER_2,SAY_SACRIFICE_PLAYER_3,SAY_SACRIFICE_PLAYER_4,SAY_SACRIFICE_PLAYER_5),me);
DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
//Spell doesn't teleport
DoTeleportPlayer(pSacrificeTarget, 296.632, -346.075, 90.63, 4.6);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLY_MODE);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_FLY_MODE);
DoTeleportTo(296.632, -346.075, 120.85);
Phase = SACRIFICING;
if (pInstance)
@@ -322,7 +322,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
pInstance->SetData64(DATA_SACRIFICED_PLAYER,pSacrificeTarget->GetGUID());
for (uint8 i = 0; i < 3; ++i)
- if (Creature* pSummon = m_creature->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ if (Creature* pSummon = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
pSummon->AI()->DoAction(0);
}
@@ -336,16 +336,16 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
{
if (uiSacrificeTimer <= diff)
{
- Unit* pSacrificeTarget = pInstance ? Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SACRIFICED_PLAYER)) : NULL;
+ Unit* pSacrificeTarget = pInstance ? Unit::GetUnit(*me, pInstance->GetData64(DATA_SACRIFICED_PLAYER)) : NULL;
if (pInstance && !summons.empty() && pSacrificeTarget && pSacrificeTarget->isAlive())
- m_creature->Kill(pSacrificeTarget, false); // durability damage?
+ me->Kill(pSacrificeTarget, false); // durability damage?
//go down
Phase = NORMAL;
pSacrificeTarget = NULL;
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- m_creature->GetMotionMaster()->MoveChase(pTarget);
+ me->GetMotionMaster()->MoveChase(pTarget);
uiSacrificeTimer = 8*IN_MILISECONDS;
}
@@ -355,20 +355,20 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* pKiller)
{
if (pInstance)
{
- Creature* pSvala = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_SVALA));
+ Creature* pSvala = Unit::GetCreature((*me), pInstance->GetData64(DATA_SVALA));
if (pSvala && pSvala->isAlive())
pKiller->Kill(pSvala);
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
}
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
};
diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
index 9804a237fd2..164f24faedd 100644
--- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
+++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
@@ -158,7 +158,7 @@ struct boss_ymironAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_KING_YMIRON_EVENT, IN_PROGRESS);
@@ -170,12 +170,12 @@ struct boss_ymironAI : public ScriptedAI
{
if (m_uiPause_Timer <= diff)
{
- DoScriptText(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].say, m_creature);
- DoCast(m_creature, SPELL_CHANNEL_YMIRON_TO_SPIRIT); // should be on spirit
- if (Creature* pTemp = m_creature->SummonCreature(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].npc, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnX, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnY, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnZ, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnO, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ DoScriptText(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].say, me);
+ DoCast(me, SPELL_CHANNEL_YMIRON_TO_SPIRIT); // should be on spirit
+ if (Creature* pTemp = me->SummonCreature(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].npc, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnX, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnY, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnZ, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnO, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
m_uiActivedCreatureGUID = pTemp->GetGUID();
- pTemp->CastSpell(m_creature, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true);
+ pTemp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
@@ -218,40 +218,40 @@ struct boss_ymironAI : public ScriptedAI
// Normal spells ------------------------------------------------------------------------
if (m_uiBane_Timer <= diff)
{
- DoCast(m_creature, SPELL_BANE);
+ DoCast(me, SPELL_BANE);
m_uiBane_Timer = urand(20000,25000);
} else m_uiBane_Timer -= diff;
if (m_uiFetidRot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FETID_ROT);
+ DoCast(me->getVictim(), SPELL_FETID_ROT);
m_uiFetidRot_Timer = urand(10000,15000);
} else m_uiFetidRot_Timer -= diff;
if (m_uiDarkSlash_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DARK_SLASH);
+ DoCast(me->getVictim(), SPELL_DARK_SLASH);
m_uiDarkSlash_Timer = urand(30000,35000);
} else m_uiDarkSlash_Timer -= diff;
if (m_uiAncestors_Vengeance_Timer <= diff)
{
- DoCast(m_creature, SPELL_ANCESTORS_VENGEANCE);
+ DoCast(me, SPELL_ANCESTORS_VENGEANCE);
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(urand(60000,65000),urand(45000,50000));
} else m_uiAncestors_Vengeance_Timer -= diff;
// Abilities ------------------------------------------------------------------------------
if (m_bIsActiveWithBJORN && m_uiAbility_BJORN_Timer <= diff)
{
- //DoCast(m_creature, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control
- if (Creature* pTemp = m_creature->SummonCreature(CREATURE_SPIRIT_FOUNT, 385+rand()%10, -330+rand()%10, 104.756, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
+ //DoCast(me, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control
+ if (Creature* pTemp = me->SummonCreature(CREATURE_SPIRIT_FOUNT, 385+rand()%10, -330+rand()%10, 104.756, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
{
pTemp->SetSpeed(MOVE_RUN, 0.4f);
pTemp->CastSpell(pTemp, DUNGEON_MODE(SPELL_SPIRIT_FOUNT, H_SPELL_SPIRIT_FOUNT), true);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetDisplayId(11686);
- //pTemp->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ //pTemp->GetMotionMaster()->MoveChase(me->getVictim());
m_uiOrbGUID = pTemp->GetGUID();
}
m_bIsActiveWithBJORN = false; // only one orb
@@ -259,26 +259,26 @@ struct boss_ymironAI : public ScriptedAI
if (m_bIsActiveWithHALDOR && m_uiAbility_HALDOR_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SPIRIT_STRIKE);
+ DoCast(me->getVictim(), SPELL_SPIRIT_STRIKE);
m_uiAbility_HALDOR_Timer = 5000; // overtime
} else m_uiAbility_HALDOR_Timer -= diff;
if (m_bIsActiveWithRANULF && m_uiAbility_RANULF_Timer <= diff)
{
- DoCast(m_creature, SPELL_SPIRIT_BURST);
+ DoCast(me, SPELL_SPIRIT_BURST);
m_uiAbility_RANULF_Timer = 10000; // overtime
} else m_uiAbility_RANULF_Timer -= diff;
if (m_bIsActiveWithTORGYN && m_uiAbility_TORGYN_Timer <= diff)
{
float x,y,z;
- x = m_creature->GetPositionX()-5;
- y = m_creature->GetPositionY()-5;
- z = m_creature->GetPositionZ();
+ x = me->GetPositionX()-5;
+ y = me->GetPositionY()-5;
+ z = me->GetPositionZ();
for (uint8 i = 0; i < 4; ++i)
{
- //DoCast(m_creature, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control
- if (Creature* pTemp = m_creature->SummonCreature(CREATURE_AVENGING_SPIRIT, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
+ //DoCast(me, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control
+ if (Creature* pTemp = me->SummonCreature(CREATURE_AVENGING_SPIRIT, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
@@ -291,17 +291,17 @@ struct boss_ymironAI : public ScriptedAI
} else m_uiAbility_TORGYN_Timer -= diff;
// Health check -----------------------------------------------------------------------------
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(m_uiHealthAmountMultipler * m_uiHealthAmountModifier)))
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(m_uiHealthAmountMultipler * m_uiHealthAmountModifier)))
{
uint8 m_uiOrder = m_uiHealthAmountModifier - 1;
++m_uiHealthAmountModifier;
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_SCREAMS_OF_THE_DEAD);
- m_creature->GetMotionMaster()->Clear();
- m_creature->StopMoving();
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->MovePoint(0, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveX, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveY, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveZ);
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_SCREAMS_OF_THE_DEAD);
+ me->GetMotionMaster()->Clear();
+ me->StopMoving();
+ me->AttackStop();
+ me->GetMotionMaster()->MovePoint(0, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveX, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveY, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveZ);
DespawnBoatGhosts(m_uiActivedCreatureGUID);
DespawnBoatGhosts(m_uiOrbGUID);
@@ -327,7 +327,7 @@ struct boss_ymironAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
DespawnBoatGhosts(m_uiActivedCreatureGUID);
DespawnBoatGhosts(m_uiOrbGUID);
@@ -338,13 +338,13 @@ struct boss_ymironAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
void DespawnBoatGhosts(uint64& m_uiCreatureGUID)
{
if (m_uiCreatureGUID)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, m_uiCreatureGUID))
+ if (Creature* pTemp = Unit::GetCreature(*me, m_uiCreatureGUID))
pTemp->DisappearAndDie();
m_uiCreatureGUID = 0;
diff --git a/src/scripts/northrend/vault_of_archavon/boss_archavon.cpp b/src/scripts/northrend/vault_of_archavon/boss_archavon.cpp
index ea077af48ed..f052600900b 100644
--- a/src/scripts/northrend/vault_of_archavon/boss_archavon.cpp
+++ b/src/scripts/northrend/vault_of_archavon/boss_archavon.cpp
@@ -127,8 +127,8 @@ struct boss_archavonAI : public ScriptedAI
DoCast(me->getVictim(), SPELL_IMPALE);
return;
case EVENT_BERSERK:
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(EMOTE_BERSERK, m_creature);
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(EMOTE_BERSERK, me);
return;
}
}
@@ -179,11 +179,11 @@ struct mob_archavon_warderAI : public ScriptedAI //npc 32353
return;
}
case EVENT_SHIELD_CRUSH:
- DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH);
+ DoCast(me->getVictim(), SPELL_SHIELD_CRUSH);
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
return;
case EVENT_WHIRL:
- DoCast(m_creature->getVictim(), SPELL_WHIRL);
+ DoCast(me->getVictim(), SPELL_WHIRL);
events.ScheduleEvent(EVENT_WHIRL, 8000);
return;
}
diff --git a/src/scripts/northrend/vault_of_archavon/boss_emalon.cpp b/src/scripts/northrend/vault_of_archavon/boss_emalon.cpp
index 71c9047604e..f849f4d39ed 100644
--- a/src/scripts/northrend/vault_of_archavon/boss_emalon.cpp
+++ b/src/scripts/northrend/vault_of_archavon/boss_emalon.cpp
@@ -69,15 +69,15 @@ struct boss_emalonAI : public BossAI
_Reset();
for (uint8 i = 0; i < MAX_TEMPEST_MINIONS; ++i)
- m_creature->SummonCreature(MOB_TEMPEST_MINION, TempestMinions[i], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(MOB_TEMPEST_MINION, TempestMinions[i], TEMPSUMMON_CORPSE_DESPAWN, 0);
}
void JustSummoned(Creature *summoned)
{
BossAI::JustSummoned(summoned);
- if (m_creature->getVictim() && summoned->AI())
- summoned->AI()->AttackStart(m_creature->getVictim());
+ if (me->getVictim() && summoned->AI())
+ summoned->AI()->AttackStart(me->getVictim());
}
void EnterCombat(Unit *who)
@@ -86,7 +86,7 @@ struct boss_emalonAI : public BossAI
{
for (std::list<uint64>::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
- Creature *minion = Unit::GetCreature(*m_creature, *itr);
+ Creature *minion = Unit::GetCreature(*me, *itr);
if (minion && minion->isAlive() && !minion->getVictim() && minion->AI())
minion->AI()->AttackStart(who);
}
@@ -129,19 +129,19 @@ struct boss_emalonAI : public BossAI
{
std::list<uint64>::const_iterator itr = summons.begin();
std::advance(itr, urand(0, summons.size()-1));
- Creature *minion = Unit::GetCreature(*m_creature, *itr);
+ Creature *minion = Unit::GetCreature(*me, *itr);
if (minion && minion->isAlive())
{
minion->CastSpell(me, SPELL_OVERCHARGED, true);
minion->SetHealth(minion->GetMaxHealth());
- DoScriptText(EMOTE_OVERCHARGE, m_creature);
+ DoScriptText(EMOTE_OVERCHARGE, me);
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
}
}
break;
case EVENT_BERSERK:
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(EMOTE_BERSERK, m_creature);
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(EMOTE_BERSERK, me);
break;
}
}
@@ -175,12 +175,12 @@ struct mob_tempest_minionAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- if (Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
+ if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
if (pEmalon->isAlive())
{
pEmalon->SummonCreature(MOB_TEMPEST_MINION, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoScriptText(EMOTE_MINION_RESPAWN, m_creature);
+ DoScriptText(EMOTE_MINION_RESPAWN, me);
}
}
}
@@ -190,7 +190,7 @@ struct mob_tempest_minionAI : public ScriptedAI
DoZoneInCombat();
events.ScheduleEvent(EVENT_SHOCK, 20000);
- if (Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
+ if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
if (!pEmalon->getVictim() && pEmalon->AI())
pEmalon->AI()->AttackStart(who);
@@ -208,7 +208,7 @@ struct mob_tempest_minionAI : public ScriptedAI
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
- if (Aura *overchargedAura = m_creature->GetAura(SPELL_OVERCHARGED))
+ if (Aura *overchargedAura = me->GetAura(SPELL_OVERCHARGED))
{
if (overchargedAura->GetStackAmount() < 10)
{
@@ -223,8 +223,8 @@ struct mob_tempest_minionAI : public ScriptedAI
if (overchargedAura->GetStackAmount() == 10)
{
DoCast(me, SPELL_OVERCHARGED_BLAST);
- m_creature->ForcedDespawn();
- DoScriptText(EMOTE_MINION_RESPAWN, m_creature);
+ me->ForcedDespawn();
+ DoScriptText(EMOTE_MINION_RESPAWN, me);
}
}
}
diff --git a/src/scripts/northrend/vault_of_archavon/boss_koralon.cpp b/src/scripts/northrend/vault_of_archavon/boss_koralon.cpp
index 5fbe7378c85..7503d6c8fd8 100644
--- a/src/scripts/northrend/vault_of_archavon/boss_koralon.cpp
+++ b/src/scripts/northrend/vault_of_archavon/boss_koralon.cpp
@@ -112,7 +112,7 @@ struct boss_koralonAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -179,7 +179,7 @@ struct mob_flame_warderAI : public ScriptedAI
switch(eventId)
{
case EVENT_FW_LAVA_BIRST:
- DoCast(m_creature->getVictim(), RAID_MODE(SPELL_FW_LAVA_BIRST,SPELL_FW_LAVA_BIRST_H));
+ DoCast(me->getVictim(), RAID_MODE(SPELL_FW_LAVA_BIRST,SPELL_FW_LAVA_BIRST_H));
events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 15000);
return;
case EVENT_FW_METEOR_FISTS_A:
diff --git a/src/scripts/northrend/vault_of_archavon/boss_toravon.cpp b/src/scripts/northrend/vault_of_archavon/boss_toravon.cpp
index 5540acd6ad1..554c36b0789 100644
--- a/src/scripts/northrend/vault_of_archavon/boss_toravon.cpp
+++ b/src/scripts/northrend/vault_of_archavon/boss_toravon.cpp
@@ -101,7 +101,7 @@ struct boss_toravonAI : public ScriptedAI
events.Update(diff);
- if (m_creature->hasUnitState(UNIT_STAT_CASTING))
+ if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -162,7 +162,7 @@ struct mob_frost_warderAI : public ScriptedAI
switch(eventId)
{
case EVENT_FROST_BLAST:
- DoCast(m_creature->getVictim(), SPELL_FROST_BLAST);
+ DoCast(me->getVictim(), SPELL_FROST_BLAST);
events.ScheduleEvent(EVENT_FROST_BLAST, 20000);
return;
}
@@ -205,7 +205,7 @@ struct mob_frozen_orbAI : public ScriptedAI
if (killtimer <= diff)
{
if (!UpdateVictim())
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
killtimer = 10000;
}
else
@@ -236,14 +236,14 @@ struct mob_frozen_orb_stalkerAI : public Scripted_NoMovementAI
if (!spawned)
{
Unit* pToravon;
- if (pInstance && (pToravon = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_TORAVON))))
+ if (pInstance && (pToravon = me->GetCreature(*me, pInstance->GetData64(DATA_TORAVON))))
{
uint8 num_orbs = RAID_MODE(1, 3);
for (uint8 i=0; i<num_orbs; ++i)
{
Position pos;
- m_creature->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
- m_creature->SetPosition(pos, true);
+ me->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
+ me->SetPosition(pos, true);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
}
}
diff --git a/src/scripts/northrend/violet_hold/boss_cyanigosa.cpp b/src/scripts/northrend/violet_hold/boss_cyanigosa.cpp
index 232f1874239..aebca89f345 100644
--- a/src/scripts/northrend/violet_hold/boss_cyanigosa.cpp
+++ b/src/scripts/northrend/violet_hold/boss_cyanigosa.cpp
@@ -67,8 +67,8 @@ struct boss_cyanigosaAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_TRANSFORM);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_TRANSFORM);
if (pInstance)
pInstance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS);
@@ -80,7 +80,7 @@ struct boss_cyanigosaAI : public ScriptedAI
{
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
pInstance->SetData(DATA_REMOVE_NPC, 0);
}
@@ -126,7 +126,7 @@ struct boss_cyanigosaAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_CYANIGOSA_EVENT, DONE);
@@ -134,9 +134,9 @@ struct boss_cyanigosaAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
diff --git a/src/scripts/northrend/violet_hold/boss_erekem.cpp b/src/scripts/northrend/violet_hold/boss_erekem.cpp
index d24091673a0..8773040c81d 100644
--- a/src/scripts/northrend/violet_hold/boss_erekem.cpp
+++ b/src/scripts/northrend/violet_hold/boss_erekem.cpp
@@ -67,12 +67,12 @@ struct boss_erekemAI : public ScriptedAI
pInstance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
}
- if (Creature *pGuard1 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
+ if (Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
{
if (!pGuard1->isAlive())
pGuard1->Respawn();
}
- if (Creature *pGuard2 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
+ if (Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
{
if (!pGuard2->isAlive())
pGuard2->Respawn();
@@ -81,23 +81,23 @@ struct boss_erekemAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
- if (Creature *pGuard1 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
+ if (Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
{
pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
if (!pGuard1->getVictim() && pGuard1->AI())
pGuard1->AI()->AttackStart(pWho);
}
- if (Creature *pGuard2 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
+ if (Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
{
pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
if (!pGuard2->getVictim() && pGuard2->AI())
@@ -108,8 +108,8 @@ struct boss_erekemAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
- DoCast(m_creature, SPELL_EARTH_SHIELD);
+ DoScriptText(SAY_AGGRO, me);
+ DoCast(me, SPELL_EARTH_SHIELD);
if (pInstance)
{
@@ -138,19 +138,19 @@ struct boss_erekemAI : public ScriptedAI
//spam stormstrike in hc mode if spawns are dead
if (IsHeroic())
{
- if (Creature *pGuard1 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
+ if (Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
{
- if (Creature *pGuard2 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
+ if (Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
{
if (!pGuard1->isAlive() && !pGuard2->isAlive())
- DoCast(m_creature->getVictim(), SPELL_STORMSTRIKE);
+ DoCast(me->getVictim(), SPELL_STORMSTRIKE);
}
}
}
if (uiEarthShieldTimer <= diff)
{
- DoCast(m_creature, SPELL_EARTH_SHIELD);
+ DoCast(me, SPELL_EARTH_SHIELD);
uiEarthShieldTimer = 20000;
} else uiEarthShieldTimer -= diff;
@@ -158,25 +158,25 @@ struct boss_erekemAI : public ScriptedAI
{
if (uint64 TargetGUID = GetChainHealTargetGUID())
{
- if (Creature *pTarget = Unit::GetCreature(*m_creature, TargetGUID))
+ if (Creature *pTarget = Unit::GetCreature(*me, TargetGUID))
DoCast(pTarget, SPELL_CHAIN_HEAL);
//If one of the adds is dead spawn heals faster
- Creature *pGuard1 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
- Creature *pGuard2 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
+ Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
+ Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
uiChainHealTimer = ((pGuard1 && !pGuard1->isAlive()) || (pGuard2 && !pGuard2->isAlive()) ? 3000 : 8000) + rand()%3000;
}
} else uiChainHealTimer -= diff;
if (uiBloodlustTimer <= diff)
{
- DoCast(m_creature, SPELL_BLOODLUST);
+ DoCast(me, SPELL_BLOODLUST);
uiBloodlustTimer = urand(35000,45000);
} else uiBloodlustTimer -= diff;
if (uiEarthShockTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_EARTH_SHOCK);
+ DoCast(me->getVictim(), SPELL_EARTH_SHOCK);
uiEarthShockTimer = urand(8000,13000);
} else uiEarthShockTimer -= diff;
@@ -192,7 +192,7 @@ struct boss_erekemAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -211,21 +211,21 @@ struct boss_erekemAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
uint64 GetChainHealTargetGUID()
{
if (HealthBelowPct(85))
- return m_creature->GetGUID();
+ return me->GetGUID();
- Creature *pGuard1 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
+ Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
if (pGuard1 && pGuard1->isAlive() && (pGuard1->GetHealth()*100 <= pGuard1->GetMaxHealth() * 75))
return pGuard1->GetGUID();
- Creature *pGuard2 = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
+ Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
if (pGuard2 && pGuard2->isAlive() && (pGuard2->GetHealth()*100 <= pGuard2->GetMaxHealth() * 75))
return pGuard2->GetGUID();
@@ -267,14 +267,14 @@ struct mob_erekem_guardAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
@@ -290,19 +290,19 @@ struct mob_erekem_guardAI : public ScriptedAI
if (uiStrikeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STRIKE);
+ DoCast(me->getVictim(), SPELL_STRIKE);
uiStrikeTimer = urand(4000,8000);
} else uiStrikeTimer -= diff;
if (uiHowlingScreechTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HOWLING_SCREECH);
+ DoCast(me->getVictim(), SPELL_HOWLING_SCREECH);
uiHowlingScreechTimer = urand(8000,13000);
} else uiHowlingScreechTimer -= diff;
if (uiGushingWoundTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_GUSHING_WOUND);
+ DoCast(me->getVictim(), SPELL_GUSHING_WOUND);
uiGushingWoundTimer = urand(7000,12000);
} else uiGushingWoundTimer -= diff;
}
diff --git a/src/scripts/northrend/violet_hold/boss_ichoron.cpp b/src/scripts/northrend/violet_hold/boss_ichoron.cpp
index 2bb6d119ea1..cd7c4b2fb8b 100644
--- a/src/scripts/northrend/violet_hold/boss_ichoron.cpp
+++ b/src/scripts/northrend/violet_hold/boss_ichoron.cpp
@@ -104,7 +104,7 @@ struct boss_ichoronAI : public ScriptedAI
uiBubbleCheckerTimer = 1000;
uiWaterBoltVolleyTimer = urand(10000, 15000);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
DespawnWaterElements();
if (pInstance)
@@ -118,9 +118,9 @@ struct boss_ichoronAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
- DoCast(m_creature, SPELL_PROTECTIVE_BUBBLE);
+ DoCast(me, SPELL_PROTECTIVE_BUBBLE);
if (pInstance)
{
@@ -139,27 +139,27 @@ struct boss_ichoronAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
void DoAction(const int32 param)
{
- if (!m_creature->isAlive())
+ if (!me->isAlive())
return;
switch(param)
{
case ACTION_WATER_ELEMENT_HIT:
- m_creature->SetHealth(m_creature->GetHealth() + m_creature->GetMaxHealth() * 0.01);
+ me->SetHealth(me->GetHealth() + me->GetMaxHealth() * 0.01);
if (bIsExploded)
DoExplodeCompleted();
@@ -167,9 +167,9 @@ struct boss_ichoronAI : public ScriptedAI
bAchievement = false;
break;
case ACTION_WATER_ELEMENT_KILLED:
- uint32 damage = (m_creature->GetMaxHealth()*3)/100;
- m_creature->SetHealth(m_creature->GetHealth() - damage);
- m_creature->LowerPlayerDamageReq(damage);
+ uint32 damage = (me->GetMaxHealth()*3)/100;
+ me->SetHealth(me->GetHealth() - damage);
+ me->LowerPlayerDamageReq(damage);
break;
}
}
@@ -187,12 +187,12 @@ struct boss_ichoronAI : public ScriptedAI
if (!HealthBelowPct(25))
{
- DoScriptText(SAY_BUBBLE, m_creature);
- DoCast(m_creature, SPELL_PROTECTIVE_BUBBLE, true);
+ DoScriptText(SAY_BUBBLE, me);
+ DoCast(me, SPELL_PROTECTIVE_BUBBLE, true);
}
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->SetVisibility(VISIBILITY_ON);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
void MoveInLineOfSight(Unit* pWho) {}
@@ -205,8 +205,8 @@ struct boss_ichoronAI : public ScriptedAI
if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded)
{
- DoScriptText(SAY_ENRAGE, m_creature);
- DoCast(m_creature, SPELL_FRENZY, true);
+ DoScriptText(SAY_ENRAGE, me);
+ DoCast(me, SPELL_FRENZY, true);
bIsFrenzy = true;
}
@@ -216,18 +216,18 @@ struct boss_ichoronAI : public ScriptedAI
{
if (!bIsExploded)
{
- if (!m_creature->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
+ if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
{
- DoScriptText(SAY_SHATTER, m_creature);
- DoCast(m_creature, SPELL_WATER_BLAST);
- DoCast(m_creature, SPELL_DRAINED);
+ DoScriptText(SAY_SHATTER, me);
+ DoCast(me, SPELL_WATER_BLAST);
+ DoCast(me, SPELL_DRAINED);
bIsExploded = true;
- m_creature->AttackStop();
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->AttackStop();
+ me->SetVisibility(VISIBILITY_OFF);
for (uint8 i = 0; i < 10; i++)
{
int tmp = urand(0, MAX_SPAWN_LOC-1);
- m_creature->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN);
}
}
}
@@ -237,7 +237,7 @@ struct boss_ichoronAI : public ScriptedAI
if (!m_waterElements.empty())
{
for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr)
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
if (pTemp->isAlive())
{
bIsWaterElementsAlive = true;
@@ -257,7 +257,7 @@ struct boss_ichoronAI : public ScriptedAI
{
if (uiWaterBoltVolleyTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_WATER_BOLT_VOLLEY);
+ DoCast(me, SPELL_WATER_BOLT_VOLLEY);
uiWaterBoltVolleyTimer = urand(10000, 15000);
}
else uiWaterBoltVolleyTimer -= uiDiff;
@@ -268,12 +268,12 @@ struct boss_ichoronAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (bIsExploded)
{
bIsExploded = false;
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
}
DespawnWaterElements();
@@ -299,7 +299,7 @@ struct boss_ichoronAI : public ScriptedAI
void JustSummoned(Creature* pSummoned)
{
pSummoned->SetSpeed(MOVE_RUN, 0.3f);
- pSummoned->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
+ pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0);
m_waterElements.push_back(pSummoned->GetGUID());
}
@@ -311,9 +311,9 @@ struct boss_ichoronAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
@@ -349,13 +349,13 @@ struct mob_ichor_globuleAI : public ScriptedAI
{
if (pInstance)
{
- if (Creature* pIchoron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ICHORON)))
+ if (Creature* pIchoron = Unit::GetCreature(*me, pInstance->GetData64(DATA_ICHORON)))
{
- if (m_creature->IsWithinDist(pIchoron, 2.0f , false))
+ if (me->IsWithinDist(pIchoron, 2.0f , false))
{
if (pIchoron->AI())
pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_HIT);
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
}
}
}
@@ -366,8 +366,8 @@ struct mob_ichor_globuleAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- DoCast(m_creature, SPELL_SPLASH);
- if (Creature* pIchoron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ICHORON)))
+ DoCast(me, SPELL_SPLASH);
+ if (Creature* pIchoron = Unit::GetCreature(*me, pInstance->GetData64(DATA_ICHORON)))
if (pIchoron->AI())
pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_KILLED);
}
diff --git a/src/scripts/northrend/violet_hold/boss_lavanthor.cpp b/src/scripts/northrend/violet_hold/boss_lavanthor.cpp
index 81fb0834b7e..c9f1a1c4ba8 100644
--- a/src/scripts/northrend/violet_hold/boss_lavanthor.cpp
+++ b/src/scripts/northrend/violet_hold/boss_lavanthor.cpp
@@ -71,14 +71,14 @@ struct boss_lavanthorAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
@@ -93,19 +93,19 @@ struct boss_lavanthorAI : public ScriptedAI
if (uiFireboltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
+ DoCast(me->getVictim(), SPELL_FIREBOLT);
uiFireboltTimer = urand(5000,13000);
} else uiFireboltTimer -= diff;
if (uiFlameBreathTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FLAME_BREATH);
+ DoCast(me->getVictim(), SPELL_FLAME_BREATH);
uiFlameBreathTimer = urand(10000,15000);
} else uiFlameBreathTimer -= diff;
if (uiLavaBurnTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LAVA_BURN);
+ DoCast(me->getVictim(), SPELL_LAVA_BURN);
uiLavaBurnTimer = urand(15000,23000);
}
@@ -113,7 +113,7 @@ struct boss_lavanthorAI : public ScriptedAI
{
if (uiCauterizingFlamesTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CAUTERIZING_FLAMES);
+ DoCast(me->getVictim(), SPELL_CAUTERIZING_FLAMES);
uiCauterizingFlamesTimer = urand(10000,16000);
} else uiCauterizingFlamesTimer -= diff;
}
diff --git a/src/scripts/northrend/violet_hold/boss_moragg.cpp b/src/scripts/northrend/violet_hold/boss_moragg.cpp
index 47d479ff23c..9cc769be04d 100644
--- a/src/scripts/northrend/violet_hold/boss_moragg.cpp
+++ b/src/scripts/northrend/violet_hold/boss_moragg.cpp
@@ -64,14 +64,14 @@ struct boss_moraggAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
@@ -93,7 +93,7 @@ struct boss_moraggAI : public ScriptedAI
if (uiCorrosiveSalivaTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CORROSIVE_SALIVA);
+ DoCast(me->getVictim(), SPELL_CORROSIVE_SALIVA);
uiCorrosiveSalivaTimer = 10000;
} else uiCorrosiveSalivaTimer -= diff;
diff --git a/src/scripts/northrend/violet_hold/boss_xevozz.cpp b/src/scripts/northrend/violet_hold/boss_xevozz.cpp
index 99100760d12..edb78b68f6b 100644
--- a/src/scripts/northrend/violet_hold/boss_xevozz.cpp
+++ b/src/scripts/northrend/violet_hold/boss_xevozz.cpp
@@ -95,7 +95,7 @@ struct boss_xevozzAI : public ScriptedAI
void DespawnSphere()
{
std::list<Creature*> assistList;
- GetCreatureListWithEntryInGrid(assistList,m_creature, NPC_ETHEREAL_SPHERE ,150.0f);
+ GetCreatureListWithEntryInGrid(assistList,me, NPC_ETHEREAL_SPHERE ,150.0f);
if (assistList.empty())
return;
@@ -119,21 +119,21 @@ struct boss_xevozzAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_XEVOZZ_CELL)))
@@ -159,7 +159,7 @@ struct boss_xevozzAI : public ScriptedAI
if (uiArcaneBarrageVolley_Timer < uiDiff)
{
- DoCast(m_creature, SPELL_ARCANE_BARRAGE_VOLLEY);
+ DoCast(me, SPELL_ARCANE_BARRAGE_VOLLEY);
uiArcaneBarrageVolley_Timer = urand(20000, 22000);
}
else uiArcaneBarrageVolley_Timer -= uiDiff;
@@ -167,17 +167,17 @@ struct boss_xevozzAI : public ScriptedAI
if (uiArcaneBuffet_Timer)
if (uiArcaneBuffet_Timer < uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BUFFET);
+ DoCast(me->getVictim(), SPELL_ARCANE_BUFFET);
uiArcaneBuffet_Timer = 0;
}
else uiArcaneBuffet_Timer -= uiDiff;
if (uiSummonEtherealSphere_Timer < uiDiff)
{
- DoScriptText(SAY_SPAWN, m_creature);
- DoCast(m_creature, SPELL_SUMMON_ETHEREAL_SPHERE_1);
+ DoScriptText(SAY_SPAWN, me);
+ DoCast(me, SPELL_SUMMON_ETHEREAL_SPHERE_1);
if (IsHeroic()) // extra one for heroic
- m_creature->SummonCreature(NPC_ETHEREAL_SPHERE, m_creature->GetPositionX()-5+rand()%10, m_creature->GetPositionY()-5+rand()%10, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 40000);
+ me->SummonCreature(NPC_ETHEREAL_SPHERE, me->GetPositionX()-5+rand()%10, me->GetPositionY()-5+rand()%10, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 40000);
uiSummonEtherealSphere_Timer = urand(45000, 47000);
uiArcaneBuffet_Timer = urand(5000, 6000);
@@ -189,7 +189,7 @@ struct boss_xevozzAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
DespawnSphere();
@@ -209,10 +209,10 @@ struct boss_xevozzAI : public ScriptedAI
}
void KilledUnit(Unit* pVictim)
{
- if (pVictim == m_creature)
+ if (pVictim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
@@ -245,20 +245,20 @@ struct mob_ethereal_sphereAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!m_creature->HasAura(SPELL_POWER_BALL_VISUAL))
- DoCast(m_creature, SPELL_POWER_BALL_VISUAL);
+ if (!me->HasAura(SPELL_POWER_BALL_VISUAL))
+ DoCast(me, SPELL_POWER_BALL_VISUAL);
if (uiRangeCheck_Timer < uiDiff)
{
if (pInstance)
{
- if (Creature* pXevozz = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_XEVOZZ)))
+ if (Creature* pXevozz = Unit::GetCreature(*me, pInstance->GetData64(DATA_XEVOZZ)))
{
- float fDistance = m_creature->GetDistance2d(pXevozz);
+ float fDistance = me->GetDistance2d(pXevozz);
if (fDistance <= 3)
DoCast(pXevozz, SPELL_ARCANE_POWER);
else
- DoCast(m_creature, 35845); //Is it blizzlike?
+ DoCast(me, 35845); //Is it blizzlike?
}
}
uiRangeCheck_Timer = 1000;
@@ -267,9 +267,9 @@ struct mob_ethereal_sphereAI : public ScriptedAI
if (uiSummonPlayers_Timer < uiDiff)
{
- DoCast(m_creature, SPELL_SUMMON_PLAYERS); // not working right
+ DoCast(me, SPELL_SUMMON_PLAYERS); // not working right
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -277,7 +277,7 @@ struct mob_ethereal_sphereAI : public ScriptedAI
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->getSource()->isAlive())
- DoTeleportPlayer(i->getSource(), m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), i->getSource()->GetOrientation());
+ DoTeleportPlayer(i->getSource(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), i->getSource()->GetOrientation());
}
uiSummonPlayers_Timer = urand(33000, 35000);
diff --git a/src/scripts/northrend/violet_hold/boss_zuramat.cpp b/src/scripts/northrend/violet_hold/boss_zuramat.cpp
index 35732239ced..f6dcf7c86b1 100644
--- a/src/scripts/northrend/violet_hold/boss_zuramat.cpp
+++ b/src/scripts/northrend/violet_hold/boss_zuramat.cpp
@@ -67,21 +67,21 @@ struct boss_zuramatAI : public ScriptedAI
void AttackStart(Unit* pWho)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
DoStartMovement(pWho);
}
}
void EnterCombat(Unit* who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ZURAMAT_CELL)))
@@ -107,7 +107,7 @@ struct boss_zuramatAI : public ScriptedAI
if (SpellSummonVoidTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUMMON_VOID_SENTRY, false);
+ DoCast(me->getVictim(), SPELL_SUMMON_VOID_SENTRY, false);
SpellSummonVoidTimer = 20000;
} else SpellSummonVoidTimer -=diff;
@@ -120,7 +120,7 @@ struct boss_zuramatAI : public ScriptedAI
if (SpellShroudOfDarknessTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHROUD_OF_DARKNESS);
+ DoCast(me->getVictim(), SPELL_SHROUD_OF_DARKNESS);
SpellShroudOfDarknessTimer = 20000;
} else SpellShroudOfDarknessTimer -=diff;
@@ -129,7 +129,7 @@ struct boss_zuramatAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -148,15 +148,15 @@ struct boss_zuramatAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature)
+ if (victim == me)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustSummoned(Creature* summon)
{
- summon->AI()->AttackStart(m_creature->getVictim());
+ summon->AI()->AttackStart(me->getVictim());
summon->AI()->DoCastAOE(SPELL_ZURAMAT_ADD_2);
summon->SetPhaseMask(17,true);
}
diff --git a/src/scripts/northrend/violet_hold/violet_hold.cpp b/src/scripts/northrend/violet_hold/violet_hold.cpp
index 42a9e11aec2..6c1b33a77bf 100644
--- a/src/scripts/northrend/violet_hold/violet_hold.cpp
+++ b/src/scripts/northrend/violet_hold/violet_hold.cpp
@@ -49,11 +49,11 @@ struct npc_sinclariAI : public ScriptedAI
uiPhase = 0;
uiTimer = 0;
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->SetReactState(REACT_AGGRESSIVE);
std::list<Creature*> GuardList;
- m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
+ me->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
{
for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
@@ -81,8 +81,8 @@ struct npc_sinclariAI : public ScriptedAI
}
//She should not be despawned, she will be used by the instance to summon some npcs
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 uiDiff)
@@ -96,14 +96,14 @@ struct npc_sinclariAI : public ScriptedAI
switch(uiPhase)
{
case 1:
- DoScriptText(SAY_SINCLARI_1, m_creature);
+ DoScriptText(SAY_SINCLARI_1, me);
uiTimer = 4000;
uiPhase = 2;
break;
case 2:
{
std::list<Creature*> GuardList;
- m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
+ me->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
{
@@ -120,7 +120,7 @@ struct npc_sinclariAI : public ScriptedAI
case 3:
{
std::list<Creature*> GuardList;
- m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
+ me->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
{
@@ -135,7 +135,7 @@ struct npc_sinclariAI : public ScriptedAI
break;
}
case 4:
- m_creature->GetMotionMaster()->MovePoint(0, MovePosition);
+ me->GetMotionMaster()->MovePoint(0, MovePosition);
uiTimer = 0;
uiPhase = 0;
break;
@@ -210,7 +210,7 @@ struct npc_teleportation_portalAI : public ScriptedAI
{
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
pInstance->SetData(DATA_REMOVE_NPC, 0);
}
@@ -222,7 +222,7 @@ struct npc_teleportation_portalAI : public ScriptedAI
for (uint8 i = 0; i < k; ++i)
{
uint32 entry = RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR);
- if (Creature* pSummon = DoSummon(entry, m_creature, 2.0f, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
+ if (Creature* pSummon = DoSummon(entry, me, 2.0f, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
pSummon->GetMotionMaster()->MovePoint(0, DoorPosition);
}
}
@@ -230,16 +230,16 @@ struct npc_teleportation_portalAI : public ScriptedAI
{
bPortalGuardianOrKeeperSpawn = true;
uint32 entry = RAND(CREATURE_PORTAL_GUARDIAN, CREATURE_PORTAL_KEEPER);
- if (Creature *pPortalKeeper = DoSummon(entry, m_creature, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
- m_creature->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false);
+ if (Creature *pPortalKeeper = DoSummon(entry, me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
+ me->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false);
}
uiSpawnTimer = SPAWN_TIME;
} else uiSpawnTimer -= diff;
- if (bPortalGuardianOrKeeperSpawn && !m_creature->IsNonMeleeSpellCasted(false))
+ if (bPortalGuardianOrKeeperSpawn && !me->IsNonMeleeSpellCasted(false))
{
- m_creature->Kill(m_creature, false);
- m_creature->RemoveCorpse();
+ me->Kill(me, false);
+ me->RemoveCorpse();
return;
}
}
diff --git a/src/scripts/northrend/zuldrak.cpp b/src/scripts/northrend/zuldrak.cpp
index 6550a3ce979..ceaac1a864a 100644
--- a/src/scripts/northrend/zuldrak.cpp
+++ b/src/scripts/northrend/zuldrak.cpp
@@ -42,12 +42,12 @@ struct npc_drakuru_shacklesAI : public ScriptedAI
void Reset()
{
RageclawGUID = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
float x, y, z;
- m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize() / 3, 0.1f);
+ me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 0.1f);
- if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW, x, y, z,
+ if (Unit* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z,
0, TEMPSUMMON_DEAD_DESPAWN, 1000))
{
RageclawGUID = summon->GetGUID();
@@ -57,10 +57,10 @@ struct npc_drakuru_shacklesAI : public ScriptedAI
void LockRageclaw()
{
- Unit *Rageclaw = Unit::GetCreature(*m_creature, RageclawGUID);
+ Unit *Rageclaw = Unit::GetCreature(*me, RageclawGUID);
// pointer check not needed
- m_creature->SetInFront(Rageclaw);
- Rageclaw->SetInFront(m_creature);
+ me->SetInFront(Rageclaw);
+ Rageclaw->SetInFront(me);
DoCast(Rageclaw, SPELL_LEFT_CHAIN, true);
DoCast(Rageclaw, SPELL_RIGHT_CHAIN, true);
@@ -71,21 +71,21 @@ struct npc_drakuru_shacklesAI : public ScriptedAI
if (!pWho)
return;
- Creature *Rageclaw = Unit::GetCreature(*m_creature, RageclawGUID);
+ Creature *Rageclaw = Unit::GetCreature(*me, RageclawGUID);
// pointer check not needed
DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true);
- m_creature->setDeathState(DEAD);
+ me->setDeathState(DEAD);
}
void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
{
if (pSpell->Id == SPELL_UNLOCK_SHACKLE)
{
- if (Creature *Rageclaw = Unit::GetCreature(*m_creature, RageclawGUID))
+ if (Creature *Rageclaw = Unit::GetCreature(*me, RageclawGUID))
UnlockRageclaw(pCaster);
else
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
}
}
};
@@ -123,8 +123,8 @@ struct npc_captured_rageclawAI : public ScriptedAI
{
Despawn = false;
DespawnTimer = 0;
- m_creature->setFaction(35);
- DoCast(m_creature, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
+ me->setFaction(35);
+ DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
}
void MoveInLineOfSight(Unit *who){}
@@ -133,17 +133,17 @@ struct npc_captured_rageclawAI : public ScriptedAI
{
if (pSpell->Id == SPELL_FREE_RAGECLAW)
{
- m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
+ me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
- m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
+ me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
- m_creature->RemoveAurasDueToSpell(SPELL_KNEEL);
+ me->RemoveAurasDueToSpell(SPELL_KNEEL);
- m_creature->setFaction(m_creature->GetCreatureInfo()->faction_H);
+ me->setFaction(me->GetCreatureInfo()->faction_H);
- DoCast(m_creature, SPELL_UNSHACKLED, true);
- m_creature->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, NULL);
- m_creature->GetMotionMaster()->MoveRandom(10);
+ DoCast(me, SPELL_UNSHACKLED, true);
+ me->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, NULL);
+ me->GetMotionMaster()->MoveRandom(10);
DespawnTimer = 10000;
Despawn = true;
@@ -162,7 +162,7 @@ struct npc_captured_rageclawAI : public ScriptedAI
return;
if (DespawnTimer <= uiDiff)
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
else DespawnTimer -= uiDiff;
}
};
@@ -261,7 +261,7 @@ struct npc_gurgthockAI : public ScriptedAI
void Reset()
{
SummonGUID = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
uiTimer = 0;
uiPhase = 0;
uiQuest = 0;
@@ -277,11 +277,11 @@ struct npc_gurgthockAI : public ScriptedAI
bEventInProgress = false;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
- if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pTemp = Unit::GetCreature(*me, *itr))
if (pTemp)
pTemp->RemoveFromWorld();
}
@@ -300,12 +300,12 @@ struct npc_gurgthockAI : public ScriptedAI
switch(uiValue)
{
case QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON:
- DoScriptText(SAY_QUEST_ACCEPT_TUSKARRMAGEDON, m_creature);
+ DoScriptText(SAY_QUEST_ACCEPT_TUSKARRMAGEDON, me);
uiPhase = 1;
uiTimer = 4000;
break;
case QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER:
- DoScriptText(SAY_QUEST_ACCEPT_KORRAK_1, m_creature);
+ DoScriptText(SAY_QUEST_ACCEPT_KORRAK_1, me);
uiPhase = 3;
uiTimer = 3000;
break;
@@ -335,7 +335,7 @@ struct npc_gurgthockAI : public ScriptedAI
{
if (uiRemoveFlagTimer <= uiDiff)
{
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
bRemoveFlag = false;
uiRemoveFlagTimer = 5000;
} else uiRemoveFlagTimer -= uiDiff;
@@ -348,39 +348,39 @@ struct npc_gurgthockAI : public ScriptedAI
switch(uiPhase)
{
case 1:
- if (Creature *pSummon = m_creature->SummonCreature(NPC_ORINOKO_TUSKBREAKER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
+ if (Creature *pSummon = me->SummonCreature(NPC_ORINOKO_TUSKBREAKER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
SummonGUID = pSummon->GetGUID();
uiPhase = 2;
uiTimer = 4000;
break;
case 2:
- if (Creature *pSummon = Unit::GetCreature(*m_creature, SummonGUID))
+ if (Creature *pSummon = Unit::GetCreature(*me, SummonGUID))
pSummon->GetMotionMaster()->MoveJump(5776.319824, -2981.005371, 273.100037, 10.0f, 20.0f);
uiPhase = 0;
SummonGUID = 0;
break;
case 3:
- DoScriptText(SAY_QUEST_ACCEPT_KORRAK_2, m_creature);
+ DoScriptText(SAY_QUEST_ACCEPT_KORRAK_2, me);
uiTimer = 3000;
uiPhase = 4;
break;
case 4:
- if (Creature *pSummon = m_creature->SummonCreature(NPC_KORRAK_BLOODRAGER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
+ if (Creature *pSummon = me->SummonCreature(NPC_KORRAK_BLOODRAGER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
SummonGUID = pSummon->GetGUID();
uiTimer = 3000;
uiPhase = 0;
break;
case 6:
- m_creature->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000);
+ me->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000);
uiPhase = 0;
break;
case 7:
- DoScriptText(SAY_QUEST_ACCEPT_MAGNATAUR, m_creature);
+ DoScriptText(SAY_QUEST_ACCEPT_MAGNATAUR, me);
uiTimer = 3000;
uiPhase = 8;
break;
case 8:
- m_creature->SummonCreature(NPC_STINKBEARD, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000);
+ me->SummonCreature(NPC_STINKBEARD, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000);
uiPhase = 0;
break;
}
@@ -398,7 +398,7 @@ struct npc_gurgthockAI : public ScriptedAI
if (bEventInProgress)
bEventInProgress = false;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
}
};
@@ -449,8 +449,8 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
{
npc_orinoko_tuskbreakerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
}
bool bSummoned;
@@ -477,11 +477,11 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
void EnterEvadeMode()
{
if (uiWhisker)
- if (Creature *pWhisker = m_creature->GetCreature(*m_creature, uiWhisker))
+ if (Creature *pWhisker = me->GetCreature(*me, uiWhisker))
pWhisker->RemoveFromWorld();
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->RemoveSummons();
}
@@ -491,9 +491,9 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_AGGRESSIVE);
- m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), 0);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), 0);
uiBattleShoutTimer = 7000;
}
@@ -509,7 +509,7 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
if (!bBattleShout && uiBattleShoutTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_BATTLE_SHOUT);
+ DoCast(me, SPELL_BATTLE_SHOUT);
bBattleShout = true;
} else uiBattleShoutTimer -= uiDiff;
@@ -523,12 +523,12 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
uiFishyScentTimer = 20000;
} else uiFishyScentTimer -= uiDiff;
- if (!bSummoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
+ if (!bSummoned && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
{
- DoScriptText(SAY_CALL_FOR_HELP ,m_creature);
- //DoCast(m_creature->getVictim(), SPELL_SUMMON_WHISKER); petai is not working correctly???
+ DoScriptText(SAY_CALL_FOR_HELP ,me);
+ //DoCast(me->getVictim(), SPELL_SUMMON_WHISKER); petai is not working correctly???
- if (Creature *pWhisker = m_creature->SummonCreature(NPC_WHISKER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
+ if (Creature *pWhisker = me->SummonCreature(NPC_WHISKER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
uiWhisker = pWhisker->GetGUID();
bSummoned = true;
}
@@ -541,10 +541,10 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
switch(pSummon->GetEntry())
{
case NPC_WHISKER:
- pSummon->AI()->AttackStart(m_creature->getVictim());
+ pSummon->AI()->AttackStart(me->getVictim());
break;
case NPC_HUNGRY_PENGUIN:
- if (Unit *pAffected = Unit::GetUnit(*m_creature, AffectedGUID))
+ if (Unit *pAffected = Unit::GetUnit(*me, AffectedGUID))
{
if (pAffected->isAlive())
pSummon->AI()->AttackStart(pAffected);
@@ -556,14 +556,14 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
if (uiWhisker)
- if (Creature *pWhisker = m_creature->GetCreature(*m_creature, uiWhisker))
+ if (Creature *pWhisker = me->GetCreature(*me, uiWhisker))
pWhisker->RemoveFromWorld();
if (pKiller->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON, CAST_PLR(pKiller));
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->bEventInProgress = false;
}
@@ -601,8 +601,8 @@ struct npc_korrak_bloodragerAI : public npc_escortAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
uiChargeTimer = 15000;
uiUppercutTimer = 12000;
bEnrage = false;
@@ -610,8 +610,8 @@ struct npc_korrak_bloodragerAI : public npc_escortAI
void EnterEvadeMode()
{
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->RemoveSummons();
}
@@ -621,16 +621,16 @@ struct npc_korrak_bloodragerAI : public npc_escortAI
switch(uiI)
{
case 6:
- m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), 0);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), 0);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_AGGRESSIVE);
break;
}
}
void EnterCombat(Unit* pWho)
{
- DoCast(m_creature, SPELL_GROW);
+ DoCast(me, SPELL_GROW);
}
void UpdateAI(const uint32 uiDiff)
@@ -654,9 +654,9 @@ struct npc_korrak_bloodragerAI : public npc_escortAI
uiChargeTimer = 15000;
} else uiChargeTimer -= uiDiff;
- if (!bEnrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20)
+ if (!bEnrage && me->GetHealth()*100 / me->GetMaxHealth() <= 20)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
bEnrage = true;
}
DoMeleeAttackIfReady();
@@ -667,8 +667,8 @@ struct npc_korrak_bloodragerAI : public npc_escortAI
if (pKiller->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER, CAST_PLR(pKiller));
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->bEventInProgress = false;
}
@@ -705,15 +705,15 @@ struct npc_yggdrasAI : public ScriptedAI
void EnterEvadeMode() //If you lose the combat, then the npc go away
{
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->RemoveSummons();
}
void EnterCombat(Unit* pWho)
{
- DoCast(m_creature, SPELL_GROW);
+ DoCast(me, SPELL_GROW);
}
void UpdateAI(const uint32 uiDiff)
@@ -723,13 +723,13 @@ struct npc_yggdrasAI : public ScriptedAI
if (uiCleaveTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = 12000;
} else uiCleaveTimer -= uiDiff;
if (uiCorrodeFleshTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CHARGE);
+ DoCast(me->getVictim(), SPELL_CHARGE);
uiCorrodeFleshTimer = 18000;
} else uiCorrodeFleshTimer -= uiDiff;
@@ -747,8 +747,8 @@ struct npc_yggdrasAI : public ScriptedAI
for (uint8 i = 0; i < 2; ++i)
DoCast(pKiller, SPELL_JORMUNGAR_SPAWN, true);
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->bEventInProgress = false;
}
@@ -776,8 +776,8 @@ struct npc_stinkbeardAI : public npc_escortAI
{
npc_stinkbeardAI(Creature* pCreature) : npc_escortAI(pCreature)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
Start(true,true, 0, NULL);
SetDespawnAtEnd(false);
}
@@ -790,7 +790,7 @@ struct npc_stinkbeardAI : public npc_escortAI
void Reset()
{
- DoCast(m_creature, SPELL_THUNDERBLADE);
+ DoCast(me, SPELL_THUNDERBLADE);
uiThunderclapTimer = 5000;
uiKnockAwayTimer = 10000;
uiStinkyBeardTimer = 15000;
@@ -799,8 +799,8 @@ struct npc_stinkbeardAI : public npc_escortAI
void EnterEvadeMode()
{
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->RemoveSummons();
}
@@ -810,9 +810,9 @@ struct npc_stinkbeardAI : public npc_escortAI
switch(uiI)
{
case 7:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetReactState(REACT_AGGRESSIVE);
- m_creature->SetHomePosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation());
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
break;
}
}
@@ -850,9 +850,9 @@ struct npc_stinkbeardAI : public npc_escortAI
uiStinkyBeardTimer = 15000;
} else uiStinkyBeardTimer -= uiDiff;
- if (!bEnrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20)
+ if (!bEnrage && me->GetHealth()*100 / me->GetMaxHealth() <= 20)
{
- DoCast(m_creature, SPELL_ENRAGE_STINKBEARD);
+ DoCast(me, SPELL_ENRAGE_STINKBEARD);
bEnrage = true;
}
DoMeleeAttackIfReady();
@@ -860,8 +860,8 @@ struct npc_stinkbeardAI : public npc_escortAI
void JustDied(Unit* pKiller)
{
- if (m_creature->isSummon())
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
+ if (me->isSummon())
+ if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->bEventInProgress = false;
@@ -886,15 +886,15 @@ struct npc_released_offspring_harkoaAI : public ScriptedAI
void Reset()
{
float x, y, z;
- m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize() / 3, 25.0f);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 25.0f);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE)
return;
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
}
};
@@ -934,9 +934,9 @@ struct npc_crusade_recruitAI : public ScriptedAI
{
m_uiTimer = 0;
m_uiPhase = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_COWER);
- m_heading = m_creature->GetOrientation();
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_COWER);
+ m_heading = me->GetOrientation();
}
void UpdateAI(const uint32 uiDiff)
@@ -949,22 +949,22 @@ struct npc_crusade_recruitAI : public ScriptedAI
{
case 1:
// say random text
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- DoScriptText(RAND(SAY_RECRUIT_1,SAY_RECRUIT_2,SAY_RECRUIT_3), m_creature);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ DoScriptText(RAND(SAY_RECRUIT_1,SAY_RECRUIT_2,SAY_RECRUIT_3), me);
m_uiTimer = 3000;
m_uiPhase = 2;
break;
case 2:
// walk forward
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(0,m_creature->GetPositionX() + (cos(m_heading) * 10), m_creature->GetPositionY() + (sin(m_heading) * 10), m_creature->GetPositionZ());
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->MovePoint(0,me->GetPositionX() + (cos(m_heading) * 10), me->GetPositionY() + (sin(m_heading) * 10), me->GetPositionZ());
m_uiTimer = 5000;
m_uiPhase = 3;
break;
case 3:
// despawn
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
m_uiTimer = 0;
m_uiPhase = 0;
break;
diff --git a/src/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
index aaeb92d3ba9..e46d14fb3f9 100644
--- a/src/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
+++ b/src/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
@@ -69,39 +69,39 @@ struct mob_stolen_soulAI : public ScriptedAI
switch (myClass)
{
case CLASS_WARRIOR:
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
Class_Timer = 6000;
break;
case CLASS_PALADIN:
- DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
+ DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
Class_Timer = 6000;
break;
case CLASS_HUNTER:
- DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
+ DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
Class_Timer = 20000;
break;
case CLASS_ROGUE:
- DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
+ DoCast(me->getVictim(), SPELL_HEMORRHAGE);
Class_Timer = 10000;
break;
case CLASS_PRIEST:
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ DoCast(me->getVictim(), SPELL_MIND_FLAY);
Class_Timer = 5000;
break;
case CLASS_SHAMAN:
- DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK);
+ DoCast(me->getVictim(), SPELL_FROSTSHOCK);
Class_Timer = 8000;
break;
case CLASS_MAGE:
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ DoCast(me->getVictim(), SPELL_FIREBALL);
Class_Timer = 5000;
break;
case CLASS_WARLOCK:
- DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY);
+ DoCast(me->getVictim(), SPELL_CURSE_OF_AGONY);
Class_Timer = 20000;
break;
case CLASS_DRUID:
- DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
+ DoCast(me->getVictim(), SPELL_MOONFIRE);
Class_Timer = 10000;
break;
}
@@ -174,9 +174,9 @@ struct boss_exarch_maladaarAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0))
+ if (!HasTaunted && me->IsWithinDistInMap(who, 150.0))
{
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
HasTaunted = true;
}
@@ -185,7 +185,7 @@ struct boss_exarch_maladaarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void JustSummoned(Creature *summoned)
@@ -195,9 +195,9 @@ struct boss_exarch_maladaarAI : public ScriptedAI
//SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
summoned->SetDisplayId(soulmodel);
- summoned->setFaction(m_creature->getFaction());
+ summoned->setFaction(me->getFaction());
- if (Unit *pTarget = Unit::GetUnit(*m_creature,soulholder))
+ if (Unit *pTarget = Unit::GetUnit(*me,soulholder))
{
CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass);
@@ -211,14 +211,14 @@ struct boss_exarch_maladaarAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
//When Exarch Maladar is defeated D'ore appear.
- m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -226,14 +226,14 @@ struct boss_exarch_maladaarAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25))
+ if (!Avatar_summoned && ((me->GetHealth()*100) / me->GetMaxHealth() < 25))
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
- DoCast(m_creature, SPELL_SUMMON_AVATAR);
+ DoCast(me, SPELL_SUMMON_AVATAR);
Avatar_summoned = true;
StolenSoul_Timer = 15000 + rand()% 15000;
}
@@ -244,21 +244,21 @@ struct boss_exarch_maladaarAI : public ScriptedAI
{
if (pTarget->GetTypeId() == TYPEID_PLAYER)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
uint32 i = urand(1,2);
if (i == 1)
- DoScriptText(SAY_ROAR, m_creature);
+ DoScriptText(SAY_ROAR, me);
else
- DoScriptText(SAY_SOUL_CLEAVE, m_creature);
+ DoScriptText(SAY_SOUL_CLEAVE, me);
soulmodel = pTarget->GetDisplayId();
soulholder = pTarget->GetGUID();
soulclass = pTarget->getClass();
DoCast(pTarget, SPELL_STOLEN_SOUL);
- m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
+ me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
StolenSoul_Timer = 20000 + rand()% 10000;
} else StolenSoul_Timer = 1000;
@@ -275,7 +275,7 @@ struct boss_exarch_maladaarAI : public ScriptedAI
if (Fear_timer <= diff)
{
- DoCast(m_creature, SPELL_SOUL_SCREAM);
+ DoCast(me, SPELL_SOUL_SCREAM);
Fear_timer = 15000 + rand()% 15000;
} else Fear_timer -= diff;
@@ -313,7 +313,7 @@ struct mob_avatar_of_martyredAI : public ScriptedAI
if (Mortal_Strike_timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE);
+ DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE);
Mortal_Strike_timer = 10000 + rand()%20 * 1000;
} else Mortal_Strike_timer -= diff;
diff --git a/src/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
index 29808075fce..38cc2d63375 100644
--- a/src/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
@@ -68,11 +68,11 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE)
{
summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
- summoned->setFaction(m_creature->getFaction());
- summoned->SetLevel(m_creature->getLevel());
+ summoned->setFaction(me->getFaction());
+ summoned->SetLevel(me->getLevel());
summoned->addUnitState(UNIT_STAT_ROOT);
- if (Unit *pFocusedTarget = Unit::GetUnit(*m_creature, FocusedTargetGUID))
+ if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
summoned->AI()->AttackStart(pFocusedTarget);
}
}
@@ -83,20 +83,20 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
if (Inhibitmagic_Timer <= diff)
{
float dist;
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
- if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45)))
+ if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(me, 45)))
{
i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
- m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
if (dist < 35)
- m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
if (dist < 25)
- m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
if (dist < 15)
- m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
}
Inhibitmagic_Timer = 3000+(rand()%1000);
} else Inhibitmagic_Timer -= diff;
@@ -108,7 +108,7 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
//Attractmagic_Timer
if (Attractmagic_Timer <= diff)
{
- DoCast(m_creature, SPELL_ATTRACTMAGIC);
+ DoCast(me, SPELL_ATTRACTMAGIC);
Attractmagic_Timer = 30000;
Carnivorousbite_Timer = 1500;
} else Attractmagic_Timer -= diff;
@@ -116,7 +116,7 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
//Carnivorousbite_Timer
if (Carnivorousbite_Timer <= diff)
{
- DoCast(m_creature, SPELL_CARNIVOROUSBITE);
+ DoCast(me, SPELL_CARNIVOROUSBITE);
Carnivorousbite_Timer = 10000;
} else Carnivorousbite_Timer -= diff;
@@ -128,7 +128,7 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
{
FocusedTargetGUID = pTarget->GetGUID();
- m_creature->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
+ me->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
// TODO: Find better way to handle emote
// Emote
@@ -136,7 +136,7 @@ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
emote->append(pTarget->GetName());
emote->append("!");
const char* text = emote->c_str();
- m_creature->MonsterTextEmote(text, 0, true);
+ me->MonsterTextEmote(text, 0, true);
delete emote;
}
FocusFire_Timer = 15000+(rand()%5000);
@@ -178,7 +178,7 @@ struct mob_focus_fireAI : public ScriptedAI
//FieryBlast_Timer
if (fiery2 && FieryBlast_Timer <= diff)
{
- DoCast(m_creature, SPELL_FIERY_BLAST);
+ DoCast(me, SPELL_FIERY_BLAST);
if (fiery1) fiery1 = false;
else if (fiery2) fiery2 = false;
diff --git a/src/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
index 56826ce0a5f..5350494fda7 100644
--- a/src/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
+++ b/src/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
@@ -80,11 +80,11 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
float dist = 8.0f;
float posX, posY, posZ, angle;
- m_creature->GetHomePosition(posX, posY, posZ, angle);
+ me->GetHomePosition(posX, posY, posZ, angle);
- m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
- m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
- m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
}
void EnterEvadeMode()
@@ -95,16 +95,16 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f))
+ if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
{
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
HasTaunted = true;
}
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
DoZoneInCombat();
summons.DoZoneInCombat();
@@ -130,12 +130,12 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEAD, m_creature);
+ DoScriptText(SAY_DEAD, me);
summons.DespawnAll();
}
@@ -146,23 +146,23 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
if (FrostNova_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_FROSTNOVA);
+ DoCast(me, SPELL_FROSTNOVA);
FrostNova_Timer = 17500 + rand()%7500;
CanBlink = true;
} else FrostNova_Timer -= diff;
if (Frostbolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 4500 + rand()%1500;
} else Frostbolt_Timer -= diff;
if (FireBall_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ DoCast(me->getVictim(), SPELL_FIREBALL);
FireBall_Timer = 4500 + rand()%1500;
} else FireBall_Timer -= diff;
@@ -170,15 +170,15 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
{
if (Blink_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
//expire movement, will prevent from running right back to victim after cast
//(but should MoveChase be used again at a certain time or should he not move?)
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- m_creature->GetMotionMaster()->MovementExpired();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
- DoCast(m_creature, SPELL_BLINK);
+ DoCast(me, SPELL_BLINK);
Blink_Timer = 1000 + rand()%1500;
CanBlink = false;
} else Blink_Timer -= diff;
@@ -186,13 +186,13 @@ struct boss_nexusprince_shaffarAI : public ScriptedAI
if (Beacon_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
if (!urand(0,3))
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
- DoCast(m_creature, SPELL_ETHEREAL_BEACON, true);
+ DoCast(me, SPELL_ETHEREAL_BEACON, true);
Beacon_Timer = 10000;
} else Beacon_Timer -= diff;
@@ -224,7 +224,7 @@ struct mob_ethereal_beaconAI : public ScriptedAI
void KillSelf()
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
}
void Reset()
@@ -249,7 +249,7 @@ struct mob_ethereal_beaconAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
- summoned->AI()->AttackStart(m_creature->getVictim());
+ summoned->AI()->AttackStart(me->getVictim());
}
void UpdateAI(const uint32 diff)
@@ -270,17 +270,17 @@ struct mob_ethereal_beaconAI : public ScriptedAI
if (ArcaneBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
+ DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
ArcaneBolt_Timer = 2000 + rand()%2500;
} else ArcaneBolt_Timer -= diff;
if (Apprentice_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_ETHEREAL_APPRENTICE, true);
- m_creature->ForcedDespawn();
+ DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
+ me->ForcedDespawn();
return;
} else Apprentice_Timer -= diff;
}
@@ -320,10 +320,10 @@ struct mob_ethereal_apprenticeAI : public ScriptedAI
{
if (isFireboltTurn)
{
- DoCast(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true);
+ DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true);
isFireboltTurn = false;
}else{
- DoCast(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true);
+ DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true);
isFireboltTurn = true;
}
Cast_Timer = 3000;
diff --git a/src/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp
index 4ef812deaab..ad841b56cd4 100644
--- a/src/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp
+++ b/src/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp
@@ -58,17 +58,17 @@ struct boss_pandemoniusAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void UpdateAI(const uint32 diff)
@@ -96,12 +96,12 @@ struct boss_pandemoniusAI : public ScriptedAI
{
if (DarkShell_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoScriptText(EMOTE_DARK_SHELL, m_creature);
+ DoScriptText(EMOTE_DARK_SHELL, me);
- DoCast(m_creature, SPELL_DARK_SHELL);
+ DoCast(me, SPELL_DARK_SHELL);
DarkShell_Timer = 20000;
} else DarkShell_Timer -= diff;
}
diff --git a/src/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp
index badcd649635..ff0240c309c 100644
--- a/src/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp
+++ b/src/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp
@@ -82,12 +82,12 @@ struct boss_darkweaver_sythAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void KilledUnit(Unit* victim)
@@ -95,7 +95,7 @@ struct boss_darkweaver_sythAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustSummoned(Creature *summoned)
@@ -106,15 +106,15 @@ struct boss_darkweaver_sythAI : public ScriptedAI
void SythSummoning()
{
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_SUMMON_SYTH_ARCANE, true); //front
- DoCast(m_creature, SPELL_SUMMON_SYTH_FIRE, true); //back
- DoCast(m_creature, SPELL_SUMMON_SYTH_FROST, true); //left
- DoCast(m_creature, SPELL_SUMMON_SYTH_SHADOW, true); //right
+ DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front
+ DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back
+ DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left
+ DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right
}
void UpdateAI(const uint32 diff)
@@ -122,19 +122,19 @@ struct boss_darkweaver_sythAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90)
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 90) && !summon90)
{
SythSummoning();
summon90 = true;
}
- if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50)
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 50) && !summon50)
{
SythSummoning();
summon50 = true;
}
- if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10)
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 10) && !summon10)
{
SythSummoning();
summon10 = true;
@@ -202,7 +202,7 @@ struct mob_syth_fireAI : public ScriptedAI
void Reset()
{
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
flameshock_timer = 2500;
flamebuffet_timer = 5000;
}
@@ -250,7 +250,7 @@ struct mob_syth_arcaneAI : public ScriptedAI
void Reset()
{
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
arcaneshock_timer = 2500;
arcanebuffet_timer = 5000;
}
@@ -298,7 +298,7 @@ struct mob_syth_frostAI : public ScriptedAI
void Reset()
{
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
frostshock_timer = 2500;
frostbuffet_timer = 5000;
}
@@ -346,7 +346,7 @@ struct mob_syth_shadowAI : public ScriptedAI
void Reset()
{
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
shadowshock_timer = 2500;
shadowbuffet_timer = 5000;
}
diff --git a/src/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
index 1fa55df8837..a81a58df8d8 100644
--- a/src/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
+++ b/src/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
@@ -81,19 +81,19 @@ struct boss_talon_king_ikissAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- if (!Intro && m_creature->IsWithinDistInMap(who, 100))
+ if (!Intro && me->IsWithinDistInMap(who, 100))
{
Intro = true;
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
}
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
@@ -103,12 +103,12 @@ struct boss_talon_king_ikissAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
@@ -116,7 +116,7 @@ struct boss_talon_king_ikissAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void UpdateAI(const uint32 diff)
@@ -126,14 +126,14 @@ struct boss_talon_king_ikissAI : public ScriptedAI
if (Blink)
{
- DoCast(m_creature, SPELL_ARCANE_EXPLOSION);
- DoCast(m_creature, SPELL_ARCANE_BUBBLE, true);
+ DoCast(me, SPELL_ARCANE_EXPLOSION);
+ DoCast(me, SPELL_ARCANE_BUBBLE, true);
Blink = false;
}
if (ArcaneVolley_Timer <= diff)
{
- DoCast(m_creature, SPELL_ARCANE_VOLLEY);
+ DoCast(me, SPELL_ARCANE_VOLLEY);
ArcaneVolley_Timer = 7000+rand()%5000;
} else ArcaneVolley_Timer -= diff;
@@ -153,9 +153,9 @@ struct boss_talon_king_ikissAI : public ScriptedAI
} else Sheep_Timer -= diff;
//may not be correct time to cast
- if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20))
+ if (!ManaShield && ((me->GetHealth()*100) / me->GetMaxHealth() < 20))
{
- DoCast(m_creature, SPELL_MANA_SHIELD);
+ DoCast(me, SPELL_MANA_SHIELD);
ManaShield = true;
}
@@ -163,19 +163,19 @@ struct boss_talon_king_ikissAI : public ScriptedAI
{
if (Slow_Timer <= diff)
{
- DoCast(m_creature, H_SPELL_SLOW);
+ DoCast(me, H_SPELL_SLOW);
Slow_Timer = 15000+rand()%25000;
} else Slow_Timer -= diff;
}
if (Blink_Timer <= diff)
{
- DoScriptText(EMOTE_ARCANE_EXP, m_creature);
+ DoScriptText(EMOTE_ARCANE_EXP, me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
//Spell doesn't work, but we use for visual effect at least
DoCast(pTarget, SPELL_BLINK);
diff --git a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
index 5227a2c4d49..45017a4f3a2 100644
--- a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
@@ -69,10 +69,10 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
IsBanished = true;
Enraged = false;
- if (m_pInstance && m_creature->isAlive())
+ if (m_pInstance && me->isAlive())
{
if (m_pInstance->GetData(TYPE_OVERSEER) != DONE)
- DoCast(m_creature, SPELL_BANISH, true);
+ DoCast(me, SPELL_BANISH, true);
}
}
@@ -84,7 +84,7 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
void MoveInLineOfSight(Unit* pWho)
{
- if (m_creature->HasAura(SPELL_BANISH))
+ if (me->HasAura(SPELL_BANISH))
return;
npc_escortAI::MoveInLineOfSight(pWho);
@@ -96,8 +96,8 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
void DoIntro()
{
- if (m_creature->HasAura(SPELL_BANISH))
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
+ if (me->HasAura(SPELL_BANISH))
+ me->RemoveAurasDueToSpell(SPELL_BANISH);
IsBanished = false;
Intro = true;
@@ -106,7 +106,7 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
{
if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL)
{
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
Start(true, false, 0, NULL, false, true);
}
@@ -116,17 +116,17 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_HELLMAW, DONE);
@@ -161,7 +161,7 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
if (!UpdateVictim())
return;
- if (m_creature->HasAura(SPELL_BANISH, 0))
+ if (me->HasAura(SPELL_BANISH, 0))
{
EnterEvadeMode();
return;
@@ -169,13 +169,13 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
if (CorrosiveAcid_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CORROSIVE_ACID);
+ DoCast(me->getVictim(), SPELL_CORROSIVE_ACID);
CorrosiveAcid_Timer = 15000 + rand()%10000;
} else CorrosiveAcid_Timer -= diff;
if (Fear_Timer <= diff)
{
- DoCast(m_creature, SPELL_FEAR);
+ DoCast(me, SPELL_FEAR);
Fear_Timer = 20000 + rand()%15000;
} else Fear_Timer -= diff;
@@ -183,7 +183,7 @@ struct boss_ambassador_hellmawAI : public npc_escortAI
{
if (!Enraged && Enrage_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Enrage_Timer -= diff;
}
diff --git a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
index d7c04a35c9c..f725c0f2a38 100644
--- a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
@@ -81,12 +81,12 @@ struct boss_blackheart_the_inciterAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
@@ -94,7 +94,7 @@ struct boss_blackheart_the_inciterAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
if (pInstance)
pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
@@ -119,12 +119,12 @@ struct boss_blackheart_the_inciterAI : public ScriptedAI
if (InciteChaos_Timer <= diff)
{
- DoCast(m_creature, SPELL_INCITE_CHAOS);
+ DoCast(me, SPELL_INCITE_CHAOS);
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
pTarget->CastSpell(pTarget,SPELL_INCITE_CHAOS_B,true);
}
@@ -146,7 +146,7 @@ struct boss_blackheart_the_inciterAI : public ScriptedAI
//Knockback_Timer
if (Knockback_Timer <= diff)
{
- DoCast(m_creature, SPELL_WAR_STOMP);
+ DoCast(me, SPELL_WAR_STOMP);
Knockback_Timer = 18000 + rand()%6000;
} else Knockback_Timer -= diff;
diff --git a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
index 98f2f3ffe96..2af5ff130cd 100644
--- a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
@@ -83,12 +83,12 @@ struct mob_voidtravelerAI : public ScriptedAI
{
if (!VorpilGUID)
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
}
if (move <= diff)
{
- Creature *Vorpil = Unit::GetCreature(*m_creature, VorpilGUID);
+ Creature *Vorpil = Unit::GetCreature(*me, VorpilGUID);
if (!Vorpil)
{
VorpilGUID = 0;
@@ -97,23 +97,23 @@ struct mob_voidtravelerAI : public ScriptedAI
if (sacrificed)
{
- m_creature->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil);
+ me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil);
Vorpil->SetHealth(Vorpil->GetHealth() + Vorpil->GetMaxHealth()/25);
- DoCast(m_creature, SPELL_SHADOW_NOVA, true);
- m_creature->Kill(m_creature);
+ DoCast(me, SPELL_SHADOW_NOVA, true);
+ me->Kill(me);
return;
}
- m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0);
- if (m_creature->IsWithinDist(Vorpil, 3))
+ me->GetMotionMaster()->MoveFollow(Vorpil,0,0);
+ if (me->IsWithinDist(Vorpil, 3))
{
- DoCast(m_creature, SPELL_SACRIFICE, false);
+ DoCast(me, SPELL_SACRIFICE, false);
sacrificed = true;
move = 500;
return;
}
if (!Vorpil->isInCombat() || Vorpil->isDead())
{
- m_creature->Kill(m_creature);
+ me->Kill(me);
return;
}
move = 1000;
@@ -163,7 +163,7 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
for (uint8 i = 0; i < 5; ++i)
{
Creature *Portal = NULL;
- Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
+ Portal = me->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
if (Portal)
{
PortalsGuid[i] = Portal->GetGUID();
@@ -181,7 +181,7 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
{
for (uint8 i = 0; i < 5; ++i)
{
- Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
+ Unit *Portal = Unit::GetUnit((*me), PortalsGuid[i]);
if (Portal && Portal->isAlive())
Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
PortalsGuid[i] = 0;
@@ -193,10 +193,10 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
void spawnVoidTraveler()
{
int pos = urand(0,4);
- m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000);
+ me->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000);
if (!HelpYell)
{
- DoScriptText(SAY_HELP, m_creature);
+ DoScriptText(SAY_HELP, me);
HelpYell = true;
}
}
@@ -204,17 +204,17 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER)
- CAST_AI(mob_voidtravelerAI, summoned->AI())->VorpilGUID = m_creature->GetGUID();
+ CAST_AI(mob_voidtravelerAI, summoned->AI())->VorpilGUID = me->GetGUID();
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
destroyPortals();
if (pInstance)
@@ -223,7 +223,7 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
summonPortals();
if (pInstance)
@@ -234,9 +234,9 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
{
ScriptedAI::MoveInLineOfSight(who);
- if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who))
+ if (!Intro && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 100) && me->IsHostileTo(who))
{
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
Intro = true;
}
}
@@ -248,7 +248,7 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
if (ShadowBoltVolley_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOWBOLT_VOLLEY);
+ DoCast(me, SPELL_SHADOWBOLT_VOLLEY);
ShadowBoltVolley_Timer = 15000 + rand()%15000;
} else ShadowBoltVolley_Timer -= diff;
@@ -264,17 +264,17 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
if (DrawShadows_Timer <= diff)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
- i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
+ i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
- m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f);
- DoCast(m_creature, SPELL_DRAW_SHADOWS, true);
+ me->GetMap()->CreatureRelocation(me, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f);
+ DoCast(me, SPELL_DRAW_SHADOWS, true);
- DoCast(m_creature, SPELL_RAIN_OF_FIRE);
+ DoCast(me, SPELL_RAIN_OF_FIRE);
ShadowBoltVolley_Timer = 6000;
DrawShadows_Timer = 30000;
@@ -285,7 +285,7 @@ struct boss_grandmaster_vorpilAI : public ScriptedAI
spawnVoidTraveler();
summonTraveler_Timer = 10000;
//enrage at 20%
- if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth())
+ if ((me->GetHealth()*5) < me->GetMaxHealth())
summonTraveler_Timer = 5000;
} else summonTraveler_Timer -=diff;
diff --git a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp
index 61c4c6dce64..ef35e9f01c5 100644
--- a/src/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -60,21 +60,21 @@ struct boss_murmurAI : public ScriptedAI
SonicBoom = false;
//database should have `RegenHealth`=0 to prevent regen
- uint32 hp = (m_creature->GetMaxHealth()*40)/100;
- if (hp) m_creature->SetHealth(hp);
- m_creature->ResetPlayerDamageReq();
+ uint32 hp = (me->GetMaxHealth()*40)/100;
+ if (hp) me->SetHealth(hp);
+ me->ResetPlayerDamageReq();
}
void SonicBoomEffect()
{
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
//Not do anything without aura, spell can be resisted!
- if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(pTarget, 34.0f))
+ if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f))
{
//This will be wrong calculation. Also, comments suggest it must deal damage
pTarget->SetHealth(uint32(pTarget->GetMaxHealth() - pTarget->GetMaxHealth() * 0.8));
@@ -89,19 +89,19 @@ struct boss_murmurAI : public ScriptedAI
void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
{
if (pTarget && pTarget->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT)
- m_creature->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell);
+ me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target or casting
- if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false))
+ if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false))
return;
// Sonic Boom
if (SonicBoom)
{
- DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true);
+ DoCast(me, SPELL_SONIC_BOOM_EFFECT, true);
SonicBoomEffect();
SonicBoom = false;
@@ -109,8 +109,8 @@ struct boss_murmurAI : public ScriptedAI
}
if (SonicBoom_Timer <= diff)
{
- DoScriptText(EMOTE_SONIC_BOOM, m_creature);
- DoCast(m_creature, SPELL_SONIC_BOOM_CAST);
+ DoScriptText(EMOTE_SONIC_BOOM, me);
+ DoCast(me, SPELL_SONIC_BOOM_CAST);
SonicBoom_Timer = 30000;
SonicBoom = true;
return;
@@ -125,11 +125,11 @@ struct boss_murmurAI : public ScriptedAI
} else MurmursTouch_Timer -= diff;
// Resonance
- if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim())))
+ if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim())))
{
if (Resonance_Timer <= diff)
{
- DoCast(m_creature, SPELL_RESONANCE);
+ DoCast(me, SPELL_RESONANCE);
Resonance_Timer = 5000;
} else Resonance_Timer -= diff;
}
@@ -152,10 +152,10 @@ struct boss_murmurAI : public ScriptedAI
// Thundering Storm
if (ThunderingStorm_Timer <= diff)
{
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
- if (Unit *pTarget = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()))
- if (pTarget->isAlive() && !m_creature->IsWithinDist(pTarget, 35, false))
+ if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
+ if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false))
DoCast(pTarget, SPELL_THUNDERING_STORM, true);
ThunderingStorm_Timer = 15000;
} else ThunderingStorm_Timer -= diff;
@@ -171,16 +171,16 @@ struct boss_murmurAI : public ScriptedAI
}
// Select nearest most aggro target if top aggro too far
- if (!m_creature->isAttackReady())
+ if (!me->isAttackReady())
return;
- if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (!me->IsWithinMeleeRange(me->getVictim()))
{
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
- if (Unit *pTarget = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()))
- if (pTarget->isAlive() && m_creature->IsWithinMeleeRange(pTarget))
+ if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
+ if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget))
{
- m_creature->TauntApply(pTarget);
+ me->TauntApply(pTarget);
break;
}
}
diff --git a/src/scripts/outland/black_temple/boss_bloodboil.cpp b/src/scripts/outland/black_temple/boss_bloodboil.cpp
index da598ed0ea2..835f0b5dd29 100644
--- a/src/scripts/outland/black_temple/boss_bloodboil.cpp
+++ b/src/scripts/outland/black_temple/boss_bloodboil.cpp
@@ -101,21 +101,21 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
Phase1 = true;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
}
void EnterCombat(Unit *who)
{
DoZoneInCombat();
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
@@ -123,14 +123,14 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
// Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited.
void CastBloodboil()
{
// Get the Threat List
- std::list<HostileReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> m_threatlist = me->getThreatManager().getThreatList();
if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue
return;
@@ -139,14 +139,14 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
std::list<HostileReference *>::const_iterator itr = m_threatlist.begin();
for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
{
- Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//only on alive players
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
}
//Sort the list of players
- targets.sort(ObjectDistanceOrderReversed(m_creature));
+ targets.sort(ObjectDistanceOrderReversed(me));
//Resize so we only get top 5
targets.resize(5);
@@ -174,13 +174,13 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
void RevertThreatOnTarget(uint64 guid)
{
Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), guid);
+ pUnit = Unit::GetUnit((*me), guid);
if (pUnit)
{
if (DoGetThreat(pUnit))
DoModifyThreatPercent(pUnit, -100);
if (TargetThreat)
- m_creature->AddThreat(pUnit, TargetThreat);
+ me->AddThreat(pUnit, TargetThreat);
}
}
@@ -191,22 +191,22 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
if (ArcingSmashTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ DoCast(me->getVictim(), SPELL_ARCING_SMASH);
ArcingSmashTimer = 10000;
} else ArcingSmashTimer -= diff;
if (FelAcidTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEL_ACID);
+ DoCast(me->getVictim(), SPELL_FEL_ACID);
FelAcidTimer = 25000;
} else FelAcidTimer -= diff;
- if (!m_creature->HasAura(SPELL_BERSERK))
+ if (!me->HasAura(SPELL_BERSERK))
{
if (EnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), m_creature);
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), me);
} else EnrageTimer -= diff;
}
@@ -214,23 +214,23 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
{
if (BewilderingStrikeTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
- float mt_threat = DoGetThreat(m_creature->getVictim());
+ DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE);
+ float mt_threat = DoGetThreat(me->getVictim());
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
- m_creature->AddThreat(pTarget, mt_threat);
+ me->AddThreat(pTarget, mt_threat);
BewilderingStrikeTimer = 20000;
} else BewilderingStrikeTimer -= diff;
if (EjectTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_EJECT1);
- DoModifyThreatPercent(m_creature->getVictim(), -40);
+ DoCast(me->getVictim(), SPELL_EJECT1);
+ DoModifyThreatPercent(me->getVictim(), -40);
EjectTimer = 15000;
} else EjectTimer -= diff;
if (AcidicWoundTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND);
+ DoCast(me->getVictim(), SPELL_ACIDIC_WOUND);
AcidicWoundTimer = 10000;
} else AcidicWoundTimer -= diff;
@@ -239,7 +239,7 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
if (BloodboilCount < 5) // Only cast it five times.
{
//CastBloodboil(); // Causes issues on windows, so is commented out.
- DoCast(m_creature->getVictim(), SPELL_BLOODBOIL);
+ DoCast(me->getVictim(), SPELL_BLOODBOIL);
++BloodboilCount;
BloodboilTimer = 10000*BloodboilCount;
}
@@ -250,13 +250,13 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
{
if (AcidGeyserTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER);
+ DoCast(me->getVictim(), SPELL_ACID_GEYSER);
AcidGeyserTimer = 30000;
} else AcidGeyserTimer -= diff;
if (EjectTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_EJECT2);
+ DoCast(me->getVictim(), SPELL_EJECT2);
EjectTimer = 15000;
} else EjectTimer -= diff;
}
@@ -272,14 +272,14 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
TargetThreat = DoGetThreat(pTarget);
TargetGUID = pTarget->GetGUID();
- pTarget->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
+ pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
- m_creature->AddThreat(pTarget, 50000000.0f);
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ me->AddThreat(pTarget, 50000000.0f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
// If VMaps are disabled, this spell can call the whole instance
- DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
+ DoCast(me, SPELL_INSIGNIFIGANCE, true);
DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true);
DoCast(pTarget, SPELL_FEL_RAGE_2, true);
/* These spells do not work, comment them out for now.
@@ -287,9 +287,9 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/
//Cast this without triggered so that it appears in combat logs and shows visual.
- DoCast(m_creature, SPELL_FEL_RAGE_SELF);
+ DoCast(me, SPELL_FEL_RAGE_SELF);
- DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), m_creature);
+ DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
AcidGeyserTimer = 1000;
PhaseChangeTimer = 30000;
@@ -307,8 +307,8 @@ struct boss_gurtogg_bloodboilAI : public ScriptedAI
FelAcidTimer += 2000;
EjectTimer += 2000;
PhaseChangeTimer = 60000;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
}
} else PhaseChangeTimer -= diff;
diff --git a/src/scripts/outland/black_temple/boss_illidan.cpp b/src/scripts/outland/black_temple/boss_illidan.cpp
index 8ee901f41dc..4a61253496b 100644
--- a/src/scripts/outland/black_temple/boss_illidan.cpp
+++ b/src/scripts/outland/black_temple/boss_illidan.cpp
@@ -25,8 +25,8 @@ EndScriptData */
#include "black_temple.h"
#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid)
-#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
-#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid)
+#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*me, guid)
+#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*me, guid)
#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
/************* Quotes and Sounds ***********************/
@@ -365,10 +365,10 @@ static Animation DemonTransformation[]=
/************************************** Illidan's AI ***************************************/
struct boss_illidan_stormrageAI : public ScriptedAI
{
- boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature)
+ boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
+ DoCast(me, SPELL_DUAL_WIELD, true);
SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE);
if (TempSpell)
@@ -408,7 +408,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL)
{
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
EnterPhase(PHASE_FLIGHT_SEQUENCE);
}
}
@@ -419,10 +419,10 @@ struct boss_illidan_stormrageAI : public ScriptedAI
{
if (FlightCount == 7) //change hover point
{
- if (m_creature->getVictim())
+ if (me->getVictim())
{
- m_creature->SetInFront(m_creature->getVictim());
- m_creature->StopMoving();
+ me->SetInFront(me->getVictim());
+ me->StopMoving();
}
EnterPhase(PHASE_FLIGHT);
}
@@ -432,7 +432,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->setActive(true);
+ me->setActive(true);
DoZoneInCombat();
}
@@ -451,7 +451,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
void JustDied(Unit *killer)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (!pInstance)
return;
@@ -464,44 +464,44 @@ struct boss_illidan_stormrageAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- if (victim == m_creature) return;
+ if (victim == me) return;
// TODO: Find better way to handle emote
switch (urand(0,1))
{
case 0:
- m_creature->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID());
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ me->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID());
+ DoPlaySoundToSet(me, SOUND_KILL1);
break;
case 1:
- m_creature->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID());
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ me->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID());
+ DoPlaySoundToSet(me, SOUND_KILL2);
break;
}
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && done_by != m_creature)
+ if (damage >= me->GetHealth() && done_by != me)
damage = 0;
if (done_by->GetGUID() == MaievGUID)
- done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him
+ done_by->AddThreat(me, -(3*(float)damage)/4); // do not let maiev tank him
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
{
- if (!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
+ if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
else
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
}
void DeleteFromThreatList(uint64 TargetGUID)
{
- for (std::list<HostileReference*>::const_iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
{
if ((*itr)->getUnitGuid() == TargetGUID)
{
@@ -517,11 +517,11 @@ struct boss_illidan_stormrageAI : public ScriptedAI
Creature* pCreature = NULL;
if (Conversation[count].pCreature == ILLIDAN_STORMRAGE)
- pCreature = m_creature;
+ pCreature = me;
else if (Conversation[count].pCreature == AKAMA)
- pCreature = (Unit::GetCreature((*m_creature), AkamaGUID));
+ pCreature = (Unit::GetCreature((*me), AkamaGUID));
else if (Conversation[count].pCreature == MAIEV_SHADOWSONG)
- pCreature = (Unit::GetCreature((*m_creature), MaievGUID));
+ pCreature = (Unit::GetCreature((*me), MaievGUID));
if (pCreature)
{
@@ -544,27 +544,27 @@ struct boss_illidan_stormrageAI : public ScriptedAI
switch(FlightCount)
{
case 1://lift off
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- m_creature->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_TAKEOFF);
Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
break;
case 2://move to center
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
+ me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 3://throw one glaive
{
uint8 i=1;
- Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Glaive)
{
GlaiveGUID[i] = Glaive->GetGUID();
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Glaive->SetDisplayId(11686);
- Glaive->setFaction(m_creature->getFaction());
+ Glaive->setFaction(me->getFaction());
DoCast(Glaive, SPELL_THROW_GLAIVE2);
}
}
@@ -574,13 +574,13 @@ struct boss_illidan_stormrageAI : public ScriptedAI
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);
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Glaive)
{
GlaiveGUID[i] = Glaive->GetGUID();
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Glaive->SetDisplayId(11686);
- Glaive->setFaction(m_creature->getFaction());
+ Glaive->setFaction(me->getFaction());
DoCast(Glaive, SPELL_THROW_GLAIVE, true);
}
}
@@ -591,11 +591,11 @@ struct boss_illidan_stormrageAI : public ScriptedAI
Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
break;
case 6://fly to hover point
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 7://return to center
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
+ me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 8://glaive return
@@ -603,10 +603,10 @@ struct boss_illidan_stormrageAI : public ScriptedAI
{
if (GlaiveGUID[i])
{
- Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]);
+ Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]);
if (Glaive)
{
- Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
+ Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
Glaive->SetDisplayId(11686); // disappear but not die for now
}
}
@@ -614,9 +614,9 @@ struct boss_illidan_stormrageAI : public ScriptedAI
Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
break;
case 9://land
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
for (uint8 i = 0; i < 2; ++i)
{
if (GlaiveGUID[i])
@@ -633,8 +633,8 @@ struct boss_illidan_stormrageAI : public ScriptedAI
break;
case 10://attack
DoResetThreat();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
EnterPhase(PHASE_NORMAL_2);
break;
default:
@@ -646,19 +646,19 @@ struct boss_illidan_stormrageAI : public ScriptedAI
void HandleTransformSequence()
{
if (DemonTransformation[TransformCount].unaura)
- m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
+ me->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
if (DemonTransformation[TransformCount].aura)
- DoCast(m_creature, DemonTransformation[TransformCount].aura, true);
+ DoCast(me, DemonTransformation[TransformCount].aura, true);
if (DemonTransformation[TransformCount].displayid)
- m_creature->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time!
+ me->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time!
if (DemonTransformation[TransformCount].equip)
{
// Requip warglaives if needed
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
else
{
@@ -711,17 +711,17 @@ struct boss_illidan_stormrageAI : public ScriptedAI
switch(Phase)
{
case PHASE_NORMAL:
- if (HPPCT(m_creature) < 65)
+ if (HPPCT(me) < 65)
EnterPhase(PHASE_FLIGHT_SEQUENCE);
break;
case PHASE_NORMAL_2:
- if (HPPCT(m_creature) < 30)
+ if (HPPCT(me) < 30)
EnterPhase(PHASE_TALK_SEQUENCE);
break;
case PHASE_NORMAL_MAIEV:
- if (HPPCT(m_creature) < 1)
+ if (HPPCT(me) < 1)
EnterPhase(PHASE_TALK_SEQUENCE);
break;
@@ -741,18 +741,18 @@ struct boss_illidan_stormrageAI : public ScriptedAI
break;
}
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
- if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED))
+ if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED))
{
switch(Event)
{
//PHASE_NORMAL
case EVENT_BERSERK:
- m_creature->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- DoCast(m_creature, SPELL_BERSERK, true);
+ me->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ENRAGE);
+ DoCast(me, SPELL_BERSERK, true);
Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever.
break;
@@ -762,21 +762,21 @@ struct boss_illidan_stormrageAI : public ScriptedAI
char* yell = RandomTaunts[random].text;
uint32 soundid = RandomTaunts[random].sound;
if (yell)
- m_creature->MonsterYell(yell, LANG_UNIVERSAL, 0);
+ me->MonsterYell(yell, LANG_UNIVERSAL, 0);
if (soundid)
- DoPlaySoundToSet(m_creature, soundid);
+ DoPlaySoundToSet(me, soundid);
}
Timer[EVENT_TAUNT] = 25000 + rand()%10000;
break;
case EVENT_SHEAR:
// no longer exists in 3.0.2
- //DoCast(m_creature->getVictim(), SPELL_SHEAR);
+ //DoCast(me->getVictim(), SPELL_SHEAR);
Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
break;
case EVENT_FLAME_CRASH:
- DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
+ DoCast(me->getVictim(), SPELL_FLAME_CRASH);
Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000;
break;
@@ -793,7 +793,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
break;
case EVENT_DRAW_SOUL:
- DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
+ DoCast(me->getVictim(), SPELL_DRAW_SOUL);
Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;
break;
@@ -809,7 +809,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
//PHASE_NORMAL_MAIEV
case EVENT_ENRAGE:
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Timer[EVENT_ENRAGE] = 0;
break;
@@ -844,7 +844,7 @@ struct boss_illidan_stormrageAI : public ScriptedAI
HoverPoint += (rand()%3 + 1);
if (HoverPoint > 3)
HoverPoint -= 4;
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
break;
default:
@@ -857,21 +857,21 @@ struct boss_illidan_stormrageAI : public ScriptedAI
switch(Event)
{
case EVENT_SHADOW_BLAST:
- m_creature->GetMotionMaster()->Clear(false);
- if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim()))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
+ me->GetMotionMaster()->Clear(false);
+ if (!me->IsWithinDistInMap(me->getVictim(), 50)||!me->IsWithinLOSInMap(me->getVictim()))
+ me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
else
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST);
+ me->GetMotionMaster()->MoveIdle();
+ DoCast(me->getVictim(), SPELL_SHADOW_BLAST);
Timer[EVENT_SHADOW_BLAST] = 4000;
break;
case EVENT_SHADOWDEMON:
- DoCast(m_creature, SPELL_SUMMON_SHADOWDEMON);
+ DoCast(me, SPELL_SUMMON_SHADOWDEMON);
Timer[EVENT_SHADOWDEMON] = 0;
Timer[EVENT_FLAME_BURST] += 10000;
break;
case EVENT_FLAME_BURST:
- DoCast(m_creature, SPELL_FLAME_BURST);
+ DoCast(me, SPELL_FLAME_BURST);
Timer[EVENT_FLAME_BURST] = 15000;
break;
case EVENT_TRANSFORM_DEMON:
@@ -906,12 +906,12 @@ struct flame_of_azzinothAI : public ScriptedAI
void ChargeCheck()
{
Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false);
- if (pTarget && (!m_creature->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE)))
+ if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE)))
{
- m_creature->AddThreat(pTarget, 5000000.0f);
+ me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
DoCast(pTarget, SPELL_CHARGE);
- m_creature->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID());
+ me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID());
}
}
@@ -919,22 +919,22 @@ struct flame_of_azzinothAI : public ScriptedAI
{
if (GETUNIT(Glaive, GlaiveGUID))
{
- if (!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
+ if (!me->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
{
Glaive->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_FLAME_ENRAGE, true);
+ DoCast(me, SPELL_FLAME_ENRAGE, true);
DoResetThreat();
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget && pTarget->isAlive())
{
- m_creature->AddThreat(m_creature->getVictim(), 5000000.0f);
- AttackStart(m_creature->getVictim());
+ me->AddThreat(me->getVictim(), 5000000.0f);
+ AttackStart(me->getVictim());
}
}
- else if (!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL))
+ else if (!me->HasAura(SPELL_AZZINOTH_CHANNEL))
{
- Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
- m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
+ Glaive->CastSpell(me, SPELL_AZZINOTH_CHANNEL, false);
+ me->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
}
}
}
@@ -948,8 +948,8 @@ struct flame_of_azzinothAI : public ScriptedAI
if (FlameBlastTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
- DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST);
+ DoCast(me->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
+ DoCast(me->getVictim(), SPELL_FLAME_BLAST);
FlameBlastTimer = 15000; //10000 is official-like?
DoZoneInCombat(); //in case someone is revived
} else FlameBlastTimer -= diff;
@@ -1039,18 +1039,18 @@ struct npc_akama_illidanAI : public ScriptedAI
KillAllElites();
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- m_creature->setActive(false);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->setActive(false);
+ me->SetVisibility(VISIBILITY_OFF);
}
// Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit
void EnterEvadeMode()
{
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
}
void EnterCombat(Unit *who) {}
@@ -1064,17 +1064,17 @@ struct npc_akama_illidanAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID)
+ if (damage > me->GetHealth() || done_by->GetGUID() != IllidanGUID)
damage = 0;
}
void KillAllElites()
{
- std::list<HostileReference*>& threatList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
std::vector<Unit*> eliteList;
for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE)
eliteList.push_back(pUnit);
}
@@ -1094,19 +1094,19 @@ struct npc_akama_illidanAI : public ScriptedAI
if (GETCRE(Illidan, IllidanGUID))
{
Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
- m_creature->SetInFront(Illidan);
- Illidan->SetInFront(m_creature);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->SetInFront(Illidan);
+ Illidan->SetInFront(me);
+ me->GetMotionMaster()->MoveIdle();
Illidan->GetMotionMaster()->MoveIdle();
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID();
+ CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = me->GetGUID();
CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
}
}
void BeginChannel()
{
- m_creature->setActive(true);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->setActive(true);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if (!JustCreated)
return;
float x, y, z;
@@ -1115,7 +1115,7 @@ struct npc_akama_illidanAI : public ScriptedAI
else
return;//if door not spawned, don't crash server
- if (Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ if (Creature* Channel = me->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
{
ChannelGUID = Channel->GetGUID();
Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen.
@@ -1123,7 +1123,7 @@ struct npc_akama_illidanAI : public ScriptedAI
}
for (uint8 i = 0; i < 2; ++i)
- if (Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
+ if (Creature* Spirit = me->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
{
Spirit->SetVisibility(VISIBILITY_OFF);
SpiritGUID[i] = Spirit->GetGUID();
@@ -1132,9 +1132,9 @@ struct npc_akama_illidanAI : public ScriptedAI
void BeginWalk()
{
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetSpeed(MOVE_RUN, 1.0f);
- m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->SetSpeed(MOVE_RUN, 1.0f);
+ me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
}
void EnterPhase(PhaseAkama NextPhase)
@@ -1154,9 +1154,9 @@ struct npc_akama_illidanAI : public ScriptedAI
else if (Phase == PHASE_TALK)
{
if (GETCRE(Illidan, IllidanGUID))
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
+ CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
EnterEvadeMode();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
++WalkCount;
}
JustCreated = false;
@@ -1178,17 +1178,17 @@ struct npc_akama_illidanAI : public ScriptedAI
case PHASE_FIGHT_ILLIDAN:
if (GETUNIT(Illidan, IllidanGUID))
{
- m_creature->AddThreat(Illidan, 10000000.0f);
- m_creature->GetMotionMaster()->MoveChase(Illidan);
+ me->AddThreat(Illidan, 10000000.0f);
+ me->GetMotionMaster()->MoveChase(Illidan);
}
Timer = 30000; //chain lightning
break;
case PHASE_FIGHT_MINIONS:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Timer = 10000 + rand()%6000;//summon minion
break;
case PHASE_RETURN:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
KillAllElites();
WalkCount = 0;
BeginWalk();
@@ -1215,8 +1215,8 @@ struct npc_akama_illidanAI : public ScriptedAI
Timer = 8000;
break;
case 1:
- m_creature->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE);
+ me->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_AKAMA_LEAVE);
Timer = 3000;
break;
case 2:
@@ -1231,9 +1231,9 @@ struct npc_akama_illidanAI : public ScriptedAI
Unit* Channel, *Spirit[2];
if (ChannelCount <= 5)
{
- Channel = Unit::GetUnit((*m_creature), ChannelGUID);
- Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]);
- Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]);
+ Channel = Unit::GetUnit((*me), ChannelGUID);
+ Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]);
+ Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]);
if (!Channel || !Spirit[0] || !Spirit[1])
return;
}
@@ -1241,7 +1241,7 @@ struct npc_akama_illidanAI : public ScriptedAI
switch(ChannelCount)
{
case 0: // channel failed
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
Timer = 2000;
break;
case 1: // spirit appear
@@ -1256,7 +1256,7 @@ struct npc_akama_illidanAI : public ScriptedAI
Timer = 5000;
break;
case 3: //open the gate
- m_creature->InterruptNonMeleeSpells(true);
+ me->InterruptNonMeleeSpells(true);
Spirit[0]->InterruptNonMeleeSpells(true);
Spirit[1]->InterruptNonMeleeSpells(true);
if (pInstance)
@@ -1264,12 +1264,12 @@ struct npc_akama_illidanAI : public ScriptedAI
Timer = 2000;
break;
case 4:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
Timer = 2000;
break;
case 5:
- m_creature->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE);
+ me->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_AKAMA_BEWARE);
Channel->setDeathState(JUST_DIED);
Spirit[0]->SetVisibility(VISIBILITY_OFF);
Spirit[1]->SetVisibility(VISIBILITY_OFF);
@@ -1308,18 +1308,18 @@ struct npc_akama_illidanAI : public ScriptedAI
{
Timer = 0;
++WalkCount;
- m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ me->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
}
}
void UpdateAI(const uint32 diff)
{
- if (m_creature->GetVisibility() == VISIBILITY_OFF)
+ if (me->GetVisibility() == VISIBILITY_OFF)
{
if (Check_Timer <= diff)
{
if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE)
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
Check_Timer = 5000;
} else Check_Timer -= diff;
@@ -1357,7 +1357,7 @@ struct npc_akama_illidanAI : public ScriptedAI
EnterPhase(PHASE_TALK);
else
{
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
Timer = 30000;
}
}
@@ -1365,15 +1365,15 @@ struct npc_akama_illidanAI : public ScriptedAI
case PHASE_FIGHT_MINIONS:
{
float x, y, z;
- m_creature->GetPosition(x, y, z);
- Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ me->GetPosition(x, y, z);
+ Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ //Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
if (Elite)
{
- Elite->AI()->AttackStart(m_creature);
- Elite->AddThreat(m_creature, 1000000.0f);
+ Elite->AI()->AttackStart(me);
+ Elite->AddThreat(me, 1000000.0f);
AttackStart(Elite);
- m_creature->AddThreat(Elite, 1000000.0f);
+ me->AddThreat(Elite, 1000000.0f);
}
Timer = 10000 + rand()%6000;
GETUNIT(Illidan, IllidanGUID);
@@ -1389,8 +1389,8 @@ struct npc_akama_illidanAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
- DoCast(m_creature, SPELL_HEALING_POTION);
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 20)
+ DoCast(me, SPELL_HEALING_POTION);
DoMeleeAttackIfReady();
}
@@ -1416,7 +1416,7 @@ struct boss_maievAI : public ScriptedAI
Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738);
}
void EnterCombat(Unit *who) {}
@@ -1431,9 +1431,9 @@ struct boss_maievAI : public ScriptedAI
else
{
GETUNIT(Illidan, IllidanGUID);
- if (Illidan && Illidan->getVictim() == m_creature)
- damage = m_creature->GetMaxHealth()/10;
- if (damage >= m_creature->GetHealth())
+ if (Illidan && Illidan->getVictim() == me)
+ damage = me->GetMaxHealth()/10;
+ if (damage >= me->GetHealth())
damage = 0;
}
}
@@ -1448,7 +1448,7 @@ struct boss_maievAI : public ScriptedAI
else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE)
{
GETUNIT(Illidan, IllidanGUID);
- if (Illidan && m_creature->IsWithinDistInMap(Illidan, 25))
+ if (Illidan && me->IsWithinDistInMap(Illidan, 25))
BlinkToPlayer();//Do not let dread aura hurt her.
AttackStartNoMove(who);
}
@@ -1469,14 +1469,14 @@ struct boss_maievAI : public ScriptedAI
case PHASE_TALK_SEQUENCE:
if (Timer[EVENT_MAIEV_STEALTH])
{
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetHealth(me->GetMaxHealth());
+ me->SetVisibility(VISIBILITY_ON);
Timer[EVENT_MAIEV_STEALTH] = 0;
}
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->AttackStop();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
+ me->InterruptNonMeleeSpells(false);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
+ me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
MaxTimer = 0;
break;
case PHASE_TRANSFORM_SEQUENCE:
@@ -1501,11 +1501,11 @@ struct boss_maievAI : public ScriptedAI
void BlinkTo(float x, float y, float z)
{
- m_creature->AttackStop();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
+ me->AttackStop();
+ me->InterruptNonMeleeSpells(false);
+ me->GetMotionMaster()->Clear(false);
DoTeleportTo(x, y, z);
- DoCast(m_creature, SPELL_TELEPORT_VISUAL, true);
+ DoCast(me, SPELL_TELEPORT_VISUAL, true);
}
void BlinkToPlayer()
@@ -1514,7 +1514,7 @@ struct boss_maievAI : public ScriptedAI
{
Unit *pTarget = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!pTarget || !m_creature->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20))
+ if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20))
{
uint8 pos = rand()%4;
BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
@@ -1547,9 +1547,9 @@ struct boss_maievAI : public ScriptedAI
{
case EVENT_MAIEV_STEALTH:
{
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetHealth(me->GetMaxHealth());
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Timer[EVENT_MAIEV_STEALTH] = 0;
BlinkToPlayer();
EnterPhase(Phase);
@@ -1560,27 +1560,27 @@ struct boss_maievAI : public ScriptedAI
uint32 random = rand()%4;
char* text = MaievTaunts[random].text;
uint32 sound = MaievTaunts[random].sound;
- m_creature->MonsterYell(text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, sound);
+ me->MonsterYell(text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, sound);
Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
}
break;
case EVENT_MAIEV_SHADOW_STRIKE:
- DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE);
+ DoCast(me->getVictim(), SPELL_SHADOW_STRIKE);
Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
break;
case EVENT_MAIEV_TRAP:
if (Phase == PHASE_NORMAL_MAIEV)
{
BlinkToPlayer();
- DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON);
+ DoCast(me, SPELL_CAGE_TRAP_SUMMON);
Timer[EVENT_MAIEV_TRAP] = 22000;
}
else
{
- if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
- DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER);
+ if (!me->IsWithinDistInMap(me->getVictim(), 40))
+ me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
+ DoCast(me->getVictim(), SPELL_THROW_DAGGER);
Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
}
break;
@@ -1588,13 +1588,13 @@ struct boss_maievAI : public ScriptedAI
break;
}
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (GETCRE(Illidan, IllidanGUID))
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
- m_creature->AttackStop();
+ CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
+ me->AttackStop();
Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
MaxTimer = 1;
}
@@ -1641,7 +1641,7 @@ struct cage_trap_triggerAI : public ScriptedAI
DespawnTimer = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who){}
@@ -1655,7 +1655,7 @@ struct 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)))
+ if (!IllidanGUID && me->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED)))
{
IllidanGUID = who->GetGUID();
who->CastSpell(who, SPELL_CAGED, true);
@@ -1673,12 +1673,12 @@ struct cage_trap_triggerAI : public ScriptedAI
{
if (DespawnTimer)
if (DespawnTimer <= diff)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
else DespawnTimer -= diff;
//if (IllidanGUID && !SummonedBeams)
//{
- // if (Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID)
+ // if (Unit* Illidan = Unit::GetUnit(*me, IllidanGUID)
// {
// //TODO: Find proper spells and properly apply 'caged' Illidan effect
// }
@@ -1709,12 +1709,12 @@ struct shadow_demonAI : public ScriptedAI
void Reset()
{
TargetGUID = 0;
- DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
+ DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true);
}
void JustDied(Unit *killer)
{
- if (Unit *pTarget = Unit::GetUnit((*m_creature), TargetGUID))
+ if (Unit *pTarget = Unit::GetUnit((*me), TargetGUID))
pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE);
}
@@ -1722,18 +1722,18 @@ struct shadow_demonAI : public ScriptedAI
{
if (!UpdateVictim()) return;
- if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
+ if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
- if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE))
+ if (!me->getVictim()->HasAura(SPELL_PARALYZE))
{
- TargetGUID = m_creature->getVictim()->GetGUID();
- m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
- DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true);
- DoCast(m_creature->getVictim(), SPELL_PARALYZE, true);
+ TargetGUID = me->getVictim()->GetGUID();
+ me->AddThreat(me->getVictim(), 10000000.0f);
+ DoCast(me->getVictim(), SPELL_PURPLE_BEAM, true);
+ DoCast(me->getVictim(), SPELL_PARALYZE, true);
}
// Kill our target if we're very close.
- if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3))
- DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL);
+ if (me->IsWithinDistInMap(me->getVictim(), 3))
+ DoCast(me->getVictim(), SPELL_CONSUME_SOUL);
}
};
@@ -1757,37 +1757,37 @@ struct mob_parasitic_shadowfiendAI : public ScriptedAI
IllidanGUID = 0;
CheckTimer = 5000;
- DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true);
+ DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true);
}
void EnterCombat(Unit* who) { DoZoneInCombat(); }
void DoMeleeAttackIfReady()
{
- if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
{
- if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
- && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
+ if (!me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
+ && !me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
{
- if (Creature* illidan = Unit::GetCreature((*m_creature),IllidanGUID))//summon only in 1. phase
+ if (Creature* illidan = Unit::GetCreature((*me),IllidanGUID))//summon only in 1. phase
if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL)
- m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
+ me->CastSpell(me->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
}
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
AttackStart(pTarget);
else
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->setDeathState(JUST_DIED);
return;
}
}
@@ -1797,8 +1797,8 @@ struct mob_parasitic_shadowfiendAI : public ScriptedAI
GETUNIT(Illidan, IllidanGUID);
if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode())
{
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->setDeathState(JUST_DIED);
return;
} else CheckTimer = 5000;
} else CheckTimer -= diff;
@@ -1855,13 +1855,13 @@ void boss_illidan_stormrageAI::Reset()
FlightCount = 0;
TransformCount = 0;
- m_creature->SetDisplayId(21135);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(21135);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->setActive(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->setActive(false);
Summons.DespawnAll();
}
@@ -1898,7 +1898,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();
- CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID());
+ CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(me->GetGUID());
summon->AI()->DoAction(PHASE_TALK_SEQUENCE);
}
break;
@@ -1917,19 +1917,19 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
switch(TalkCount)
{
case 0:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
case 8:
// Equip our warglaives!
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 9:
if (GETCRE(Akama, AkamaGUID))
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->AddThreat(Akama, 100.0f);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->AddThreat(Akama, 100.0f);
CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
EnterPhase(PHASE_NORMAL);
}
@@ -1942,39 +1942,39 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
{
Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible
Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
- Maiev->SetInFront(m_creature); // Have her face us
- m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
+ Maiev->SetInFront(me); // Have her face us
+ me->SetInFront(Maiev); // Face her, so it's not rude =P
Maiev->GetMotionMaster()->MoveIdle();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
}
break;
case 14:
if (GETCRE(Maiev, MaievGUID))
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
- Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us.
+ Maiev->AddThreat(me, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
+ Maiev->AI()->AttackStart(me); // Force Maiev to attack us.
EnterPhase(PHASE_NORMAL_MAIEV);
}
break;
case 15:
- DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
+ DoCast(me, SPELL_DEATH); // Animate his kneeling + stun him
Summons.DespawnAll();
break;
case 17:
if (GETUNIT(Akama, AkamaGUID))
{
- if (!m_creature->IsWithinDistInMap(Akama, 15))
+ if (!me->IsWithinDistInMap(Akama, 15))
{
float x, y, z;
- m_creature->GetPosition(x, y, z);
+ me->GetPosition(x, y, z);
x += 10; y += 10;
Akama->GetMotionMaster()->Clear(false);
//Akama->GetMotionMaster()->MoveIdle();
- Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f);
+ Akama->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives.
- Akama->GetMotionMaster()->MoveChase(m_creature);
+ Akama->GetMotionMaster()->MoveChase(me);
}
}
break;
@@ -1983,11 +1983,11 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
{
Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
Maiev->setDeathState(JUST_DIED);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
break;
case 21: // Kill ourself.
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
break;
default:
break;
@@ -1999,10 +1999,10 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
void boss_illidan_stormrageAI::CastEyeBlast()
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
- m_creature->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST);
+ me->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_EYE_BLAST);
float distx, disty, dist[2];
for (uint8 i = 0; i < 2; ++i)
@@ -2023,7 +2023,7 @@ void boss_illidan_stormrageAI::CastEyeBlast()
final.x = 2 * final.x - initial.x;
final.y = 2 * final.y - initial.y;
- Creature* Trigger = m_creature->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
+ Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
if (!Trigger) return;
Trigger->SetSpeed(MOVE_WALK, 3);
@@ -2031,23 +2031,23 @@ void boss_illidan_stormrageAI::CastEyeBlast()
Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
//Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
+ me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
DoCast(Trigger, SPELL_EYE_BLAST);
}
void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
{
- m_creature->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES);
+ me->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SUMMONFLAMES);
for (uint8 i = 0; i < 2; ++i)
{
if (GETUNIT(Glaive, GlaiveGUID[i]))
{
- Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ Creature* Flame = me->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
if (Flame)
{
- Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction
+ Flame->setFaction(me->getFaction()); // Just in case the database has it as a different faction
Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
@@ -2059,12 +2059,12 @@ void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
void boss_illidan_stormrageAI::SummonMaiev()
{
- DoCast(m_creature, SPELL_SHADOW_PRISON, true);
- DoCast(m_creature, 40403, true);
+ DoCast(me, SPELL_SHADOW_PRISON, true);
+ DoCast(me, 40403, true);
if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
{
EnterEvadeMode();
- m_creature->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
+ me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
}
}
@@ -2077,7 +2077,7 @@ void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
case PHASE_NORMAL:
case PHASE_NORMAL_2:
case PHASE_NORMAL_MAIEV:
- AttackStart(m_creature->getVictim());
+ AttackStart(me->getVictim());
Timer[EVENT_TAUNT] = 32000;
Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000;
Timer[EVENT_FLAME_CRASH] = 20000;
@@ -2104,26 +2104,26 @@ void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
Timer[EVENT_FLAME_BURST] = 10000;
Timer[EVENT_SHADOWDEMON] = 30000;
Timer[EVENT_TRANSFORM_DEMON] = 60000;
- AttackStart(m_creature->getVictim());
+ AttackStart(me->getVictim());
break;
case PHASE_TALK_SEQUENCE:
Timer[EVENT_TALK_SEQUENCE] = 100;
- m_creature->RemoveAllAuras();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->AttackStop();
+ me->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
break;
case PHASE_FLIGHT_SEQUENCE:
if (Phase == PHASE_NORMAL) //lift off
{
FlightCount = 1;
Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- m_creature->RemoveAllAuras();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->AttackStop();
+ me->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
}
else //land
Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
@@ -2135,11 +2135,11 @@ void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
{
TransformCount = 0;
Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- m_creature->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_MORPH);
+ me->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_MORPH);
}
- m_creature->GetMotionMaster()->Clear();
- m_creature->AttackStop();
+ me->GetMotionMaster()->Clear();
+ me->AttackStop();
break;
default:
break;
diff --git a/src/scripts/outland/black_temple/boss_mother_shahraz.cpp b/src/scripts/outland/black_temple/boss_mother_shahraz.cpp
index b8596e1bf62..5a0fcc0c1da 100644
--- a/src/scripts/outland/black_temple/boss_mother_shahraz.cpp
+++ b/src/scripts/outland/black_temple/boss_mother_shahraz.cpp
@@ -129,12 +129,12 @@ struct boss_shahrazAI : public ScriptedAI
pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
DoZoneInCombat();
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
@@ -142,7 +142,7 @@ struct boss_shahrazAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void TeleportPlayers()
@@ -168,11 +168,11 @@ struct boss_shahrazAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
+ if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !Enraged)
{
Enraged = true;
- DoCast(m_creature, SPELL_ENRAGE, true);
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(me, SPELL_ENRAGE, true);
+ DoScriptText(SAY_ENRAGE, me);
}
//Randomly cast one beam.
@@ -212,7 +212,7 @@ struct boss_shahrazAI : public ScriptedAI
{
uint32 random = rand()%6;
if (PrismaticAuras[random])
- DoCast(m_creature, PrismaticAuras[random]);
+ DoCast(me, PrismaticAuras[random]);
PrismaticShieldTimer = 15000;
} else PrismaticShieldTimer -= diff;
@@ -223,7 +223,7 @@ struct boss_shahrazAI : public ScriptedAI
TeleportPlayers();
- DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), m_creature);
+ DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), me);
FatalAttractionExplodeTimer = 2000;
FatalAttractionTimer = 40000 + rand()%31 * 1000;
} else FatalAttractionTimer -= diff;
@@ -238,7 +238,7 @@ struct boss_shahrazAI : public ScriptedAI
Unit* pUnit = NULL;
if (TargetGUID[i])
{
- pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]);
+ pUnit = Unit::GetUnit((*me), TargetGUID[i]);
if (pUnit)
pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true);
TargetGUID[i] = 0;
@@ -257,28 +257,28 @@ struct boss_shahrazAI : public ScriptedAI
if (ShriekTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK);
+ DoCast(me->getVictim(), SPELL_SILENCING_SHRIEK);
ShriekTimer = 25000+rand()%10 * 1000;
} else ShriekTimer -= diff;
if (SaberTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SABER_LASH);
+ DoCast(me->getVictim(), SPELL_SABER_LASH);
SaberTimer = 25000+rand()%10 * 1000;
} else SaberTimer -= diff;
//Enrage
- if (!m_creature->HasAura(SPELL_BERSERK))
+ if (!me->HasAura(SPELL_BERSERK))
if (EnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(SAY_ENRAGE, me);
} else EnrageTimer -= diff;
//Random taunts
if (RandomYellTimer <= diff)
{
- DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), m_creature);
+ DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), me);
RandomYellTimer = 60000 + rand()%91 * 1000;
} else RandomYellTimer -= diff;
diff --git a/src/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/src/scripts/outland/black_temple/boss_reliquary_of_souls.cpp
index 6d23761aa52..7f7e5df19fa 100644
--- a/src/scripts/outland/black_temple/boss_reliquary_of_souls.cpp
+++ b/src/scripts/outland/black_temple/boss_reliquary_of_souls.cpp
@@ -109,7 +109,7 @@ struct npc_enslaved_soulAI : public ScriptedAI
void EnterCombat(Unit* who)
{
- DoCast(m_creature, ENSLAVED_SOUL_PASSIVE, true);
+ DoCast(me, ENSLAVED_SOUL_PASSIVE, true);
DoZoneInCombat();
}
@@ -142,7 +142,7 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
if (EssenceGUID)
{
- if (Creature* Essence = Unit::GetCreature(*m_creature, EssenceGUID))
+ if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID))
{
Essence->ForcedDespawn();
}
@@ -151,14 +151,14 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
Phase = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
}
void EnterCombat(Unit* who)
{
- m_creature->AddThreat(who, 10000.0f);
+ me->AddThreat(who, 10000.0f);
DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
@@ -173,11 +173,11 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
uint32 random = rand()%6;
float x = Coords[random].x;
float y = Coords[random].y;
- Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
if (!Soul) return false;
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID();
+ CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID();
Soul->AI()->AttackStart(pTarget);
} else EnterEvadeMode();
return true;
@@ -192,12 +192,12 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
for (; itr != m_threatlist.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit)
{
DoModifyThreatPercent(pUnit, -100);
float threat = pTarget->getThreatManager().getThreat(pUnit);
- m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
+ me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
}
}
}
@@ -213,7 +213,7 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
if (!Phase)
return;
- if (m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
+ if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
{
EnterEvadeMode();
return;
@@ -222,7 +222,7 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
Creature* Essence;
if (EssenceGUID)
{
- Essence = Unit::GetCreature(*m_creature, EssenceGUID);
+ Essence = Unit::GetCreature(*me, EssenceGUID);
if (!Essence)
{
EnterEvadeMode();
@@ -235,24 +235,24 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
switch(Counter)
{
case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY!
- DoStartNoMovement(m_creature);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY!
+ DoStartNoMovement(me);
Timer = 3000;
break;
case 1:
Timer = 2800;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube
- DoCast(m_creature, SPELL_SUBMERGE);
- DoStartNoMovement(m_creature);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube
+ DoCast(me, SPELL_SUBMERGE);
+ DoStartNoMovement(me);
break;
case 2:
Timer = 5000;
if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
{
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open
Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
EssenceGUID = Summon->GetGUID();
- DoStartNoMovement(m_creature);
+ DoStartNoMovement(me);
} else EnterEvadeMode();
break;
case 3:
@@ -260,7 +260,7 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
if (Phase == 3)
{
if (!Essence->isAlive())
- DoCast(m_creature, 7, true);
+ DoCast(me, 7, true);
else return;
}
else
@@ -270,24 +270,24 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
MergeThreatList(Essence);
Essence->RemoveAllAuras();
Essence->DeleteThreatList();
- Essence->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f);
+ Essence->GetMotionMaster()->MoveFollow(me,0.0f,0.0f);
} else return;
}
break;
case 4:
Timer = 1500;
- if (Essence->IsWithinDistInMap(m_creature, 10))
+ if (Essence->IsWithinDistInMap(me, 10))
{
Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear
Timer = 2000;
- m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE);
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
}
else
{
MergeThreatList(Essence);
Essence->RemoveAllAuras();
Essence->DeleteThreatList();
- Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
+ Essence->GetMotionMaster()->MoveFollow(me, 0, 0);
return;
}
break;
@@ -301,7 +301,7 @@ struct boss_reliquary_of_soulsAI : public ScriptedAI
DoScriptText(DESI_SAY_AFTER, Essence);
}
Essence->ForcedDespawn();
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
EssenceGUID = 0;
SoulCount = 0;
SoulDeathCount = 0;
@@ -357,60 +357,60 @@ struct boss_essence_of_sufferingAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
- DoScriptText(SUFF_SAY_RECAP, m_creature);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoScriptText(SUFF_SAY_RECAP, me);
}
}
void EnterCombat(Unit *who)
{
- if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
- DoScriptText(SUFF_SAY_FREED, m_creature);
+ DoScriptText(SUFF_SAY_FREED, me);
DoZoneInCombat();
- DoCast(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support
- DoCast(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true);
- DoCast(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true);
+ DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support
+ DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true);
+ DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true);
}
else return;
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), me);
}
void CastFixate()
{
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
if (m_threatlist.empty())
return; // No point continuing if empty threatlist.
std::list<Unit*> targets;
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
for (; itr != m_threatlist.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
targets.push_back(pUnit);
}
if (targets.empty())
return; // No targets added for some reason. No point continuing.
- targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance.
+ targets.sort(ObjectDistanceOrder(me)); // Sort players by distance.
targets.resize(1); // Only need closest target.
Unit *pTarget = targets.front(); // Get the first target.
if (pTarget)
- pTarget->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
+ pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true);
DoResetThreat();
- m_creature->AddThreat(pTarget,1000000);
+ me->AddThreat(pTarget,1000000);
}
void UpdateAI(const uint32 diff)
{
- if (m_creature->isInCombat())
+ if (me->isInCombat())
{
//Supposed to be cast on nearest target
if (FixateTimer <= diff)
@@ -419,7 +419,7 @@ struct boss_essence_of_sufferingAI : public ScriptedAI
FixateTimer = 5000;
if (!(rand()%16))
{
- DoScriptText(SUFF_SAY_AGGRO, m_creature);
+ DoScriptText(SUFF_SAY_AGGRO, me);
}
} else FixateTimer -= diff;
}
@@ -430,9 +430,9 @@ struct boss_essence_of_sufferingAI : public ScriptedAI
if (EnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
EnrageTimer = 60000;
- DoScriptText(SUFF_EMOTE_ENRAGE, m_creature);
+ DoScriptText(SUFF_EMOTE_ENRAGE, me);
} else EnrageTimer -= diff;
if (SoulDrainTimer <= diff)
@@ -458,47 +458,47 @@ struct boss_essence_of_desireAI : public ScriptedAI
RuneShieldTimer = 60000;
DeadenTimer = 30000;
SoulShockTimer = 5000;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (done_by == m_creature)
+ if (done_by == me)
return;
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
{
damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SUFF_SAY_RECAP, m_creature);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoScriptText(SUFF_SAY_RECAP, me);
}
else
{
int32 bp0 = damage / 2;
- m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
+ me->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
}
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL))
+ if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL))
for (uint8 i = 0; i < 3; ++i)
if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
- if (m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK
- || m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN)
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
+ if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK
+ || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN)
+ me->InterruptSpell(CURRENT_GENERIC_SPELL, false);
}
void EnterCombat(Unit *who)
{
- DoScriptText(DESI_SAY_FREED, m_creature);
+ DoScriptText(DESI_SAY_FREED, me);
DoZoneInCombat();
- DoCast(m_creature, AURA_OF_DESIRE, true);
+ DoCast(me, AURA_OF_DESIRE, true);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), m_creature);
+ DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), me);
}
void UpdateAI(const uint32 diff)
@@ -508,8 +508,8 @@ struct boss_essence_of_desireAI : public ScriptedAI
if (RuneShieldTimer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_RUNE_SHIELD, true);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_RUNE_SHIELD, true);
SoulShockTimer += 2000;
DeadenTimer += 2000;
RuneShieldTimer = 60000;
@@ -517,18 +517,18 @@ struct boss_essence_of_desireAI : public ScriptedAI
if (SoulShockTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK);
+ DoCast(me->getVictim(), SPELL_SOUL_SHOCK);
SoulShockTimer = 5000;
} else SoulShockTimer -= diff;
if (DeadenTimer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_DEADEN);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_DEADEN);
DeadenTimer = 25000 + rand()%10000;
if (!(rand()%2))
{
- DoScriptText(DESI_SAY_SPEC, m_creature);
+ DoScriptText(DESI_SAY_SPEC, me);
}
} else DeadenTimer -= diff;
@@ -565,20 +565,20 @@ struct boss_essence_of_angerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), m_creature);
+ DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), me);
DoZoneInCombat();
- DoCast(m_creature, AURA_OF_ANGER, true);
+ DoCast(me, AURA_OF_ANGER, true);
}
void JustDied(Unit *victim)
{
- DoScriptText(ANGER_SAY_DEATH, m_creature);
+ DoScriptText(ANGER_SAY_DEATH, me);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), m_creature);
+ DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), me);
}
void UpdateAI(const uint32 diff)
@@ -589,36 +589,36 @@ struct boss_essence_of_angerAI : public ScriptedAI
if (!CheckedAggro)
{
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ AggroTargetGUID = me->getVictim()->GetGUID();
CheckedAggro = true;
}
if (CheckTankTimer <= diff)
{
- if (m_creature->getVictim()->GetGUID() != AggroTargetGUID)
+ if (me->getVictim()->GetGUID() != AggroTargetGUID)
{
- DoScriptText(ANGER_SAY_BEFORE, m_creature);
- DoCast(m_creature, SPELL_SELF_SEETHE, true);
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ DoScriptText(ANGER_SAY_BEFORE, me);
+ DoCast(me, SPELL_SELF_SEETHE, true);
+ AggroTargetGUID = me->getVictim()->GetGUID();
}
CheckTankTimer = 2000;
} else CheckTankTimer -= diff;
if (SoulScreamTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM);
+ DoCast(me->getVictim(), SPELL_SOUL_SCREAM);
SoulScreamTimer = 9000 + rand()%2000;
if (!(rand()%3))
{
- DoScriptText(ANGER_SAY_SPEC, m_creature);
+ DoScriptText(ANGER_SAY_SPEC, me);
}
} else SoulScreamTimer -= diff;
if (SpiteTimer <= diff)
{
- DoCast(m_creature, SPELL_SPITE_TARGET);
+ DoCast(me, SPELL_SPITE_TARGET);
SpiteTimer = 30000;
- DoScriptText(ANGER_SAY_SPEC, m_creature);
+ DoScriptText(ANGER_SAY_SPEC, me);
} else SpiteTimer -= diff;
DoMeleeAttackIfReady();
@@ -628,10 +628,10 @@ struct boss_essence_of_angerAI : public ScriptedAI
void npc_enslaved_soulAI::JustDied(Unit *killer)
{
if (ReliquaryGUID)
- if (Creature *Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)))
+ if (Creature *Reliquary = (Unit::GetCreature((*me), ReliquaryGUID)))
++(CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount);
- DoCast(m_creature, SPELL_SOUL_RELEASE, true);
+ DoCast(me, SPELL_SOUL_RELEASE, true);
}
CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature)
diff --git a/src/scripts/outland/black_temple/boss_shade_of_akama.cpp b/src/scripts/outland/black_temple/boss_shade_of_akama.cpp
index 7c1e5406d69..beb06b23c6f 100644
--- a/src/scripts/outland/black_temple/boss_shade_of_akama.cpp
+++ b/src/scripts/outland/black_temple/boss_shade_of_akama.cpp
@@ -144,13 +144,13 @@ struct mob_ashtongue_sorcererAI : public ScriptedAI
if (CheckTimer <= diff)
{
- Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
- if (Shade && Shade->isAlive() && m_creature->isAlive())
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
+ if (Shade && Shade->isAlive() && me->isAlive())
{
- if (m_creature->IsWithinDist(Shade, 20,false))
+ if (me->IsWithinDist(Shade, 20,false))
{
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
@@ -164,13 +164,13 @@ struct mob_ashtongue_sorcererAI : public ScriptedAI
struct boss_shade_of_akamaAI : public ScriptedAI
{
- boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature)
+ boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
{
pInstance = c->GetInstanceData();
AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
- m_creature->setActive(true);//if view distance is too low
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ me->setActive(true);//if view distance is too low
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
ScriptedInstance* pInstance;
@@ -204,7 +204,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
Sorcerers.clear();
summons.DespawnAll();//despawn all adds
- if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID))
+ if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
{
Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event
if (Akama->isDead())
@@ -224,12 +224,12 @@ struct boss_shade_of_akamaAI : public ScriptedAI
IsBanished = true;
HasKilledAkama = false;
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->GetMotionMaster()->Clear();
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //me->GetMotionMaster()->Clear();
+ //me->GetMotionMaster()->MoveIdle();
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
if (pInstance)
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
@@ -261,7 +261,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
{
for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
{
- Creature* Channeler = (Unit::GetCreature(*m_creature, *itr));
+ Creature* Channeler = (Unit::GetCreature(*me, *itr));
if (Channeler)
{
if (Channeler->isDead())
@@ -270,8 +270,8 @@ struct boss_shade_of_akamaAI : public ScriptedAI
Channeler->Respawn();
}
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
+ Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
+ Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
GridSearcherSucceeded = true;
}
@@ -284,7 +284,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
{
if (!who || IsBanished) return;
- if (who->isTargetableForAttack() && who != m_creature)
+ if (who->isTargetableForAttack() && who != me)
DoStartMovement(who);
}
@@ -295,7 +295,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
debug_log("TSCR: Increasing Death Count for Shade of Akama encounter");
++DeathCount;
- m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
+ me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
if (guid)
{
if (Sorcerers.empty())
@@ -312,13 +312,13 @@ struct boss_shade_of_akamaAI : public ScriptedAI
// max of 6 sorcerers can be summoned
if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7))
{
- Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Creature* Sorcerer = me->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Sorcerer)
{
- CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID();
+ CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->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());
+ Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
Sorcerers.push_back(Sorcerer->GetGUID());
--DeathCount;
++SorcererCount;
@@ -328,7 +328,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
{
for (uint8 i = 0; i < 3; ++i)
{
- Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
if (Spawn)
{
Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -343,13 +343,13 @@ struct boss_shade_of_akamaAI : public ScriptedAI
void FindChannelers()
{
std::list<Creature*> ChannelerList;
- m_creature->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f);
+ me->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f);
if (!ChannelerList.empty())
{
for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
{
- CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID();
+ CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID();
Channelers.push_back((*itr)->GetGUID());
debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
}
@@ -366,7 +366,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
}
for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if (Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)))
+ if (Creature* Channeler = (Unit::GetCreature(*me, *itr)))
Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -374,13 +374,13 @@ struct boss_shade_of_akamaAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
return;
if (IsBanished)
{
// Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
- if (m_creature->getThreatManager().getThreatList().size() < 2)
+ if (me->getThreatManager().getThreatList().size() < 2)
{
EnterEvadeMode();
return;
@@ -389,14 +389,14 @@ struct boss_shade_of_akamaAI : public ScriptedAI
if (DefenderTimer <= diff)
{
uint32 ran = rand()%2;
- Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
if (Defender)
{
Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
bool move = true;
if (AkamaGUID)
{
- if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID))
+ if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
{
float x, y, z;
Akama->GetPosition(x,y,z);
@@ -421,21 +421,21 @@ struct boss_shade_of_akamaAI : public ScriptedAI
{
if (AkamaGUID)
{
- Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID);
+ Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
if (Akama && Akama->isAlive())
{
IsBanished = false;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(Akama);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveChase(Akama);
Akama->GetMotionMaster()->Clear();
// Shade should move to Akama, not the other way around
Akama->GetMotionMaster()->MoveIdle();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// Crazy amount of threat
- m_creature->AddThreat(Akama, 10000000.0f);
- Akama->AddThreat(m_creature, 10000000.0f);
- m_creature->Attack(Akama, true);
- Akama->Attack(m_creature, true);
+ me->AddThreat(Akama, 10000000.0f);
+ Akama->AddThreat(me, 10000000.0f);
+ me->Attack(Akama, true);
+ Akama->Attack(me, true);
}
}
}
@@ -446,11 +446,11 @@ struct boss_shade_of_akamaAI : public ScriptedAI
{
if (AkamaGUID)
{
- Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID);
+ Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
if (Akama && Akama->isAlive())
{
//10 % less health every few seconds.
- m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
ReduceHealthTimer = 12000;
}
}
@@ -461,12 +461,12 @@ struct boss_shade_of_akamaAI : public ScriptedAI
if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug
{
HasKilledAkamaAndReseting = true;
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- //m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop();
+ //me->SetHealth(me->GetMaxHealth());
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->MoveTargetedHome();
}
if (ResetTimer <= diff)
{
@@ -482,7 +482,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI
void mob_ashtongue_channelerAI::JustDied(Unit* killer)
{
- Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount();
else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
@@ -490,21 +490,21 @@ void mob_ashtongue_channelerAI::JustDied(Unit* killer)
void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
{
- Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
+ CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID());
else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
}
struct npc_akamaAI : public ScriptedAI
{
- npc_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature)
+ npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
{
ShadeHasDied = false;
StartCombat = false;
pInstance = c->GetInstanceData();
ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED;
- m_creature->setActive(true);
+ me->setActive(true);
EventBegun = false;
CastSoulRetrieveTimer = 0;
SoulRetrieveTimer = 0;
@@ -546,8 +546,8 @@ struct npc_akamaAI : public ScriptedAI
if (!EventBegun)
{
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
summons.DespawnAll();
}
@@ -574,18 +574,18 @@ struct npc_akamaAI : public ScriptedAI
if (!ShadeGUID)
return;
- Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade)
{
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
// Prevent players from trying to restart event
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID());
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID());
CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers();
- Shade->AddThreat(m_creature, 1000000.0f);
- m_creature->CombatStart(Shade);
+ Shade->AddThreat(me, 1000000.0f);
+ me->CombatStart(Shade);
Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (pl) Shade->AddThreat(pl, 1.0f);
DoZoneInCombat(Shade);
EventBegun = true;
@@ -602,9 +602,9 @@ struct npc_akamaAI : public ScriptedAI
case 0: ++WayPointId; break;
case 1:
- if (Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID))
+ if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID))
{
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
EndingTalkCount = 0;
SoulRetrieveTimer = 16000;
@@ -615,7 +615,7 @@ struct npc_akamaAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
EventBegun = false;
ShadeHasDied = false;
StartCombat = false;
@@ -627,7 +627,7 @@ struct npc_akamaAI : public ScriptedAI
BrokenSummonIndex = 0;
BrokenList.clear();
HasYelledOnce = false;
- Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
if (Shade && Shade->isAlive())
CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true;
summons.DespawnAll();
@@ -638,15 +638,15 @@ struct npc_akamaAI : public ScriptedAI
if (!EventBegun)
return;
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce)
{
- DoScriptText(SAY_LOW_HEALTH, m_creature);
+ DoScriptText(SAY_LOW_HEALTH, me);
HasYelledOnce = true;
}
if (ShadeGUID && !StartCombat)
{
- Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
{
if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished)
@@ -659,7 +659,7 @@ struct npc_akamaAI : public ScriptedAI
}
else
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
StartCombat = true;
}
}
@@ -669,7 +669,7 @@ struct npc_akamaAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
+ me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
++WayPointId;
}
@@ -679,13 +679,13 @@ struct npc_akamaAI : public ScriptedAI
{
if (ShadeGUID)
{
- Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
if (Shade && !Shade->isAlive())
{
ShadeHasDied = true;
WayPointId = 0;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
}
if (Shade && Shade->isAlive())
{
@@ -707,7 +707,7 @@ struct npc_akamaAI : public ScriptedAI
float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
float z = BrokenCoords[BrokenSummonIndex].z;
float o = BrokenCoords[BrokenSummonIndex].o;
- Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
+ Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
if (Broken)
{
float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
@@ -729,13 +729,13 @@ struct npc_akamaAI : public ScriptedAI
switch(EndingTalkCount)
{
case 0:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
++EndingTalkCount;
SoulRetrieveTimer = 2000;
SummonBrokenTimer = 1;
break;
case 1:
- DoScriptText(SAY_FREE, m_creature);
+ DoScriptText(SAY_FREE, me);
++EndingTalkCount;
SoulRetrieveTimer = 25000;
break;
@@ -744,7 +744,7 @@ struct npc_akamaAI : public ScriptedAI
{
bool Yelled = false;
for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pUnit = Unit::GetCreature(*me, *itr))
{
if (!Yelled)
{
@@ -761,7 +761,7 @@ struct npc_akamaAI : public ScriptedAI
if (!BrokenList.empty())
{
for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr))
+ if (Creature* pUnit = Unit::GetCreature(*me, *itr))
// This is the incorrect spell, but can't seem to find the right one.
pUnit->CastSpell(pUnit, 39656, true);
}
@@ -772,7 +772,7 @@ struct npc_akamaAI : public ScriptedAI
if (!BrokenList.empty())
{
for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature((*m_creature), *itr))
+ if (Creature* pUnit = Unit::GetCreature((*me), *itr))
pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
}
SoulRetrieveTimer = 0;
@@ -785,7 +785,7 @@ struct npc_akamaAI : public ScriptedAI
if (DestructivePoisonTimer <= diff)
{
- Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
if (Shade && Shade->isAlive())
DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
DestructivePoisonTimer = 15000;
@@ -793,7 +793,7 @@ struct npc_akamaAI : public ScriptedAI
if (LightningBoltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
LightningBoltTimer = 10000;
} else LightningBoltTimer -= diff;
diff --git a/src/scripts/outland/black_temple/boss_supremus.cpp b/src/scripts/outland/black_temple/boss_supremus.cpp
index 23423b7a581..0722992f252 100644
--- a/src/scripts/outland/black_temple/boss_supremus.cpp
+++ b/src/scripts/outland/black_temple/boss_supremus.cpp
@@ -25,7 +25,7 @@ EndScriptData */
#include "black_temple.h"
#define EMOTE_NEW_TARGET -1564010
-#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature);
+#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, me);
#define EMOTE_GROUND_CRACK -1564012
//Spells
@@ -67,7 +67,7 @@ struct molten_flameAI : public NullCreatureAI
struct boss_supremusAI : public ScriptedAI
{
- boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature)
+ boss_supremusAI(Creature *c) : ScriptedAI(c), summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -81,7 +81,7 @@ struct boss_supremusAI : public ScriptedAI
{
if (pInstance)
{
- if (m_creature->isAlive())
+ if (me->isAlive())
{
pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
//ToggleDoors(true);
@@ -112,18 +112,18 @@ struct boss_supremusAI : public ScriptedAI
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);
+ me->SetSpeed(MOVE_RUN, 1.2f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->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);
+ me->SetSpeed(MOVE_RUN, 0.9f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
DoResetThreat();
DoZoneInCombat();
@@ -149,12 +149,12 @@ struct boss_supremusAI : public ScriptedAI
uint32 health = 0;
Unit *pTarget = NULL;
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if (pUnit && m_creature->IsWithinMeleeRange(pUnit))
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
+ if (pUnit && me->IsWithinMeleeRange(pUnit))
{
if (pUnit->GetHealth() > health)
{
@@ -179,10 +179,10 @@ struct boss_supremusAI : public ScriptedAI
switch(eventId)
{
case EVENT_BERSERK:
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoCast(me, SPELL_BERSERK, true);
break;
case EVENT_FLAME:
- DoCast(m_creature, SPELL_MOLTEN_PUNCH);
+ DoCast(me, SPELL_MOLTEN_PUNCH);
events.DelayEvents(1500, GCD_CAST);
events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
break;
@@ -196,20 +196,20 @@ struct boss_supremusAI : public ScriptedAI
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
{
DoResetThreat();
- m_creature->AddThreat(pTarget, 5000000.0f);
- DoScriptText(EMOTE_NEW_TARGET, m_creature);
+ me->AddThreat(pTarget, 5000000.0f);
+ DoScriptText(EMOTE_NEW_TARGET, me);
}
events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
break;
case EVENT_VOLCANO:
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
- if (!pTarget) pTarget = m_creature->getVictim();
+ if (!pTarget) pTarget = me->getVictim();
if (pTarget)
{
//DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged
- m_creature->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
- DoScriptText(EMOTE_GROUND_CRACK, m_creature);
+ me->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
+ DoScriptText(EMOTE_GROUND_CRACK, me);
events.DelayEvents(1500, GCD_CAST);
}
events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE);
@@ -231,9 +231,9 @@ struct npc_volcanoAI : public Scripted_NoMovementAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //DoCast(me, SPELL_VOLCANIC_ERUPTION);
me->SetReactState(REACT_PASSIVE);
wait = 3000;
}
@@ -245,14 +245,14 @@ struct npc_volcanoAI : public Scripted_NoMovementAI
void DoAction(const uint32 info)
{
- m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION);
+ me->RemoveAura(SPELL_VOLCANIC_ERUPTION);
}
void UpdateAI(const uint32 diff)
{
if (wait <= diff)//wait 3secs before casting
{
- DoCast(m_creature, SPELL_VOLCANIC_ERUPTION);
+ DoCast(me, SPELL_VOLCANIC_ERUPTION);
wait = 60000;
}
else wait -= diff;
diff --git a/src/scripts/outland/black_temple/boss_teron_gorefiend.cpp b/src/scripts/outland/black_temple/boss_teron_gorefiend.cpp
index 7be98d4b986..1fe2a2084c5 100644
--- a/src/scripts/outland/black_temple/boss_teron_gorefiend.cpp
+++ b/src/scripts/outland/black_temple/boss_teron_gorefiend.cpp
@@ -70,8 +70,8 @@ struct mob_doom_blossomAI : public ScriptedAI
void Despawn()
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
}
void UpdateAI(const uint32 diff)
@@ -82,7 +82,7 @@ struct mob_doom_blossomAI : public ScriptedAI
{
DoZoneInCombat();
- Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
+ Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
Despawn();
}
@@ -92,7 +92,7 @@ struct mob_doom_blossomAI : public ScriptedAI
CheckTeronTimer = 5000;
} else CheckTeronTimer -= diff;
- if (ShadowBoltTimer < diff && m_creature->isInCombat())
+ if (ShadowBoltTimer < diff && me->isInCombat())
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
ShadowBoltTimer = 10000;
@@ -142,23 +142,23 @@ struct mob_shadowy_constructAI : public ScriptedAI
void CheckPlayers()
{
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
if (m_threatlist.empty())
return; // No threat list. Don't continue.
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
std::list<Unit*> targets;
for (; itr != m_threatlist.end(); ++itr)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive())
targets.push_back(pUnit);
}
- targets.sort(ObjectDistanceOrder(m_creature));
+ targets.sort(ObjectDistanceOrder(me));
Unit *pTarget = targets.front();
- if (pTarget && m_creature->IsWithinDistInMap(pTarget, m_creature->GetAttackDistance(pTarget)))
+ if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
{
DoCast(pTarget, SPELL_ATROPHY);
- m_creature->AI()->AttackStart(pTarget);
+ me->AI()->AttackStart(pTarget);
}
}
@@ -172,9 +172,9 @@ struct mob_shadowy_constructAI : public ScriptedAI
if (CheckTeronTimer <= diff)
{
- Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
+ Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
CheckTeronTimer = 5000;
} else CheckTeronTimer -= diff;
@@ -217,9 +217,9 @@ struct boss_teron_gorefiendAI : public ScriptedAI
SummonShadowsTimer = 60000;
RandomYellTimer = 50000;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->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);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 20000;
AggroTargetGUID = 0;
@@ -231,17 +231,17 @@ struct boss_teron_gorefiendAI : public ScriptedAI
void MoveInLineOfSight(Unit* pWho)
{
- if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature))
+ if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(me))
{
- if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho))
+ if (me->IsWithinDistInMap(pWho, VISIBLE_RANGE) && me->IsWithinLOSInMap(pWho))
{
if (pInstance)
pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SAY_INTRO, m_creature);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ me->GetMotionMaster()->Clear(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoScriptText(SAY_INTRO, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
AggroTargetGUID = pWho->GetGUID();
Intro = true;
}
@@ -252,7 +252,7 @@ struct boss_teron_gorefiendAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
@@ -260,7 +260,7 @@ struct boss_teron_gorefiendAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
float CalculateRandomLocation(float Loc, uint32 radius)
@@ -282,11 +282,11 @@ struct boss_teron_gorefiendAI : public ScriptedAI
{
if (!Blossom) return;
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && pUnit->isAlive())
{
float threat = DoGetThreat(pUnit);
@@ -306,12 +306,12 @@ struct boss_teron_gorefiendAI : public ScriptedAI
Unit* Ghost = NULL;
if (GhostGUID)
- Ghost = Unit::GetUnit((*m_creature), GhostGUID);
+ Ghost = Unit::GetUnit((*me), GhostGUID);
if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
{
/*float x,y,z;
Ghost->GetPosition(x,y,z);
- Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
+ Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
if (control)
{
CAST_PLR(Ghost)->Possess(control);
@@ -323,7 +323,7 @@ struct boss_teron_gorefiendAI : public ScriptedAI
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);
+ Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
if (Construct)
{
Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
@@ -331,7 +331,7 @@ struct boss_teron_gorefiendAI : public ScriptedAI
CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID;
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) // someone's trying to solo.
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
Construct->GetMotionMaster()->MoveChase(pTarget);
@@ -346,14 +346,14 @@ struct boss_teron_gorefiendAI : public ScriptedAI
{
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);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoScriptText(SAY_AGGRO, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
Done = true;
if (AggroTargetGUID)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
+ Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID);
if (pUnit)
AttackStart(pUnit);
@@ -377,13 +377,13 @@ struct boss_teron_gorefiendAI : public ScriptedAI
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);
+ float X = CalculateRandomLocation(me->GetPositionX(), 10);
+ Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
if (Shadow)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
Shadow->AI()->AttackStart(pTarget);
@@ -399,14 +399,14 @@ struct boss_teron_gorefiendAI : public ScriptedAI
float X = CalculateRandomLocation(pTarget->GetPositionX(), 20);
float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20);
float Z = pTarget->GetPositionZ();
- Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z);
- Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
+ Z = me->GetMap()->GetVmapHeight(X, Y, Z);
+ Creature* DoomBlossom = me->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->setFaction(me->getFaction());
DoomBlossom->AddThreat(pTarget, 1.0f);
- CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
+ CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID());
pTarget->CombatStart(DoomBlossom);
SetThreatList(DoomBlossom);
SummonDoomBlossomTimer = 35000;
@@ -418,11 +418,11 @@ struct boss_teron_gorefiendAI : public ScriptedAI
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
{
- DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), m_creature);
+ DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
DoCast(pTarget, SPELL_INCINERATE);
IncinerateTimer = 20000 + rand()%31 * 1000;
}
@@ -442,7 +442,7 @@ struct boss_teron_gorefiendAI : public ScriptedAI
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
{
@@ -455,16 +455,16 @@ struct boss_teron_gorefiendAI : public ScriptedAI
if (RandomYellTimer <= diff)
{
- DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), m_creature);
+ DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), me);
RandomYellTimer = 50000 + rand()%51 * 1000;
} else RandomYellTimer -= diff;
- if (!m_creature->HasAura(SPELL_BERSERK))
+ if (!me->HasAura(SPELL_BERSERK))
{
if (EnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(SAY_ENRAGE, me);
} else EnrageTimer -= diff;
}
diff --git a/src/scripts/outland/black_temple/boss_warlord_najentus.cpp b/src/scripts/outland/black_temple/boss_warlord_najentus.cpp
index 838bbef5d75..b33b766e2a1 100644
--- a/src/scripts/outland/black_temple/boss_warlord_najentus.cpp
+++ b/src/scripts/outland/black_temple/boss_warlord_najentus.cpp
@@ -82,7 +82,7 @@ struct boss_najentusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature);
+ DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, me);
events.DelayEvents(5000, GCD_YELL);
}
@@ -91,15 +91,15 @@ struct boss_najentusAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD))
+ if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD))
{
- m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
- DoCast(m_creature, SPELL_TIDAL_BURST, true);
+ me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
+ DoCast(me, SPELL_TIDAL_BURST, true);
ResetTimer();
}
}
@@ -109,7 +109,7 @@ struct boss_najentusAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST);
events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL);
@@ -119,7 +119,7 @@ struct boss_najentusAI : public ScriptedAI
bool RemoveImpalingSpine()
{
if (!SpineTargetGUID) return false;
- Unit *pTarget = Unit::GetUnit(*m_creature, SpineTargetGUID);
+ Unit *pTarget = Unit::GetUnit(*me, SpineTargetGUID);
if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE))
pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
SpineTargetGUID=0;
@@ -145,25 +145,25 @@ struct boss_najentusAI : public ScriptedAI
switch(eventId)
{
case EVENT_SHIELD:
- DoCast(m_creature, SPELL_TIDAL_SHIELD, true);
+ DoCast(me, SPELL_TIDAL_SHIELD, true);
ResetTimer(45000);
break;
case EVENT_BERSERK:
- DoScriptText(SAY_ENRAGE2, m_creature);
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoScriptText(SAY_ENRAGE2, me);
+ DoCast(me, SPELL_BERSERK, true);
events.DelayEvents(15000, GCD_YELL);
break;
case EVENT_SPINE:
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget) pTarget = m_creature->getVictim();
+ if (!pTarget) pTarget = me->getVictim();
if (pTarget)
{
DoCast(pTarget, SPELL_IMPALING_SPINE, true);
SpineTargetGUID = pTarget->GetGUID();
//must let target summon, otherwise you cannot click the spine
- pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
- DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature);
+ pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
+ DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me);
events.DelayEvents(1500, GCD_CAST);
events.DelayEvents(15000, GCD_YELL);
}
@@ -172,7 +172,7 @@ struct boss_najentusAI : public ScriptedAI
}
case EVENT_NEEDLE:
{
- //DoCast(m_creature, SPELL_NEEDLE_SPINE, true);
+ //DoCast(me, SPELL_NEEDLE_SPINE, true);
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
@@ -182,7 +182,7 @@ struct boss_najentusAI : public ScriptedAI
return;
}
case EVENT_YELL:
- DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), m_creature);
+ DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me);
events.ScheduleEvent(EVENT_YELL, urand(25000,100000), GCD_YELL);
events.DelayEvents(15000, GCD_YELL);
break;
diff --git a/src/scripts/outland/black_temple/illidari_council.cpp b/src/scripts/outland/black_temple/illidari_council.cpp
index 078f065cb31..faa18048e3e 100644
--- a/src/scripts/outland/black_temple/illidari_council.cpp
+++ b/src/scripts/outland/black_temple/illidari_council.cpp
@@ -137,7 +137,7 @@ struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI
// finds and stores the GUIDs for each Council member using instance data system.
void LoadCouncilGUIDs()
{
- if (ScriptedInstance* pInstance = m_creature->GetInstanceData())
+ if (ScriptedInstance* pInstance = me->GetInstanceData())
{
Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW);
@@ -163,7 +163,7 @@ struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI
{
if (AggroYellTimer <= diff)
{
- if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
{
DoScriptText(CouncilAggro[YellCounter].entry, pMember);
AggroYellTimer = CouncilAggro[YellCounter].timer;
@@ -178,7 +178,7 @@ struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI
{
if (EnrageTimer <= diff)
{
- if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
{
pMember->CastSpell(pMember, SPELL_BERSERK, true);
DoScriptText(CouncilEnrage[YellCounter].entry, pMember);
@@ -220,7 +220,7 @@ struct mob_illidari_councilAI : public ScriptedAI
Creature* pMember = NULL;
for (uint8 i = 0; i < 4; ++i)
{
- if (pMember = (Unit::GetCreature((*m_creature), Council[i])))
+ if (pMember = (Unit::GetCreature((*me), Council[i])))
{
if (!pMember->isAlive())
{
@@ -234,15 +234,15 @@ struct mob_illidari_councilAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
- if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
VoiceTrigger->AI()->EnterEvadeMode();
}
EventBegun = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(11686);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(11686);
}
void EnterCombat(Unit *who) {}
@@ -262,7 +262,7 @@ struct mob_illidari_councilAI : public ScriptedAI
Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
// Start the event for the Voice Trigger
- if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
{
CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs();
CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true;
@@ -273,7 +273,7 @@ struct mob_illidari_councilAI : public ScriptedAI
Unit* Member = NULL;
if (Council[i])
{
- Member = Unit::GetUnit((*m_creature), Council[i]);
+ Member = Unit::GetUnit((*me), Council[i]);
if (Member && Member->isAlive())
CAST_CRE(Member)->AI()->AttackStart(pTarget);
}
@@ -297,16 +297,16 @@ struct mob_illidari_councilAI : public ScriptedAI
{
if (pInstance)
{
- if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
- //m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0);
+ //me->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0);
}
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
- Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount]));
+ Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount]));
if (pMember && pMember->isAlive())
pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
++DeathCount;
@@ -323,7 +323,7 @@ struct mob_illidari_councilAI : public ScriptedAI
{
if (Council[i])
{
- if (Creature* Member = (Unit::GetCreature((*m_creature), Council[i])))
+ if (Creature* Member = (Unit::GetCreature((*me), Council[i])))
{
// This is the evade/death check.
if (Member->isAlive() && !Member->getVictim())
@@ -368,7 +368,7 @@ struct boss_illidari_councilAI : public ScriptedAI
{
if (pInstance)
{
- Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
+ Creature* Controller = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
if (Controller)
CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who);
}
@@ -391,8 +391,8 @@ struct boss_illidari_councilAI : public ScriptedAI
{
for (uint8 i = 0; i < 4; ++i)
{
- if (Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
- if (pUnit != m_creature && pUnit->getVictim())
+ if (Unit* pUnit = Unit::GetUnit(*me, Council[i]))
+ if (pUnit != me && pUnit->getVictim())
{
AttackStart(pUnit->getVictim());
return;
@@ -403,14 +403,14 @@ struct boss_illidari_councilAI : public ScriptedAI
void DamageTaken(Unit* done_by, uint32 &damage)
{
- if (done_by == m_creature)
+ if (done_by == me)
return;
damage /= 4;
for (uint8 i = 0; i < 4; ++i)
{
- if (Creature* pUnit = Unit::GetCreature(*m_creature, Council[i]))
- if (pUnit != m_creature && damage < pUnit->GetHealth())
+ if (Creature* pUnit = Unit::GetCreature(*me, Council[i]))
+ if (pUnit != me && damage < pUnit->GetHealth())
{
pUnit->SetHealth(pUnit->GetHealth() - damage);
pUnit->LowerPlayerDamageReq(damage);
@@ -456,24 +456,24 @@ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_GATH_SLAY, m_creature);
+ DoScriptText(SAY_GATH_SLAY, me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_GATH_DEATH, m_creature);
+ DoScriptText(SAY_GATH_DEATH, me);
}
Unit* SelectCouncilMember()
{
- Unit* pUnit = m_creature;
+ Unit* pUnit = me;
uint32 member = 0; // He chooses Lady Malande most often
if (rand()%10 == 0) // But there is a chance he picks someone else.
member = urand(1, 3);
if (member != 2) // No need to create another pointer to us using Unit::GetUnit
- pUnit = Unit::GetUnit((*m_creature), Council[member]);
+ pUnit = Unit::GetUnit((*me), Council[member]);
return pUnit;
}
@@ -487,9 +487,9 @@ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
}
for (uint8 i = 0; i < 4; ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]);
+ Unit* pUnit = Unit::GetUnit((*me), Council[i]);
if (pUnit)
- pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID());
}
}
@@ -513,7 +513,7 @@ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
if (ConsecrationTimer <= diff)
{
- DoCast(m_creature, SPELL_CONSECRATION);
+ DoCast(me, SPELL_CONSECRATION);
ConsecrationTimer = 40000;
} else ConsecrationTimer -= diff;
@@ -522,7 +522,7 @@ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
// is in ~10-40 yd range
- if (m_creature->IsInRange(pTarget, 10.0f, 40.0f, false))
+ if (me->IsInRange(pTarget, 10.0f, 40.0f, false))
{
DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE);
HammerOfJusticeTimer = 20000;
@@ -534,8 +534,8 @@ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
{
switch (urand(0,1))
{
- case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break;
- case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break;
+ case 0: DoCast(me, SPELL_SEAL_OF_COMMAND); break;
+ case 1: DoCast(me, SPELL_SEAL_OF_BLOOD); break;
}
SealTimer = 40000;
} else SealTimer -= diff;
@@ -573,12 +573,12 @@ struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_ZERE_SLAY, m_creature);
+ DoScriptText(SAY_ZERE_SLAY, me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_ZERE_DEATH, m_creature);
+ DoScriptText(SAY_ZERE_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -598,7 +598,7 @@ struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
if (DampenMagicTimer <= diff)
{
- DoCast(m_creature, SPELL_DAMPEN_MAGIC);
+ DoCast(me, SPELL_DAMPEN_MAGIC);
Cooldown = 1000;
DampenMagicTimer = 67200; // almost 1,12 minutes
ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
@@ -606,14 +606,14 @@ struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
if (ArcaneExplosionTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
Cooldown = 1000;
ArcaneExplosionTimer = 14000;
} else ArcaneExplosionTimer -= diff;
if (ArcaneBoltTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
+ DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
ArcaneBoltTimer = 3000;
Cooldown = 2000;
} else ArcaneBoltTimer -= diff;
@@ -661,12 +661,12 @@ struct boss_lady_malandeAI : public boss_illidari_councilAI
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_MALA_SLAY, m_creature);
+ DoScriptText(SAY_MALA_SLAY, me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_MALA_DEATH, m_creature);
+ DoScriptText(SAY_MALA_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -685,7 +685,7 @@ struct boss_lady_malandeAI : public boss_illidari_councilAI
if (CircleOfHealingTimer <= diff)
{
- DoCast(m_creature, SPELL_CIRCLE_OF_HEALING);
+ DoCast(me, SPELL_CIRCLE_OF_HEALING);
CircleOfHealingTimer = 60000;
} else CircleOfHealingTimer -= diff;
@@ -700,7 +700,7 @@ struct boss_lady_malandeAI : public boss_illidari_councilAI
if (ReflectiveShieldTimer <= diff)
{
- DoCast(m_creature, SPELL_REFLECTIVE_SHIELD);
+ DoCast(me, SPELL_REFLECTIVE_SHIELD);
ReflectiveShieldTimer = 65000;
} else ReflectiveShieldTimer -= diff;
@@ -729,18 +729,18 @@ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
AppearEnvenomTimer = 150000;
HasVanished = false;
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(SAY_VERA_SLAY, m_creature);
+ DoScriptText(SAY_VERA_SLAY, me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_VERA_DEATH, m_creature);
+ DoScriptText(SAY_VERA_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -752,13 +752,13 @@ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
{
if (DeadlyPoisonTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON);
+ DoCast(me->getVictim(), SPELL_DEADLY_POISON);
DeadlyPoisonTimer = 15000 + rand()%31 * 1000;
} else DeadlyPoisonTimer -= diff;
if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over
{
- DoCast(m_creature->getVictim(), SPELL_ENVENOM);
+ DoCast(me->getVictim(), SPELL_ENVENOM);
AppearEnvenomTimer = 90000;
} else AppearEnvenomTimer -= diff;
@@ -769,12 +769,12 @@ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
VanishTimer = 30000;
AppearEnvenomTimer= 28000;
HasVanished = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoResetThreat();
// Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
- m_creature->AddThreat(pTarget, 500000.0f);
- m_creature->GetMotionMaster()->MoveChase(pTarget);
+ me->AddThreat(pTarget, 500000.0f);
+ me->GetMotionMaster()->MoveChase(pTarget);
}
} else VanishTimer -= diff;
@@ -784,11 +784,11 @@ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
{
if (VanishTimer <= diff) // Become attackable and poison current target
{
- Unit *pTarget = m_creature->getVictim();
+ Unit *pTarget = me->getVictim();
DoCast(pTarget, SPELL_DEADLY_POISON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoResetThreat();
- m_creature->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
+ me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
DeadlyPoisonTimer += 6000;
VanishTimer = 90000;
AppearEnvenomTimer = 4000;
@@ -797,9 +797,9 @@ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
if (AppearEnvenomTimer <= diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish)
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ me->SetVisibility(VISIBILITY_ON);
AppearEnvenomTimer = 6000;
} else AppearEnvenomTimer -= diff;
}
diff --git a/src/scripts/outland/blades_edge_mountains.cpp b/src/scripts/outland/blades_edge_mountains.cpp
index 1b83336622f..219095b2a07 100644
--- a/src/scripts/outland/blades_edge_mountains.cpp
+++ b/src/scripts/outland/blades_edge_mountains.cpp
@@ -117,7 +117,7 @@ struct mobs_nether_drakeAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -131,9 +131,9 @@ struct mobs_nether_drakeAI : public ScriptedAI
if (id == 0)
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
- m_creature->SetHealth(0);
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
+ me->SetHealth(0);
}
}
@@ -144,23 +144,23 @@ struct mobs_nether_drakeAI : public ScriptedAI
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())
+ if (entry_list[cid] == me->GetEntry())
++cid;
//we are nihil, so say before transform
- if (m_creature->GetEntry() == ENTRY_NIHIL)
+ if (me->GetEntry() == ENTRY_NIHIL)
{
- DoScriptText(SAY_NIHIL_INTERRUPT, m_creature);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoScriptText(SAY_NIHIL_INTERRUPT, me);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
IsNihil = false;
}
- if (m_creature->UpdateEntry(entry_list[cid]))
+ if (me->UpdateEntry(entry_list[cid]))
{
if (entry_list[cid] == ENTRY_NIHIL)
{
EnterEvadeMode();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
IsNihil = true;
}else
AttackStart(caster);
@@ -177,25 +177,25 @@ struct mobs_nether_drakeAI : public ScriptedAI
switch(NihilSpeech_Phase)
{
case 0:
- DoScriptText(SAY_NIHIL_1, m_creature);
+ DoScriptText(SAY_NIHIL_1, me);
++NihilSpeech_Phase;
break;
case 1:
- DoScriptText(SAY_NIHIL_2, m_creature);
+ DoScriptText(SAY_NIHIL_2, me);
++NihilSpeech_Phase;
break;
case 2:
- DoScriptText(SAY_NIHIL_3, m_creature);
+ DoScriptText(SAY_NIHIL_3, me);
++NihilSpeech_Phase;
break;
case 3:
- DoScriptText(SAY_NIHIL_4, m_creature);
+ DoScriptText(SAY_NIHIL_4, me);
++NihilSpeech_Phase;
break;
case 4:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->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);
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+50.0f, me->GetPositionY(), me->GetPositionZ()+50.0f);
++NihilSpeech_Phase;
break;
}
@@ -211,13 +211,13 @@ struct mobs_nether_drakeAI : public ScriptedAI
if (IntangiblePresence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
+ DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
IntangiblePresence_Timer = 15000+rand()%15000;
} else IntangiblePresence_Timer -= diff;
if (ManaBurn_Timer <= diff)
{
- Unit *pTarget = m_creature->getVictim();
+ Unit *pTarget = me->getVictim();
if (pTarget && pTarget->getPowerType() == POWER_MANA)
DoCast(pTarget, SPELL_MANA_BURN);
ManaBurn_Timer = 8000+rand()%8000;
@@ -225,7 +225,7 @@ struct mobs_nether_drakeAI : public ScriptedAI
if (ArcaneBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST);
+ DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 2500+rand()%5000;
} else ArcaneBlast_Timer -= diff;
@@ -260,9 +260,9 @@ struct npc_daranelleAI : public ScriptedAI
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- if (who->HasAura(SPELL_LASHHAN_CHANNEL) && m_creature->IsWithinDistInMap(who, 10.0f))
+ if (who->HasAura(SPELL_LASHHAN_CHANNEL) && me->IsWithinDistInMap(who, 10.0f))
{
- DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
+ DoScriptText(SAY_SPELL_INFLUENCE, me, who);
//TODO: Move the below to updateAI and run if this statement == true
DoCast(who, 37028, true);
}
diff --git a/src/scripts/outland/boss_doomlord_kazzak.cpp b/src/scripts/outland/boss_doomlord_kazzak.cpp
index b5aa660a5c5..8d364b1ec1d 100644
--- a/src/scripts/outland/boss_doomlord_kazzak.cpp
+++ b/src/scripts/outland/boss_doomlord_kazzak.cpp
@@ -70,12 +70,12 @@ struct boss_doomlordkazzakAI : public ScriptedAI
void JustRespawned()
{
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
}
void KilledUnit(Unit* victim)
@@ -84,14 +84,14 @@ struct boss_doomlordkazzakAI : public ScriptedAI
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
- DoCast(m_creature, SPELL_CAPTURESOUL);
+ DoCast(me, SPELL_CAPTURESOUL);
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), m_creature);
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -103,28 +103,28 @@ struct boss_doomlordkazzakAI : public ScriptedAI
//ShadowVolley_Timer
if (ShadowVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY);
+ DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
ShadowVolley_Timer = 4000 + rand()%2000;
} else ShadowVolley_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 8000 + rand()%4000;
} else Cleave_Timer -= diff;
//ThunderClap_Timer
if (ThunderClap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
ThunderClap_Timer = 10000 + rand()%4000;
} else ThunderClap_Timer -= diff;
//VoidBolt_Timer
if (VoidBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VOIDBOLT);
+ DoCast(me->getVictim(), SPELL_VOIDBOLT);
VoidBolt_Timer = 15000 + rand()%3000;
} else VoidBolt_Timer -= diff;
@@ -142,8 +142,8 @@ struct boss_doomlordkazzakAI : public ScriptedAI
//Enrage_Timer
if (Enrage_Timer <= diff)
{
- DoScriptText(EMOTE_FRENZY, m_creature);
- DoCast(m_creature, SPELL_ENRAGE);
+ DoScriptText(EMOTE_FRENZY, me);
+ DoCast(me, SPELL_ENRAGE);
Enrage_Timer = 30000;
} else Enrage_Timer -= diff;
diff --git a/src/scripts/outland/boss_doomwalker.cpp b/src/scripts/outland/boss_doomwalker.cpp
index c1b6241802e..0591a3dee90 100644
--- a/src/scripts/outland/boss_doomwalker.cpp
+++ b/src/scripts/outland/boss_doomwalker.cpp
@@ -71,22 +71,22 @@ struct boss_doomwalkerAI : public ScriptedAI
if (rand()%5)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
{
- if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
+ if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
{
if (who->HasAura(SPELL_MARK_DEATH,0))
{
@@ -101,11 +101,11 @@ struct boss_doomwalkerAI : public ScriptedAI
return;
//Spell Enrage, when hp <= 20% gain enrage
- if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)
+ if (((me->GetHealth()*100)/ me->GetMaxHealth()) <= 20)
{
if (Enrage_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enrage_Timer = 6000;
InEnrage = true;
} else Enrage_Timer -= diff;
@@ -114,9 +114,9 @@ struct boss_doomwalkerAI : public ScriptedAI
//Spell Overrun
if (Overrun_Timer <= diff)
{
- DoScriptText(RAND(SAY_OVERRUN_1,SAY_OVERRUN_2), m_creature);
+ DoScriptText(RAND(SAY_OVERRUN_1,SAY_OVERRUN_2), me);
- DoCast(m_creature->getVictim(), SPELL_OVERRUN);
+ DoCast(me->getVictim(), SPELL_OVERRUN);
Overrun_Timer = 25000 + rand()%15000;
} else Overrun_Timer -= diff;
@@ -126,13 +126,13 @@ struct boss_doomwalkerAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(RAND(SAY_EARTHQUAKE_1,SAY_EARTHQUAKE_2), m_creature);
+ DoScriptText(RAND(SAY_EARTHQUAKE_1,SAY_EARTHQUAKE_2), me);
//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
if (InEnrage)
- m_creature->RemoveAura(SPELL_ENRAGE);
+ me->RemoveAura(SPELL_ENRAGE);
- DoCast(m_creature, SPELL_EARTHQUAKE);
+ DoCast(me, SPELL_EARTHQUAKE);
Quake_Timer = 30000 + rand()%25000;
} else Quake_Timer -= diff;
@@ -143,7 +143,7 @@ struct boss_doomwalkerAI : public ScriptedAI
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
@@ -154,7 +154,7 @@ struct boss_doomwalkerAI : public ScriptedAI
//Spell Sunder Armor
if (Armor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
+ DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
Armor_Timer = 10000 + rand()%15000;
} else Armor_Timer -= diff;
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
index e992d6258f8..1733b174dcc 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
@@ -132,7 +132,7 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
if (RAdvisors[i])
{
- pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i]));
+ pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
if (pAdvisor && !pAdvisor->isAlive())
{
pAdvisor->Respawn();
@@ -147,20 +147,20 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
void EventSharkkisDeath()
{
- DoScriptText(SAY_GAIN_ABILITY1, m_creature);
- DoCast(m_creature, SPELL_POWER_OF_SHARKKIS);
+ DoScriptText(SAY_GAIN_ABILITY1, me);
+ DoCast(me, SPELL_POWER_OF_SHARKKIS);
}
void EventTidalvessDeath()
{
- DoScriptText(SAY_GAIN_ABILITY2, m_creature);
- DoCast(m_creature, SPELL_POWER_OF_TIDALVESS);
+ DoScriptText(SAY_GAIN_ABILITY2, me);
+ DoCast(me, SPELL_POWER_OF_TIDALVESS);
}
void EventCaribdisDeath()
{
- DoScriptText(SAY_GAIN_ABILITY3, m_creature);
- DoCast(m_creature, SPELL_POWER_OF_CARIBDIS);
+ DoScriptText(SAY_GAIN_ABILITY3, me);
+ DoCast(me, SPELL_POWER_OF_CARIBDIS);
}
void GetAdvisors()
@@ -180,7 +180,7 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
GetAdvisors();
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
@@ -189,18 +189,18 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
//support for quest 10944
- m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
+ me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
}
void EnterCombat(Unit *who)
@@ -211,9 +211,9 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
if (pTarget)
{
@@ -241,7 +241,7 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
//if there aren't other units, cast on the tank
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_CATACLYSMIC_BOLT);
@@ -251,19 +251,19 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
//SearNova_Timer
if (SearNova_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA);
+ DoCast(me->getVictim(), SPELL_SEAR_NOVA);
SearNova_Timer = 20000+rand()%40000;
} else SearNova_Timer -= diff;
//Enrage_Timer
if (Enrage_Timer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
Enrage_Timer = 90000;
} else Enrage_Timer -= diff;
//Blessing of Tides Trigger
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides)
{
BlessingOfTides = true;
bool continueTriggering;
@@ -271,7 +271,7 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
for (uint8 i = 0; i < 4; ++i)
if (Advisors[i])
{
- Advisor = (Unit::GetCreature(*m_creature, Advisors[i]));
+ Advisor = (Unit::GetCreature(*me, Advisors[i]));
if (Advisor)
{
if (Advisor->isAlive())
@@ -283,9 +283,9 @@ struct boss_fathomlord_karathressAI : public ScriptedAI
}
if (continueTriggering)
{
- DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES);
- m_creature->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES);
+ DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
+ me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
}
@@ -321,7 +321,7 @@ struct boss_fathomguard_sharkkisAI : public ScriptedAI
pet = false;
- Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet);
+ Creature *Pet = Unit::GetCreature(*me, SummonedPet);
if (Pet && Pet->isAlive())
{
Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -338,7 +338,7 @@ struct boss_fathomguard_sharkkisAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
@@ -358,9 +358,9 @@ struct boss_fathomguard_sharkkisAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
if (pTarget)
{
@@ -382,22 +382,22 @@ struct boss_fathomguard_sharkkisAI : public ScriptedAI
//LeechingThrow_Timer
if (LeechingThrow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW);
+ DoCast(me->getVictim(), SPELL_LEECHING_THROW);
LeechingThrow_Timer = 20000;
} else LeechingThrow_Timer -= diff;
//Multishot_Timer
if (Multishot_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MULTISHOT);
+ DoCast(me->getVictim(), SPELL_MULTISHOT);
Multishot_Timer = 20000;
} else Multishot_Timer -= diff;
//TheBeastWithin_Timer
if (TheBeastWithin_Timer <= diff)
{
- DoCast(m_creature, SPELL_THE_BEAST_WITHIN);
- Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet);
+ DoCast(me, SPELL_THE_BEAST_WITHIN);
+ Creature *Pet = Unit::GetCreature(*me, SummonedPet);
if (Pet && Pet->isAlive())
{
Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true);
@@ -422,7 +422,7 @@ struct boss_fathomguard_sharkkisAI : public ScriptedAI
pet_id = CREATURE_FATHOM_SPOREBAT;
break;
}
- //DoCast(m_creature, spell_id, true);
+ //DoCast(me, spell_id, true);
Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (Pet && pTarget)
@@ -467,10 +467,10 @@ struct boss_fathomguard_tidalvessAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
- if (!m_creature->isAlive() && Karathress)
+ if (!me->isAlive() && Karathress)
CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
}
}
@@ -482,15 +482,15 @@ struct boss_fathomguard_tidalvessAI : public ScriptedAI
pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
- DoCast(m_creature, SPELL_WINDFURY_WEAPON);
+ DoCast(me, SPELL_WINDFURY_WEAPON);
}
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
if (pTarget)
{
@@ -509,26 +509,26 @@ struct boss_fathomguard_tidalvessAI : public ScriptedAI
return;
}
- if (!m_creature->HasAura(SPELL_WINDFURY_WEAPON))
+ if (!me->HasAura(SPELL_WINDFURY_WEAPON))
{
- DoCast(m_creature, SPELL_WINDFURY_WEAPON);
+ DoCast(me, SPELL_WINDFURY_WEAPON);
}
//FrostShock_Timer
if (FrostShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
FrostShock_Timer = 25000+rand()%5000;
} else FrostShock_Timer -= diff;
//Spitfire_Timer
if (Spitfire_Timer <= diff)
{
- DoCast(m_creature, SPELL_SPITFIRE_TOTEM);
- Unit *SpitfireTotem = Unit::GetUnit(*m_creature, CREATURE_SPITFIRE_TOTEM);
+ DoCast(me, SPELL_SPITFIRE_TOTEM);
+ Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM);
if (SpitfireTotem)
{
- CAST_CRE(SpitfireTotem)->AI()->AttackStart(m_creature->getVictim());
+ CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim());
}
Spitfire_Timer = 60000;
} else Spitfire_Timer -= diff;
@@ -536,14 +536,14 @@ struct boss_fathomguard_tidalvessAI : public ScriptedAI
//PoisonCleansing_Timer
if (PoisonCleansing_Timer <= diff)
{
- DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM);
+ DoCast(me, SPELL_POISON_CLEANSING_TOTEM);
PoisonCleansing_Timer = 30000;
} else PoisonCleansing_Timer -= diff;
//Earthbind_Timer
if (Earthbind_Timer <= diff)
{
- DoCast(m_creature, SPELL_EARTHBIND_TOTEM);
+ DoCast(me, SPELL_EARTHBIND_TOTEM);
Earthbind_Timer = 45000;
} else Earthbind_Timer -= diff;
@@ -582,10 +582,10 @@ struct boss_fathomguard_caribdisAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
- if (!m_creature->isAlive() && Karathress)
+ if (!me->isAlive() && Karathress)
CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
}
}
@@ -602,9 +602,9 @@ struct boss_fathomguard_caribdisAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
if (pTarget)
{
@@ -626,30 +626,30 @@ struct boss_fathomguard_caribdisAI : public ScriptedAI
//WaterBoltVolley_Timer
if (WaterBoltVolley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY);
+ DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY);
WaterBoltVolley_Timer = 30000;
} else WaterBoltVolley_Timer -= diff;
//TidalSurge_Timer
if (TidalSurge_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE);
+ DoCast(me->getVictim(), SPELL_TIDAL_SURGE);
// Hacky way to do it - won't trigger elseways
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
+ me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
TidalSurge_Timer = 15000+rand()%5000;
} else TidalSurge_Timer -= diff;
//Cyclone_Timer
if (Cyclone_Timer <= diff)
{
- //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work
+ //DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
Cyclone_Timer = 30000+rand()%10000;
- Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
+ Creature *Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
if (Cyclone)
{
CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Cyclone->setFaction(m_creature->getFaction());
+ Cyclone->setFaction(me->getFaction());
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -686,19 +686,19 @@ struct boss_fathomguard_caribdisAI : public ScriptedAI
switch(rand()%4)
{
case 0:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS));
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS));
break;
case 1:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS));
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS));
break;
case 2:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS));
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS));
break;
case 3:
- pUnit = m_creature;
+ pUnit = me;
break;
}
- } else pUnit = m_creature;
+ } else pUnit = me;
return pUnit;
}
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
index 3190eaf7b51..737e18a2366 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
@@ -76,7 +76,7 @@ EndScriptData */
struct boss_hydross_the_unstableAI : public ScriptedAI
{
- boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
+ boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
}
@@ -111,11 +111,11 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
EnrageTimer = 600000;
CorruptedForm = false;
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- m_creature->SetDisplayId(MODEL_CLEAN);
+ me->SetDisplayId(MODEL_CLEAN);
if (pInstance)
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
@@ -125,18 +125,18 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
void SummonBeams()
{
- Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
+ Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
if (beamer)
{
- beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true);
+ beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
beamer->SetDisplayId(11686); //invisible
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
beams[0]=beamer->GetGUID();
}
- beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
+ beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
if (beamer)
{
- beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true);
+ beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
beamer->SetDisplayId(11686); //invisible
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
beams[1]=beamer->GetGUID();
@@ -146,7 +146,7 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
{
for (uint8 i=0; i<2; ++i)
{
- Creature* mob = Unit::GetCreature(*m_creature,beams[i]);
+ Creature* mob = Unit::GetCreature(*me,beams[i]);
if (mob)
{
mob->setDeathState(DEAD);
@@ -156,7 +156,7 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
@@ -166,11 +166,11 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
{
if (CorruptedForm)
{
- DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), me);
}
else
{
- DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), me);
}
}
@@ -198,9 +198,9 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
void JustDied(Unit *victim)
{
if (CorruptedForm)
- DoScriptText(SAY_CORRUPT_DEATH, m_creature);
+ DoScriptText(SAY_CORRUPT_DEATH, me);
else
- DoScriptText(SAY_CLEAN_DEATH, m_creature);
+ DoScriptText(SAY_CLEAN_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
@@ -238,7 +238,7 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
}
- DoCast(m_creature->getVictim(), mark_spell);
+ DoCast(me->getVictim(), mark_spell);
if (MarkOfCorruption_Count < 5)
++MarkOfCorruption_Count;
@@ -260,14 +260,14 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
//PosCheck_Timer
if (PosCheck_Timer <= diff)
{
- if (m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
+ if (me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
{
// switch to clean form
- m_creature->SetDisplayId(MODEL_CLEAN);
+ me->SetDisplayId(MODEL_CLEAN);
CorruptedForm = false;
MarkOfHydross_Count = 0;
- DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature);
+ DoScriptText(SAY_SWITCH_TO_CLEAN, me);
DoResetThreat();
SummonBeams();
@@ -277,9 +277,9 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
}
PosCheck_Timer = 2500;
@@ -305,7 +305,7 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
}
- DoCast(m_creature->getVictim(), mark_spell);
+ DoCast(me->getVictim(), mark_spell);
if (MarkOfHydross_Count < 5)
++MarkOfHydross_Count;
@@ -327,14 +327,14 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
//PosCheck_Timer
if (PosCheck_Timer <= diff)
{
- if (!m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
+ if (!me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
{
// switch to corrupted form
- m_creature->SetDisplayId(MODEL_CORRUPT);
+ me->SetDisplayId(MODEL_CORRUPT);
MarkOfCorruption_Count = 0;
CorruptedForm = true;
- DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature);
+ DoScriptText(SAY_SWITCH_TO_CORRUPT, me);
DoResetThreat();
DeSummonBeams();
@@ -344,9 +344,9 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
}
PosCheck_Timer = 2500;
@@ -356,7 +356,7 @@ struct boss_hydross_the_unstableAI : public ScriptedAI
//EnrageTimer
if (EnrageTimer <= diff)
{
- DoCast(m_creature, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
EnrageTimer = 60000;
} else EnrageTimer -= diff;
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
index cd7823cd006..2e66414afa4 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
@@ -192,7 +192,7 @@ struct boss_lady_vashjAI : public ScriptedAI
Unit *remo;
for (uint8 i = 0; i < 4; ++i)
{
- remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]);
+ remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]);
if (remo)
remo->setDeathState(JUST_DIED);
}
@@ -204,7 +204,7 @@ struct boss_lady_vashjAI : public ScriptedAI
ShieldGeneratorChannel[2] = 0;
ShieldGeneratorChannel[3] = 0;
- m_creature->SetCorpseDelay(1000*60*60);
+ me->SetCorpseDelay(1000*60*60);
}
//Called when a tainted elemental dies
@@ -216,12 +216,12 @@ struct boss_lady_vashjAI : public ScriptedAI
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_LADYVASHJEVENT, DONE);
@@ -229,7 +229,7 @@ struct boss_lady_vashjAI : public ScriptedAI
void StartEvent()
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), me);
Phase = 1;
@@ -242,7 +242,7 @@ struct boss_lady_vashjAI : public ScriptedAI
if (pInstance)
{
//remove old tainted cores to prevent cheating in phase 2
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
@@ -263,22 +263,22 @@ struct boss_lady_vashjAI : public ScriptedAI
if (!Intro)
{
Intro = true;
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
}
if (!CanAttack)
return;
- if (!who || m_creature->getVictim())
+ if (!who || me->getVictim())
return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->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))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
{
//if (who->HasStealthAura())
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- if (!m_creature->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
+ if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
StartEvent();
if (Phase != 2)
@@ -294,17 +294,17 @@ struct boss_lady_vashjAI : public ScriptedAI
case 0:
//Shoot
//Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ DoCast(me->getVictim(), SPELL_SHOOT);
break;
case 1:
//Multishot
//Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
- DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
+ DoCast(me->getVictim(), SPELL_MULTI_SHOT);
break;
}
if (rand()%3)
{
- DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), m_creature);
+ DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), me);
}
}
@@ -315,7 +315,7 @@ struct boss_lady_vashjAI : public ScriptedAI
if (AggroTimer <= diff)
{
CanAttack = true;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer=19000;
}else
{
@@ -324,7 +324,7 @@ struct boss_lady_vashjAI : public ScriptedAI
}
}
//to prevent abuses during phase 2
- if (Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat())
+ if (Phase == 2 && !me->getVictim() && me->isInCombat())
{
EnterEvadeMode();
return;
@@ -340,8 +340,8 @@ struct boss_lady_vashjAI : public ScriptedAI
{
//Shock Burst
//Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
- DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST);
- m_creature->TauntApply(m_creature->getVictim());
+ DoCast(me->getVictim(), SPELL_SHOCK_BLAST);
+ me->TauntApply(me->getVictim());
ShockBlast_Timer = 1000+rand()%14000; //random cooldown
} else ShockBlast_Timer -= diff;
@@ -368,7 +368,7 @@ struct boss_lady_vashjAI : public ScriptedAI
{
//Entangle
//Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
- DoCast(m_creature->getVictim(), SPELL_ENTANGLE);
+ DoCast(me->getVictim(), SPELL_ENTANGLE);
Entangle = true;
Entangle_Timer = 10000;
}
@@ -384,22 +384,22 @@ struct boss_lady_vashjAI : public ScriptedAI
if (Phase == 1)
{
//Start phase 2
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70)
{
//Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
Phase = 2;
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
Creature *pCreature;
for (uint8 i = 0; i < 4; ++i)
{
- pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ pCreature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
if (pCreature)
ShieldGeneratorChannel[i] = pCreature->GetGUID();
}
- DoScriptText(SAY_PHASE2, m_creature);
+ DoScriptText(SAY_PHASE2, me);
}
}
//Phase 3
@@ -409,7 +409,7 @@ struct boss_lady_vashjAI : public ScriptedAI
if (SummonSporebat_Timer <= diff)
{
Creature *Sporebat = NULL;
- Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Sporebat)
{
@@ -439,12 +439,12 @@ struct boss_lady_vashjAI : public ScriptedAI
{
bool InMeleeRange = false;
Unit *pTarget;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//if in melee range
- if (pTarget && pTarget->IsWithinDistInMap(m_creature, 5))
+ if (pTarget && pTarget->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
break;
@@ -470,7 +470,7 @@ struct boss_lady_vashjAI : public ScriptedAI
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
DoCast(pTarget, SPELL_FORKED_LIGHTNING);
@@ -481,7 +481,7 @@ struct boss_lady_vashjAI : public ScriptedAI
if (EnchantedElemental_Timer <= diff)
{
Creature *Elemental;
- Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Elemental = me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
if (EnchantedElemental_Pos == 7)
EnchantedElemental_Pos = 0;
@@ -496,7 +496,7 @@ struct boss_lady_vashjAI : public ScriptedAI
{
Creature *Tain_Elemental;
uint32 pos = rand()%8;
- Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
+ Tain_Elemental = me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
TaintedElemental_Timer = 120000;
} else TaintedElemental_Timer -= diff;
@@ -506,15 +506,15 @@ struct boss_lady_vashjAI : public ScriptedAI
{
uint32 pos = rand()%3;
Creature* CoilfangElite = NULL;
- CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (CoilfangElite)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
CoilfangElite->AI()->AttackStart(pTarget);
- else if (m_creature->getVictim())
- CoilfangElite->AI()->AttackStart(m_creature->getVictim());
+ else if (me->getVictim())
+ CoilfangElite->AI()->AttackStart(me->getVictim());
}
CoilfangElite_Timer = 45000+rand()%5000;
} else CoilfangElite_Timer -= diff;
@@ -524,15 +524,15 @@ struct boss_lady_vashjAI : public ScriptedAI
{
uint32 pos = rand()%3;
Creature* CoilfangStrider = NULL;
- CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (CoilfangStrider)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
CoilfangStrider->AI()->AttackStart(pTarget);
- else if (m_creature->getVictim())
- CoilfangStrider->AI()->AttackStart(m_creature->getVictim());
+ else if (me->getVictim())
+ CoilfangStrider->AI()->AttackStart(me->getVictim());
}
CoilfangStrider_Timer = 60000+rand()%10000;
} else CoilfangStrider_Timer -= diff;
@@ -544,16 +544,16 @@ struct boss_lady_vashjAI : public ScriptedAI
if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
{
//set life 50%
- m_creature->SetHealth(m_creature->GetMaxHealth()/2);
+ me->SetHealth(me->GetMaxHealth()/2);
- m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
+ me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
- DoScriptText(SAY_PHASE3, m_creature);
+ DoScriptText(SAY_PHASE3, me);
Phase = 3;
//return to the tank
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
Check_Timer = 1000;
} else Check_Timer -= diff;
@@ -579,8 +579,8 @@ struct mob_enchanted_elementalAI : public ScriptedAI
void Reset()
{
- m_creature->SetSpeed(MOVE_WALK,0.6);//walk
- m_creature->SetSpeed(MOVE_RUN,0.6);//run
+ me->SetSpeed(MOVE_WALK,0.6);//walk
+ me->SetSpeed(MOVE_RUN,0.6);//run
move = 0;
phase = 1;
@@ -596,7 +596,7 @@ struct mob_enchanted_elementalAI : public ScriptedAI
}
else
{
- if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z))
+ if (me->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < me->GetDistance(x,y,z))
{
x = ElementWPPos[i][0];
y = ElementWPPos[i][1];
@@ -622,28 +622,28 @@ struct mob_enchanted_elementalAI : public ScriptedAI
if (move <= diff)
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (phase == 1)
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- if (phase == 1 && m_creature->IsWithinDist3d(x,y,z, 0.1))
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
+ if (phase == 1 && me->IsWithinDist3d(x,y,z, 0.1))
phase = 2;
if (phase == 2)
{
- m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+ me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
phase = 3;
}
if (phase == 3)
{
- m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- if (m_creature->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
- DoCast(m_creature, SPELL_SURGE);
+ me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+ if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
+ DoCast(me, SPELL_SURGE);
}
- if (Creature *Vashj = Unit::GetCreature(*m_creature, VashjGUID))
+ if (Creature *Vashj = Unit::GetCreature(*me, VashjGUID))
{
if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
{
//call Unsummon()
- m_creature->Kill(m_creature);
+ me->Kill(me);
}
}
move = 1000;
@@ -676,7 +676,7 @@ struct mob_tainted_elementalAI : public ScriptedAI
if (pInstance)
{
Creature *Vashj = NULL;
- Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)));
+ Vashj = (Unit::GetCreature((*me), pInstance->GetData64(DATA_LADYVASHJ)));
if (Vashj)
CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath();
@@ -685,7 +685,7 @@ struct mob_tainted_elementalAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->AddThreat(who, 0.1f);
+ me->AddThreat(who, 0.1f);
}
void UpdateAI(const uint32 diff)
@@ -696,7 +696,7 @@ struct mob_tainted_elementalAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && pTarget->IsWithinDistInMap(m_creature, 30))
+ if (pTarget && pTarget->IsWithinDistInMap(me, 30))
DoCast(pTarget, SPELL_POISON_BOLT);
PoisonBolt_Timer = 5000+rand()%5000;
@@ -706,7 +706,7 @@ struct mob_tainted_elementalAI : public ScriptedAI
if (Despawn_Timer <= diff)
{
//call Unsummon()
- m_creature->setDeathState(DEAD);
+ me->setDeathState(DEAD);
//to prevent crashes
Despawn_Timer = 1000;
@@ -733,8 +733,8 @@ struct mob_toxic_sporebatAI : public ScriptedAI
void Reset()
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->setFaction(14);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->setFaction(14);
movement_timer = 0;
ToxicSpore_Timer = 5000;
bolt_timer = 5500;
@@ -766,7 +766,7 @@ struct mob_toxic_sporebatAI : public ScriptedAI
if (movement_timer <= diff)
{
uint32 rndpos = rand()%8;
- m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
+ me->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
movement_timer = 6000;
} else movement_timer -= diff;
@@ -777,7 +777,7 @@ struct mob_toxic_sporebatAI : public ScriptedAI
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{
- Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
+ Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
if (trig)
{
trig->setFaction(14);
@@ -795,13 +795,13 @@ struct mob_toxic_sporebatAI : public ScriptedAI
{
//check if vashj is death
Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
+ Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3))
{
//remove
- m_creature->setDeathState(DEAD);
- m_creature->RemoveCorpse();
- m_creature->setFaction(35);
+ me->setDeathState(DEAD);
+ me->RemoveCorpse();
+ me->setFaction(35);
}
}
@@ -862,9 +862,9 @@ struct mob_shield_generator_channelAI : public ScriptedAI
{
Check_Timer = 0;
Casted = false;
- m_creature->SetDisplayId(11686); //invisible
+ me->SetDisplayId(11686); //invisible
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who) { return; }
@@ -879,7 +879,7 @@ struct mob_shield_generator_channelAI : public ScriptedAI
if (Check_Timer <= diff)
{
Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
+ Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
if (Vashj && Vashj->isAlive())
{
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
index cd8d12a097e..48554d5de53 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
@@ -84,14 +84,14 @@ struct mob_inner_demonAI : public ScriptedAI
}
void JustDied(Unit *victim)
{
- Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID);
+ Unit* pUnit = Unit::GetUnit((*me),victimGUID);
if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER))
pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID())
+ if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != me->GetGUID())
{
damage = 0;
DoModifyThreatPercent(done_by, -100);
@@ -109,33 +109,33 @@ struct mob_inner_demonAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->getVictim()->GetGUID() != victimGUID)
+ if (me->getVictim()->GetGUID() != victimGUID)
{
- DoModifyThreatPercent(m_creature->getVictim(), -100);
- Unit* owner = Unit::GetUnit((*m_creature),victimGUID);
+ DoModifyThreatPercent(me->getVictim(), -100);
+ Unit* owner = Unit::GetUnit((*me),victimGUID);
if (owner && owner->isAlive())
{
- m_creature->AddThreat(owner,999999);
+ me->AddThreat(owner,999999);
AttackStart(owner);
} else if (owner && owner->isDead())
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
}
if (Link_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true);
+ DoCast(me->getVictim(), SPELL_SOUL_LINK, true);
Link_Timer = 1000;
} else Link_Timer -= diff;
- if (!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT))
- DoCast(m_creature, AURA_DEMONIC_ALIGNMENT, true);
+ if (!me->HasAura(AURA_DEMONIC_ALIGNMENT))
+ DoCast(me, AURA_DEMONIC_ALIGNMENT, true);
if (ShadowBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false);
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT, false);
ShadowBolt_Timer = 10000;
} else ShadowBolt_Timer -= diff;
@@ -187,19 +187,19 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
SwitchToHuman_Timer = 60000;
Berserk_Timer = 600000;
InnerDemons_Timer = 30000;
- m_creature->SetCanDualWield(true);
+ me->SetCanDualWield(true);
DealDamage = true;
DemonForm = false;
IsFinalForm = false;
NeedThreatReset = false;
EnrageUsed = false;
InnerDemon_Count = 0;
- m_creature->SetSpeed(MOVE_RUN, 2.0f, true);
- m_creature->SetDisplayId(MODEL_NIGHTELF);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
- m_creature->SetCorpseDelay(1000*60*60);
+ me->SetSpeed(MOVE_RUN, 2.0f, true);
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ DoCast(me, SPELL_DUAL_WIELD, true);
+ me->SetCorpseDelay(1000*60*60);
if (pInstance)
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
}
@@ -208,7 +208,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
{
for (uint8 i = 0; i < 3; ++i)
{
- if (Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i]))
+ if (Creature *add = Unit::GetCreature(*me,SpellBinderGUID[i]))
add->DisappearAndDie();
float nx = x;
@@ -217,7 +217,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (i == 0) {nx += 10; ny -= 5; o=2.5f;}
if (i == 1) {nx -= 8; ny -= 7; o=0.9f;}
if (i == 2) {nx -= 3; ny += 9; o=5.0f;}
- Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0);
+ Creature* binder = me->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0);
if (binder)
SpellBinderGUID[i] = binder->GetGUID();
@@ -225,19 +225,19 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
}
void MoveInLineOfSight(Unit *who)
{
- if (m_creature->HasAura(AURA_BANISH))
+ if (me->HasAura(AURA_BANISH))
return;
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius))
{
// Check first that object is in an angle in front of this one before LoS check
- if (m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who))
+ if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who))
{
AttackStart(who);
}
@@ -247,7 +247,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
void StartEvent()
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
}
@@ -257,48 +257,48 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
uint8 AliveChannelers = 0;
for (uint8 i = 0; i < 3; ++i)
{
- Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]);
+ Unit *add = Unit::GetUnit(*me,SpellBinderGUID[i]);
if (add && add->isAlive())
++AliveChannelers;
}
// channelers == 0 remove banish aura
- if (AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH))
+ if (AliveChannelers == 0 && me->HasAura(AURA_BANISH))
{
// removing banish aura
- m_creature->RemoveAurasDueToSpell(AURA_BANISH);
+ me->RemoveAurasDueToSpell(AURA_BANISH);
// Leotheras is getting immune again
- m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
+ me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
// changing model to bloodelf
- m_creature->SetDisplayId(MODEL_NIGHTELF);
+ me->SetDisplayId(MODEL_NIGHTELF);
// and reseting equipment
- m_creature->LoadEquipment(m_creature->GetEquipmentId());
+ me->LoadEquipment(me->GetEquipmentId());
if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
{
Unit *victim = NULL;
- victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
+ victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
if (victim)
- m_creature->getThreatManager().addThreat(victim, 1);
+ me->getThreatManager().addThreat(victim, 1);
StartEvent();
}
}
- else if (AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH))
+ else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH))
{
// channelers != 0 apply banish aura
// removing Leotheras banish immune to apply AURA_BANISH
- m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false);
- DoCast(m_creature, AURA_BANISH);
+ me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false);
+ DoCast(me, AURA_BANISH);
// changing model
- m_creature->SetDisplayId(MODEL_DEMON);
+ me->SetDisplayId(MODEL_DEMON);
// and removing weapons
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
}
@@ -310,7 +310,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (InnderDemon[i])
{
//delete creature
- Creature* pCreature = Unit::GetCreature((*m_creature), InnderDemon[i]);
+ Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]);
if (pCreature && pCreature->isAlive())
{
pCreature->ForcedDespawn();
@@ -328,7 +328,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
{
if (InnderDemon[i] > 0)
{
- Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]);
+ Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]);
if (pUnit && pUnit->isAlive())
{
Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID);
@@ -349,22 +349,22 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (DemonForm)
{
- DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
}
else
{
- DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), me);
}
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
//despawn copy
if (Demon)
{
- if (Creature* pDemon = Unit::GetCreature(*m_creature, Demon))
+ if (Creature* pDemon = Unit::GetCreature(*me, Demon))
pDemon->ForcedDespawn();
}
if (pInstance)
@@ -373,16 +373,16 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- if (m_creature->HasAura(AURA_BANISH))
+ if (me->HasAura(AURA_BANISH))
return;
- m_creature->LoadEquipment(m_creature->GetEquipmentId());
+ me->LoadEquipment(me->GetEquipmentId());
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
- if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim())
+ if (me->HasAura(AURA_BANISH) || !UpdateVictim())
{
if (BanishTimer <= diff)
{
@@ -391,21 +391,21 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
} else BanishTimer -= diff;
return;
}
- if (m_creature->HasAura(SPELL_WHIRLWIND))
+ if (me->HasAura(SPELL_WHIRLWIND))
if (Whirlwind_Timer <= diff)
{
Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (newTarget)
{
DoResetThreat();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ());
}
Whirlwind_Timer = 2000;
} else Whirlwind_Timer -= diff;
// reseting after changing forms and after ending whirlwind
- if (NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND))
+ if (NeedThreatReset && !me->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)
@@ -415,26 +415,26 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
NeedThreatReset = false;
DoResetThreat();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
//Enrage_Timer (10 min)
if (Berserk_Timer < diff && !EnrageUsed)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_BERSERK);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_BERSERK);
EnrageUsed = true;
} else Berserk_Timer -= diff;
if (!DemonForm)
{
//Whirldind Timer
- if (!m_creature->HasAura(SPELL_WHIRLWIND))
+ if (!me->HasAura(SPELL_WHIRLWIND))
{
if (Whirlwind_Timer <= diff)
{
- DoCast(m_creature, SPELL_WHIRLWIND);
+ DoCast(me, SPELL_WHIRLWIND);
// while whirlwinding this variable is used to countdown target's change
Whirlwind_Timer = 2000;
NeedThreatReset = true;
@@ -446,11 +446,11 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (SwitchToDemon_Timer <= diff)
{
//switch to demon form
- m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
- m_creature->SetDisplayId(MODEL_DEMON);
- DoScriptText(SAY_SWITCH_TO_DEMON, m_creature);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ me->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
+ me->SetDisplayId(MODEL_DEMON);
+ DoScriptText(SAY_SWITCH_TO_DEMON, me);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
DemonForm = true;
NeedThreatReset = true;
SwitchToDemon_Timer = 45000;
@@ -460,30 +460,30 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
else
{
//ChaosBlast_Timer
- if (!m_creature->getVictim())
+ if (!me->getVictim())
return;
- if (m_creature->IsWithinDist(m_creature->getVictim(), 30))
- m_creature->StopMoving();
+ if (me->IsWithinDist(me->getVictim(), 30))
+ me->StopMoving();
if (ChaosBlast_Timer <= diff)
{
// will cast only when in range of spell
- if (m_creature->IsWithinDist(m_creature->getVictim(), 30))
+ if (me->IsWithinDist(me->getVictim(), 30))
{
- //DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST, true);
+ //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
int damage = 100;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
+ me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
}
ChaosBlast_Timer = 3000;
} else ChaosBlast_Timer -= diff;
//Summon Inner Demon
if (InnerDemons_Timer <= diff)
{
- std::list<HostileReference *>& ThreatList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *>& ThreatList = me->getThreatManager().getThreatList();
std::vector<Unit *> TargetList;
for (std::list<HostileReference *>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
{
- Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5)
+ Unit *tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5)
TargetList.push_back(tempTarget);
}
SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER);
@@ -491,7 +491,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
{
if ((*itr) && (*itr)->isAlive())
{
- Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Creature * demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (demon)
{
demon->AI()->AttackStart((*itr));
@@ -510,7 +510,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
}
}
}
- DoScriptText(SAY_INNER_DEMONS, m_creature);
+ DoScriptText(SAY_INNER_DEMONS, me);
InnerDemons_Timer = 999999;
} else InnerDemons_Timer -= diff;
@@ -519,8 +519,8 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (SwitchToHuman_Timer <= diff)
{
//switch to nightelf form
- m_creature->SetDisplayId(MODEL_NIGHTELF);
- m_creature->LoadEquipment(m_creature->GetEquipmentId());
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->LoadEquipment(me->GetEquipmentId());
CastConsumingMadness();
DespawnDemon();
@@ -532,7 +532,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
} else SwitchToHuman_Timer -= diff;
}
- if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15)
+ if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15)
{
//at this point he divides himself in two parts
CastConsumingMadness();
@@ -542,16 +542,16 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
if (Copy)
{
Demon = Copy->GetGUID();
- if (m_creature->getVictim())
- Copy->AI()->AttackStart(m_creature->getVictim());
+ if (me->getVictim())
+ Copy->AI()->AttackStart(me->getVictim());
}
//set nightelf final form
IsFinalForm = true;
DemonForm = false;
- DoScriptText(SAY_FINAL_FORM, m_creature);
- m_creature->SetDisplayId(MODEL_NIGHTELF);
- m_creature->LoadEquipment(m_creature->GetEquipmentId());
+ DoScriptText(SAY_FINAL_FORM, me);
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->LoadEquipment(me->GetEquipmentId());
}
}
};
@@ -572,7 +572,7 @@ struct boss_leotheras_the_blind_demonformAI : public ScriptedAI
void StartEvent()
{
- DoScriptText(SAY_FREE, m_creature);
+ DoScriptText(SAY_FREE, me);
}
void KilledUnit(Unit *victim)
@@ -580,13 +580,13 @@ struct boss_leotheras_the_blind_demonformAI : public ScriptedAI
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
- DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
}
void JustDied(Unit *victim)
{
//invisibility (blizzlike, at the end of the fight he doesn't die, he disappears)
- DoCast(m_creature, 8149, true);
+ DoCast(me, 8149, true);
}
void EnterCombat(Unit *who)
@@ -600,17 +600,17 @@ struct boss_leotheras_the_blind_demonformAI : public ScriptedAI
if (!UpdateVictim())
return;
//ChaosBlast_Timer
- if (m_creature->IsWithinDist(m_creature->getVictim(), 30))
- m_creature->StopMoving();
+ if (me->IsWithinDist(me->getVictim(), 30))
+ me->StopMoving();
if (ChaosBlast_Timer <= diff)
{
// will cast only when in range od spell
- if (m_creature->IsWithinDist(m_creature->getVictim(), 30))
+ if (me->IsWithinDist(me->getVictim(), 30))
{
- //DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST, true);
+ //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
int damage = 100;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
+ me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
ChaosBlast_Timer = 3000;
}
} else ChaosBlast_Timer -= diff;
@@ -644,7 +644,7 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
- Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID);
+ Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
if (leotheras && leotheras->isAlive())
CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false);
}
@@ -652,7 +652,7 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
if (pInstance)
pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
}
@@ -665,11 +665,11 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
void CastChanneling()
{
- if (!m_creature->isInCombat() && !m_creature->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
+ if (!me->isInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
{
if (leotherasGUID)
{
- Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID);
+ Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
if (leotheras && leotheras->isAlive())
DoCast(leotheras, BANISH_BEAM);
}
@@ -683,10 +683,10 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
if (!leotherasGUID)
leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS);
- if (!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
+ if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
{
Unit *victim = NULL;
- victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
+ victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
if (victim)
AttackStart(victim);
}
@@ -716,7 +716,7 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
if (Earthshock_Timer <= diff)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
index 9e783d4c1eb..4d661bb2812 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
@@ -66,7 +66,7 @@ float AddPos[9][3] =
struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
- boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature)
+ boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM);
@@ -104,7 +104,7 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
}
void Reset()
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
SpoutAnimTimer = 1000;
RotTimer = 0;
WaterboltTimer = 15000;//give time to get in range when fight starts
@@ -128,10 +128,10 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
pInstance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
}
- DoCast(m_creature, SPELL_SUBMERGE);//submerge anim
- m_creature->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ DoCast(me, SPELL_SUBMERGE);//submerge anim
+ me->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
void JustDied(Unit* Killer)
@@ -153,10 +153,10 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
if (!CanStartEvent)//boss is invisible, don't attack
return;
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)))
{
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius))
{
AttackStart(who);
}
@@ -177,15 +177,15 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
if (Submerged)
{
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->SetVisibility(VISIBILITY_ON);
Submerged = false;
WaitTimer2 = 500;
}
if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim
{
- m_creature->RemoveAllAuras();
- m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
- DoCast(m_creature, SPELL_EMERGE, false);
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
+ DoCast(me, SPELL_EMERGE, false);
WaitTimer2 = 60000;//never reached
WaitTimer = 3000;
} else WaitTimer2 -= diff;
@@ -194,16 +194,16 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
WaitTimer = 3000;
CanStartEvent=true;//fresh fished from pool
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} else WaitTimer -= diff;
}
return;
}
- if (m_creature->getThreatManager().getThreatList().empty())//check if should evade
+ if (me->getThreatManager().getThreatList().empty())//check if should evade
{
- if (m_creature->isInCombat())
+ if (me->isInCombat())
EnterEvadeMode();
return;
}
@@ -211,15 +211,15 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
if (PhaseTimer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_SUBMERGE);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_SUBMERGE);
PhaseTimer = 60000;//60secs submerged
Submerged = true;
} else PhaseTimer-=diff;
if (SpoutTimer <= diff)
{
- m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true);
+ me->MonsterTextEmote(EMOTE_SPOUT,0,true);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
SpoutTimer = 45000;
@@ -232,19 +232,19 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (WhirlTimer <= diff)
{
WhirlTimer = 18000;
- DoCast(m_creature, SPELL_WHIRL);
+ DoCast(me, SPELL_WHIRL);
} else WhirlTimer -= diff;
if (CheckTimer <= diff)//check if there are players in melee range
{
InRange = false;
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- if (m_creature->IsWithinMeleeRange(i->getSource()))
+ if (me->IsWithinMeleeRange(i->getSource()))
InRange = true;
}
}
@@ -253,20 +253,20 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (RotTimer)
{
- Map* pMap = m_creature->GetMap();
+ Map* pMap = me->GetMap();
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- if (i->getSource() && i->getSource()->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && m_creature->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
+ if (i->getSource() && i->getSource()->isAlive() && me->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
}
}
if (SpoutAnimTimer <= diff)
{
- DoCast(m_creature, SPELL_SPOUT_ANIM, true);
+ DoCast(me, SPELL_SPOUT_ANIM, true);
SpoutAnimTimer = 1000;
} else SpoutAnimTimer -= diff;
@@ -280,8 +280,8 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (GeyserTimer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (!pTarget && m_creature->getVictim())
- pTarget = m_creature->getVictim();
+ if (!pTarget && me->getVictim())
+ pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_GEYSER, true);
GeyserTimer = rand()%5000 + 15000;
@@ -292,8 +292,8 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (WaterboltTimer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (!pTarget && m_creature->getVictim())
- pTarget = m_creature->getVictim();
+ if (!pTarget && me->getVictim())
+ pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_WATERBOLT, true);
WaterboltTimer = 3000;
@@ -310,35 +310,35 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (PhaseTimer <= diff)
{
Submerged = false;
- m_creature->InterruptNonMeleeSpells(false);//shouldn't be any
- m_creature->RemoveAllAuras();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
- DoCast(m_creature, SPELL_EMERGE, true);
+ me->InterruptNonMeleeSpells(false);//shouldn't be any
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
+ DoCast(me, SPELL_EMERGE, true);
Spawned = false;
SpoutTimer = 3000; // directly cast Spout after emerging!
PhaseTimer = 120000;
return;
} else PhaseTimer-=diff;
- if (m_creature->getThreatManager().getThreatList().empty())//check if should evade
+ if (me->getThreatManager().getThreatList().empty())//check if should evade
{
EnterEvadeMode();
return;
}
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
DoZoneInCombat();
if (!Spawned)
{
- m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
//spawn adds
for (uint8 i = 0; i < 9; ++i)
{
Creature* Summoned;
if (i < 6)
- Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Summoned)
Summons.Summon(Summoned);
@@ -394,9 +394,9 @@ struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *who)
{
- if (!who || m_creature->getVictim()) return;
+ if (!who || me->getVictim()) return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who) && m_creature->IsWithinDistInMap(who, 45))
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who) && me->IsWithinDistInMap(who, 45))
{
AttackStart(who);
}
@@ -406,8 +406,8 @@ struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI
{
if (MultiShotTimer <= diff)
{
- if (m_creature->getVictim())
- DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true);
+ if (me->getVictim())
+ DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true);
MultiShotTimer = 10000+rand()%10000;
ShootBowTimer += 1500;//add global cooldown
@@ -419,7 +419,7 @@ struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
int bp0 = 1100;
if (pTarget)
- m_creature->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true);
+ me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true);
ShootBowTimer = 4000+rand()%5000;
MultiShotTimer += 1500;//add global cooldown
} else ShootBowTimer -= diff;
diff --git a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
index 3ba2272463c..c2b88822824 100644
--- a/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
+++ b/src/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
@@ -138,7 +138,7 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
void StartEvent()
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
@@ -146,12 +146,12 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
@@ -159,7 +159,7 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- PlayerList = &m_creature->GetMap()->GetPlayers();
+ PlayerList = &me->GetMap()->GetPlayers();
Playercount = PlayerList->getSize();
StartEvent();
}
@@ -186,22 +186,22 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
{
if (!Earthquake)
{
- DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
+ DoCast(me->getVictim(), SPELL_EARTHQUAKE);
Earthquake = true;
Earthquake_Timer = 10000;
}
else
{
- DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
for (uint8 i = 0; i < 10; ++i)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
+ Creature* Murloc = me->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (pTarget && Murloc)
Murloc->AI()->AttackStart(pTarget);
}
- DoScriptText(EMOTE_EARTHQUAKE, m_creature);
+ DoScriptText(EMOTE_EARTHQUAKE, me);
Earthquake = false;
Earthquake_Timer = 40000+rand()%5000;
}
@@ -210,7 +210,7 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
//TidalWave_Timer
if (TidalWave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE);
+ DoCast(me->getVictim(), SPELL_TIDAL_WAVE);
TidalWave_Timer = 20000;
} else TidalWave_Timer -= diff;
@@ -244,14 +244,14 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
}
}
- DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), me);
- DoScriptText(EMOTE_WATERY_GRAVE, m_creature);
+ DoScriptText(EMOTE_WATERY_GRAVE, me);
WateryGrave_Timer = 30000;
} else WateryGrave_Timer -= diff;
//Start Phase2
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)
Phase2 = true;
}
else
@@ -278,7 +278,7 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI
globulelist.insert(pGlobuleTarget->GetGUID());
pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true);
}
- DoScriptText(EMOTE_WATERY_GLOBULES, m_creature);
+ DoScriptText(EMOTE_WATERY_GLOBULES, me);
WateryGlobules_Timer = 25000;
} else WateryGlobules_Timer -= diff;
}
@@ -300,19 +300,19 @@ struct mob_water_globuleAI : public ScriptedAI
{
Check_Timer = 1000;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
}
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who)
{
- if (!who || m_creature->getVictim())
+ if (!who || me->getVictim())
return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
{
//no attack radius check - it attacks the first target that moves in his los
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
@@ -328,12 +328,12 @@ struct mob_water_globuleAI : public ScriptedAI
if (Check_Timer <= diff)
{
- if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
+ if (me->IsWithinDistInMap(me->getVictim(), 5))
{
- DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION);
+ DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION);
//despawn
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
return;
}
Check_Timer = 500;
diff --git a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
index 7fda5e69384..7b4f0fac6aa 100644
--- a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
+++ b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
@@ -66,7 +66,7 @@ struct boss_thespiaAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEAD, m_creature);
+ DoScriptText(SAY_DEAD, me);
if (pInstance)
pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
@@ -74,12 +74,12 @@ struct boss_thespiaAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
if (pInstance)
pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
@@ -152,7 +152,7 @@ struct mob_coilfang_waterelementalAI : public ScriptedAI
if (WaterBoltVolley_Timer <= diff)
{
- DoCast(m_creature, SPELL_WATER_BOLT_VOLLEY);
+ DoCast(me, SPELL_WATER_BOLT_VOLLEY);
WaterBoltVolley_Timer = 7000+rand()%5000;
} else WaterBoltVolley_Timer -= diff;
diff --git a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
index eec25ee7d49..2cf5e8e3a85 100644
--- a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
+++ b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
@@ -78,7 +78,7 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
@@ -86,12 +86,12 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
if (pInstance)
pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
@@ -100,7 +100,7 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
//no known summon spells exist
void SummonMechanichs()
{
- DoScriptText(SAY_MECHANICS, m_creature);
+ DoScriptText(SAY_MECHANICS, me);
DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
@@ -119,7 +119,7 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
if (Shrink_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SUPER_SHRINK_RAY);
+ DoCast(me->getVictim(), SPELL_SUPER_SHRINK_RAY);
Shrink_Timer = 20000;
} else Shrink_Timer -= diff;
@@ -128,21 +128,21 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget, SPELL_SAW_BLADE);
else
- DoCast(m_creature->getVictim(), SPELL_SAW_BLADE);
+ DoCast(me->getVictim(), SPELL_SAW_BLADE);
Saw_Blade_Timer = 15000;
} else Saw_Blade_Timer -= diff;
if (Electrified_Net_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ELECTRIFIED_NET);
+ DoCast(me->getVictim(), SPELL_ELECTRIFIED_NET);
Electrified_Net_Timer = 10000;
}
else Electrified_Net_Timer -= diff;
if (!Summon75)
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75)
{
SummonMechanichs();
Summon75 = true;
@@ -151,7 +151,7 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
if (!Summon50)
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
{
SummonMechanichs();
Summon50 = true;
@@ -160,7 +160,7 @@ struct boss_mekgineer_steamriggerAI : public ScriptedAI
if (!Summon25)
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)
{
SummonMechanichs();
Summon25 = true;
@@ -213,24 +213,24 @@ struct mob_steamrigger_mechanicAI : public ScriptedAI
{
if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
{
- if (Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)))
+ if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)))
{
- if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
+ if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
{
//are we already channeling? Doesn't work very well, find better check?
- if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL))
+ if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL))
{
- //m_creature->GetMotionMaster()->MovementExpired();
- //m_creature->GetMotionMaster()->MoveIdle();
+ //me->GetMotionMaster()->MovementExpired();
+ //me->GetMotionMaster()->MoveIdle();
- DoCast(m_creature, SPELL_REPAIR, true);
+ DoCast(me, SPELL_REPAIR, true);
}
Repair_Timer = 5000;
}
else
{
- //m_creature->GetMotionMaster()->MovementExpired();
- //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
+ //me->GetMotionMaster()->MovementExpired();
+ //me->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
}
}
} else Repair_Timer = 5000;
diff --git a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
index f46b8b335c0..6f9a5a4a858 100644
--- a/src/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
+++ b/src/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
@@ -51,16 +51,16 @@ struct mob_naga_distillerAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//hack, due to really weird spell behaviour :(
if (pInstance)
{
if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
}
@@ -69,10 +69,10 @@ struct mob_naga_distillerAI : public ScriptedAI
void StartRageGen(Unit *caster)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature, SPELL_WARLORDS_RAGE_NAGA, true);
+ DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true);
if (pInstance)
pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS);
@@ -80,7 +80,7 @@ struct mob_naga_distillerAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (m_creature->GetHealth() <= damage)
+ if (me->GetHealth() <= damage)
if (pInstance)
pInstance->SetData(TYPE_DISTILLER,DONE);
}
@@ -113,7 +113,7 @@ struct boss_warlord_kalithreshAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
if (pInstance)
pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
@@ -121,7 +121,7 @@ struct boss_warlord_kalithreshAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
@@ -130,12 +130,12 @@ struct boss_warlord_kalithreshAI : public ScriptedAI
if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
if (pInstance)
if (pInstance->GetData(TYPE_DISTILLER) == DONE)
- m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
+ me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
@@ -150,9 +150,9 @@ struct boss_warlord_kalithreshAI : public ScriptedAI
{
if (Creature* distiller = me->FindNearestCreature(17954, 100.0f))
{
- DoScriptText(SAY_REGEN, m_creature);
- DoCast(m_creature, SPELL_WARLORDS_RAGE);
- CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature);
+ DoScriptText(SAY_REGEN, me);
+ DoCast(me, SPELL_WARLORDS_RAGE);
+ CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(me);
}
Rage_Timer = 3000+rand()%15000;
} else Rage_Timer -= diff;
@@ -160,7 +160,7 @@ struct boss_warlord_kalithreshAI : public ScriptedAI
//Reflection_Timer
if (Reflection_Timer <= diff)
{
- DoCast(m_creature, SPELL_SPELL_REFLECTION);
+ DoCast(me, SPELL_SPELL_REFLECTION);
Reflection_Timer = 15000+rand()%10000;
} else Reflection_Timer -= diff;
diff --git a/src/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp
index 3736e4a230d..a453b9ca0aa 100644
--- a/src/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp
+++ b/src/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp
@@ -52,11 +52,11 @@ struct boss_hungarfenAI : public ScriptedAI
if (!UpdateVictim())
return;
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
{
if (!Root)
{
- DoCast(m_creature, SPELL_FOUL_SPORES);
+ DoCast(me, SPELL_FOUL_SPORES);
Root = true;
}
}
@@ -64,9 +64,9 @@ struct boss_hungarfenAI : public ScriptedAI
if (Mushroom_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- m_creature->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+ me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
else
- m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+ me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
Mushroom_Timer = 10000;
} else Mushroom_Timer -= diff;
@@ -104,8 +104,8 @@ struct mob_underbog_mushroomAI : public ScriptedAI
Grow_Timer = 0;
Shrink_Timer = 20000;
- DoCast(m_creature, SPELL_PUTRID_MUSHROOM, true);
- DoCast(m_creature, SPELL_SPORE_CLOUD, true);
+ DoCast(me, SPELL_PUTRID_MUSHROOM, true);
+ DoCast(me, SPELL_SPORE_CLOUD, true);
}
void MoveInLineOfSight(Unit *who) { return; }
@@ -121,13 +121,13 @@ struct mob_underbog_mushroomAI : public ScriptedAI
if (Grow_Timer <= diff)
{
- DoCast(m_creature, SPELL_GROW);
+ DoCast(me, SPELL_GROW);
Grow_Timer = 3000;
} else Grow_Timer -= diff;
if (Shrink_Timer <= diff)
{
- m_creature->RemoveAurasDueToSpell(SPELL_GROW);
+ me->RemoveAurasDueToSpell(SPELL_GROW);
Stop = true;
} else Shrink_Timer -= diff;
}
diff --git a/src/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
index 9be8d3294d5..a970debdaea 100644
--- a/src/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
+++ b/src/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
@@ -71,15 +71,15 @@ struct boss_the_black_stalkerAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
summon->AI()->AttackStart(pTarget);
else
- if (m_creature->getVictim())
- summon->AI()->AttackStart(m_creature->getVictim());
+ if (me->getVictim())
+ summon->AI()->AttackStart(me->getVictim());
}
}
void JustDied(Unit *who)
{
for (std::list<uint64>::const_iterator i = Striders.begin(); i != Striders.end(); ++i)
- if (Creature *strider = Unit::GetCreature(*m_creature, *i))
+ if (Creature *strider = Unit::GetCreature(*me, *i))
strider->DisappearAndDie();
}
@@ -92,8 +92,8 @@ struct boss_the_black_stalkerAI : public ScriptedAI
if (check_Timer <= diff)
{
float x,y,z,o;
- m_creature->GetHomePosition(x,y,z,o);
- if (!m_creature->IsWithinDist3d(x,y,z, 60))
+ me->GetHomePosition(x,y,z,o);
+ if (!me->IsWithinDist3d(x,y,z, 60))
{
EnterEvadeMode();
return;
@@ -104,7 +104,7 @@ struct boss_the_black_stalkerAI : public ScriptedAI
// Spore Striders
if (IsHeroic() && SporeStriders_Timer <= diff)
{
- DoCast(m_creature, SPELL_SUMMON_SPORE_STRIDER);
+ DoCast(me, SPELL_SUMMON_SPORE_STRIDER);
SporeStriders_Timer = 10000+rand()%5000;
} else SporeStriders_Timer -= diff;
@@ -113,7 +113,7 @@ struct boss_the_black_stalkerAI : public ScriptedAI
{
if (LevitatedTarget_Timer <= diff)
{
- if (Unit *pTarget = Unit::GetUnit(*m_creature, LevitatedTarget))
+ if (Unit *pTarget = Unit::GetUnit(*me, LevitatedTarget))
{
if (!pTarget->HasAura(SPELL_LEVITATE))
{
diff --git a/src/scripts/outland/gruuls_lair/boss_gruul.cpp b/src/scripts/outland/gruuls_lair/boss_gruul.cpp
index 25b6c73f472..c0b29be3e94 100644
--- a/src/scripts/outland/gruuls_lair/boss_gruul.cpp
+++ b/src/scripts/outland/gruuls_lair/boss_gruul.cpp
@@ -86,7 +86,7 @@ struct boss_gruulAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
@@ -94,12 +94,12 @@ struct boss_gruulAI : public ScriptedAI
void KilledUnit()
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -118,8 +118,8 @@ struct boss_gruulAI : public ScriptedAI
{
switch (urand(0,1))
{
- case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break;
- case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break;
+ case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break;
+ case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break;
}
}
}
@@ -139,10 +139,10 @@ struct boss_gruulAI : public ScriptedAI
m_bPerformingGroundSlam = false;
//and correct movement, if not already
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
{
- if (m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ if (me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
}
}
@@ -158,8 +158,8 @@ struct boss_gruulAI : public ScriptedAI
// Gruul can cast this spell up to 30 times
if (m_uiGrowth_Timer <= uiDiff)
{
- DoScriptText(EMOTE_GROW, m_creature);
- DoCast(m_creature, SPELL_GROWTH);
+ DoScriptText(EMOTE_GROW, me);
+ DoCast(me, SPELL_GROWTH);
m_uiGrowth_Timer = 30000;
}
else
@@ -175,7 +175,7 @@ struct boss_gruulAI : public ScriptedAI
if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
m_uiReverberation_Timer += 10000;
- DoCast(m_creature, SPELL_SHATTER);
+ DoCast(me, SPELL_SHATTER);
}
else
m_uiGroundSlamTimer -= uiDiff;
@@ -187,10 +187,10 @@ struct boss_gruulAI : public ScriptedAI
{
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- if (pTarget && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (pTarget && me->IsWithinMeleeRange(me->getVictim()))
DoCast(pTarget, SPELL_HURTFUL_STRIKE);
else
- DoCast(m_creature->getVictim(), SPELL_HURTFUL_STRIKE);
+ DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE);
m_uiHurtfulStrike_Timer= 8000;
}
@@ -200,7 +200,7 @@ struct boss_gruulAI : public ScriptedAI
// Reverberation
if (m_uiReverberation_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true);
+ DoCast(me->getVictim(), SPELL_REVERBERATION, true);
m_uiReverberation_Timer = 15000 + rand()%10000;
}
else
@@ -223,13 +223,13 @@ struct boss_gruulAI : public ScriptedAI
// Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
if (m_uiGroundSlamTimer <= uiDiff)
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
m_bPerformingGroundSlam= true;
m_uiGroundSlamTimer = 10000;
- DoCast(m_creature, SPELL_GROUND_SLAM);
+ DoCast(me, SPELL_GROUND_SLAM);
}
else
m_uiGroundSlamTimer -= uiDiff;
diff --git a/src/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp b/src/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp
index 8984c1759d2..01367894c3d 100644
--- a/src/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp
+++ b/src/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp
@@ -65,9 +65,9 @@ EndScriptData */
#define SPELL_SPELLSHIELD 33054
#define SPELL_BLAST_WAVE 33061
-bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature)
+bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* me)
{
- if (!pInstance || !m_creature)
+ if (!pInstance || !me)
return false;
uint64 MaulgarGUID = 0;
@@ -88,11 +88,11 @@ bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature)
OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER);
KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND);
- Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID));
- Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID));
- Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID));
- Olm = (Unit::GetCreature((*m_creature), OlmGUID));
- Krosh = (Unit::GetCreature((*m_creature), KroshGUID));
+ Maulgar = (Unit::GetCreature((*me), MaulgarGUID));
+ Kiggler = (Unit::GetCreature((*me), KigglerGUID));
+ Blindeye = (Unit::GetCreature((*me), BlindeyeGUID));
+ Olm = (Unit::GetCreature((*me), OlmGUID));
+ Krosh = (Unit::GetCreature((*me), KroshGUID));
if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh)
return false;
@@ -133,7 +133,7 @@ struct boss_high_king_maulgarAI : public ScriptedAI
Charging_Timer = 0;
Roar_Timer = 0;
- DoCast(m_creature, SPELL_DUAL_WIELD, false);
+ DoCast(me, SPELL_DUAL_WIELD, false);
Phase2 = false;
@@ -142,7 +142,7 @@ struct boss_high_king_maulgarAI : public ScriptedAI
{
if (Council[i])
{
- pCreature = (Unit::GetCreature((*m_creature), Council[i]));
+ pCreature = (Unit::GetCreature((*me), Council[i]));
if (pCreature && !pCreature->isAlive())
{
pCreature->Respawn();
@@ -158,20 +158,20 @@ struct boss_high_king_maulgarAI : public ScriptedAI
void KilledUnit()
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
- if (CheckAllBossDied(pInstance, m_creature))
+ if (CheckAllBossDied(pInstance, me))
pInstance->SetData(DATA_MAULGAREVENT, DONE);
}
void AddDeath()
{
- DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), m_creature);
+ DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), me);
}
void EnterCombat(Unit *who)
@@ -198,7 +198,7 @@ struct boss_high_king_maulgarAI : public ScriptedAI
GetCouncil();
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
@@ -209,9 +209,9 @@ struct boss_high_king_maulgarAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
if (pTarget)
{
@@ -234,33 +234,33 @@ struct boss_high_king_maulgarAI : public ScriptedAI
//ArcingSmash_Timer
if (ArcingSmash_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ DoCast(me->getVictim(), SPELL_ARCING_SMASH);
ArcingSmash_Timer = 10000;
} else ArcingSmash_Timer -= diff;
//Whirlwind_Timer
if (Whirlwind_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 55000;
} else Whirlwind_Timer -= diff;
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW);
+ DoCast(me->getVictim(), SPELL_MIGHTY_BLOW);
MightyBlow_Timer = 30000+rand()%10000;
} else MightyBlow_Timer -= diff;
//Entering Phase 2
- if (!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ if (!Phase2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50)
{
Phase2 = true;
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoScriptText(SAY_ENRAGE, me);
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ DoCast(me, SPELL_DUAL_WIELD, true);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
if (Phase2)
@@ -281,7 +281,7 @@ struct boss_high_king_maulgarAI : public ScriptedAI
//Intimidating Roar
if (Roar_Timer <= diff)
{
- DoCast(m_creature, SPELL_ROAR);
+ DoCast(me, SPELL_ROAR);
Roar_Timer = 40000+(rand()%10000);
} else Roar_Timer -= diff;
}
@@ -320,13 +320,13 @@ struct boss_olm_the_summonerAI : public ScriptedAI
if (!pWho)
return;
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
- m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f);
+ me->GetMotionMaster()->MoveChase(pWho, 30.0f);
}
}
@@ -344,12 +344,12 @@ struct boss_olm_the_summonerAI : public ScriptedAI
if (pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
if (Maulgar)
CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- if (CheckAllBossDied(pInstance, m_creature))
+ if (CheckAllBossDied(pInstance, me))
pInstance->SetData(DATA_MAULGAREVENT, DONE);
}
}
@@ -357,9 +357,9 @@ struct boss_olm_the_summonerAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
if (pTarget)
{
@@ -381,14 +381,14 @@ struct boss_olm_the_summonerAI : public ScriptedAI
//DarkDecay_Timer
if (DarkDecay_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DARK_DECAY);
+ DoCast(me->getVictim(), SPELL_DARK_DECAY);
DarkDecay_Timer = 20000;
} else DarkDecay_Timer -= diff;
//Summon_Timer
if (Summon_Timer <= diff)
{
- DoCast(m_creature, SPELL_SUMMON_WFH);
+ DoCast(me, SPELL_SUMMON_WFH);
Summon_Timer = 30000;
} else Summon_Timer -= diff;
@@ -447,12 +447,12 @@ struct boss_kiggler_the_crazedAI : public ScriptedAI
if (pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
if (Maulgar)
CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- if (CheckAllBossDied(pInstance, m_creature))
+ if (CheckAllBossDied(pInstance, me))
pInstance->SetData(DATA_MAULGAREVENT, DONE);
}
}
@@ -460,9 +460,9 @@ struct boss_kiggler_the_crazedAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
if (pTarget)
{
@@ -494,21 +494,21 @@ struct boss_kiggler_the_crazedAI : public ScriptedAI
//LightningBolt_Timer
if (LightningBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
LightningBolt_Timer = 15000;
} else LightningBolt_Timer -= diff;
//ArcaneShock_Timer
if (ArcaneShock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK);
+ DoCast(me->getVictim(), SPELL_ARCANE_SHOCK);
ArcaneShock_Timer = 20000;
} else ArcaneShock_Timer -= diff;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
ArcaneExplosion_Timer = 30000;
} else ArcaneExplosion_Timer -= diff;
@@ -555,12 +555,12 @@ struct boss_blindeye_the_seerAI : public ScriptedAI
if (pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
if (Maulgar)
CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- if (CheckAllBossDied(pInstance, m_creature))
+ if (CheckAllBossDied(pInstance, me))
pInstance->SetData(DATA_MAULGAREVENT, DONE);
}
}
@@ -568,9 +568,9 @@ struct boss_blindeye_the_seerAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
if (pTarget)
{
@@ -592,21 +592,21 @@ struct boss_blindeye_the_seerAI : public ScriptedAI
//GreaterPowerWordShield_Timer
if (GreaterPowerWordShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_GREATER_PW_SHIELD);
+ DoCast(me, SPELL_GREATER_PW_SHIELD);
GreaterPowerWordShield_Timer = 40000;
} else GreaterPowerWordShield_Timer -= diff;
//Heal_Timer
if (Heal_Timer <= diff)
{
- DoCast(m_creature, SPELL_HEAL);
+ DoCast(me, SPELL_HEAL);
Heal_Timer = 15000 + rand()%25000;
} else Heal_Timer -= diff;
//PrayerofHealing_Timer
if (PrayerofHealing_Timer <= diff)
{
- DoCast(m_creature, SPELL_PRAYER_OH);
+ DoCast(me, SPELL_PRAYER_OH);
PrayerofHealing_Timer = 35000 + rand()%15000;
} else PrayerofHealing_Timer -= diff;
@@ -653,12 +653,12 @@ struct boss_krosh_firehandAI : public ScriptedAI
if (pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
if (Maulgar)
CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- if (CheckAllBossDied(pInstance, m_creature))
+ if (CheckAllBossDied(pInstance, me))
pInstance->SetData(DATA_MAULGAREVENT, DONE);
}
}
@@ -666,9 +666,9 @@ struct boss_krosh_firehandAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
- if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
if (pTarget)
{
@@ -688,17 +688,17 @@ struct boss_krosh_firehandAI : public ScriptedAI
}
//GreaterFireball_Timer
- if (GreaterFireball_Timer < diff || m_creature->IsWithinDist(m_creature->getVictim(), 30))
+ if (GreaterFireball_Timer < diff || me->IsWithinDist(me->getVictim(), 30))
{
- DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL);
+ DoCast(me->getVictim(), SPELL_GREATER_FIREBALL);
GreaterFireball_Timer = 2000;
} else GreaterFireball_Timer -= diff;
//SpellShield_Timer
if (SpellShield_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_SPELLSHIELD);
SpellShield_Timer = 30000;
} else SpellShield_Timer -= diff;
@@ -706,20 +706,20 @@ struct boss_krosh_firehandAI : public ScriptedAI
if (BlastWave_Timer <= diff)
{
Unit *pTarget;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//15 yard radius minimum
- if (pTarget && pTarget->IsWithinDist(m_creature, 15,false))
+ if (pTarget && pTarget->IsWithinDist(me, 15,false))
target_list.push_back(pTarget);
pTarget = NULL;
}
if (target_list.size())
pTarget = *(target_list.begin()+rand()%target_list.size());
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(pTarget, SPELL_BLAST_WAVE);
BlastWave_Timer = 60000;
} else BlastWave_Timer -= diff;
diff --git a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp
index b7198f26510..b231069dbd1 100644
--- a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp
+++ b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp
@@ -62,7 +62,7 @@ struct boss_broggokAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS);
@@ -75,7 +75,7 @@ struct boss_broggokAI : public ScriptedAI
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());
+ summoned->CastSpell(summoned,SPELL_POISON,false,0,0,me->GetGUID());
}
void UpdateAI(const uint32 diff)
@@ -85,19 +85,19 @@ struct boss_broggokAI : public ScriptedAI
if (AcidSpray_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SLIME_SPRAY);
+ DoCast(me->getVictim(), SPELL_SLIME_SPRAY);
AcidSpray_Timer = 4000+rand()%8000;
} else AcidSpray_Timer -=diff;
if (PoisonBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POISON_BOLT);
+ DoCast(me->getVictim(), SPELL_POISON_BOLT);
PoisonBolt_Timer = 4000+rand()%8000;
} else PoisonBolt_Timer -=diff;
if (PoisonSpawn_Timer <= diff)
{
- DoCast(m_creature, SPELL_POISON_CLOUD);
+ DoCast(me, SPELL_POISON_CLOUD);
PoisonSpawn_Timer = 20000;
} else PoisonSpawn_Timer -=diff;
diff --git a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
index 40ca316e2fd..8fbabc21ddb 100644
--- a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
+++ b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
@@ -100,9 +100,9 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_WAKE, m_creature);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ DoScriptText(SAY_WAKE, me);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
DoStartMovement(who);
if (pInstance)
pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS);
@@ -113,7 +113,7 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void ChannelerEngaged(Unit* who)
@@ -121,11 +121,11 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
if (who && !addYell)
{
addYell = true;
- DoScriptText(RAND(SAY_ADD_AGGRO_1,SAY_ADD_AGGRO_2,SAY_ADD_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_ADD_AGGRO_1,SAY_ADD_AGGRO_2,SAY_ADD_AGGRO_3), me);
}
for (uint8 i=0; i<5; ++i)
{
- Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
+ Creature *channeler = Unit::GetCreature(*me, Channelers[i]);
if (who && channeler && !channeler->isInCombat())
channeler->AI()->AttackStart(who);
}
@@ -135,13 +135,13 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
{
for (uint8 i=0; i<5; ++i)
{
- Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
+ Creature *channeler = Unit::GetCreature(*me, Channelers[i]);
if (channeler && channeler->isAlive())
return;
}
if (killer)
- m_creature->AI()->AttackStart(killer);
+ me->AI()->AttackStart(killer);
}
uint64 GetChanneled(Creature *channeler1)
@@ -151,7 +151,7 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
uint8 i;
for (i=0; i<5; ++i)
{
- Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
+ Creature *channeler = Unit::GetCreature(*me, Channelers[i]);
if (channeler && channeler->GetGUID() == channeler1->GetGUID())
break;
}
@@ -162,9 +162,9 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
{
for (uint8 i=0; i<5; ++i)
{
- Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
+ Creature *channeler = Unit::GetCreature(*me, Channelers[i]);
if (!channeler || channeler->isDead())
- channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
+ channeler = me->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
if (channeler)
Channelers[i] = channeler->GetGUID();
else
@@ -174,7 +174,7 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DIE, m_creature);
+ DoScriptText(SAY_DIE, me);
if (!pInstance)
return;
@@ -190,8 +190,8 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
{
if (check_Timer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
- DoCast(m_creature, SPELL_EVOCATION);
+ if (!me->IsNonMeleeSpellCasted(false))
+ DoCast(me, SPELL_EVOCATION);
check_Timer = 5000;
} else check_Timer -= diff;
return;
@@ -201,7 +201,7 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
{
if (Firenova_Timer <= diff)
{
- DoCast(m_creature, SPELL_FIRE_NOVA, true);
+ DoCast(me, SPELL_FIRE_NOVA, true);
Firenova = false;
ShadowVolley_Timer = 2000;
} else Firenova_Timer -=diff;
@@ -211,22 +211,22 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
if (ShadowVolley_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY);
+ DoCast(me, SPELL_SHADOW_BOLT_VOLLEY);
ShadowVolley_Timer = 5000+rand()%8000;
} else ShadowVolley_Timer -=diff;
if (Corruption_Timer <= diff)
{
- DoCast(m_creature, SPELL_CORRUPTION);
+ DoCast(me, SPELL_CORRUPTION);
Corruption_Timer = 30000+rand()%20000;
} else Corruption_Timer -=diff;
if (BurningNova_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoScriptText(SAY_NOVA, m_creature);
+ DoScriptText(SAY_NOVA, me);
if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA))
{
@@ -235,7 +235,7 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
}
if (IsHeroic())
- DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
+ DoTeleportAll(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
BurningNova_Timer = 20000+rand()%8000;
Firenova_Timer= 5000;
@@ -280,16 +280,16 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
ShadowBolt_Timer = 1000+rand()%1000;
MarkOfShadow_Timer = 5000+rand()%2000;
check_Timer = 0;
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
}
void EnterCombat(Unit* who)
{
if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
DoStartMovement(who);
}
@@ -305,11 +305,11 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
{
if (check_Timer <= diff)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
{
- uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature);
- if (Unit *channeled = Unit::GetUnit(*m_creature, channeler))
+ uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
+ if (Unit *channeled = Unit::GetUnit(*me, channeler))
DoCast(channeled, SPELL_CHANNELING);
}
check_Timer = 5000;
@@ -326,7 +326,7 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
if (ShadowBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
+ DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
ShadowBolt_Timer = 5000+rand()%1000;
} else ShadowBolt_Timer -=diff;
diff --git a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp
index 9f204d63e9d..4defbe3182e 100644
--- a/src/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp
+++ b/src/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp
@@ -69,7 +69,7 @@ struct boss_the_makerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
if (!pInstance)
return;
@@ -80,12 +80,12 @@ struct boss_the_makerAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DIE, m_creature);
+ DoScriptText(SAY_DIE, me);
if (!pInstance)
return;
@@ -103,7 +103,7 @@ struct boss_the_makerAI : public ScriptedAI
if (AcidSpray_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ACID_SPRAY);
+ DoCast(me->getVictim(), SPELL_ACID_SPRAY);
AcidSpray_Timer = 15000+rand()%8000;
} else AcidSpray_Timer -=diff;
@@ -128,7 +128,7 @@ struct boss_the_makerAI : public ScriptedAI
if (Knockdown_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 4000+rand()%8000;
} else Knockdown_Timer -=diff;
diff --git a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
index 03e5757b918..770f8859604 100644
--- a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
+++ b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
@@ -60,7 +60,7 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
void Reset()
{
- DoScriptText(SAY_WIPE, m_creature);
+ DoScriptText(SAY_WIPE, me);
OrbitalStrike_Timer = 25000;
ShadowWhip_Timer = 2000;
@@ -75,7 +75,7 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void KilledUnit(Unit* victim)
@@ -83,12 +83,12 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(SAY_KILL_1, m_creature);
+ DoScriptText(SAY_KILL_1, me);
}
void JustSummoned(Creature* summoned)
{
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0))
summoned->AI()->AttackStart(random);
@@ -98,7 +98,7 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DIE, m_creature);
+ DoScriptText(SAY_DIE, me);
}
void UpdateAI(const uint32 diff)
@@ -111,8 +111,8 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
{
if (Summon_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_SUMMON_FIENDISH_HOUND);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_SUMMON_FIENDISH_HOUND);
Summon_Timer = 15000+rand()%15000;
} else Summon_Timer -= diff;
}
@@ -126,7 +126,7 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
//if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoCast(temp, SPELL_SHADOW_WHIP);
}
}
@@ -138,8 +138,8 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
else if (OrbitalStrike_Timer <= diff)
{
Unit* temp = NULL;
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
- temp = m_creature->getVictim();
+ if (me->IsWithinMeleeRange(me->getVictim()))
+ temp = me->getVictim();
else temp = SelectUnit(SELECT_TARGET_RANDOM,0);
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
@@ -153,18 +153,18 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
}
} else OrbitalStrike_Timer -= diff;
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 20)
{
if (DemonicShield_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEMONIC_SHIELD);
+ DoCast(me, SPELL_DEMONIC_SHIELD);
DemonicShield_Timer = 15000;
} else DemonicShield_Timer -= diff;
}
if (Aura_Timer <= diff)
{
- DoScriptText(SAY_CURSE, m_creature);
+ DoScriptText(SAY_CURSE, me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
@@ -178,7 +178,7 @@ struct boss_omor_the_unscarredAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
if (pTarget)
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
DoCast(pTarget, SPELL_SHADOW_BOLT);
Shadowbolt_Timer = 4000+rand()%2500;
diff --git a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp
index c65e5ad838b..4ad5ff31d8f 100644
--- a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp
+++ b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp
@@ -89,8 +89,8 @@ struct boss_nazanAI : public ScriptedAI
{
if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE)
{
- summoned->SetLevel(m_creature->getLevel());
- summoned->setFaction(m_creature->getFaction());
+ summoned->SetLevel(me->getLevel());
+ summoned->setFaction(me->getFaction());
summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true);
summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true);
}
@@ -99,15 +99,15 @@ struct boss_nazanAI : public ScriptedAI
void SpellHitTarget(Unit *pTarget, const SpellEntry* entry)
{
if (pTarget && entry->Id == SPELL_FIREBALL)
- m_creature->SummonCreature(ENTRY_LIQUID_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),pTarget->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000);
+ me->SummonCreature(ENTRY_LIQUID_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),pTarget->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
{
- if (UnsummonCheck < diff && m_creature->isAlive())
- m_creature->DisappearAndDie();
+ if (UnsummonCheck < diff && me->isAlive())
+ me->DisappearAndDie();
else
UnsummonCheck -= diff;
return;
@@ -122,27 +122,27 @@ struct boss_nazanAI : public ScriptedAI
if (flight) // phase 1 - the flight
{
- Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID);
+ Creature *Vazruden = Unit::GetCreature(*me,VazrudenGUID);
if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth())))
{
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->Clear();
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->Clear();
if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0))
- m_creature->AI()->AttackStart(victim);
- DoStartMovement(m_creature->getVictim());
- DoScriptText(EMOTE, m_creature);
+ me->AI()->AttackStart(victim);
+ DoStartMovement(me->getVictim());
+ DoScriptText(EMOTE, me);
return;
} else Fly_Timer -= diff;
if (Turn_Timer <= diff)
{
uint32 waypoint = (Fly_Timer/10000)%2;
- if (m_creature->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5))
- m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]);
+ if (me->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5))
+ me->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]);
Turn_Timer = 10000;
} else Turn_Timer -= diff;
}
@@ -150,7 +150,7 @@ struct boss_nazanAI : public ScriptedAI
{
if (ConeOfFire_Timer <= diff)
{
- DoCast(m_creature, SPELL_CONE_OF_FIRE);
+ DoCast(me, SPELL_CONE_OF_FIRE);
ConeOfFire_Timer = 12000;
Fireball_Timer = 4000;
} else ConeOfFire_Timer -= diff;
@@ -158,7 +158,7 @@ struct boss_nazanAI : public ScriptedAI
if (IsHeroic())
if (BellowingRoar_Timer <= diff)
{
- DoCast(m_creature, SPELL_BELLOWING_ROAR);
+ DoCast(me, SPELL_BELLOWING_ROAR);
BellowingRoar_Timer = 45000;
} else BellowingRoar_Timer -= diff;
@@ -186,40 +186,40 @@ struct boss_vazrudenAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void KilledUnit(Unit* who)
{
if (who && who->GetEntry() != ENTRY_VAZRUDEN)
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void JustDied(Unit* who)
{
- if (who && who != m_creature)
- DoScriptText(SAY_DIE, m_creature);
+ if (who && who != me)
+ DoScriptText(SAY_DIE, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
{
- if (UnsummonCheck < diff && m_creature->isAlive())
+ if (UnsummonCheck < diff && me->isAlive())
{
if (!WipeSaid)
{
- DoScriptText(SAY_WIPE, m_creature);
+ DoScriptText(SAY_WIPE, me);
WipeSaid = true;
}
- m_creature->DisappearAndDie();
+ me->DisappearAndDie();
} else UnsummonCheck -= diff;
return;
}
if (Revenge_Timer <= diff)
{
- if (Unit *victim = m_creature->getVictim())
+ if (Unit *victim = me->getVictim())
DoCast(victim, SPELL_REVENGE);
Revenge_Timer = 5000;
} else Revenge_Timer -= diff;
@@ -252,15 +252,15 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
waypoint = 0;
check = 0;
UnsummonAdds();
- m_creature->GetMotionMaster()->MovePath(PATH_ENTRY, true);
+ me->GetMotionMaster()->MovePath(PATH_ENTRY, true);
}
void UnsummonAdds()
{
if (summoned)
{
- Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
- Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
+ Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
+ Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000)))
{
Nazan->DisappearAndDie();
@@ -272,8 +272,8 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
VazrudenGUID = 0;
}
summoned = false;
- m_creature->clearUnitState(UNIT_STAT_ROOT);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->clearUnitState(UNIT_STAT_ROOT);
+ me->SetVisibility(VISIBILITY_ON);
}
}
@@ -281,13 +281,13 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
{
if (!summoned)
{
- if (Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000))
+ if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000))
VazrudenGUID = Vazruden->GetGUID();
- if (Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000))
+ if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000))
NazanGUID = Nazan->GetGUID();
summoned = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->addUnitState(UNIT_STAT_ROOT);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->addUnitState(UNIT_STAT_ROOT);
}
}
@@ -297,14 +297,14 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
{
phase = 1;
check = 0;
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
}
}
void JustSummoned(Creature *summoned)
{
if (!summoned) return;
- Unit *victim = m_creature->getVictim();
+ Unit *victim = me->getVictim();
if (summoned->GetEntry() == ENTRY_NAZAN)
{
CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID;
@@ -338,10 +338,10 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
case 1: // go to the middle and begin the fight
if (check <= diff)
{
- if (!m_creature->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5))
+ if (!me->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5))
{
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]);
check = 1000;
}
else
@@ -355,8 +355,8 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
default: // adds do the job now
if (check <= diff)
{
- Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
- Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
+ Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
+ Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive())
{
if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim())
@@ -370,9 +370,9 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
}
else
{
- m_creature->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0);
- m_creature->SetLootRecipient(NULL); // don't think this is necessary..
- m_creature->Kill(m_creature);
+ me->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0);
+ me->SetLootRecipient(NULL); // don't think this is necessary..
+ me->Kill(me);
}
check = 2000;
} else check -= diff;
@@ -407,7 +407,7 @@ struct mob_hellfire_sentryAI : public ScriptedAI
if (KidneyShot_Timer <= diff)
{
- if (Unit *victim = m_creature->getVictim())
+ if (Unit *victim = me->getVictim())
DoCast(victim, SPELL_KIDNEY_SHOT);
KidneyShot_Timer = 20000;
} else KidneyShot_Timer -= diff;
diff --git a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
index 8d7b607a709..5afe596d907 100644
--- a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
+++ b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
@@ -63,25 +63,25 @@ struct boss_watchkeeper_gargolmarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void MoveInLineOfSight(Unit* who)
{
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
- else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
+ else if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f))
{
- DoScriptText(SAY_TAUNT, m_creature);
+ DoScriptText(SAY_TAUNT, me);
HasTaunted = true;
}
}
@@ -89,12 +89,12 @@ struct boss_watchkeeper_gargolmarAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DIE, m_creature);
+ DoScriptText(SAY_DIE, me);
}
void UpdateAI(const uint32 diff)
@@ -104,13 +104,13 @@ struct boss_watchkeeper_gargolmarAI : public ScriptedAI
if (MortalWound_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MORTAL_WOUND);
+ DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
MortalWound_Timer = 5000+rand()%8000;
} else MortalWound_Timer -= diff;
if (Surge_Timer <= diff)
{
- DoScriptText(SAY_SURGE, m_creature);
+ DoScriptText(SAY_SURGE, me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_SURGE);
@@ -118,20 +118,20 @@ struct boss_watchkeeper_gargolmarAI : public ScriptedAI
Surge_Timer = 5000+rand()%8000;
} else Surge_Timer -= diff;
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 20)
{
if (Retaliation_Timer <= diff)
{
- DoCast(m_creature, SPELL_RETALIATION);
+ DoCast(me, SPELL_RETALIATION);
Retaliation_Timer = 30000;
} else Retaliation_Timer -= diff;
}
if (!YelledForHeal)
{
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 40)
{
- DoScriptText(SAY_HEAL, m_creature);
+ DoScriptText(SAY_HEAL, me);
YelledForHeal = true;
}
}
diff --git a/src/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
index 1cc620d9926..bd8cfc69e5a 100644
--- a/src/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
+++ b/src/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
@@ -109,8 +109,8 @@ struct mob_abyssalAI : public ScriptedAI
{
if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET)
{
- DoCast(m_creature, SPELL_BLAZE_TRAP, true);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ DoCast(me, SPELL_BLAZE_TRAP, true);
+ me->SetVisibility(VISIBILITY_OFF);
Despawn_Timer = 130000;
}
}
@@ -118,11 +118,11 @@ struct mob_abyssalAI : public ScriptedAI
void SetTrigger(uint32 _trigger)
{
trigger = _trigger;
- m_creature->SetDisplayId(11686);
+ me->SetDisplayId(11686);
if (trigger == 1) //debris
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_DEBRIS_VISUAL, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_DEBRIS_VISUAL, true);
FireBlast_Timer = 5000;
Despawn_Timer = 10000;
}
@@ -140,7 +140,7 @@ struct mob_abyssalAI : public ScriptedAI
{
if (FireBlast_Timer <= diff)
{
- DoCast(m_creature, SPELL_DEBRIS_DAMAGE, true);
+ DoCast(me, SPELL_DEBRIS_DAMAGE, true);
trigger = 3;
} else FireBlast_Timer -= diff;
}
@@ -149,7 +149,7 @@ struct mob_abyssalAI : public ScriptedAI
if (Despawn_Timer <= diff)
{
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
} else Despawn_Timer -= diff;
if (!UpdateVictim())
@@ -157,7 +157,7 @@ struct mob_abyssalAI : public ScriptedAI
if (FireBlast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST);
+ DoCast(me->getVictim(), SPELL_FIRE_BLAST);
FireBlast_Timer = 5000+rand()%10000;
} else FireBlast_Timer -= diff;
@@ -170,8 +170,8 @@ struct boss_magtheridonAI : public ScriptedAI
boss_magtheridonAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
// target 7, random target with certain entry spell, need core fix
SpellEntry *TempSpell;
@@ -216,11 +216,11 @@ struct boss_magtheridonAI : public ScriptedAI
Phase3 = false;
NeedCheckCube = false;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- DoCast(m_creature, SPELL_SHADOW_CAGE_C, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->addUnitState(UNIT_STAT_STUNNED);
+ DoCast(me, SPELL_SHADOW_CAGE_C, true);
}
void JustReachedHome()
@@ -236,7 +236,7 @@ struct boss_magtheridonAI : public ScriptedAI
{
// to avoid multiclicks from 1 cube
if (uint64 guid = Cube[cubeGUID])
- DebuffClicker(Unit::GetUnit(*m_creature, guid));
+ DebuffClicker(Unit::GetUnit(*me, guid));
Cube[cubeGUID] = clickerGUID;
NeedCheckCube = true;
}
@@ -259,7 +259,7 @@ struct boss_magtheridonAI : public ScriptedAI
// if not - apply mind exhaustion and delete from clicker's list
for (CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i)
{
- Unit *clicker = Unit::GetUnit(*m_creature, (*i).second);
+ Unit *clicker = Unit::GetUnit(*me, (*i).second);
if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP))
{
DebuffClicker(clicker);
@@ -268,20 +268,20 @@ struct boss_magtheridonAI : public ScriptedAI
}
// if 5 clickers from other cubes apply shadow cage
- if (ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE))
+ if (ClickerNum >= CLICKERS_COUNT && !me->HasAura(SPELL_SHADOW_CAGE))
{
- DoScriptText(SAY_BANISH, m_creature);
- DoCast(m_creature, SPELL_SHADOW_CAGE, true);
+ DoScriptText(SAY_BANISH, me);
+ DoCast(me, SPELL_SHADOW_CAGE, true);
}
- else if (ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE))
- m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
+ else if (ClickerNum < CLICKERS_COUNT && me->HasAura(SPELL_SHADOW_CAGE))
+ me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
if (!ClickerNum) NeedCheckCube = false;
}
void KilledUnit(Unit* victim)
{
- DoScriptText(SAY_PLAYER_KILLED, m_creature);
+ DoScriptText(SAY_PLAYER_KILLED, me);
}
void JustDied(Unit* Killer)
@@ -289,14 +289,14 @@ struct boss_magtheridonAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void MoveInLineOfSight(Unit* who) {}
void AttackStart(Unit *who)
{
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED))
ScriptedAI::AttackStart(who);
}
@@ -306,19 +306,19 @@ struct boss_magtheridonAI : public ScriptedAI
pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS);
DoZoneInCombat();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C);
- DoScriptText(SAY_FREED, m_creature);
+ DoScriptText(SAY_FREED, me);
}
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat())
+ if (!me->isInCombat())
{
if (RandChat_Timer <= diff)
{
- DoScriptText(RandomTaunt[rand()%6].id, m_creature);
+ DoScriptText(RandomTaunt[rand()%6].id, me);
RandChat_Timer = 90000;
} else RandChat_Timer -= diff;
}
@@ -330,24 +330,24 @@ struct boss_magtheridonAI : public ScriptedAI
if (Berserk_Timer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK, true);
- DoScriptText(EMOTE_BERSERK, m_creature);
+ DoCast(me, SPELL_BERSERK, true);
+ DoScriptText(EMOTE_BERSERK, me);
Berserk_Timer = 60000;
} else Berserk_Timer -= diff;
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 10000;
} else Cleave_Timer -= diff;
if (BlastNova_Timer <= diff)
{
// to avoid earthquake interruption
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED))
{
- DoScriptText(EMOTE_BLASTNOVA, m_creature);
- DoCast(m_creature, SPELL_BLASTNOVA);
+ DoScriptText(EMOTE_BLASTNOVA, me);
+ DoCast(me, SPELL_BLASTNOVA);
BlastNova_Timer = 60000;
}
} else BlastNova_Timer -= diff;
@@ -355,9 +355,9 @@ struct boss_magtheridonAI : public ScriptedAI
if (Quake_Timer <= diff)
{
// to avoid blastnova interruption
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
- DoCast(m_creature, SPELL_QUAKE_TRIGGER, true);
+ DoCast(me, SPELL_QUAKE_TRIGGER, true);
Quake_Timer = 50000;
}
} else Quake_Timer -= diff;
@@ -368,7 +368,7 @@ struct boss_magtheridonAI : public ScriptedAI
{
float x, y, z;
pTarget->GetPosition(x, y, z);
- Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (summon)
{
CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2);
@@ -379,14 +379,14 @@ struct boss_magtheridonAI : public ScriptedAI
Blaze_Timer = 20000 + rand()%20000;
} else Blaze_Timer -= diff;
- if (!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3
- && !m_creature->IsNonMeleeSpellCasted(false) // blast nova
- && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
+ if (!Phase3 && me->GetHealth()*10 < me->GetMaxHealth()*3
+ && !me->IsNonMeleeSpellCasted(false) // blast nova
+ && !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
{
Phase3 = true;
- DoScriptText(SAY_CHAMBER_DESTROY, m_creature);
- DoCast(m_creature, SPELL_CAMERA_SHAKE, true);
- DoCast(m_creature, SPELL_DEBRIS_KNOCKDOWN, true);
+ DoScriptText(SAY_CHAMBER_DESTROY, me);
+ DoCast(me, SPELL_CAMERA_SHAKE, true);
+ DoCast(me, SPELL_DEBRIS_KNOCKDOWN, true);
if (pInstance)
pInstance->SetData(DATA_COLLAPSE, true);
@@ -400,7 +400,7 @@ struct boss_magtheridonAI : public ScriptedAI
{
float x, y, z;
pTarget->GetPosition(x, y, z);
- Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1);
}
Debris_Timer = 10000;
@@ -415,7 +415,7 @@ struct mob_hellfire_channelerAI : public ScriptedAI
{
mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c)
{
- pInstance =m_creature->GetInstanceData();
+ pInstance =me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -442,7 +442,7 @@ struct mob_hellfire_channelerAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS);
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
DoZoneInCombat();
}
@@ -451,18 +451,18 @@ struct mob_hellfire_channelerAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED);
- DoCast(m_creature, SPELL_SHADOW_GRASP_C, false);
+ DoCast(me, SPELL_SHADOW_GRASP_C, false);
}
void JustSummoned(Creature *summon)
{
- summon->AI()->AttackStart(m_creature->getVictim());
+ summon->AI()->AttackStart(me->getVictim());
}
void DamageTaken(Unit*, uint32 &damage)
{
- if (damage >= m_creature->GetHealth())
- DoCast(m_creature, SPELL_SOUL_TRANSFER, true);
+ if (damage >= me->GetHealth())
+ DoCast(me, SPELL_SOUL_TRANSFER, true);
}
void JustDied(Unit* who)
@@ -478,14 +478,14 @@ struct mob_hellfire_channelerAI : public ScriptedAI
if (ShadowBoltVolley_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY);
+ DoCast(me, SPELL_SHADOW_BOLT_VOLLEY);
ShadowBoltVolley_Timer = 10000 + rand()%10000;
} else ShadowBoltVolley_Timer -= diff;
if (DarkMending_Timer <= diff)
{
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- DoCast(m_creature, SPELL_DARK_MENDING);
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
+ DoCast(me, SPELL_DARK_MENDING);
DarkMending_Timer = 10000 +(rand() % 10000);
} else DarkMending_Timer -= diff;
diff --git a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
index 3b41da6bfd9..0c8466b3686 100644
--- a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
+++ b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
@@ -99,7 +99,7 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
IsIntroEvent = false;
IntroOnce = false;
@@ -122,7 +122,7 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
if (PeonEngagedCount >= 4)
return;
- DoScriptText(PeonAttacked[PeonEngagedCount].id, m_creature);
+ DoScriptText(PeonAttacked[PeonEngagedCount].id, me);
++PeonEngagedCount;
}
@@ -131,27 +131,27 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
if (PeonKilledCount >= 4)
return;
- DoScriptText(PeonDies[PeonKilledCount].id, m_creature);
+ DoScriptText(PeonDies[PeonKilledCount].id, me);
++PeonKilledCount;
if (PeonKilledCount == 4)
{
IsIntroEvent = false;
IsMainEvent = true;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
void DoTauntPeons()
{
- DoScriptText(RAND(SAY_TAUNT_1,SAY_TAUNT_2,SAY_TAUNT_3), m_creature);
+ DoScriptText(RAND(SAY_TAUNT_1,SAY_TAUNT_2,SAY_TAUNT_3), me);
//TODO: kill the peons first
IsIntroEvent = false;
PeonEngagedCount = 4;
PeonKilledCount = 4;
IsMainEvent = true;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void AttackStart(Unit* who)
@@ -159,7 +159,7 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
if (IsIntroEvent || !IsMainEvent)
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
if (Phase)
DoStartNoMovement(who);
@@ -170,12 +170,12 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f))
+ if (!IntroOnce && me->IsWithinDistInMap(who, 50.0f))
{
if (who->GetTypeId() != TYPEID_PLAYER)
return;
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
IntroOnce = true;
IsIntroEvent = true;
@@ -191,7 +191,7 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
void JustSummoned(Creature *summoned)
@@ -202,17 +202,17 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
//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());
+ summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,me->GetGUID());
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DIE, m_creature);
+ DoScriptText(SAY_DIE, me);
if (!pInstance)
return;
@@ -247,13 +247,13 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
{
if (!SpinOnce)
{
- DoCast(m_creature->getVictim(), SPELL_DARK_SPIN);
+ DoCast(me->getVictim(), SPELL_DARK_SPIN);
SpinOnce = true;
}
if (Cleave_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHADOW_CLEAVE);
+ DoCast(me->getVictim(), SPELL_SHADOW_CLEAVE);
Cleave_Timer = 6000+rand()%2500;
} else Cleave_Timer -= diff;
}
@@ -273,7 +273,7 @@ struct boss_grand_warlock_nethekurseAI : public ScriptedAI
DeathCoil_Timer = urand(15000,20000);
} else DeathCoil_Timer -= diff;
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
Phase = true;
DoMeleeAttackIfReady();
@@ -293,7 +293,7 @@ struct mob_fel_orc_convertAI : public ScriptedAI
void Reset()
{
- m_creature->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!)
+ me->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!)
Hemorrhage_Timer = 3000;
}
@@ -307,8 +307,8 @@ struct mob_fel_orc_convertAI : public ScriptedAI
{
if (pInstance->GetData64(DATA_NETHEKURSE))
{
- Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
- if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f))
+ Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE));
+ if (pKurse && me->IsWithinDist(pKurse, 45.0f))
{
CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro();
@@ -328,7 +328,7 @@ struct mob_fel_orc_convertAI : public ScriptedAI
if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS)
return;
if (pInstance->GetData64(DATA_NETHEKURSE))
- if (Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)))
+ if (Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE)))
CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath();
}
}
@@ -340,7 +340,7 @@ struct mob_fel_orc_convertAI : public ScriptedAI
if (Hemorrhage_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
+ DoCast(me->getVictim(), SPELL_HEMORRHAGE);
Hemorrhage_Timer = 15000;
} else Hemorrhage_Timer -= diff;
diff --git a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
index 7417a9b46f6..f8409912717 100644
--- a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
+++ b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
@@ -124,9 +124,9 @@ struct mob_omrogg_headsAI : public ScriptedAI
if (Death_Timer <= diff)
{
- DoScriptText(YELL_DIE_R, m_creature);
+ DoScriptText(YELL_DIE_R, me);
Death_Timer = false;
- m_creature->setDeathState(JUST_DIED);
+ me->setDeathState(JUST_DIED);
} else Death_Timer -= diff;
}
};
@@ -163,13 +163,13 @@ struct boss_warbringer_omroggAI : public ScriptedAI
void Reset()
{
- if (Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID))
+ if (Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID))
{
pLeftHead->setDeathState(JUST_DIED);
LeftHeadGUID = 0;
}
- if (Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID))
+ if (Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID))
{
pRightHead->setDeathState(JUST_DIED);
RightHeadGUID = 0;
@@ -194,8 +194,8 @@ struct boss_warbringer_omroggAI : public ScriptedAI
void DoYellForThreat()
{
- Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID);
- Unit *pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID);
+ Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID);
+ Unit *pRightHead = Unit::GetUnit(*me,RightHeadGUID);
if (!pLeftHead || !pRightHead)
return;
@@ -212,10 +212,10 @@ struct boss_warbringer_omroggAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
- m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
- if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID))
+ if (Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID))
{
iaggro = rand()%3;
@@ -244,8 +244,8 @@ struct boss_warbringer_omroggAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
- Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID);
- Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID);
+ Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID);
+ Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID);
if (!pLeftHead || !pRightHead)
return;
@@ -270,8 +270,8 @@ struct boss_warbringer_omroggAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID);
- Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID);
+ Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID);
+ Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID);
if (!pLeftHead || !pRightHead)
return;
@@ -290,8 +290,8 @@ struct boss_warbringer_omroggAI : public ScriptedAI
{
Delay_Timer = 3500;
- Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID);
- Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID);
+ Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID);
+ Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID);
if (!pLeftHead || !pRightHead)
return;
@@ -333,7 +333,7 @@ struct boss_warbringer_omroggAI : public ScriptedAI
if (BlastCount && BlastWave_Timer <= diff)
{
- DoCast(m_creature, SPELL_BLAST_WAVE);
+ DoCast(me, SPELL_BLAST_WAVE);
BlastWave_Timer = 5000;
++BlastCount;
@@ -343,8 +343,8 @@ struct boss_warbringer_omroggAI : public ScriptedAI
if (BurningMaul_Timer <= diff)
{
- DoScriptText(EMOTE_ENRAGE, m_creature);
- DoCast(m_creature, SPELL_BURNING_MAUL);
+ DoScriptText(EMOTE_ENRAGE, me);
+ DoCast(me, SPELL_BURNING_MAUL);
BurningMaul_Timer = 40000;
BlastWave_Timer = 16000;
BlastCount = 1;
@@ -356,20 +356,20 @@ struct boss_warbringer_omroggAI : public ScriptedAI
{
DoYellForThreat();
DoResetThreat();
- m_creature->AddThreat(pTarget, 0.0f);
+ me->AddThreat(pTarget, 0.0f);
}
ResetThreat_Timer = 25000+rand()%15000;
} else ResetThreat_Timer -= diff;
if (Fear_Timer <= diff)
{
- DoCast(m_creature, SPELL_FEAR);
+ DoCast(me, SPELL_FEAR);
Fear_Timer = 15000+rand()%20000;
} else Fear_Timer -= diff;
if (ThunderClap_Timer <= diff)
{
- DoCast(m_creature, SPELL_THUNDERCLAP);
+ DoCast(me, SPELL_THUNDERCLAP);
ThunderClap_Timer = 15000+rand()%15000;
} else ThunderClap_Timer -= diff;
diff --git a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
index 0b1b3ab8428..1626e2450cd 100644
--- a/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
+++ b/src/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
@@ -74,8 +74,8 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
{
removeAdds();
- m_creature->SetSpeed(MOVE_RUN,2);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->SetSpeed(MOVE_RUN,2);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
summoned = 2;
InBlade = false;
@@ -90,7 +90,7 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
}
void JustSummoned(Creature *summoned)
@@ -113,13 +113,13 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
removeAdds();
}
@@ -136,7 +136,7 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
if (target_num > 0) // to prevent loops
{
Wait_Timer = 1;
- DoCast(m_creature, SPELL_BLADE_DANCE, true);
+ DoCast(me, SPELL_BLADE_DANCE, true);
target_num--;
}
}
@@ -146,11 +146,11 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
{
for (std::vector<uint64>::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr)
{
- Unit* temp = Unit::GetUnit((*m_creature),*itr);
+ Unit* temp = Unit::GetUnit((*me),*itr);
if (temp && temp->isAlive())
{
(*temp).GetMotionMaster()->Clear(true);
- m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
CAST_CRE(temp)->RemoveCorpse();
}
}
@@ -158,11 +158,11 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
for (std::vector<uint64>::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr)
{
- Unit* temp = Unit::GetUnit((*m_creature),*itr);
+ Unit* temp = Unit::GetUnit((*me),*itr);
if (temp && temp->isAlive())
{
(*temp).GetMotionMaster()->Clear(true);
- m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
CAST_CRE(temp)->RemoveCorpse();
}
}
@@ -170,10 +170,10 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
}
void SpawnAssassin()
{
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
}
void UpdateAI(const uint32 diff)
@@ -198,8 +198,8 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
{
// stop bladedance
InBlade = false;
- m_creature->SetSpeed(MOVE_RUN,2);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->SetSpeed(MOVE_RUN,2);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
Blade_Dance_Timer = 30000;
Wait_Timer = 0;
if (IsHeroic())
@@ -213,7 +213,7 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
randy = (rand()%40);
x = 210+ randx ;
y = -60- randy ;
- m_creature->GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(1,x,y,me->GetPositionZ());
Wait_Timer = 0;
}
} else Wait_Timer -= diff;
@@ -227,7 +227,7 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
Wait_Timer = 1;
InBlade = true;
Blade_Dance_Timer = 0;
- m_creature->SetSpeed(MOVE_RUN,4);
+ me->SetSpeed(MOVE_RUN,4);
return;
} else Blade_Dance_Timer -= diff;
@@ -246,9 +246,9 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
{
switch (urand(0,2))
{
- 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;
+ case 0: me->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
+ case 1: me->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
+ case 2: me->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
}
}
if (urand(0,9) < 2)
@@ -262,8 +262,8 @@ struct boss_warchief_kargath_bladefistAI : public ScriptedAI
if (resetcheck_timer <= diff)
{
uint32 tempx,tempy;
- tempx = uint32(m_creature->GetPositionX());
- tempy = uint32(m_creature->GetPositionY());
+ tempx = uint32(me->GetPositionX());
+ tempy = uint32(me->GetPositionY());
if (tempx > 255 || tempx < 205)
{
EnterEvadeMode();
diff --git a/src/scripts/outland/hellfire_peninsula.cpp b/src/scripts/outland/hellfire_peninsula.cpp
index cc7e0f675f7..6d1d9894074 100644
--- a/src/scripts/outland/hellfire_peninsula.cpp
+++ b/src/scripts/outland/hellfire_peninsula.cpp
@@ -66,10 +66,10 @@ struct npc_aeranasAI : public ScriptedAI
EnvelopingWinds_Timer = 9000;
Shock_Timer = 5000;
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- m_creature->setFaction(FACTION_FRIENDLY);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->setFaction(FACTION_FRIENDLY);
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
}
void UpdateAI(const uint32 diff)
@@ -78,7 +78,7 @@ struct npc_aeranasAI : public ScriptedAI
{
if (Faction_Timer <= diff)
{
- m_creature->setFaction(FACTION_HOSTILE);
+ me->setFaction(FACTION_HOSTILE);
Faction_Timer = 0;
} else Faction_Timer -= diff;
}
@@ -86,26 +86,26 @@ struct npc_aeranasAI : public ScriptedAI
if (!UpdateVictim())
return;
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
{
- m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- DoScriptText(SAY_FREE, m_creature);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ DoScriptText(SAY_FREE, me);
return;
}
if (Shock_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SHOCK);
+ DoCast(me->getVictim(), SPELL_SHOCK);
Shock_Timer = 10000;
} else Shock_Timer -= diff;
if (EnvelopingWinds_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ENVELOPING_WINDS);
+ DoCast(me->getVictim(), SPELL_ENVELOPING_WINDS);
EnvelopingWinds_Timer = 25000;
} else EnvelopingWinds_Timer -= diff;
@@ -151,12 +151,12 @@ struct npc_ancestral_wolfAI : public npc_escortAI
void Reset()
{
pRyga = NULL;
- DoCast(m_creature, SPELL_ANCESTRAL_WOLF_BUFF, true);
+ DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
}
void MoveInLineOfSight(Unit* pWho)
{
- if (!pRyga && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_RYGA && m_creature->IsWithinDistInMap(pWho, 15.0f))
+ if (!pRyga && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(pWho, 15.0f))
pRyga = pWho;
npc_escortAI::MoveInLineOfSight(pWho);
@@ -167,10 +167,10 @@ struct npc_ancestral_wolfAI : public npc_escortAI
switch(uiPointId)
{
case 0:
- DoScriptText(EMOTE_WOLF_LIFT_HEAD, m_creature);
+ DoScriptText(EMOTE_WOLF_LIFT_HEAD, me);
break;
case 2:
- DoScriptText(EMOTE_WOLF_HOWL, m_creature);
+ DoScriptText(EMOTE_WOLF_HOWL, me);
break;
case 50:
if (pRyga && pRyga->isAlive() && !pRyga->isInCombat())
@@ -347,27 +347,27 @@ struct npc_wounded_blood_elfAI : public npc_escortAI
switch (i)
{
case 0:
- DoScriptText(SAY_ELF_START, m_creature, pPlayer);
+ DoScriptText(SAY_ELF_START, me, pPlayer);
break;
case 9:
- DoScriptText(SAY_ELF_SUMMON1, m_creature, pPlayer);
+ DoScriptText(SAY_ELF_SUMMON1, me, pPlayer);
// Spawn two Haal'eshi Talonguard
DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 13:
- DoScriptText(SAY_ELF_RESTING, m_creature, pPlayer);
+ DoScriptText(SAY_ELF_RESTING, me, pPlayer);
break;
case 14:
- DoScriptText(SAY_ELF_SUMMON2, m_creature, pPlayer);
+ DoScriptText(SAY_ELF_SUMMON2, me, pPlayer);
// Spawn two Haal'eshi Windwalker
DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 27:
- DoScriptText(SAY_ELF_COMPLETE, m_creature, pPlayer);
+ DoScriptText(SAY_ELF_COMPLETE, me, pPlayer);
// Award quest credit
- pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature);
+ pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,me);
break;
}
}
@@ -377,12 +377,12 @@ struct npc_wounded_blood_elfAI : public npc_escortAI
void EnterCombat(Unit* who)
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
- DoScriptText(SAY_ELF_AGGRO, m_creature);
+ DoScriptText(SAY_ELF_AGGRO, me);
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
};
diff --git a/src/scripts/outland/nagrand.cpp b/src/scripts/outland/nagrand.cpp
index 2d467ae7105..6c91aa78985 100644
--- a/src/scripts/outland/nagrand.cpp
+++ b/src/scripts/outland/nagrand.cpp
@@ -57,14 +57,14 @@ struct mob_shattered_rumblerAI : public ScriptedAI
{
if (Spellkind->Id == 32001 && !Spawn)
{
- float x = m_creature->GetPositionX();
- float y = m_creature->GetPositionY();
- float z = m_creature->GetPositionZ();
+ float x = me->GetPositionX();
+ float y = me->GetPositionY();
+ float z = me->GetPositionZ();
Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- m_creature->setDeathState(CORPSE);
+ me->setDeathState(CORPSE);
Spawn = true;
}
return;
@@ -108,15 +108,15 @@ struct mob_lumpAI : public ScriptedAI
Reset_Timer = 60000;
Spear_Throw_Timer = 2000;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void AttackedBy(Unit* pAttacker)
{
- if (m_creature->getVictim())
+ if (me->getVictim())
return;
- if (m_creature->IsFriendlyTo(pAttacker))
+ if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -124,7 +124,7 @@ struct mob_lumpAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 & damage)
{
- if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30)
+ if (done_by->GetTypeId() == TYPEID_PLAYER && (me->GetHealth() - damage)*100 / me->GetMaxHealth() < 30)
{
if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
{
@@ -132,13 +132,13 @@ struct mob_lumpAI : public ScriptedAI
damage = 0;
CAST_PLR(done_by)->AttackStop();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
- m_creature->setFaction(1080); //friendly
- m_creature->SetStandState(UNIT_STAND_STATE_SIT);
- DoScriptText(LUMP_DEFEAT, m_creature);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->setFaction(1080); //friendly
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ DoScriptText(LUMP_DEFEAT, me);
bReset = true;
}
@@ -147,13 +147,13 @@ struct mob_lumpAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- if (m_creature->HasAura(SPELL_VISUAL_SLEEP))
- m_creature->RemoveAura(SPELL_VISUAL_SLEEP);
+ if (me->HasAura(SPELL_VISUAL_SLEEP))
+ me->RemoveAura(SPELL_VISUAL_SLEEP);
- if (!m_creature->IsStandState())
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ if (!me->IsStandState())
+ me->SetStandState(UNIT_STAND_STATE_STAND);
- DoScriptText(RAND(LUMP_SAY0,LUMP_SAY1), m_creature);
+ DoScriptText(RAND(LUMP_SAY0,LUMP_SAY1), me);
}
void UpdateAI(const uint32 diff)
@@ -165,7 +165,7 @@ struct mob_lumpAI : public ScriptedAI
{
EnterEvadeMode();
bReset = false;
- m_creature->setFaction(1711); //hostile
+ me->setFaction(1711); //hostile
return;
}
else Reset_Timer -= diff;
@@ -178,7 +178,7 @@ struct mob_lumpAI : public ScriptedAI
//Spear_Throw_Timer
if (Spear_Throw_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SPEAR_THROW);
+ DoCast(me->getVictim(), SPELL_SPEAR_THROW);
Spear_Throw_Timer = 20000;
} else Spear_Throw_Timer -= diff;
@@ -235,8 +235,8 @@ struct mob_sunspring_villagerAI : public ScriptedAI
void Reset()
{
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
}
void EnterCombat(Unit *who) {}
@@ -245,8 +245,8 @@ struct mob_sunspring_villagerAI : public ScriptedAI
{
if (spell->Id == 32146)
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
}
}
};
@@ -566,7 +566,7 @@ struct npc_maghar_captiveAI : public npc_escortAI
void Aggro(Unit* pWho)
{
- DoCast(m_creature, SPELL_EARTHBIND_TOTEM, false);
+ DoCast(me, SPELL_EARTHBIND_TOTEM, false);
}
void WaypointReached(uint32 uiPointId)
@@ -574,21 +574,21 @@ struct npc_maghar_captiveAI : public npc_escortAI
switch(uiPointId)
{
case 7:
- DoScriptText(SAY_MAG_MORE, m_creature);
+ DoScriptText(SAY_MAG_MORE, me);
- if (Creature* pTemp = m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
+ if (Creature* pTemp = me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
DoScriptText(SAY_MAG_MORE_REPLY, pTemp);
- m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 16:
- DoScriptText(SAY_MAG_COMPLETE, m_creature);
+ DoScriptText(SAY_MAG_COMPLETE, me);
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, m_creature);
+ pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun();
break;
@@ -604,8 +604,8 @@ struct npc_maghar_captiveAI : public npc_escortAI
return;
pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ pSummoned->AI()->AttackStart(me);
}
@@ -616,28 +616,28 @@ struct npc_maghar_captiveAI : public npc_escortAI
if (rand()%10)
return;
- DoScriptText(SAY_MAG_LIGHTNING, m_creature);
+ DoScriptText(SAY_MAG_LIGHTNING, me);
}
}
void UpdateEscortAI(const uint32 uiDiff)
{
- if (/*!m_creature->SelectHostilTarget() ||*/ !m_creature->getVictim())
+ if (/*!me->SelectHostilTarget() ||*/ !me->getVictim())
return;
if (m_uiChainLightningTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
m_uiChainLightningTimer = urand(7000, 14000);
}
else
m_uiChainLightningTimer -= uiDiff;
- if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*30)
+ if (me->GetHealth()*100 < me->GetMaxHealth()*30)
{
if (m_uiHealTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_HEALING_WAVE);
+ DoCast(me, SPELL_HEALING_WAVE);
m_uiHealTimer = 5000;
}
else
@@ -646,7 +646,7 @@ struct npc_maghar_captiveAI : public npc_escortAI
if (m_uiFrostShockTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
m_uiFrostShockTimer = urand(7500, 15000);
}
else
@@ -703,12 +703,12 @@ struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
{
if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
{
- uint32 creditMarkerId = m_creature->GetEntry();
+ uint32 creditMarkerId = me->GetEntry();
if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
{
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
- CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID());
+ CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, me->GetGUID());
}
}
}
@@ -738,7 +738,7 @@ struct mob_sparrowhawkAI : public ScriptedAI
void Reset()
{
- m_creature->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
+ me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
Check_Timer = 1000;
PlayerGUID = 0;
fleeing = false;
@@ -758,7 +758,7 @@ struct mob_sparrowhawkAI : public ScriptedAI
if (!who || PlayerGUID)
return;
- if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
+ if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
{
PlayerGUID = who->GetGUID();
return;
@@ -773,22 +773,22 @@ struct mob_sparrowhawkAI : public ScriptedAI
{
if (PlayerGUID)
{
- if (fleeing && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
+ if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
fleeing = false;
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
- if (pPlayer && m_creature->IsWithinDistInMap(pPlayer, 30))
+ if (pPlayer && me->IsWithinDistInMap(pPlayer, 30))
{
if (!fleeing)
{
- m_creature->DeleteThreatList();
- m_creature->GetMotionMaster()->MoveFleeing(pPlayer);
+ me->DeleteThreatList();
+ me->GetMotionMaster()->MoveFleeing(pPlayer);
fleeing = true;
}
}
else if (fleeing)
{
- m_creature->GetMotionMaster()->MovementExpired(false);
+ me->GetMotionMaster()->MovementExpired(false);
PlayerGUID = 0;
fleeing = false;
}
@@ -809,8 +809,8 @@ struct mob_sparrowhawkAI : public ScriptedAI
if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
{
DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
}
return;
diff --git a/src/scripts/outland/netherstorm.cpp b/src/scripts/outland/netherstorm.cpp
index c944b2b480d..c3bc1a49eb5 100644
--- a/src/scripts/outland/netherstorm.cpp
+++ b/src/scripts/outland/netherstorm.cpp
@@ -94,14 +94,14 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
void JustDied(Unit* killer)
{
- DoScriptText(EMOTE_ABORT, m_creature);
+ DoScriptText(EMOTE_ABORT, me);
if (someplayer)
{
- Unit* p = Unit::GetUnit((*m_creature),someplayer);
+ Unit* p = Unit::GetUnit((*me),someplayer);
if (p && p->GetTypeId() == TYPEID_PLAYER)
{
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case ENTRY_BNAAR_C_CONSOLE:
CAST_PLR(p)->FailQuest(10299);
@@ -125,7 +125,7 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
if (goConsole)
{
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
}
@@ -137,47 +137,47 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
case ENTRY_BNAAR_C_CONSOLE:
if (rand()%2)
{
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
}
else
{
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
}
Wave_Timer = 30000;
break;
case ENTRY_CORUU_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
Wave_Timer = 20000;
break;
case ENTRY_DURO_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
Wave_Timer = 15000;
break;
case ENTRY_ARA_C_CONSOLE:
if (rand()%2)
{
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
}
else
{
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
}
Wave_Timer = 15000;
@@ -189,29 +189,29 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
switch(pCreature->GetEntry())
{
case ENTRY_BNAAR_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
break;
case ENTRY_CORUU_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
break;
case ENTRY_DURO_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
break;
case ENTRY_ARA_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
- add = m_creature->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ add = me->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
break;
}
@@ -226,42 +226,42 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
case 1:
if (someplayer)
{
- Unit* u = Unit::GetUnit((*m_creature), someplayer);
- if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, m_creature, u);
+ Unit* u = Unit::GetUnit((*me), someplayer);
+ if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u);
}
Event_Timer = 60000;
Wave = true;
++Phase;
break;
case 2:
- DoScriptText(EMOTE_60, m_creature);
+ DoScriptText(EMOTE_60, me);
Event_Timer = 30000;
++Phase;
break;
case 3:
- DoScriptText(EMOTE_30, m_creature);
+ DoScriptText(EMOTE_30, me);
Event_Timer = 20000;
- DoFinalSpawnForCreature(m_creature);
+ DoFinalSpawnForCreature(me);
++Phase;
break;
case 4:
- DoScriptText(EMOTE_10, m_creature);
+ DoScriptText(EMOTE_10, me);
Event_Timer = 10000;
Wave = false;
++Phase;
break;
case 5:
- DoScriptText(EMOTE_COMPLETE, m_creature);
+ DoScriptText(EMOTE_COMPLETE, me);
if (someplayer)
{
- Unit* u = Unit::GetUnit((*m_creature),someplayer);
+ Unit* u = Unit::GetUnit((*me),someplayer);
if (u && u->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(u)->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID());
- DoCast(m_creature, SPELL_DISABLE_VISUAL);
+ CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
+ DoCast(me, SPELL_DISABLE_VISUAL);
}
if (goConsole)
{
- if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole))
+ if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
++Phase;
@@ -273,7 +273,7 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI
{
if (Wave_Timer <= diff)
{
- DoWaveSpawnForCreature(m_creature);
+ DoWaveSpawnForCreature(me);
} else Wave_Timer -= diff;
}
}
@@ -397,51 +397,51 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
// Emote Ardonis and Pathaleon
void Turn_to_Pathaleons_Image()
{
- Creature *ardonis = Unit::GetCreature(*m_creature,ardonisGUID);
- Creature *pathaleon = Unit::GetCreature(*m_creature,pathaleonGUID);
+ Creature *ardonis = Unit::GetCreature(*me,ardonisGUID);
+ Creature *pathaleon = Unit::GetCreature(*me,pathaleonGUID);
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!ardonis || !pathaleon || !pPlayer)
return;
//Calculate the angle to Pathaleon
- angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
+ angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
//Turn Dawnforge and update
- m_creature->SetOrientation(angle_dawnforge);
- m_creature->SendUpdateToPlayer(pPlayer);
+ me->SetOrientation(angle_dawnforge);
+ me->SendUpdateToPlayer(pPlayer);
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
ardonis->SendUpdateToPlayer(pPlayer);
//Set them to kneel
- m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
}
//Set them back to each other
void Turn_to_eachother()
{
- if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID))
+ if (Unit *ardonis = Unit::GetUnit(*me,ardonisGUID))
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!pPlayer)
return;
- angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
- angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY());
+ angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
+ angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
//Turn Dawnforge and update
- m_creature->SetOrientation(angle_dawnforge);
- m_creature->SendUpdateToPlayer(pPlayer);
+ me->SetOrientation(angle_dawnforge);
+ me->SendUpdateToPlayer(pPlayer);
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
ardonis->SendUpdateToPlayer(pPlayer);
//Set state
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
ardonis->SetStandState(UNIT_STAND_STATE_STAND);
}
}
@@ -480,8 +480,8 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
return;
}
- Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID);
- Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID);
+ Unit *ardonis = Unit::GetUnit(*me,ardonisGUID);
+ Unit *pathaleon = Unit::GetUnit(*me,pathaleonGUID);
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!ardonis || !pPlayer)
@@ -500,7 +500,7 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
switch (Phase)
{
case 1:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature);
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me);
++Phase;
Phase_Timer = 16000;
break;
@@ -512,14 +512,14 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
break;
//Phase 3 Dawnforge say
case 3:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature);
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me);
++Phase;
Phase_Timer = 16000;
break;
//Phase 4 Pathaleon spawns up to phase 9
case 4:
//spawn pathaleon's image
- m_creature->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000);
+ me->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000);
++Phase;
Phase_Timer = 500;
break;
@@ -541,7 +541,7 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
break;
//Subphase 2 Dawnforge say
case 1:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature);
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me);
PhaseSubphase = 0;
++Phase;
Phase_Timer = 8000;
@@ -575,7 +575,7 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
break;
//Phase 8 Dawnforge & Ardonis say
case 8:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature);
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me);
DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis);
++Phase;
Phase_Timer = 4000;
@@ -591,7 +591,7 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
break;
//Phase 10 Dawnforge say
case 10:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature);
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me);
pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING);
Reset();
break;
@@ -711,8 +711,8 @@ struct mob_phase_hunterAI : public ScriptedAI
ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
- if (m_creature->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
- m_creature->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
+ if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
+ me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
}
void EnterCombat(Unit *who)
@@ -723,19 +723,19 @@ struct mob_phase_hunterAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- DoCast(m_creature, SPELL_DE_MATERIALIZE);
+ DoCast(me, SPELL_DE_MATERIALIZE);
}
void UpdateAI(const uint32 diff)
{
if (!Materialize)
{
- DoCast(m_creature, SPELL_MATERIALIZE);
+ DoCast(me, SPELL_MATERIALIZE);
Materialize = true;
}
- if (m_creature->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || m_creature->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
- DoCast(m_creature, SPELL_PHASE_SLIP);
+ if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
+ DoCast(me, SPELL_PHASE_SLIP);
if (!UpdateVictim())
return;
@@ -743,12 +743,12 @@ struct mob_phase_hunterAI : public ScriptedAI
// some code to cast spell Mana Burn on random target which has mana
if (ManaBurnTimer <= diff)
{
- std::list<HostileReference*> AggroList = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
std::list<Unit*> UnitsWithMana;
for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
{
- if (Unit *pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit *pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
if (pUnit->GetCreateMana() > 0)
UnitsWithMana.push_back(pUnit);
@@ -767,22 +767,22 @@ struct mob_phase_hunterAI : public ScriptedAI
if (Player *pPlayer = Unit::GetPlayer(PlayerGUID)) // start: support for quest 10190
{
- if (!Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent)
+ if (!Weak && me->GetHealth() < (me->GetMaxHealth() / 100 * WeakPercent)
&& pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
{
- DoScriptText(EMOTE_WEAK, m_creature);
+ DoScriptText(EMOTE_WEAK, me);
Weak = true;
}
- if (Weak && !Drained && m_creature->HasAura(SPELL_RECHARGING_BATTERY))
+ if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
{
Drained = true;
- HpPercent = float(m_creature->GetHealth()) / float(m_creature->GetMaxHealth());
+ HpPercent = float(me->GetHealth()) / float(me->GetMaxHealth());
- m_creature->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
+ me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
- m_creature->SetHealth(m_creature->GetMaxHealth() * HpPercent);
- m_creature->LowerPlayerDamageReq(m_creature->GetMaxHealth() - m_creature->GetHealth());
- m_creature->SetInCombatWith(pPlayer);
+ me->SetHealth(me->GetMaxHealth() * HpPercent);
+ me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
+ me->SetInCombatWith(pPlayer);
}
} // end: support for quest 10190
@@ -827,30 +827,30 @@ struct npc_bessyAI : public npc_escortAI
switch(i)
{
case 3: //first spawn
- m_creature->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 7:
- m_creature->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 12:
if (pPlayer)
- pPlayer->GroupEventHappens(Q_ALMABTRIEB, m_creature);
+ pPlayer->GroupEventHappens(Q_ALMABTRIEB, me);
if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
- DoScriptText(SAY_THADELL_1, m_creature); break;
+ DoScriptText(SAY_THADELL_1, me); break;
case 13:
if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
- DoScriptText(SAY_THADELL_2, m_creature, pPlayer); break;
+ DoScriptText(SAY_THADELL_2, me, pPlayer); break;
}
}
void JustSummoned(Creature* summoned)
{
- summoned->AI()->AttackStart(m_creature);
+ summoned->AI()->AttackStart(me);
}
void Reset()
diff --git a/src/scripts/outland/shadowmoon_valley.cpp b/src/scripts/outland/shadowmoon_valley.cpp
index f37b833515c..10b5e52d24f 100644
--- a/src/scripts/outland/shadowmoon_valley.cpp
+++ b/src/scripts/outland/shadowmoon_valley.cpp
@@ -89,7 +89,7 @@ struct mob_mature_netherwing_drakeAI : public ScriptedAI
if (bCanEat || bIsEating)
return;
- if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN))
+ if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN))
{
uiPlayerGUID = pCaster->GetGUID();
bCanEat = true;
@@ -105,7 +105,7 @@ struct mob_mature_netherwing_drakeAI : public ScriptedAI
{
bIsEating = true;
EatTimer = 7000;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
}
}
@@ -117,36 +117,36 @@ struct mob_mature_netherwing_drakeAI : public ScriptedAI
{
if (bCanEat && !bIsEating)
{
- if (Unit* pUnit = Unit::GetUnit(*m_creature, uiPlayerGUID))
+ if (Unit* pUnit = Unit::GetUnit(*me, uiPlayerGUID))
{
if (GameObject* pGo = pUnit->FindNearestGameObject(GO_CARCASS, 10))
{
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
- m_creature->GetMotionMaster()->MovementExpired();
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
- m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
}
}
bCanEat = false;
}
else if (bIsEating)
{
- DoCast(m_creature, SPELL_JUST_EATEN);
- DoScriptText(SAY_JUST_EATEN, m_creature);
+ DoCast(me, SPELL_JUST_EATEN);
+ DoScriptText(SAY_JUST_EATEN, me);
if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID))
{
- pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID());
+ pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, me->GetGUID());
if (GameObject* pGo = pPlr->FindNearestGameObject(GO_CARCASS, 10))
pGo->Delete();
}
Reset();
- m_creature->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->Clear();
}
}
else
@@ -160,7 +160,7 @@ struct mob_mature_netherwing_drakeAI : public ScriptedAI
if (CastTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
+ DoCast(me->getVictim(), SPELL_NETHER_BREATH);
CastTimer = 5000;
} else CastTimer -= diff;
@@ -202,11 +202,11 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
void Reset()
{
if (!Tapped)
- m_creature->setFaction(FACTION_DEFAULT);
+ me->setFaction(FACTION_DEFAULT);
FlyTimer = 10000;
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetVisibility(VISIBILITY_ON);
}
void SpellHit(Unit* caster, const SpellEntry* spell)
@@ -219,18 +219,18 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
Tapped = true;
PlayerGUID = caster->GetGUID();
- m_creature->setFaction(FACTION_FRIENDLY);
+ me->setFaction(FACTION_FRIENDLY);
DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50);
if (Dragonmaw)
{
- m_creature->AddThreat(Dragonmaw, 100000.0f);
+ me->AddThreat(Dragonmaw, 100000.0f);
AttackStart(Dragonmaw);
}
- HostileReference* ref = m_creature->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
+ HostileReference* ref = me->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
if (ref)
ref->removeReference();
}
@@ -245,16 +245,16 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
{
if (PlayerGUID)
{
- Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
+ Unit* plr = Unit::GetUnit((*me), PlayerGUID);
if (plr)
DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
PlayerGUID = 0;
}
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
+ me->SetVisibility(VISIBILITY_OFF);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
}
}
@@ -274,10 +274,10 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
/*
float x,y,z;
- m_creature->GetPosition(x,y,z);
+ me->GetPosition(x,y,z);
float dx,dy,dz;
- m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz);
+ me->GetRandomPoint(x, y, z, 20, dx, dy, dz);
dz += 20; // so it's in the air, not ground*/
Position pos;
@@ -285,12 +285,12 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
EscapeDummy->GetPosition(&pos);
else
{
- m_creature->GetRandomNearPosition(pos, 20);
+ me->GetRandomNearPosition(pos, 20);
pos.m_positionZ += 25;
}
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->MovePoint(1, pos);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->GetMotionMaster()->MovePoint(1, pos);
}
}
} else FlyTimer -= diff;
@@ -336,10 +336,10 @@ struct mob_dragonmaw_peonAI : public ScriptedAI
Tapped = true;
float x, y, z;
- caster->GetClosePoint(x, y, z, m_creature->GetObjectSize());
+ caster->GetClosePoint(x, y, z, me->GetObjectSize());
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ me->GetMotionMaster()->MovePoint(1, x, y, z);
}
}
@@ -350,7 +350,7 @@ struct mob_dragonmaw_peonAI : public ScriptedAI
if (id)
{
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
PoisonTimer = 15000;
}
}
@@ -364,10 +364,10 @@ struct mob_dragonmaw_peonAI : public ScriptedAI
{
Player* plr = Unit::GetPlayer(PlayerGUID);
if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
- plr->KilledMonsterCredit(23209, m_creature->GetGUID());
+ plr->KilledMonsterCredit(23209, me->GetGUID());
}
PoisonTimer = 0;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
} else PoisonTimer -= diff;
}
};
@@ -692,14 +692,14 @@ struct npc_overlord_morghorAI : public ScriptedAI
Step = 0;
Event = false;
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 2);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 2);
}
void StartEvent()
{
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
- Unit* Illidan = m_creature->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ Unit* Illidan = me->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Illidan)
{
IllidanGUID = Illidan->GetGUID();
@@ -709,7 +709,7 @@ struct npc_overlord_morghorAI : public ScriptedAI
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
- DoScriptText(OVERLORD_SAY_1, m_creature, pPlayer);
+ DoScriptText(OVERLORD_SAY_1, me, pPlayer);
}
ConversationTimer = 4200;
Step = 0;
@@ -718,9 +718,9 @@ struct npc_overlord_morghorAI : public ScriptedAI
uint32 NextStep(uint32 Step)
{
- Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
+ Unit* plr = Unit::GetUnit((*me), PlayerGUID);
- Unit* Illi = Unit::GetUnit((*m_creature), IllidanGUID);
+ Unit* Illi = Unit::GetUnit((*me), IllidanGUID);
if (!plr || !Illi)
{
@@ -731,22 +731,22 @@ struct npc_overlord_morghorAI : public ScriptedAI
switch(Step)
{
case 0: return 0; break;
- case 1: m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break;
- case 2: DoScriptText(OVERLORD_YELL_1, m_creature, plr); return 4500; break;
- case 3: m_creature->SetInFront(plr); return 3200; break;
- case 4: DoScriptText(OVERLORD_SAY_2, m_creature, plr); return 2000; break;
+ case 1: me->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break;
+ case 2: DoScriptText(OVERLORD_YELL_1, me, plr); return 4500; break;
+ case 3: me->SetInFront(plr); return 3200; break;
+ case 4: DoScriptText(OVERLORD_SAY_2, me, plr); return 2000; break;
case 5: Illi->SetVisibility(VISIBILITY_ON);
Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
case 6:
Illi->CastSpell(Illi, SPELL_ONE, true);
- Illi->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
+ Illi->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
return 2000; break;
- case 7: DoScriptText(OVERLORD_YELL_2, m_creature); return 4500; break;
- case 8: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
- case 9: DoScriptText(OVERLORD_SAY_3, m_creature); return 6500; break;
+ case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break;
+ case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
+ case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break;
case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break;
- case 11: DoScriptText(OVERLORD_SAY_4, m_creature, plr); return 6000; break;
+ case 11: DoScriptText(OVERLORD_SAY_4, me, plr); return 6000; break;
case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break;
@@ -769,17 +769,17 @@ struct npc_overlord_morghorAI : public ScriptedAI
Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
return 500; break;
- case 21: DoScriptText(OVERLORD_SAY_5, m_creature); return 500; break;
+ case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break;
case 22:
Illi->SetVisibility(VISIBILITY_OFF);
Illi->setDeathState(JUST_DIED);
return 1000; break;
- case 23: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break;
- case 24: m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break;
- case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break;
+ case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break;
+ case 24: me->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break;
+ case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break;
case 26:
if (plr)
- CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature);
+ CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me);
return 6000; break;
case 27:
{
@@ -815,7 +815,7 @@ struct npc_overlord_morghorAI : public ScriptedAI
Yarzill->CastSpell(plr, 41540, true);
return 1000;}
break;
- case 32: m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break;
+ case 32: me->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break;
case 33: Reset(); return 100; break;
default : return 0;
@@ -901,14 +901,14 @@ struct npc_earthmender_wildaAI : public npc_escortAI
switch(uiPointId)
{
case 13:
- DoScriptText(SAY_WIL_PROGRESS1, m_creature, pPlayer);
+ DoScriptText(SAY_WIL_PROGRESS1, me, pPlayer);
DoSpawnAssassin();
break;
case 14:
DoSpawnAssassin();
break;
case 15:
- DoScriptText(SAY_WIL_FIND_EXIT, m_creature, pPlayer);
+ DoScriptText(SAY_WIL_FIND_EXIT, me, pPlayer);
break;
case 19:
DoRandomSay();
@@ -935,7 +935,7 @@ struct npc_earthmender_wildaAI : public npc_escortAI
DoSpawnAssassin();
break;
case 39:
- DoScriptText(SAY_WIL_JUST_AHEAD, m_creature, pPlayer);
+ DoScriptText(SAY_WIL_JUST_AHEAD, me, pPlayer);
break;
case 43:
DoRandomSay();
@@ -944,10 +944,10 @@ struct npc_earthmender_wildaAI : public npc_escortAI
DoSpawnAssassin();
break;
case 50:
- DoScriptText(SAY_WIL_END, m_creature, pPlayer);
+ DoScriptText(SAY_WIL_END, me, pPlayer);
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature);
+ pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
break;
}
}
@@ -955,13 +955,13 @@ struct npc_earthmender_wildaAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN)
- pSummoned->AI()->AttackStart(m_creature);
+ pSummoned->AI()->AttackStart(me);
}
//this is very unclear, random say without no real relevance to script/event
void DoRandomSay()
{
- DoScriptText(RAND(SAY_WIL_PROGRESS2,SAY_WIL_PROGRESS4,SAY_WIL_PROGRESS5), m_creature);
+ DoScriptText(RAND(SAY_WIL_PROGRESS2,SAY_WIL_PROGRESS4,SAY_WIL_PROGRESS5), me);
}
void DoSpawnAssassin()
@@ -993,11 +993,11 @@ struct npc_earthmender_wildaAI : public npc_escortAI
return;
//TODO: add more abilities
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30)
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 30)
{
if (m_uiHealingTimer <= uiDiff)
{
- DoCast(m_creature, SPELL_HEALING_WAVE);
+ DoCast(me, SPELL_HEALING_WAVE);
m_uiHealingTimer = 15000;
}
else
@@ -1148,17 +1148,17 @@ struct mob_illidari_spawnAI : public ScriptedAI
if (!Timers)
{
- if (m_creature->GetEntry() == 22075)//Illidari Soldier
+ if (me->GetEntry() == 22075)//Illidari Soldier
{
SpellTimer1 = SpawnCast[0].Timer1 + (rand()%4 * 1000);
}
- if (m_creature->GetEntry() == 22074)//Illidari Mind Breaker
+ if (me->GetEntry() == 22074)//Illidari Mind Breaker
{
SpellTimer1 = SpawnCast[1].Timer1 + (rand()%10 * 1000);
SpellTimer2 = SpawnCast[2].Timer1 + (rand()%4 * 1000);
SpellTimer3 = SpawnCast[3].Timer1 + (rand()%4 * 1000);
}
- if (m_creature->GetEntry() == 19797)// Illidari Highlord
+ if (me->GetEntry() == 19797)// Illidari Highlord
{
SpellTimer1 = SpawnCast[4].Timer1 + (rand()%4 * 1000);
SpellTimer2 = SpawnCast[5].Timer1 + (rand()%4 * 1000);
@@ -1166,16 +1166,16 @@ struct mob_illidari_spawnAI : public ScriptedAI
Timers = true;
}
//Illidari Soldier
- if (m_creature->GetEntry() == 22075)
+ if (me->GetEntry() == 22075)
{
if (SpellTimer1 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[0].SpellId);//Spellbreaker
+ DoCast(me->getVictim(), SpawnCast[0].SpellId);//Spellbreaker
SpellTimer1 = SpawnCast[0].Timer2 + (rand()%5 * 1000);
} else SpellTimer1 -= diff;
}
//Illidari Mind Breaker
- if (m_creature->GetEntry() == 22074)
+ if (me->GetEntry() == 22074)
{
if (SpellTimer1 <= diff)
{
@@ -1191,28 +1191,28 @@ struct mob_illidari_spawnAI : public ScriptedAI
if (SpellTimer2 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[2].SpellId);//Psychic Scream
+ DoCast(me->getVictim(), SpawnCast[2].SpellId);//Psychic Scream
SpellTimer2 = SpawnCast[2].Timer2 + (rand()%13 * 1000);
} else SpellTimer2 -= diff;
if (SpellTimer3 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[3].SpellId);//Mind Blast
+ DoCast(me->getVictim(), SpawnCast[3].SpellId);//Mind Blast
SpellTimer3 = SpawnCast[3].Timer2 + (rand()%8 * 1000);
} else SpellTimer3 -= diff;
}
//Illidari Highlord
- if (m_creature->GetEntry() == 19797)
+ if (me->GetEntry() == 19797)
{
if (SpellTimer1 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames
+ DoCast(me->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames
SpellTimer1 = SpawnCast[4].Timer2 + (rand()%10 * 1000);
} else SpellTimer1 -= diff;
if (SpellTimer2 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[5].SpellId);//Flamestrike
+ DoCast(me->getVictim(), SpawnCast[5].SpellId);//Flamestrike
SpellTimer2 = SpawnCast[5].Timer2 + (rand()%7 * 13000);
} else SpellTimer2 -= diff;
}
@@ -1246,20 +1246,20 @@ struct mob_torloth_the_magnificentAI : public ScriptedAI
AggroTargetGUID = 0;
Timers = false;
- m_creature->addUnitState(UNIT_STAT_ROOT);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->addUnitState(UNIT_STAT_ROOT);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
}
void EnterCombat(Unit* who){}
void HandleAnimation()
{
- Creature* pCreature = m_creature;
+ Creature* pCreature = me;
if (TorlothAnim[AnimationCount].pCreature == 1)
{
- pCreature = (Unit::GetCreature(*m_creature, LordIllidanGUID));
+ pCreature = (Unit::GetCreature(*me, LordIllidanGUID));
if (!pCreature)
return;
@@ -1273,28 +1273,28 @@ struct mob_torloth_the_magnificentAI : public ScriptedAI
switch(AnimationCount)
{
case 0:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,8);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,8);
break;
case 3:
- m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,8);
+ me->RemoveFlag(UNIT_FIELD_BYTES_1,8);
break;
case 5:
if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID)))
{
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID());
- m_creature->AddThreat(AggroTarget, 1);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID());
+ me->AddThreat(AggroTarget, 1);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
}
break;
case 6:
if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID)))
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->clearUnitState(UNIT_STAT_ROOT);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->clearUnitState(UNIT_STAT_ROOT);
float x, y, z;
AggroTarget->GetPosition(x,y,z);
- m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z);
}
break;
}
@@ -1313,7 +1313,7 @@ struct mob_torloth_the_magnificentAI : public ScriptedAI
if (AnimationCount < 6)
{
- m_creature->CombatStop();
+ me->CombatStop();
} else if (!Timers)
{
@@ -1327,19 +1327,19 @@ struct mob_torloth_the_magnificentAI : public ScriptedAI
{
if (SpellTimer1 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[6].SpellId);//Cleave
+ DoCast(me->getVictim(), SpawnCast[6].SpellId);//Cleave
SpellTimer1 = SpawnCast[6].Timer2 + (rand()%10 * 1000);
} else SpellTimer1 -= diff;
if (SpellTimer2 <= diff)
{
- DoCast(m_creature->getVictim(), SpawnCast[7].SpellId);//Shadowfury
+ DoCast(me->getVictim(), SpawnCast[7].SpellId);//Shadowfury
SpellTimer2 = SpawnCast[7].Timer2 + (rand()%5 * 1000);
} else SpellTimer2 -= diff;
if (SpellTimer3 <= diff)
{
- DoCast(m_creature, SpawnCast[8].SpellId);
+ DoCast(me, SpawnCast[8].SpellId);
SpellTimer3 = SpawnCast[8].Timer2 + (rand()%7 * 1000);//Spell Reflection
} else SpellTimer3 -= diff;
}
@@ -1355,15 +1355,15 @@ struct mob_torloth_the_magnificentAI : public ScriptedAI
case TYPEID_UNIT:
if (Unit *owner = slayer->GetOwner())
if (owner->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
+ CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
break;
case TYPEID_PLAYER:
- CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
+ CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
break;
}
- if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID)))
+ if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
{
DoScriptText(END_TEXT, LordIllidan, slayer);
LordIllidan->AI()->EnterEvadeMode();
@@ -1404,7 +1404,7 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
Announced = false;
Failed = false;
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetVisibility(VISIBILITY_OFF);
}
void EnterCombat(Unit* who) {}
@@ -1426,7 +1426,7 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
float Y = SpawnLocation[locIndex + i].y;
float Z = SpawnLocation[locIndex + i].z;
float O = SpawnLocation[locIndex + i].o;
- Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+ Spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
++LiveCount;
if (Spawn)
@@ -1463,12 +1463,12 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
Spawn->GetMotionMaster()->MovePoint(0,x, y, z);
}
}
- CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID();
+ CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
}
if (WavesInfo[WaveCount].CreatureId == 22076) // Torloth
{
- CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID();
+ CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
if (PlayerGUID)
CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID;
}
@@ -1501,7 +1501,7 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
GroupMember = (Unit::GetPlayer(itr->guid));
if (!GroupMember)
continue;
- if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
+ if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
{
GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE);
@@ -1534,7 +1534,7 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
}
Failed = true;
}
- } else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS))
+ } else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
{
pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
Failed = true;
@@ -1557,7 +1557,7 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
{
if (!Announced && AnnounceTimer <= diff)
{
- DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature);
+ DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
Announced = true;
} else AnnounceTimer -= diff;
@@ -1575,8 +1575,8 @@ struct npc_lord_illidan_stormrageAI : public ScriptedAI
void mob_illidari_spawnAI::JustDied(Unit *slayer)
{
- m_creature->RemoveCorpse();
- if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID)))
+ me->RemoveCorpse();
+ if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
if (LordIllidan)
CAST_AI(npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter();
}
@@ -1676,7 +1676,7 @@ struct npc_enraged_spiritAI : public ScriptedAI
uint32 entry = 0;
uint32 credit = 0;
- switch(m_creature->GetEntry()) {
+ switch(me->GetEntry()) {
case ENTRY_ENRAGED_FIRE_SPIRIT:
entry = ENTRY_FIERY_SOUL;
//credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT;
diff --git a/src/scripts/outland/shattrath_city.cpp b/src/scripts/outland/shattrath_city.cpp
index 7361c774b8c..86f84dac123 100644
--- a/src/scripts/outland/shattrath_city.cpp
+++ b/src/scripts/outland/shattrath_city.cpp
@@ -71,7 +71,7 @@ struct npc_raliq_the_drunkAI : public ScriptedAI
if (Uppercut_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 15000;
} else Uppercut_Timer -= diff;
@@ -129,9 +129,9 @@ struct npc_salsalabimAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (done_by->GetTypeId() == TYPEID_PLAYER)
- if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20)
+ if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 20)
{
- CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,m_creature);
+ CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,me);
damage = 0;
EnterEvadeMode();
}
@@ -144,7 +144,7 @@ struct npc_salsalabimAI : public ScriptedAI
if (MagneticPull_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MAGNETIC_PULL);
+ DoCast(me->getVictim(), SPELL_MAGNETIC_PULL);
MagneticPull_Timer = 15000;
} else MagneticPull_Timer -= diff;
@@ -289,30 +289,30 @@ public:
switch(i)
{
- case 0: DoScriptText(SAY1, m_creature, pPlayer); break;
- case 4: DoScriptText(WHISP1, m_creature, pPlayer); break;
- case 6: DoScriptText(WHISP2, m_creature, pPlayer); break;
- case 7: DoScriptText(WHISP3, m_creature, pPlayer); break;
- case 8: DoScriptText(WHISP4, m_creature, pPlayer); break;
- case 17: DoScriptText(WHISP5, m_creature, pPlayer); break;
- case 18: DoScriptText(WHISP6, m_creature, pPlayer); break;
- case 19: DoScriptText(WHISP7, m_creature, pPlayer); break;
- case 33: DoScriptText(WHISP8, m_creature, pPlayer); break;
- case 34: DoScriptText(WHISP9, m_creature, pPlayer); break;
- case 35: DoScriptText(WHISP10, m_creature, pPlayer); break;
- case 36: DoScriptText(WHISP11, m_creature, pPlayer); break;
- case 43: DoScriptText(WHISP12, m_creature, pPlayer); break;
- case 44: DoScriptText(WHISP13, m_creature, pPlayer); break;
- case 49: DoScriptText(WHISP14, m_creature, pPlayer); break;
- case 50: DoScriptText(WHISP15, m_creature, pPlayer); break;
- case 51: DoScriptText(WHISP16, m_creature, pPlayer); break;
- case 52: DoScriptText(WHISP17, m_creature, pPlayer); break;
- case 53: DoScriptText(WHISP18, m_creature, pPlayer); break;
- case 54: DoScriptText(WHISP19, m_creature, pPlayer); break;
- case 55: DoScriptText(WHISP20, m_creature, pPlayer); break;
- case 56: DoScriptText(WHISP21, m_creature, pPlayer);
+ case 0: DoScriptText(SAY1, me, pPlayer); break;
+ case 4: DoScriptText(WHISP1, me, pPlayer); break;
+ case 6: DoScriptText(WHISP2, me, pPlayer); break;
+ case 7: DoScriptText(WHISP3, me, pPlayer); break;
+ case 8: DoScriptText(WHISP4, me, pPlayer); break;
+ case 17: DoScriptText(WHISP5, me, pPlayer); break;
+ case 18: DoScriptText(WHISP6, me, pPlayer); break;
+ case 19: DoScriptText(WHISP7, me, pPlayer); break;
+ case 33: DoScriptText(WHISP8, me, pPlayer); break;
+ case 34: DoScriptText(WHISP9, me, pPlayer); break;
+ case 35: DoScriptText(WHISP10, me, pPlayer); break;
+ case 36: DoScriptText(WHISP11, me, pPlayer); break;
+ case 43: DoScriptText(WHISP12, me, pPlayer); break;
+ case 44: DoScriptText(WHISP13, me, pPlayer); break;
+ case 49: DoScriptText(WHISP14, me, pPlayer); break;
+ case 50: DoScriptText(WHISP15, me, pPlayer); break;
+ case 51: DoScriptText(WHISP16, me, pPlayer); break;
+ case 52: DoScriptText(WHISP17, me, pPlayer); break;
+ case 53: DoScriptText(WHISP18, me, pPlayer); break;
+ case 54: DoScriptText(WHISP19, me, pPlayer); break;
+ case 55: DoScriptText(WHISP20, me, pPlayer); break;
+ case 56: DoScriptText(WHISP21, me, pPlayer);
if (pPlayer)
- pPlayer->GroupEventHappens(10211,m_creature);
+ pPlayer->GroupEventHappens(10211,me);
break;
}
}
@@ -327,7 +327,7 @@ public:
if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
- if (m_creature->IsWithinDistInMap(pWho, Radius))
+ if (me->IsWithinDistInMap(pWho, Radius))
{
Start(false, false, pWho->GetGUID());
}
@@ -382,8 +382,8 @@ struct npc_dirty_larryAI : public ScriptedAI
SayTimer = 0;
Step = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->setFaction(1194);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->setFaction(1194);
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
if (Creepjack)
{
@@ -406,19 +406,19 @@ struct npc_dirty_larryAI : public ScriptedAI
switch(Step)
{
- case 0:{ m_creature->SetInFront(pPlayer);
+ case 0:{ me->SetInFront(pPlayer);
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
if (Creepjack)
Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
if (Malone)
Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000;
- case 1: DoScriptText(SAY_1, m_creature, pPlayer); return 3000;
- case 2: DoScriptText(SAY_2, m_creature, pPlayer); return 5000;
- case 3: DoScriptText(SAY_3, m_creature, pPlayer); return 2000;
- case 4: DoScriptText(SAY_4, m_creature, pPlayer); return 2000;
- case 5: DoScriptText(SAY_5, m_creature, pPlayer); return 2000;
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000;
+ case 1: DoScriptText(SAY_1, me, pPlayer); return 3000;
+ case 2: DoScriptText(SAY_2, me, pPlayer); return 5000;
+ case 3: DoScriptText(SAY_3, me, pPlayer); return 2000;
+ case 4: DoScriptText(SAY_4, me, pPlayer); return 2000;
+ case 5: DoScriptText(SAY_5, me, pPlayer); return 2000;
case 6: Attack = true; return 2000;
default: return 0;
}
@@ -437,8 +437,8 @@ struct npc_dirty_larryAI : public ScriptedAI
if (Attack)
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (pPlayer)
{
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
@@ -463,10 +463,10 @@ struct npc_dirty_larryAI : public ScriptedAI
Attack = false;
}
- if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 5 && !Done)
+ if ((me->GetHealth()*100)/me->GetMaxHealth() < 5 && !Done)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAllAuras();
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
if (Creepjack)
@@ -484,15 +484,15 @@ struct npc_dirty_larryAI : public ScriptedAI
Malone->GetMotionMaster()->MoveTargetedHome();
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- m_creature->setFaction(1194);
+ me->setFaction(1194);
Done = true;
- DoScriptText(SAY_GIVEUP, m_creature, NULL);
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ DoScriptText(SAY_GIVEUP, me, NULL);
+ me->DeleteThreatList();
+ me->CombatStop();
+ me->GetMotionMaster()->MoveTargetedHome();
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, m_creature);
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, me);
}
DoMeleeAttackIfReady();
}
diff --git a/src/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp b/src/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp
index d089abcfe01..11f475b5b05 100644
--- a/src/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp
+++ b/src/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp
@@ -93,20 +93,20 @@ struct npc_millhouse_manastormAI : public ScriptedAI
if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE)
{
- DoScriptText(SAY_COMPLETE, m_creature);
+ DoScriptText(SAY_COMPLETE, me);
}
}
}
void AttackStart(Unit* pWho)
{
- if (m_creature->Attack(pWho, true))
+ if (me->Attack(pWho, true))
{
- m_creature->AddThreat(pWho, 0.0f);
- m_creature->SetInCombatWith(pWho);
- pWho->SetInCombatWith(m_creature);
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
- m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f);
+ me->GetMotionMaster()->MoveChase(pWho, 25.0f);
}
}
@@ -116,12 +116,12 @@ struct npc_millhouse_manastormAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
/*for questId 10886 (heroic mode only)
if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE)
@@ -139,30 +139,30 @@ struct npc_millhouse_manastormAI : public ScriptedAI
switch(Phase)
{
case 1:
- DoScriptText(SAY_INTRO_1, m_creature);
+ DoScriptText(SAY_INTRO_1, me);
EventProgress_Timer = 18000;
break;
case 2:
- DoScriptText(SAY_INTRO_2, m_creature);
+ DoScriptText(SAY_INTRO_2, me);
EventProgress_Timer = 18000;
break;
case 3:
- DoScriptText(SAY_WATER, m_creature);
- DoCast(m_creature, SPELL_CONJURE_WATER);
+ DoScriptText(SAY_WATER, me);
+ DoCast(me, SPELL_CONJURE_WATER);
EventProgress_Timer = 7000;
break;
case 4:
- DoScriptText(SAY_BUFFS, m_creature);
- DoCast(m_creature, SPELL_ICE_ARMOR);
+ DoScriptText(SAY_BUFFS, me);
+ DoCast(me, SPELL_ICE_ARMOR);
EventProgress_Timer = 7000;
break;
case 5:
- DoScriptText(SAY_DRINK, m_creature);
- DoCast(m_creature, SPELL_ARCANE_INTELLECT);
+ DoScriptText(SAY_DRINK, me);
+ DoCast(me, SPELL_ARCANE_INTELLECT);
EventProgress_Timer = 7000;
break;
case 6:
- DoScriptText(SAY_READY, m_creature);
+ DoScriptText(SAY_READY, me);
EventProgress_Timer = 6000;
break;
case 7:
@@ -179,26 +179,26 @@ struct npc_millhouse_manastormAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20))
+ if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
{
- DoScriptText(SAY_LOWHP, m_creature);
+ DoScriptText(SAY_LOWHP, me);
LowHp = true;
}
if (Pyroblast_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
- DoScriptText(SAY_PYRO, m_creature);
+ DoScriptText(SAY_PYRO, me);
- DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
+ DoCast(me->getVictim(), SPELL_PYROBLAST);
Pyroblast_Timer = 40000;
} else Pyroblast_Timer -=diff;
if (Fireball_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ DoCast(me->getVictim(), SPELL_FIREBALL);
Fireball_Timer = 4000;
} else Fireball_Timer -=diff;
@@ -269,8 +269,8 @@ struct npc_warden_mellicharAI : public ScriptedAI
EventProgress_Timer = 22000;
Phase = 1;
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature, SPELL_TARGET_OMEGA);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(me, SPELL_TARGET_OMEGA);
if (pInstance)
pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED);
@@ -283,23 +283,23 @@ struct npc_warden_mellicharAI : public ScriptedAI
if (IsRunning)
return;
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (who->GetTypeId() != TYPEID_PLAYER)
return;
- float attackRadius = m_creature->GetAttackDistance(who)/10;
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who)/10;
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
EnterCombat(who);
}
}
void EnterCombat(Unit *who)
{
- DoScriptText(YELL_INTRO1, m_creature);
- DoCast(m_creature, SPELL_BUBBLE_VISUAL);
+ DoScriptText(YELL_INTRO1, me);
+ DoCast(me, SPELL_BUBBLE_VISUAL);
if (pInstance)
{
@@ -336,26 +336,26 @@ struct npc_warden_mellicharAI : public ScriptedAI
{
if (pInstance)
{
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAurasByType(SPELL_AURA_DUMMY);
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAurasByType(SPELL_AURA_DUMMY);
switch(Phase)
{
case 2:
- DoCast(m_creature, SPELL_TARGET_ALPHA);
+ DoCast(me, SPELL_TARGET_ALPHA);
pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS);
pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false);
break;
case 3:
- DoCast(m_creature, SPELL_TARGET_BETA);
+ DoCast(me, SPELL_TARGET_BETA);
pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS);
break;
case 5:
- DoCast(m_creature, SPELL_TARGET_DELTA);
+ DoCast(me, SPELL_TARGET_DELTA);
pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS);
break;
case 6:
- DoCast(m_creature, SPELL_TARGET_GAMMA);
+ DoCast(me, SPELL_TARGET_GAMMA);
pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS);
break;
case 7:
@@ -386,40 +386,40 @@ struct npc_warden_mellicharAI : public ScriptedAI
{
//continue beam omega pod, unless we are about to summon skyriss
if (Phase != 7)
- DoCast(m_creature, SPELL_TARGET_OMEGA);
+ DoCast(me, SPELL_TARGET_OMEGA);
switch(Phase)
{
case 2:
switch (urand(0,1))
{
- case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 0: me->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: me->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
}
break;
case 3:
- m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ me->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
break;
case 4:
- DoScriptText(YELL_RELEASE2B, m_creature);
+ DoScriptText(YELL_RELEASE2B, me);
break;
case 5:
switch (urand(0,1))
{
- case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 0: me->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: me->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
}
break;
case 6:
switch (urand(0,1))
{
- case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 0: me->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: me->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
}
break;
case 7:
- m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoScriptText(YELL_WELCOME, m_creature);
+ me->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoScriptText(YELL_WELCOME, me);
break;
}
CanSpawn = false;
@@ -430,17 +430,17 @@ struct npc_warden_mellicharAI : public ScriptedAI
switch(Phase)
{
case 1:
- DoScriptText(YELL_INTRO2, m_creature);
+ DoScriptText(YELL_INTRO2, me);
EventProgress_Timer = 10000;
++Phase;
break;
case 2:
- DoScriptText(YELL_RELEASE1, m_creature);
+ DoScriptText(YELL_RELEASE1, me);
DoPrepareForPhase();
EventProgress_Timer = 7000;
break;
case 3:
- DoScriptText(YELL_RELEASE2A, m_creature);
+ DoScriptText(YELL_RELEASE2A, me);
DoPrepareForPhase();
EventProgress_Timer = 10000;
break;
@@ -449,12 +449,12 @@ struct npc_warden_mellicharAI : public ScriptedAI
EventProgress_Timer = 15000;
break;
case 5:
- DoScriptText(YELL_RELEASE3, m_creature);
+ DoScriptText(YELL_RELEASE3, me);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
case 6:
- DoScriptText(YELL_RELEASE4, m_creature);
+ DoScriptText(YELL_RELEASE4, me);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
@@ -484,11 +484,11 @@ struct mob_zerekethvoidzoneAI : public ScriptedAI
void Reset()
{
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(16);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ me->setFaction(16);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(m_creature, SPELL_VOID_ZONE_DAMAGE);
+ DoCast(me, SPELL_VOID_ZONE_DAMAGE);
}
void EnterCombat(Unit* who) {}
diff --git a/src/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
index 4e828c67749..bd90f525bc0 100644
--- a/src/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
@@ -77,7 +77,7 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
void Reset()
{
if (!Intro)
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
IsImage33 = false;
IsImage66 = false;
@@ -103,7 +103,7 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE);
}
@@ -116,7 +116,7 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
summon->SetHealth((summon->GetMaxHealth()*33)/100);
else
summon->SetHealth((summon->GetMaxHealth()*66)/100);
- if (m_creature->getVictim())
+ if (me->getVictim())
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
summon->AI()->AttackStart(pTarget);
}
@@ -127,20 +127,20 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
if (victim->GetEntry() == 21436)
return;
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void DoSplit(uint32 val)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- DoScriptText(SAY_IMAGE, m_creature);
+ DoScriptText(SAY_IMAGE, me);
if (val == 66)
- DoCast(m_creature, SPELL_66_ILLUSION);
+ DoCast(me, SPELL_66_ILLUSION);
else
- DoCast(m_creature, SPELL_33_ILLUSION);
+ DoCast(me, SPELL_33_ILLUSION);
}
void UpdateAI(const uint32 diff)
@@ -155,14 +155,14 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
switch(Intro_Phase)
{
case 1:
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true);
++Intro_Phase;
Intro_Timer = 25000;
break;
case 2:
- DoScriptText(SAY_AGGRO, m_creature);
- if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR)))
+ DoScriptText(SAY_AGGRO, me);
+ if (Unit *mellic = Unit::GetUnit(*me,pInstance->GetData64(DATA_MELLICHAR)))
{
//should have a better way to do this. possibly spell exist.
mellic->setDeathState(JUST_DIED);
@@ -173,7 +173,7 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
Intro_Timer = 3000;
break;
case 3:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
Intro = true;
break;
}
@@ -183,12 +183,12 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66))
+ if (!IsImage66 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 66))
{
DoSplit(66);
IsImage66 = true;
}
- if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33))
+ if (!IsImage33 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 33))
{
DoSplit(33);
IsImage33 = true;
@@ -199,37 +199,37 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget, SPELL_MIND_REND);
else
- DoCast(m_creature->getVictim(), SPELL_MIND_REND);
+ DoCast(me->getVictim(), SPELL_MIND_REND);
MindRend_Timer = 8000;
} else MindRend_Timer -=diff;
if (Fear_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
- DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), m_creature);
+ DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget, SPELL_FEAR);
else
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 25000;
} else Fear_Timer -=diff;
if (Domination_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
- DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), m_creature);
+ DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), me);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget, SPELL_DOMINATION);
else
- DoCast(m_creature->getVictim(), SPELL_DOMINATION);
+ DoCast(me->getVictim(), SPELL_DOMINATION);
Domination_Timer = 16000+rand()%16000;
} else Domination_Timer -=diff;
@@ -238,7 +238,7 @@ struct boss_harbinger_skyrissAI : public ScriptedAI
{
if (ManaBurn_Timer <= diff)
{
- if (m_creature->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCasted(false))
return;
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
diff --git a/src/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
index 67b80e0f5d4..96808a2e5cf 100644
--- a/src/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
@@ -66,7 +66,7 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustSummoned(Creature *summoned)
@@ -79,21 +79,21 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
{
switch(rand()%4)
{
- case 0: DoCast(m_creature, SPELL_PLANT_WHITE); break;
- case 1: DoCast(m_creature, SPELL_PLANT_GREEN); break;
- case 2: DoCast(m_creature, SPELL_PLANT_BLUE); break;
- case 3: DoCast(m_creature, SPELL_PLANT_RED); break;
+ case 0: DoCast(me, SPELL_PLANT_WHITE); break;
+ case 1: DoCast(me, SPELL_PLANT_GREEN); break;
+ case 2: DoCast(me, SPELL_PLANT_BLUE); break;
+ case 3: DoCast(me, SPELL_PLANT_RED); break;
}
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -103,18 +103,18 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
if (TreeForm_Timer <= diff)
{
- DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), m_creature);
+ DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), me);
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(true);
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
+ me->RemoveAllAuras();
- DoCast(m_creature, SPELL_SUMMON_FRAYER, true);
- DoCast(m_creature, SPELL_TRANQUILITY, true);
- DoCast(m_creature, SPELL_TREE_FORM, true);
+ DoCast(me, SPELL_SUMMON_FRAYER, true);
+ DoCast(me, SPELL_TRANQUILITY, true);
+ DoCast(me, SPELL_TREE_FORM, true);
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
MoveFree = false;
TreeForm_Timer = 75000;
@@ -128,7 +128,7 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
{
for (std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr)
{
- if (Unit *temp = Unit::GetUnit(*m_creature,*itr))
+ if (Unit *temp = Unit::GetUnit(*me,*itr))
{
if (!temp->isAlive())
{
@@ -148,9 +148,9 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
Adds_List.clear();
DeadAddsCount = 0;
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
MoveFree = true;
}
MoveCheck_Timer = 500;
@@ -160,7 +160,7 @@ struct boss_high_botanist_freywinnAI : public ScriptedAI
return;
}
- /*if (m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0))
+ /*if (me->HasAura(SPELL_TREE_FORM,0) || me->HasAura(SPELL_TRANQUILITY,0))
return;*/
//one random seedling every 5 secs, but not in tree form
diff --git a/src/scripts/outland/tempest_keep/botanica/boss_laj.cpp b/src/scripts/outland/tempest_keep/botanica/boss_laj.cpp
index a3f86d77c23..fa1cc2fe602 100644
--- a/src/scripts/outland/tempest_keep/botanica/boss_laj.cpp
+++ b/src/scripts/outland/tempest_keep/botanica/boss_laj.cpp
@@ -55,12 +55,12 @@ struct boss_lajAI : public ScriptedAI
void Reset()
{
- m_creature->SetDisplayId(MODEL_DEFAULT);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetDisplayId(MODEL_DEFAULT);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
CanSummon = false;
Teleport_Timer = 20000;
@@ -74,44 +74,44 @@ struct boss_lajAI : public ScriptedAI
switch(rand()%5)
{
case 0:
- m_creature->SetDisplayId(MODEL_DEFAULT);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetDisplayId(MODEL_DEFAULT);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
break;
case 1:
- m_creature->SetDisplayId(MODEL_ARCANE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetDisplayId(MODEL_ARCANE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
break;
case 2:
- m_creature->SetDisplayId(MODEL_FIRE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetDisplayId(MODEL_FIRE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
break;
case 3:
- m_creature->SetDisplayId(MODEL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ me->SetDisplayId(MODEL_FROST);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
break;
case 4:
- m_creature->SetDisplayId(MODEL_NATURE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ me->SetDisplayId(MODEL_NATURE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
break;
}
}
@@ -121,20 +121,20 @@ struct boss_lajAI : public ScriptedAI
switch(rand()%4)
{
case 0:
- DoCast(m_creature, SPELL_SUMMON_LASHER_1, true);
- DoCast(m_creature, SPELL_SUMMON_FLAYER_1, true);
+ DoCast(me, SPELL_SUMMON_LASHER_1, true);
+ DoCast(me, SPELL_SUMMON_FLAYER_1, true);
break;
case 1:
- DoCast(m_creature, SPELL_SUMMON_LASHER_2, true);
- DoCast(m_creature, SPELL_SUMMON_FLAYER_2, true);
+ DoCast(me, SPELL_SUMMON_LASHER_2, true);
+ DoCast(me, SPELL_SUMMON_FLAYER_2, true);
break;
case 2:
- DoCast(m_creature, SPELL_SUMMON_LASHER_3, true);
- DoCast(m_creature, SPELL_SUMMON_FLAYER_3, true);
+ DoCast(me, SPELL_SUMMON_LASHER_3, true);
+ DoCast(me, SPELL_SUMMON_FLAYER_3, true);
break;
case 3:
- DoCast(m_creature, SPELL_SUMMON_LASHER_4, true);
- DoCast(m_creature, SPELL_SUMMON_FLAYER_4, true);
+ DoCast(me, SPELL_SUMMON_LASHER_4, true);
+ DoCast(me, SPELL_SUMMON_FLAYER_4, true);
break;
}
CanSummon = false;
@@ -146,7 +146,7 @@ struct boss_lajAI : public ScriptedAI
void JustSummoned(Creature *summon)
{
- if (summon && m_creature->getVictim())
+ if (summon && me->getVictim())
summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
@@ -159,7 +159,7 @@ struct boss_lajAI : public ScriptedAI
{
if (Summon_Timer <= diff)
{
- DoScriptText(EMOTE_SUMMON, m_creature);
+ DoScriptText(EMOTE_SUMMON, me);
DoSummons();
Summon_Timer = 2500;
} else Summon_Timer -= diff;
@@ -167,13 +167,13 @@ struct boss_lajAI : public ScriptedAI
if (Allergic_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ALLERGIC_REACTION);
+ DoCast(me->getVictim(), SPELL_ALLERGIC_REACTION);
Allergic_Timer = 25000+rand()%15000;
} else Allergic_Timer -= diff;
if (Teleport_Timer <= diff)
{
- DoCast(m_creature, SPELL_TELEPORT_SELF);
+ DoCast(me, SPELL_TELEPORT_SELF);
Teleport_Timer = 30000+rand()%10000;
CanSummon = true;
} else Teleport_Timer -= diff;
diff --git a/src/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp b/src/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp
index 8bc0408b046..573fc466300 100644
--- a/src/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp
+++ b/src/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp
@@ -54,23 +54,23 @@ struct mob_treantAI : public ScriptedAI
{
if (WarpGuid && check_Timer <= diff)
{
- if (Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid))
+ if (Unit *Warp = Unit::GetUnit(*me, WarpGuid))
{
- if (m_creature->IsWithinMeleeRange(Warp,2.5f))
+ if (me->IsWithinMeleeRange(Warp,2.5f))
{
- int32 CurrentHP_Treant = (int32)m_creature->GetHealth();
- Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID());
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ int32 CurrentHP_Treant = (int32)me->GetHealth();
+ Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, me->GetGUID());
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
- m_creature->GetMotionMaster()->MoveFollow(Warp,0,0);
+ me->GetMotionMaster()->MoveFollow(Warp,0,0);
}
check_Timer = 1000;
} else check_Timer -= diff;
return;
}
- if (m_creature->getVictim()->GetGUID() != WarpGuid)
+ if (me->getVictim()->GetGUID() != WarpGuid)
DoMeleeAttackIfReady();
}
};
@@ -125,22 +125,22 @@ struct boss_warp_splinterAI : public ScriptedAI
Summon_Treants_Timer = 45000;
Arcane_Volley_Timer = 8000 + rand()%12000;
- m_creature->SetSpeed(MOVE_RUN, 0.7f, true);
+ me->SetSpeed(MOVE_RUN, 0.7f, true);
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
}
void SummonTreants()
@@ -151,12 +151,12 @@ struct boss_warp_splinterAI : public ScriptedAI
float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle);
float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle);
- float O = - m_creature->GetAngle(X,Y);
+ float O = - me->GetAngle(X,Y);
- if (Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000))
- CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID();
+ if (Creature *pTreant = me->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000))
+ CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = me->GetGUID();
}
- DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), m_creature);
+ DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), me);
}
void UpdateAI(const uint32 diff)
@@ -167,14 +167,14 @@ struct boss_warp_splinterAI : public ScriptedAI
//Check for War Stomp
if (War_Stomp_Timer <= diff)
{
- DoCast(m_creature->getVictim(), WAR_STOMP);
+ DoCast(me->getVictim(), WAR_STOMP);
War_Stomp_Timer = 25000 + rand()%15000;
} else War_Stomp_Timer -= diff;
//Check for Arcane Volley
if (Arcane_Volley_Timer <= diff)
{
- DoCast(m_creature->getVictim(), ARCANE_VOLLEY);
+ DoCast(me->getVictim(), ARCANE_VOLLEY);
Arcane_Volley_Timer = 20000 + rand()%15000;
} else Arcane_Volley_Timer -= diff;
diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
index a9c579eadf0..cf920ca762f 100644
--- a/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
@@ -112,14 +112,14 @@ struct boss_alarAI : public ScriptedAI
cur_wp = 4;
- m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
- m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
- //m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- //m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->setActive(false);
+ me->SetDisplayId(me->GetNativeDisplayId());
+ me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->setActive(false);
}
void EnterCombat(Unit *who)
@@ -127,9 +127,9 @@ struct boss_alarAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
DoZoneInCombat();
- m_creature->setActive(true);
+ me->setActive(true);
}
void JustDied(Unit *victim)
@@ -157,22 +157,22 @@ struct boss_alarAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && Phase1)
+ if (damage >= me->GetHealth() && Phase1)
{
damage = 0;
if (!WaitEvent)
{
WaitEvent = WE_DIE;
WaitTimer = 0;
- m_creature->SetHealth(0);
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AttackStop();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
+ me->SetHealth(0);
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->AttackStop();
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ me->SetSpeed(MOVE_RUN, 5.0f);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
}
}
}
@@ -181,9 +181,9 @@ struct boss_alarAI : public ScriptedAI
{
if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
{
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- m_creature->SetDisplayId(11686);
- //m_creature->SendUpdateObjectToAllExcept(NULL);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ me->SetDisplayId(11686);
+ //me->SendUpdateObjectToAllExcept(NULL);
}
}
@@ -199,12 +199,12 @@ struct boss_alarAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug?
+ if (!me->isInCombat()) // sometimes isincombat but !incombat, faction bug?
return;
if (Berserk_Timer <= diff)
{
- DoCast(m_creature, SPELL_BERSERK, true);
+ DoCast(me, SPELL_BERSERK, true);
Berserk_Timer = 60000;
} else Berserk_Timer -= diff;
@@ -212,7 +212,7 @@ struct boss_alarAI : public ScriptedAI
{
if (ForceTimer <= diff)
{
- m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
+ me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
ForceTimer = 5000;
} else ForceTimer -= diff;
@@ -225,7 +225,7 @@ struct boss_alarAI : public ScriptedAI
{
if (AfterMoving)
{
- m_creature->GetMotionMaster()->MoveIdle();
+ me->GetMotionMaster()->MoveIdle();
AfterMoving = false;
}
@@ -235,24 +235,24 @@ struct boss_alarAI : public ScriptedAI
Platforms_Move_Timer = 30000+rand()%5000;
break;
case WE_QUILL:
- DoCast(m_creature, SPELL_FLAME_QUILLS, true);
+ DoCast(me, SPELL_FLAME_QUILLS, true);
Platforms_Move_Timer = 1;
WaitTimer = 10000;
WaitEvent = WE_DUMMY;
return;
case WE_DIE:
ForceMove = false;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
WaitTimer = 5000;
WaitEvent = WE_REVIVE;
return;
case WE_REVIVE:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
+ me->SetHealth(me->GetMaxHealth());
+ me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoZoneInCombat();
- DoCast(m_creature, SPELL_REBIRTH, true);
+ DoCast(me, SPELL_REBIRTH, true);
MeltArmor_Timer = 60000;
Charge_Timer = 7000;
DiveBomb_Timer = 40000+rand()%5000;
@@ -260,22 +260,22 @@ struct boss_alarAI : public ScriptedAI
Phase1 = false;
break;
case WE_METEOR:
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- DoCast(m_creature, SPELL_DIVE_BOMB_VISUAL, false);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ DoCast(me, SPELL_DIVE_BOMB_VISUAL, false);
WaitEvent = WE_DIVE;
WaitTimer = 4000;
return;
case WE_DIVE:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
+ me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
DoCast(pTarget, SPELL_DIVE_BOMB, true);
float dist = 3.0f;
- if (m_creature->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f))
+ if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f))
dist = 5.0f;
WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
- m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f);
- m_creature->StopMoving();
+ me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f);
+ me->StopMoving();
WaitEvent = WE_LAND;
}
else
@@ -290,10 +290,10 @@ struct boss_alarAI : public ScriptedAI
case WE_SUMMON:
for (uint8 i = 0; i < 2; ++i)
DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
- DoCast(m_creature, SPELL_REBIRTH_2, true);
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(me->GetNativeDisplayId());
+ DoCast(me, SPELL_REBIRTH_2, true);
break;
case WE_DUMMY:
default:
@@ -309,7 +309,7 @@ struct boss_alarAI : public ScriptedAI
if (Phase1)
{
- if (m_creature->getThreatManager().getThreatList().empty())
+ if (me->getThreatManager().getThreatList().empty())
{
EnterEvadeMode();
return;
@@ -341,7 +341,7 @@ struct boss_alarAI : public ScriptedAI
}
ForceMove = true;
ForceTimer = 5000;
- m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
+ me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
WaitTimer = 0;
return;
} else Platforms_Move_Timer -= diff;
@@ -358,16 +358,16 @@ struct boss_alarAI : public ScriptedAI
if (MeltArmor_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR);
+ DoCast(me->getVictim(), SPELL_MELT_ARMOR);
MeltArmor_Timer = 60000;
} else MeltArmor_Timer -= diff;
if (DiveBomb_Timer <= diff)
{
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
+ me->AttackStop();
+ me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
WaitEvent = WE_METEOR;
WaitTimer = 0;
DiveBomb_Timer = 40000+rand()%5000;
@@ -378,14 +378,14 @@ struct boss_alarAI : public ScriptedAI
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
+ Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
if (Summoned)
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
Summoned->SetDisplayId(11686);
- Summoned->setFaction(m_creature->getFaction());
- Summoned->SetLevel(m_creature->getLevel());
+ Summoned->setFaction(me->getFaction());
+ Summoned->SetLevel(me->getLevel());
Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
}
}
@@ -398,23 +398,23 @@ struct boss_alarAI : public ScriptedAI
void DoMeleeAttackIfReady()
{
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
}
else
{
Unit *pTarget = NULL;
- pTarget = m_creature->SelectNearestTarget(5);
+ pTarget = me->SelectNearestTarget(5);
if (pTarget)
- m_creature->AI()->AttackStart(pTarget);
+ me->AI()->AttackStart(pTarget);
else
{
- DoCast(m_creature, SPELL_FLAME_BUFFET, true);
- m_creature->setAttackTimer(BASE_ATTACK, 1500);
+ DoCast(me, SPELL_FLAME_BUFFET, true);
+ me->setAttackTimer(BASE_ATTACK, 1500);
}
}
}
@@ -440,19 +440,19 @@ struct mob_ember_of_alarAI : public ScriptedAI
void Reset() {toDie = false;}
void EnterCombat(Unit *who) {DoZoneInCombat();}
- void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);}
+ void EnterEvadeMode() {me->setDeathState(JUST_DIED);}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie)
+ if (damage >= me->GetHealth() && pKiller != me && !toDie)
{
damage = 0;
- DoCast(m_creature, SPELL_EMBER_BLAST, true);
- m_creature->SetDisplayId(11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_EMBER_BLAST, true);
+ me->SetDisplayId(11686);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2)
{
- if (Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR)))
+ if (Unit* Alar = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALAR)))
{
int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03;
if (AlarHealth > 0)
@@ -472,8 +472,8 @@ struct mob_ember_of_alarAI : public ScriptedAI
if (toDie)
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- //m_creature->SetVisibility(VISIBILITY_OFF);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ //me->SetVisibility(VISIBILITY_OFF);
}
DoMeleeAttackIfReady();
diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp
index 0bc2226df19..d29d58e606f 100644
--- a/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp
@@ -71,7 +71,7 @@ static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421};
struct boss_high_astromancer_solarianAI : public ScriptedAI
{
- boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
+ boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
@@ -122,25 +122,25 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
- m_creature->SetArmor(defaultarmor);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
- m_creature->SetDisplayId(MODEL_HUMAN);
+ me->SetArmor(defaultarmor);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
+ me->SetDisplayId(MODEL_HUMAN);
Summons.DespawnAll();
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), m_creature);
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
}
void JustDied(Unit *victim)
{
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
- m_creature->SetDisplayId(MODEL_HUMAN);
- DoScriptText(SAY_DEATH, m_creature);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
+ me->SetDisplayId(MODEL_HUMAN);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE);
@@ -148,7 +148,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
@@ -157,7 +157,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
void SummonMinion(uint32 entry, float x, float y, float z)
{
- Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (Summoned)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
@@ -189,15 +189,15 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
if (AppearDelay)
{
- m_creature->StopMoving();
- m_creature->AttackStop();
+ me->StopMoving();
+ me->AttackStop();
if (AppearDelay_Timer <= diff)
{
AppearDelay = false;
if (Phase == 2)
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_OFF);
}
AppearDelay_Timer = 2000;
} else AppearDelay_Timer -= diff;
@@ -213,7 +213,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
if (Wrath_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true);
Wrath_Timer = 20000+rand()%5000;
@@ -223,13 +223,13 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
{
if (BlindingLight)
{
- DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT);
+ DoCast(me->getVictim(), SPELL_BLINDING_LIGHT);
BlindingLight = false;
}else{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!m_creature->HasInArc(2.5f, pTarget))
- pTarget = m_creature->getVictim();
+ if (!me->HasInArc(2.5f, pTarget))
+ pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_MISSILES);
@@ -239,7 +239,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
if (m_uiWrathOfTheAstromancer_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//Target the tank ?
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
@@ -258,8 +258,8 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
Phase = 2;
Phase1_Timer = 50000;
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
+ me->GetMotionMaster()->Clear();
+ me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
for (uint8 i=0; i <= 2; ++i)
{
if (!i)
@@ -285,7 +285,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
}
for (int i=0; i <= 2; ++i)
{
- if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
+ if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
@@ -297,8 +297,8 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
else if (Phase == 2)
{
//10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
- m_creature->AttackStop();
- m_creature->StopMoving();
+ me->AttackStop();
+ me->StopMoving();
if (Phase2_Timer <= diff)
{
Phase = 3;
@@ -306,14 +306,14 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
for (int j=1; j <= 4; j++)
SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
- DoScriptText(SAY_SUMMON1, m_creature);
+ DoScriptText(SAY_SUMMON1, me);
Phase2_Timer = 10000;
} else Phase2_Timer -= diff;
}
else if (Phase == 3)
{
- m_creature->AttackStop();
- m_creature->StopMoving();
+ me->AttackStop();
+ me->StopMoving();
//Check Phase3_Timer
if (Phase3_Timer <= diff)
@@ -322,17 +322,17 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
int i = rand()%3;
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
+ me->GetMotionMaster()->Clear();
+ me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
for (int j=0; j <= 2; j++)
if (j != i)
SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
- DoScriptText(SAY_SUMMON2, m_creature);
+ DoScriptText(SAY_SUMMON2, me);
AppearDelay = true;
Phase3_Timer = 15000;
} else Phase3_Timer -= diff;
@@ -342,31 +342,31 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
//Fear_Timer
if (Fear_Timer <= diff)
{
- DoCast(m_creature, SPELL_FEAR);
+ DoCast(me, SPELL_FEAR);
Fear_Timer = 20000;
} else Fear_Timer -= diff;
//VoidBolt_Timer
if (VoidBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_VOID_BOLT);
+ DoCast(me->getVictim(), SPELL_VOID_BOLT);
VoidBolt_Timer = 10000;
} else VoidBolt_Timer -= diff;
}
//When Solarian reaches 20% she will transform into a huge void walker.
- if (Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20))
+ if (Phase != 4 && ((me->GetHealth()*100 / me->GetMaxHealth())<20))
{
Phase = 4;
//To make sure she wont be invisible or not selecatble
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
- DoScriptText(SAY_VOIDA, m_creature);
- DoScriptText(SAY_VOIDB, m_creature);
- m_creature->SetArmor(WV_ARMOR);
- m_creature->SetDisplayId(MODEL_VOIDWALKER);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisibility(VISIBILITY_ON);
+ DoScriptText(SAY_VOIDA, me);
+ DoScriptText(SAY_VOIDB, me);
+ me->SetArmor(WV_ARMOR);
+ me->SetDisplayId(MODEL_VOIDWALKER);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
}
DoMeleeAttackIfReady();
@@ -410,10 +410,10 @@ struct mob_solarium_priestAI : public ScriptedAI
{
case 0:
if (pInstance)
- pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER));
+ pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER));
break;
case 1:
- pTarget = m_creature;
+ pTarget = me;
break;
}
@@ -426,13 +426,13 @@ struct mob_solarium_priestAI : public ScriptedAI
if (holysmiteTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE);
+ DoCast(me->getVictim(), SPELL_SOLARIUM_HOLY_SMITE);
holysmiteTimer = 4000;
} else holysmiteTimer -= diff;
if (aoesilenceTimer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT);
+ DoCast(me->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT);
aoesilenceTimer = 13000;
} else aoesilenceTimer -= diff;
diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp
index 26a744e6ff4..53ddbddc841 100644
--- a/src/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp
@@ -159,7 +159,7 @@ struct advisorbase_ai : public ScriptedAI
{
if (m_bDoubled_Health)
{
- m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2);
+ me->SetMaxHealth(me->GetMaxHealth() / 2);
m_bDoubled_Health = false;
}
@@ -167,19 +167,19 @@ struct advisorbase_ai : public ScriptedAI
DelayRes_Timer = 0;
DelayRes_Target = 0;
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//reset encounter
if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3))
- if (Creature *Kaelthas = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_KAELTHAS)))
+ if (Creature *Kaelthas = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_KAELTHAS)))
Kaelthas->AI()->EnterEvadeMode();
}
void MoveInLineOfSight(Unit *who)
{
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -187,7 +187,7 @@ struct advisorbase_ai : public ScriptedAI
void AttackStart(Unit* who)
{
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -195,20 +195,20 @@ struct advisorbase_ai : public ScriptedAI
void Revive(Unit* Target)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// double health for phase 3
- m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2);
+ me->SetMaxHealth(me->GetMaxHealth() * 2);
m_bDoubled_Health = true;
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetHealth(me->GetMaxHealth());
+ me->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(m_creature, SPELL_RES_VISUAL, false);
+ DoCast(me, SPELL_RES_VISUAL, false);
DelayRes_Timer = 2000;
}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (damage < m_creature->GetHealth())
+ if (damage < me->GetHealth())
return;
//Prevent glitch if in fake death
@@ -225,19 +225,19 @@ struct advisorbase_ai : public ScriptedAI
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);
+ me->InterruptNonMeleeSpells(false);
+ me->SetHealth(0);
+ me->StopMoving();
+ me->ClearComboPointHolders();
+ me->RemoveAllAurasOnDeath();
+ me->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
+ me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->ClearAllReactives();
+ me->SetUInt64Value(UNIT_FIELD_TARGET,0);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
JustDied(pKiller);
}
}
@@ -251,15 +251,15 @@ struct advisorbase_ai : public ScriptedAI
DelayRes_Timer = 0;
FakeDeath = false;
- Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target);
+ Unit* Target = Unit::GetUnit((*me), DelayRes_Target);
if (!Target)
- Target = m_creature->getVictim();
+ Target = me->getVictim();
DoResetThreat();
AttackStart(Target);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(Target);
- m_creature->AddThreat(Target, 0.0f);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(Target);
+ me->AddThreat(Target, 0.0f);
} else DelayRes_Timer -= diff;
}
}
@@ -269,7 +269,7 @@ struct advisorbase_ai : public ScriptedAI
//Kael'thas AI
struct boss_kaelthasAI : public ScriptedAI
{
- boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(m_creature)
+ boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
{
m_pInstance = pCreature->GetInstanceData();
memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid));
@@ -318,13 +318,13 @@ struct boss_kaelthasAI : public ScriptedAI
IsCastingFireball = false;
ChainPyros = false;
- if (m_creature->isInCombat())
+ if (me->isInCombat())
PrepareAdvisors();
summons.DespawnAll();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 0);
@@ -334,11 +334,11 @@ struct boss_kaelthasAI : public ScriptedAI
{
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
- if (Creature *pCreature = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i]))
+ if (Creature *pCreature = Unit::GetCreature((*me), m_auiAdvisorGuid[i]))
{
pCreature->Respawn();
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->setFaction(m_creature->getFaction());
+ pCreature->setFaction(me->getFaction());
pCreature->AI()->EnterEvadeMode();
}
}
@@ -358,14 +358,14 @@ struct boss_kaelthasAI : public ScriptedAI
{
error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3");
- DoScriptText(SAY_PHASE4_INTRO2, m_creature);
+ DoScriptText(SAY_PHASE4_INTRO2, me);
Phase = 4;
m_pInstance->SetData(DATA_KAELTHASEVENT, 4);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
AttackStart(pTarget);
@@ -375,10 +375,10 @@ struct boss_kaelthasAI : public ScriptedAI
{
PrepareAdvisors();
- DoScriptText(SAY_INTRO, m_creature);
+ DoScriptText(SAY_INTRO, me);
m_pInstance->SetData(DATA_KAELTHASEVENT, 1);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
PhaseSubphase = 0;
Phase_Timer = 23000;
@@ -388,27 +388,27 @@ struct boss_kaelthasAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
- m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
+ me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
{
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
- if (!m_creature->getVictim() && Phase >= 4)
+ if (!me->getVictim() && Phase >= 4)
{
who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
- else if (m_creature->GetMap()->IsDungeon())
+ else if (me->GetMap()->IsDungeon())
{
if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase)
StartEvent();
- who->SetInCombatWith(m_creature);
- m_creature->AddThreat(who, 0.0f);
+ who->SetInCombatWith(me);
+ me->AddThreat(who, 0.0f);
}
}
}
@@ -422,7 +422,7 @@ struct boss_kaelthasAI : public ScriptedAI
void KilledUnit()
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustSummoned(Creature* pSummoned)
@@ -441,10 +441,10 @@ struct boss_kaelthasAI : public ScriptedAI
void JustDied(Unit* Killer)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
summons.DespawnAll();
@@ -453,7 +453,7 @@ struct boss_kaelthasAI : public ScriptedAI
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
- if (Unit* pAdvisor = Unit::GetUnit((*m_creature), m_auiAdvisorGuid[i]))
+ if (Unit* pAdvisor = Unit::GetUnit((*me), m_auiAdvisorGuid[i]))
pAdvisor->Kill(pAdvisor);
}
}
@@ -475,7 +475,7 @@ struct boss_kaelthasAI : public ScriptedAI
case 0:
if (Phase_Timer <= diff)
{
- DoScriptText(SAY_INTRO_THALADRED, m_creature);
+ DoScriptText(SAY_INTRO_THALADRED, me);
//start advisor within 7 seconds
Phase_Timer = 7000;
@@ -487,12 +487,12 @@ struct boss_kaelthasAI : public ScriptedAI
case 1:
if (Phase_Timer <= diff)
{
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
+ Advisor->setFaction(me->getFaction());
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -505,11 +505,11 @@ struct boss_kaelthasAI : public ScriptedAI
//Subphase 2 - Start
case 2:
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0]));
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
- DoScriptText(SAY_INTRO_SANGUINAR, m_creature);
+ DoScriptText(SAY_INTRO_SANGUINAR, me);
//start advisor within 12.5 seconds
Phase_Timer = 12500;
@@ -521,12 +521,12 @@ struct boss_kaelthasAI : public ScriptedAI
case 3:
if (Phase_Timer <= diff)
{
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
+ Advisor->setFaction(me->getFaction());
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -539,11 +539,11 @@ struct boss_kaelthasAI : public ScriptedAI
//Subphase 3 - Start
case 4:
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1]));
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
- DoScriptText(SAY_INTRO_CAPERNIAN, m_creature);
+ DoScriptText(SAY_INTRO_CAPERNIAN, me);
//start advisor within 7 seconds
Phase_Timer = 7000;
@@ -555,12 +555,12 @@ struct boss_kaelthasAI : public ScriptedAI
case 5:
if (Phase_Timer <= diff)
{
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
+ Advisor->setFaction(me->getFaction());
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -573,11 +573,11 @@ struct boss_kaelthasAI : public ScriptedAI
//Subphase 4 - Start
case 6:
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2]));
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
- DoScriptText(SAY_INTRO_TELONICUS, m_creature);
+ DoScriptText(SAY_INTRO_TELONICUS, me);
//start advisor within 8.4 seconds
Phase_Timer = 8400;
@@ -589,12 +589,12 @@ struct boss_kaelthasAI : public ScriptedAI
case 7:
if (Phase_Timer <= diff)
{
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
+ Advisor->setFaction(me->getFaction());
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
@@ -608,7 +608,7 @@ struct boss_kaelthasAI : public ScriptedAI
//End of phase 1
case 8:
- Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3]));
+ Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3]));
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
@@ -616,11 +616,11 @@ struct boss_kaelthasAI : public ScriptedAI
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 2);
- DoScriptText(SAY_PHASE2_WEAPON, m_creature);
+ DoScriptText(SAY_PHASE2_WEAPON, me);
PhaseSubphase = 0;
Phase_Timer = 3500;
- DoCast(m_creature, SPELL_SUMMON_WEAPONS);
+ DoCast(me, SPELL_SUMMON_WEAPONS);
}
break;
}
@@ -640,12 +640,12 @@ struct boss_kaelthasAI : public ScriptedAI
//Spawn weapons
if (PhaseSubphase == 1)
{
- DoCast(m_creature, SPELL_SUMMON_WEAPONS, false);
+ DoCast(me, SPELL_SUMMON_WEAPONS, false);
uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32);
for (uint32 i = 0; i < uiMaxWeapon; ++i)
- DoCast(m_creature, m_auiSpellSummonWeapon[i], true);
+ DoCast(me, m_auiSpellSummonWeapon[i], true);
PhaseSubphase = 2;
Phase_Timer = TIME_PHASE_2_3;
@@ -655,7 +655,7 @@ struct boss_kaelthasAI : public ScriptedAI
{
if (Phase_Timer <= diff)
{
- DoScriptText(SAY_PHASE3_ADVANCE, m_creature);
+ DoScriptText(SAY_PHASE3_ADVANCE, me);
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 3);
Phase = 3;
@@ -675,7 +675,7 @@ struct boss_kaelthasAI : public ScriptedAI
Creature *Advisor;
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
- Advisor = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i]);
+ Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]);
if (!Advisor)
error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
@@ -689,7 +689,7 @@ struct boss_kaelthasAI : public ScriptedAI
if (Phase_Timer <= diff)
{
- DoScriptText(SAY_PHASE4_INTRO2, m_creature);
+ DoScriptText(SAY_PHASE4_INTRO2, me);
Phase = 4;
if (m_pInstance)
@@ -698,8 +698,8 @@ struct boss_kaelthasAI : public ScriptedAI
// Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael.
DoResetThreat();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
AttackStart(pTarget);
@@ -724,12 +724,12 @@ struct boss_kaelthasAI : public ScriptedAI
{
if (!IsCastingFireball)
{
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
//interruptable
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
int32 dmg = 20000+rand()%5000;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false);
+ me->CastCustomSpell(me->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false);
IsCastingFireball = true;
Fireball_Timer = 2500;
}
@@ -737,7 +737,7 @@ struct boss_kaelthasAI : public ScriptedAI
else
{
//apply resistance
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
IsCastingFireball = false;
Fireball_Timer = 5000+rand()%10000;
}
@@ -746,7 +746,7 @@ struct boss_kaelthasAI : public ScriptedAI
//ArcaneDisruption_Timer
if (ArcaneDisruption_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true);
+ DoCast(me->getVictim(), SPELL_ARCANE_DISRUPTION, true);
ArcaneDisruption_Timer = 60000;
} else ArcaneDisruption_Timer -= diff;
@@ -760,7 +760,7 @@ struct boss_kaelthasAI : public ScriptedAI
if (MindControl_Timer <= diff)
{
- if (m_creature->getThreatManager().getThreatList().size() >= 2)
+ if (me->getThreatManager().getThreatList().size() >= 2)
for (uint32 i = 0; i < 3; ++i)
{
debug_log("SD2: Kael'Thas mind control not supported.");
@@ -774,8 +774,8 @@ struct boss_kaelthasAI : public ScriptedAI
//Phoenix_Timer
if (Phoenix_Timer <= diff)
{
- DoCast(m_creature, SPELL_PHOENIX_ANIMATION);
- DoScriptText(RAND(SAY_SUMMON_PHOENIX1,SAY_SUMMON_PHOENIX2), m_creature);
+ DoCast(me, SPELL_PHOENIX_ANIMATION);
+ DoScriptText(RAND(SAY_SUMMON_PHOENIX1,SAY_SUMMON_PHOENIX2), me);
Phoenix_Timer = 60000;
} else Phoenix_Timer -= diff;
@@ -783,41 +783,41 @@ struct boss_kaelthasAI : public ScriptedAI
//Phase 4 specific spells
if (Phase == 4)
{
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 4);
Phase = 5;
Phase_Timer = 10000;
- DoScriptText(SAY_PHASE5_NUTS, m_creature);
+ DoScriptText(SAY_PHASE5_NUTS, me);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
- m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
+ me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_FULLPOWER);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_FULLPOWER);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
//ShockBarrier_Timer
if (ShockBarrier_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHOCK_BARRIER);
+ DoCast(me, SPELL_SHOCK_BARRIER);
ChainPyros = true;
PyrosCasted = 0;
ShockBarrier_Timer = 60000;
} else ShockBarrier_Timer -= diff;
//Chain Pyros (3 of them max)
- if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false))
+ if (ChainPyros && !me->IsNonMeleeSpellCasted(false))
{
if (PyrosCasted < 3)
{
- DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
+ DoCast(me->getVictim(), SPELL_PYROBLAST);
++PyrosCasted;
}
else
@@ -833,14 +833,14 @@ struct boss_kaelthasAI : public ScriptedAI
{
if (Phase_Timer <= diff)
{
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER);
+ me->InterruptNonMeleeSpells(false);
+ me->RemoveAurasDueToSpell(SPELL_FULLPOWER);
- DoCast(m_creature, SPELL_EXPLODE);
+ DoCast(me, SPELL_EXPLODE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Phase = 6;
- AttackStart(m_creature->getVictim());
+ AttackStart(me->getVictim());
} else Phase_Timer -= diff;
}
@@ -851,20 +851,20 @@ struct boss_kaelthasAI : public ScriptedAI
//GravityLapse_Timer
if (GravityLapse_Timer <= diff)
{
- std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
+ std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
switch (GravityLapse_Phase)
{
case 0:
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
- m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
+ me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
+ me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
// 1) Kael'thas will portal the whole raid right into his body
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
//Use work around packet to prevent player from being dropped from combat
@@ -880,18 +880,18 @@ struct boss_kaelthasAI : public ScriptedAI
break;
case 1:
- DoScriptText(RAND(SAY_GRAVITYLAPSE1,SAY_GRAVITYLAPSE2), m_creature);
+ DoScriptText(RAND(SAY_GRAVITYLAPSE1,SAY_GRAVITYLAPSE2), me);
// 2) At that point he will put a Gravity Lapse debuff on everyone
- for (i = m_creature->getThreatManager().getThreatList().begin(); i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
{
- if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()))
+ if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()))
{
DoCast(pUnit, SPELL_KNOCKBACK, true);
//Gravity lapse - needs an exception in Spell system to work
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID());
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID());
//Using packet workaround
WorldPacket data(12);
@@ -907,8 +907,8 @@ struct boss_kaelthasAI : public ScriptedAI
case 2:
//Cast nether vapor aura on self
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_NETHER_VAPOR);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_NETHER_VAPOR);
GravityLapse_Timer = 20000;
++GravityLapse_Phase;
@@ -916,9 +916,9 @@ struct boss_kaelthasAI : public ScriptedAI
case 3:
//Remove flight
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
+ for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
- if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()))
+ if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()))
{
//Using packet workaround
WorldPacket data(12);
@@ -929,11 +929,11 @@ struct boss_kaelthasAI : public ScriptedAI
}
}
- m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR);
+ me->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR);
InGravityLapse = false;
GravityLapse_Timer = 60000;
GravityLapse_Phase = 0;
- AttackStart(m_creature->getVictim());
+ AttackStart(me->getVictim());
break;
}
} else GravityLapse_Timer -= diff;
@@ -943,7 +943,7 @@ struct boss_kaelthasAI : public ScriptedAI
//ShockBarrier_Timer
if (ShockBarrier_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHOCK_BARRIER);
+ DoCast(me, SPELL_SHOCK_BARRIER);
ShockBarrier_Timer = 20000;
} else ShockBarrier_Timer -= diff;
@@ -985,20 +985,20 @@ struct boss_thaladred_the_darkenerAI : public advisorbase_ai
void Aggro(Unit *who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (!who || FakeDeath)
return;
- DoScriptText(SAY_THALADRED_AGGRO, m_creature);
- m_creature->AddThreat(who, 5000000.0f);
+ DoScriptText(SAY_THALADRED_AGGRO, me);
+ me->AddThreat(who, 5000000.0f);
}
void JustDied(Unit* pKiller)
{
if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)
- DoScriptText(SAY_THALADRED_DEATH, m_creature);
+ DoScriptText(SAY_THALADRED_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -1019,8 +1019,8 @@ struct boss_thaladred_the_darkenerAI : public advisorbase_ai
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoResetThreat();
- m_creature->AddThreat(pTarget, 5000000.0f);
- DoScriptText(EMOTE_THALADRED_GAZE, m_creature, pTarget);
+ me->AddThreat(pTarget, 5000000.0f);
+ DoScriptText(EMOTE_THALADRED_GAZE, me, pTarget);
Gaze_Timer = 8500;
}
} else Gaze_Timer -= diff;
@@ -1028,14 +1028,14 @@ struct boss_thaladred_the_darkenerAI : public advisorbase_ai
//Silence_Timer
if (Silence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 20000;
} else Silence_Timer -= diff;
//PsychicBlow_Timer
if (PsychicBlow_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW);
+ DoCast(me->getVictim(), SPELL_PSYCHIC_BLOW);
PsychicBlow_Timer = 20000+rand()%5000;
} else PsychicBlow_Timer -= diff;
@@ -1058,19 +1058,19 @@ struct boss_lord_sanguinarAI : public advisorbase_ai
void Aggro(Unit *who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (!who || FakeDeath)
return;
- DoScriptText(SAY_SANGUINAR_AGGRO, m_creature);
+ DoScriptText(SAY_SANGUINAR_AGGRO, me);
}
void JustDied(Unit* Killer)
{
if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)
- DoScriptText(SAY_SANGUINAR_DEATH, m_creature);
+ DoScriptText(SAY_SANGUINAR_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -1088,7 +1088,7 @@ struct boss_lord_sanguinarAI : public advisorbase_ai
//Fear_Timer
if (Fear_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR);
+ DoCast(me->getVictim(), SPELL_BELLOWING_ROAR);
Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds
} else Fear_Timer -= diff;
@@ -1121,27 +1121,27 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai
void JustDied(Unit* pKiller)
{
if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)
- DoScriptText(SAY_CAPERNIAN_DEATH, m_creature);
+ DoScriptText(SAY_CAPERNIAN_DEATH, me);
}
void AttackStart(Unit* who)
{
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
- if (m_creature->Attack(who, true))
+ if (me->Attack(who, true))
{
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->AddThreat(who, 0.0f);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
- m_creature->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE);
+ me->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE);
}
}
void Aggro(Unit *who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (!who || FakeDeath)
@@ -1165,7 +1165,7 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai
{
if (Yell_Timer <= diff)
{
- DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature);
+ DoScriptText(SAY_CAPERNIAN_AGGRO, me);
Yell = true;
} else Yell_Timer -= diff;
}
@@ -1173,7 +1173,7 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai
//Fireball_Timer
if (Fireball_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL);
+ DoCast(me->getVictim(), SPELL_CAPERNIAN_FIREBALL);
Fireball_Timer = 4000;
} else Fireball_Timer -= diff;
@@ -1183,10 +1183,10 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && m_creature->IsWithinDistInMap(pTarget, 30))
+ if (pTarget && me->IsWithinDistInMap(pTarget, 30))
DoCast(pTarget, SPELL_CONFLAGRATION);
else
- DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION);
+ DoCast(me->getVictim(), SPELL_CONFLAGRATION);
Conflagration_Timer = 10000+rand()%5000;
} else Conflagration_Timer -= diff;
@@ -1196,12 +1196,12 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai
{
bool InMeleeRange = false;
Unit *pTarget = NULL;
- std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
{
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
//if in melee range
- if (pUnit && pUnit->IsWithinDistInMap(m_creature, 5))
+ if (pUnit && pUnit->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
pTarget = pUnit;
@@ -1238,18 +1238,18 @@ struct boss_master_engineer_telonicusAI : public advisorbase_ai
void JustDied(Unit* pKiller)
{
if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)
- DoScriptText(SAY_TELONICUS_DEATH, m_creature);
+ DoScriptText(SAY_TELONICUS_DEATH, me);
}
void Aggro(Unit *who)
{
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (!who || FakeDeath)
return;
- DoScriptText(SAY_TELONICUS_AGGRO, m_creature);
+ DoScriptText(SAY_TELONICUS_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -1267,7 +1267,7 @@ struct boss_master_engineer_telonicusAI : public advisorbase_ai
//Bomb_Timer
if (Bomb_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_BOMB);
+ DoCast(me->getVictim(), SPELL_BOMB);
Bomb_Timer = 25000;
} else Bomb_Timer -= diff;
@@ -1299,8 +1299,8 @@ struct mob_kael_flamestrikeAI : public Scripted_NoMovementAI
Casting = false;
KillSelf = false;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
}
void MoveInLineOfSight(Unit *who) {}
@@ -1311,7 +1311,7 @@ struct mob_kael_flamestrikeAI : public Scripted_NoMovementAI
{
if (!Casting)
{
- DoCast(m_creature, SPELL_FLAME_STRIKE_VIS);
+ DoCast(me, SPELL_FLAME_STRIKE_VIS);
Casting = true;
}
@@ -1320,9 +1320,9 @@ struct mob_kael_flamestrikeAI : public Scripted_NoMovementAI
{
if (!KillSelf)
{
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_FLAME_STRIKE_DMG);
- } else m_creature->Kill(m_creature);
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_FLAME_STRIKE_DMG);
+ } else me->Kill(me);
KillSelf = true;
Timer = 1000;
@@ -1340,14 +1340,14 @@ struct mob_phoenix_tkAI : public ScriptedAI
void Reset()
{
Cycle_Timer = 2000;
- DoCast(m_creature, SPELL_BURN, true);
+ DoCast(me, SPELL_BURN, true);
}
void JustDied(Unit* killer)
{
//is this spell in use anylonger?
- //DoCast(m_creature, SPELL_EMBER_BLAST, true);
- m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000);
+ //DoCast(me, SPELL_EMBER_BLAST, true);
+ me->SummonCreature(NPC_PHOENIX_EGG,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000);
}
void UpdateAI(const uint32 diff)
@@ -1359,8 +1359,8 @@ struct mob_phoenix_tkAI : public ScriptedAI
{
//spell Burn should possible do this, but it doesn't, so do this for now.
uint32 dmg = urand(4500,5500);
- if (m_creature->GetHealth() > dmg)
- m_creature->SetHealth(uint32(m_creature->GetHealth()-dmg));
+ if (me->GetHealth() > dmg)
+ me->SetHealth(uint32(me->GetHealth()-dmg));
Cycle_Timer = 2000;
} else Cycle_Timer -= diff;
@@ -1385,10 +1385,10 @@ struct mob_phoenix_egg_tkAI : public ScriptedAI
void AttackStart(Unit* who)
{
- if (m_creature->Attack(who, false))
+ if (me->Attack(who, false))
{
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
+ me->SetInCombatWith(who);
+ who->SetInCombatWith(me);
DoStartNoMovement(who);
}
@@ -1396,7 +1396,7 @@ struct mob_phoenix_egg_tkAI : public ScriptedAI
void JustSummoned(Creature* summoned)
{
- summoned->AddThreat(m_creature->getVictim(), 0.0f);
+ summoned->AddThreat(me->getVictim(), 0.0f);
summoned->CastSpell(summoned,SPELL_REBIRTH,false);
}
@@ -1407,7 +1407,7 @@ struct mob_phoenix_egg_tkAI : public ScriptedAI
if (Rebirth_Timer <= diff)
{
- m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000);
+ me->SummonCreature(NPC_PHOENIX,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000);
Rebirth_Timer = 0;
} else Rebirth_Timer -= diff;
}
diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp
index e6823106ad8..b8523e2d1df 100644
--- a/src/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp
@@ -65,18 +65,18 @@ struct boss_void_reaverAI : public ScriptedAI
Enraged = false;
- if (pInstance && m_creature->isAlive())
+ if (pInstance && me->isAlive())
pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
}
void KilledUnit(Unit *victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *victim)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
DoZoneInCombat();
if (pInstance)
@@ -85,7 +85,7 @@ struct boss_void_reaverAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
@@ -99,9 +99,9 @@ struct boss_void_reaverAI : public ScriptedAI
// Pounding
if (Pounding_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_POUNDING);
+ DoCast(me->getVictim(), SPELL_POUNDING);
- DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), m_creature);
+ DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), me);
Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000)
} else Pounding_Timer -= diff;
@@ -109,11 +109,11 @@ struct boss_void_reaverAI : public ScriptedAI
if (ArcaneOrb_Timer <= diff)
{
Unit *pTarget = NULL;
- std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (!pTarget)
continue;
@@ -122,7 +122,7 @@ struct boss_void_reaverAI : public ScriptedAI
continue;
//18 yard radius minimum
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(m_creature, 18, false))
+ if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false))
target_list.push_back(pTarget);
pTarget = NULL;
}
@@ -130,10 +130,10 @@ struct boss_void_reaverAI : public ScriptedAI
if (target_list.size())
pTarget = *(target_list.begin()+rand()%target_list.size());
else
- pTarget = m_creature->getVictim();
+ pTarget = me->getVictim();
if (pTarget)
- m_creature->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget);
+ me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget);
ArcaneOrb_Timer = 3000;
} else ArcaneOrb_Timer -= diff;
@@ -141,11 +141,11 @@ struct boss_void_reaverAI : public ScriptedAI
// Single Target knock back, reduces aggro
if (KnockAway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY);
+ DoCast(me->getVictim(), SPELL_KNOCK_AWAY);
//Drop 25% aggro
- if (DoGetThreat(m_creature->getVictim()))
- DoModifyThreatPercent(m_creature->getVictim(),-25);
+ if (DoGetThreat(me->getVictim()))
+ DoModifyThreatPercent(me->getVictim(),-25);
KnockAway_Timer = 30000;
} else KnockAway_Timer -= diff;
@@ -153,7 +153,7 @@ struct boss_void_reaverAI : public ScriptedAI
//Berserk
if (Berserk_Timer < diff && !Enraged)
{
- DoCast(m_creature, SPELL_BERSERK);
+ DoCast(me, SPELL_BERSERK);
Enraged = true;
} else Berserk_Timer -= diff;
diff --git a/src/scripts/outland/tempest_keep/the_eye/the_eye.cpp b/src/scripts/outland/tempest_keep/the_eye/the_eye.cpp
index b28acec8f9d..8a7e1531960 100644
--- a/src/scripts/outland/tempest_keep/the_eye/the_eye.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/the_eye.cpp
@@ -57,16 +57,16 @@ struct mob_crystalcore_devastatorAI : public ScriptedAI
//Knockaway_Timer
if (Knockaway_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY, true);
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
// current aggro target is knocked away pick new target
Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
- if (!pTarget || pTarget == m_creature->getVictim())
+ if (!pTarget || pTarget == me->getVictim())
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
if (pTarget)
- m_creature->TauntApply(pTarget);
+ me->TauntApply(pTarget);
Knockaway_Timer = 23000;
} else Knockaway_Timer -= diff;
@@ -74,7 +74,7 @@ struct mob_crystalcore_devastatorAI : public ScriptedAI
//Countercharge_Timer
if (Countercharge_Timer <= diff)
{
- DoCast(m_creature, SPELL_COUNTERCHARGE);
+ DoCast(me, SPELL_COUNTERCHARGE);
Countercharge_Timer = 45000;
} else Countercharge_Timer -= diff;
diff --git a/src/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
index 7eca6355001..266511bcd46 100644
--- a/src/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
+++ b/src/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
@@ -59,7 +59,7 @@ struct boss_gatewatcher_iron_handAI : public ScriptedAI
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO_1, m_creature);
+ DoScriptText(SAY_AGGRO_1, me);
}
void KilledUnit(Unit* victim)
@@ -67,12 +67,12 @@ struct boss_gatewatcher_iron_handAI : public ScriptedAI
if (rand()%2)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH_1, m_creature);
+ DoScriptText(SAY_DEATH_1, me);
//TODO: Add door check/open code
}
@@ -85,7 +85,7 @@ struct boss_gatewatcher_iron_handAI : public ScriptedAI
//Shadow Power
if (Shadow_Power_Timer <= diff)
{
- DoCast(m_creature, SPELL_SHADOW_POWER);
+ DoCast(me, SPELL_SHADOW_POWER);
Shadow_Power_Timer = 20000 + rand()%8000;
} else Shadow_Power_Timer -= diff;
@@ -93,21 +93,21 @@ struct boss_gatewatcher_iron_handAI : public ScriptedAI
if (Jackhammer_Timer <= diff)
{
//TODO: expect cast this about 5 times in a row (?), announce it by emote only once
- DoScriptText(EMOTE_HAMMER, m_creature);
- DoCast(m_creature->getVictim(), SPELL_JACKHAMMER);
+ DoScriptText(EMOTE_HAMMER, me);
+ DoCast(me->getVictim(), SPELL_JACKHAMMER);
//chance to yell, but not same time as emote (after spell in fact casted)
if (rand()%2)
return;
- DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), m_creature);
+ DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), me);
Jackhammer_Timer = 30000;
} else Jackhammer_Timer -= diff;
//Stream of Machine Fluid
if (Stream_of_Machine_Fluid_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID);
+ DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID);
Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000;
} else Stream_of_Machine_Fluid_Timer -= diff;
diff --git a/src/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
index 22451829fc9..730618aff90 100644
--- a/src/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
@@ -73,19 +73,19 @@ struct boss_nethermancer_sepethreaAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS);
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
DoCast(who, SPELL_SUMMON_RAGIN_FLAMES);
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE);
@@ -100,26 +100,26 @@ struct boss_nethermancer_sepethreaAI : public ScriptedAI
//Frost Attack
if (frost_attack_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROST_ATTACK);
+ DoCast(me->getVictim(), SPELL_FROST_ATTACK);
frost_attack_Timer = 7000 + rand()%3000;
} else frost_attack_Timer -= diff;
//Arcane Blast
if (arcane_blast_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST);
+ DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
arcane_blast_Timer = 15000;
} else arcane_blast_Timer -= diff;
//Dragons Breath
if (dragons_breath_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_DRAGONS_BREATH);
+ DoCast(me->getVictim(), SPELL_DRAGONS_BREATH);
{
if (rand()%2)
return;
- DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), m_creature);
+ DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), me);
}
dragons_breath_Timer = 12000 + rand()%10000;
} else dragons_breath_Timer -= diff;
@@ -127,14 +127,14 @@ struct boss_nethermancer_sepethreaAI : public ScriptedAI
//Knockback
if (knockback_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCKBACK);
+ DoCast(me->getVictim(), SPELL_KNOCKBACK);
knockback_Timer = 15000 + rand()%10000;
} else knockback_Timer -= diff;
//Solarburn
if (solarburn_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SOLARBURN);
+ DoCast(me->getVictim(), SPELL_SOLARBURN);
solarburn_Timer = 30000;
} else solarburn_Timer -= diff;
@@ -172,9 +172,9 @@ struct mob_ragin_flamesAI : public ScriptedAI
flame_timer = 500;
Check_Timer = 2000;
onlyonce = false;
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f));
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f));
}
void EnterCombat(Unit* who)
@@ -191,8 +191,8 @@ struct mob_ragin_flamesAI : public ScriptedAI
if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS)
{
//remove
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
}
}
Check_Timer = 1000;
@@ -204,20 +204,20 @@ struct mob_ragin_flamesAI : public ScriptedAI
if (!onlyonce)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- m_creature->GetMotionMaster()->MoveChase(pTarget);
+ me->GetMotionMaster()->MoveChase(pTarget);
onlyonce = true;
}
if (inferno_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_INFERNO);
- m_creature->TauntApply(m_creature->getVictim());
+ DoCast(me->getVictim(), SPELL_INFERNO);
+ me->TauntApply(me->getVictim());
inferno_Timer = 10000;
} else inferno_Timer -= diff;
if (flame_timer <= diff)
{
- DoCast(m_creature, SPELL_FIRE_TAIL);
+ DoCast(me, SPELL_FIRE_TAIL);
flame_timer = 500;
} else flame_timer -=diff;
diff --git a/src/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
index 008a3c2dc61..29085d25bb0 100644
--- a/src/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
+++ b/src/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
@@ -50,7 +50,7 @@ EndScriptData */
struct boss_pathaleon_the_calculatorAI : public ScriptedAI
{
- boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature)
+ boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(me)
{
}
@@ -80,17 +80,17 @@ struct boss_pathaleon_the_calculatorAI : public ScriptedAI
}
void EnterCombat(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustDied(Unit* Killer)
{
- DoScriptText(SAY_DEATH, m_creature);
+ DoScriptText(SAY_DEATH, me);
summons.DespawnAll();
}
@@ -109,23 +109,23 @@ struct boss_pathaleon_the_calculatorAI : public ScriptedAI
for (uint8 i = 0; i < 3; ++i)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
if (pTarget && Wraith)
Wraith->AI()->AttackStart(pTarget);
}
- DoScriptText(SAY_SUMMON, m_creature);
+ DoScriptText(SAY_SUMMON, me);
Summon_Timer = 30000 + rand()%15000;
} else Summon_Timer -= diff;
if (ManaTap_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_MANA_TAP);
+ DoCast(me->getVictim(), SPELL_MANA_TAP);
ManaTap_Timer = 14000 + rand()%8000;
} else ManaTap_Timer -= diff;
if (ArcaneTorrent_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANE_TORRENT);
+ DoCast(me->getVictim(), SPELL_ARCANE_TORRENT);
ArcaneTorrent_Timer = 12000 + rand()%6000;
} else ArcaneTorrent_Timer -= diff;
@@ -133,7 +133,7 @@ struct boss_pathaleon_the_calculatorAI : public ScriptedAI
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
{
- DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), m_creature);
+ DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me);
DoCast(pTarget, SPELL_DOMINATION);
}
@@ -145,15 +145,15 @@ struct boss_pathaleon_the_calculatorAI : public ScriptedAI
{
if (ArcaneExplosion_Timer <= diff)
{
- DoCast(m_creature->getVictim(), H_SPELL_ARCANE_EXPLOSION);
+ DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION);
ArcaneExplosion_Timer = 10000 + rand()%4000;
} else ArcaneExplosion_Timer -= diff;
}
- if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
+ if (!Enraged && me->GetHealth()*100 / me->GetMaxHealth() < 21)
{
- DoCast(m_creature, SPELL_FRENZY);
- DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(me, SPELL_FRENZY);
+ DoScriptText(SAY_ENRAGE, me);
Enraged = true;
}
@@ -198,7 +198,7 @@ struct mob_nether_wraithAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget, SPELL_ARCANE_MISSILES);
else
- DoCast(m_creature->getVictim(), SPELL_ARCANE_MISSILES);
+ DoCast(me->getVictim(), SPELL_ARCANE_MISSILES);
ArcaneMissiles_Timer = 5000 + rand()%5000;
} else ArcaneMissiles_Timer -=diff;
@@ -207,7 +207,7 @@ struct mob_nether_wraithAI : public ScriptedAI
{
if (Detonation_Timer <= diff)
{
- DoCast(m_creature, SPELL_DETONATION);
+ DoCast(me, SPELL_DETONATION);
Detonation = true;
} else Detonation_Timer -= diff;
}
@@ -216,8 +216,8 @@ struct mob_nether_wraithAI : public ScriptedAI
{
if (Die_Timer <= diff)
{
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
} else Die_Timer -= diff;
}
diff --git a/src/scripts/outland/terokkar_forest.cpp b/src/scripts/outland/terokkar_forest.cpp
index 2a91a96fdb5..4567986bca0 100644
--- a/src/scripts/outland/terokkar_forest.cpp
+++ b/src/scripts/outland/terokkar_forest.cpp
@@ -60,27 +60,27 @@ struct mob_unkor_the_ruthlessAI : public ScriptedAI
CanDoQuest = false;
UnkorUnfriendly_Timer = 0;
Pulverize_Timer = 3000;
- m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- m_creature->setFaction(FACTION_HOSTILE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->setFaction(FACTION_HOSTILE);
}
void EnterCombat(Unit *who) {}
void DoNice()
{
- DoScriptText(SAY_SUBMIT, m_creature);
- m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetStandState(UNIT_STAND_STATE_SIT);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop(true);
+ DoScriptText(SAY_SUBMIT, me);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
UnkorUnfriendly_Timer = 60000;
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (done_by->GetTypeId() == TYPEID_PLAYER)
- if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30)
+ if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 30)
{
if (Group* pGroup = CAST_PLR(done_by)->GetGroup())
{
@@ -112,7 +112,7 @@ struct mob_unkor_the_ruthlessAI : public ScriptedAI
{
if (!UnkorUnfriendly_Timer)
{
- //DoCast(m_creature, SPELL_QUID9889); //not using spell for now
+ //DoCast(me, SPELL_QUID9889); //not using spell for now
DoNice();
}
else
@@ -130,7 +130,7 @@ struct mob_unkor_the_ruthlessAI : public ScriptedAI
if (Pulverize_Timer <= diff)
{
- DoCast(m_creature, SPELL_PULVERIZE);
+ DoCast(me, SPELL_PULVERIZE);
Pulverize_Timer = 9000;
} else Pulverize_Timer -= diff;
@@ -157,10 +157,10 @@ struct mob_infested_root_walkerAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
- if (m_creature->GetHealth() <= damage)
+ if (me->GetHealth() <= damage)
if (rand()%100 < 75)
//Summon Wood Mites
- DoCast(m_creature, 39130, true);
+ DoCast(me, 39130, true);
}
};
CreatureAI* GetAI_mob_infested_root_walker(Creature* pCreature)
@@ -202,7 +202,7 @@ public:
if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
- if (m_creature->IsWithinDistInMap(who, Radius))
+ if (me->IsWithinDistInMap(who, Radius))
{
Start(false, false, who->GetGUID());
}
@@ -237,10 +237,10 @@ struct mob_rotting_forest_ragerAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (done_by->GetTypeId() == TYPEID_PLAYER)
- if (m_creature->GetHealth() <= damage)
+ if (me->GetHealth() <= damage)
if (rand()%100 < 75)
//Summon Lots of Wood Mights
- DoCast(m_creature, 39134, true);
+ DoCast(me, 39134, true);
}
};
CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature)
@@ -275,15 +275,15 @@ struct mob_netherweb_victimAI : public ScriptedAI
{
if (rand()%100 < 25)
{
- m_creature->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, m_creature->GetGUID());
+ me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, me->GetGUID());
}
else
- m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
if (rand()%100 < 75)
- m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
}
}
@@ -329,8 +329,8 @@ struct npc_floonAI : public ScriptedAI
Silence_Timer = 2000;
Frostbolt_Timer = 4000;
FrostNova_Timer = 9000;
- if (m_creature->getFaction() != m_uiNormFaction)
- m_creature->setFaction(m_uiNormFaction);
+ if (me->getFaction() != m_uiNormFaction)
+ me->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit *who) {}
@@ -342,19 +342,19 @@ struct npc_floonAI : public ScriptedAI
if (Silence_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 30000;
} else Silence_Timer -= diff;
if (FrostNova_Timer <= diff)
{
- DoCast(m_creature, SPELL_FROST_NOVA);
+ DoCast(me, SPELL_FROST_NOVA);
FrostNova_Timer = 20000;
} else FrostNova_Timer -= diff;
if (Frostbolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 5000;
} else Frostbolt_Timer -= diff;
@@ -427,21 +427,21 @@ struct npc_isla_starmaneAI : public npc_escortAI
Cage->SetGoState(GO_STATE_ACTIVE);
}
break;
- case 2: DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); break;
- case 5: DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer); break;
- case 6: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); break;
- case 29:DoScriptText(SAY_PROGRESS_4, m_creature, pPlayer);
+ case 2: DoScriptText(SAY_PROGRESS_1, me, pPlayer); break;
+ case 5: DoScriptText(SAY_PROGRESS_2, me, pPlayer); break;
+ case 6: DoScriptText(SAY_PROGRESS_3, me, pPlayer); break;
+ case 29:DoScriptText(SAY_PROGRESS_4, me, pPlayer);
if (pPlayer)
{
if (pPlayer->GetTeam() == ALLIANCE)
- pPlayer->GroupEventHappens(QUEST_EFTW_A, m_creature);
+ pPlayer->GroupEventHappens(QUEST_EFTW_A, me);
else if (pPlayer->GetTeam() == HORDE)
- pPlayer->GroupEventHappens(QUEST_EFTW_H, m_creature);
+ pPlayer->GroupEventHappens(QUEST_EFTW_H, me);
}
- m_creature->SetInFront(pPlayer); break;
- case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case 31: DoCast(m_creature, SPELL_CAT);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
+ me->SetInFront(pPlayer); break;
+ case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case 31: DoCast(me, SPELL_CAT);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
}
}
@@ -581,19 +581,19 @@ struct npc_akunoAI : public npc_escortAI
switch(i)
{
case 3:
- m_creature->SummonCreature(NPC_CABAL_SKRIMISHER,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- m_creature->SummonCreature(NPC_CABAL_SKRIMISHER,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_CABAL_SKRIMISHER,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_CABAL_SKRIMISHER,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 11:
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
- pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_TOMB,m_creature);
+ pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_TOMB,me);
break;
}
}
void JustSummoned(Creature* summon)
{
- summon->AI()->AttackStart(m_creature);
+ summon->AI()->AttackStart(me);
}
};
diff --git a/src/scripts/outland/zangarmarsh.cpp b/src/scripts/outland/zangarmarsh.cpp
index c4b620eb92e..5d8c30b45fe 100644
--- a/src/scripts/outland/zangarmarsh.cpp
+++ b/src/scripts/outland/zangarmarsh.cpp
@@ -142,8 +142,8 @@ struct npc_cooshcooshAI : public ScriptedAI
void Reset()
{
LightningBolt_Timer = 2000;
- if (m_creature->getFaction() != m_uiNormFaction)
- m_creature->setFaction(m_uiNormFaction);
+ if (me->getFaction() != m_uiNormFaction)
+ me->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit *who) {}
@@ -155,7 +155,7 @@ struct npc_cooshcooshAI : public ScriptedAI
if (LightningBolt_Timer <= diff)
{
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
LightningBolt_Timer = 5000;
} else LightningBolt_Timer -= diff;
@@ -294,26 +294,26 @@ struct npc_kayra_longmaneAI : public npc_escortAI
switch(i)
{
case 4:
- DoScriptText(SAY_AMBUSH1, m_creature, pPlayer);
+ DoScriptText(SAY_AMBUSH1, me, pPlayer);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 5:
- DoScriptText(SAY_PROGRESS, m_creature, pPlayer);
+ DoScriptText(SAY_PROGRESS, me, pPlayer);
SetRun();
break;
case 16:
- DoScriptText(SAY_AMBUSH2, m_creature, pPlayer);
+ DoScriptText(SAY_AMBUSH2, me, pPlayer);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 17:
SetRun(false);
- DoScriptText(SAY_NEAR_END, m_creature, pPlayer);
+ DoScriptText(SAY_NEAR_END, me, pPlayer);
break;
case 25:
- DoScriptText(SAY_END, m_creature, pPlayer);
- pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature);
+ DoScriptText(SAY_END, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM, me);
break;
}
}
diff --git a/src/scripts/world/boss_emeriss.cpp b/src/scripts/world/boss_emeriss.cpp
index fd930f6838f..0dcb30bd55d 100644
--- a/src/scripts/world/boss_emeriss.cpp
+++ b/src/scripts/world/boss_emeriss.cpp
@@ -59,7 +59,7 @@ struct boss_emerissAI : public ScriptedAI
void Aggro(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 uiDiff)
@@ -82,7 +82,7 @@ struct boss_emerissAI : public ScriptedAI
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
+ DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
@@ -91,7 +91,7 @@ struct boss_emerissAI : public ScriptedAI
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_TAILSWEEP);
+ DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
@@ -100,7 +100,7 @@ struct boss_emerissAI : public ScriptedAI
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
- // DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
+ // DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
@@ -109,7 +109,7 @@ struct boss_emerissAI : public ScriptedAI
//VolatileInfection_Timer
if (m_uiVolatileInfection_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_VOLATILEINFECTION);
+ DoCast(me->getVictim(), SPELL_VOLATILEINFECTION);
m_uiVolatileInfection_Timer = 7000 + rand()%5000;
}
else
@@ -117,11 +117,11 @@ struct boss_emerissAI : public ScriptedAI
//CorruptionofEarth_Timer
//CorruptionofEarth at 75%, 50% and 25%
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
{
++m_uiCorruptionsCasted; // prevent casting twice on same hp
- DoScriptText(SAY_CASTCORRUPTION, m_creature);
- DoCast(m_creature->getVictim(), SPELL_CORRUPTIONOFEARTH);
+ DoScriptText(SAY_CASTCORRUPTION, me);
+ DoCast(me->getVictim(), SPELL_CORRUPTIONOFEARTH);
}
DoMeleeAttackIfReady();
diff --git a/src/scripts/world/boss_taerar.cpp b/src/scripts/world/boss_taerar.cpp
index 82c02ec8e3e..b394e3240c5 100644
--- a/src/scripts/world/boss_taerar.cpp
+++ b/src/scripts/world/boss_taerar.cpp
@@ -81,7 +81,7 @@ struct boss_taerarAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustSummoned(Creature* pSummoned)
@@ -95,8 +95,8 @@ struct boss_taerarAI : public ScriptedAI
if (m_bShades && m_uiShades_Timer <= uiDiff)
{
//Become unbanished again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_bShades = false;
}
else if (m_bShades)
@@ -124,7 +124,7 @@ struct boss_taerarAI : public ScriptedAI
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
+ DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
@@ -133,7 +133,7 @@ struct boss_taerarAI : public ScriptedAI
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
- DoCast(m_creature, SPELL_TAILSWEEP);
+ DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
@@ -142,7 +142,7 @@ struct boss_taerarAI : public ScriptedAI
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
- // DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
+ // DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
@@ -151,7 +151,7 @@ struct boss_taerarAI : public ScriptedAI
//ArcaneBlast_Timer
if (m_uiArcaneBlast_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_ARCANEBLAST);
+ DoCast(me->getVictim(), SPELL_ARCANEBLAST);
m_uiArcaneBlast_Timer = 7000 + rand()%5000;
}
else
@@ -160,25 +160,25 @@ struct boss_taerarAI : public ScriptedAI
//BellowingRoar_Timer
if (m_uiBellowingRoar_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
m_uiBellowingRoar_Timer = 20000 + rand()%10000;
}
else
m_uiBellowingRoar_Timer -= uiDiff;
//Summon 3 Shades at 75%, 50% and 25% (if bShades is true we already left in line 117, no need to check here again)
- if (!m_bShades && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiShadesSummoned)))
+ if (!m_bShades && (me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiShadesSummoned)))
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
//Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
//horrible workaround, need to fix
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SAY_SUMMONSHADE, m_creature);
+ DoScriptText(SAY_SUMMONSHADE, me);
int iSize = sizeof(m_auiSpellSummonShade) / sizeof(uint32);
@@ -217,7 +217,7 @@ struct boss_shadeoftaerarAI : public ScriptedAI
//PoisonCloud_Timer
if (m_uiPoisonCloud_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_POSIONCLOUD);
+ DoCast(me->getVictim(), SPELL_POSIONCLOUD);
m_uiPoisonCloud_Timer = 30000;
}
else
@@ -226,7 +226,7 @@ struct boss_shadeoftaerarAI : public ScriptedAI
//PosionBreath_Timer
if (m_uiPosionBreath_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_POSIONBREATH);
+ DoCast(me->getVictim(), SPELL_POSIONBREATH);
m_uiPosionBreath_Timer = 12000;
}
else
diff --git a/src/scripts/world/boss_ysondre.cpp b/src/scripts/world/boss_ysondre.cpp
index bac9fe81010..9413e1b19d6 100644
--- a/src/scripts/world/boss_ysondre.cpp
+++ b/src/scripts/world/boss_ysondre.cpp
@@ -65,7 +65,7 @@ struct boss_ysondreAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
- DoScriptText(SAY_AGGRO, m_creature);
+ DoScriptText(SAY_AGGRO, me);
}
void JustSummoned(Creature* pSummoned)
@@ -93,7 +93,7 @@ struct boss_ysondreAI : public ScriptedAI
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
+ DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
@@ -113,7 +113,7 @@ struct boss_ysondreAI : public ScriptedAI
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
- // DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
+ // DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
@@ -132,12 +132,12 @@ struct boss_ysondreAI : public ScriptedAI
m_uiLightningWave_Timer -= uiDiff;
//Summon Druids
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiSummonDruidModifier)))
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiSummonDruidModifier)))
{
- DoScriptText(SAY_SUMMONDRUIDS, m_creature);
+ DoScriptText(SAY_SUMMONDRUIDS, me);
for (int i = 0; i < 10; ++i)
- DoCast(m_creature, SPELL_SUMMONDRUIDS, true);
+ DoCast(me, SPELL_SUMMONDRUIDS, true);
++m_uiSummonDruidModifier;
}
@@ -166,7 +166,7 @@ struct mob_dementeddruidsAI : public ScriptedAI
//MoonFire_Timer
if (m_uiMoonFire_Timer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
+ DoCast(me->getVictim(), SPELL_MOONFIRE);
m_uiMoonFire_Timer = 5000;
}
else
diff --git a/src/scripts/world/guards.cpp b/src/scripts/world/guards.cpp
index 3d6edd9c1c3..95aa4a381ba 100644
--- a/src/scripts/world/guards.cpp
+++ b/src/scripts/world/guards.cpp
@@ -2552,7 +2552,7 @@ struct guard_shattrath_aldorAI : public guardAI
{
if (Exile_Timer <= diff)
{
- if (Unit* temp = Unit::GetUnit(*m_creature,PlayerGUID))
+ if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
@@ -2564,7 +2564,7 @@ struct guard_shattrath_aldorAI : public guardAI
}
else if (Banish_Timer <= diff)
{
- Unit* temp = m_creature->getVictim();
+ Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
@@ -2748,7 +2748,7 @@ struct guard_shattrath_scryerAI : public guardAI
{
if (Exile_Timer <= diff)
{
- if (Unit* temp = Unit::GetUnit(*m_creature,PlayerGUID))
+ if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
@@ -2760,7 +2760,7 @@ struct guard_shattrath_scryerAI : public guardAI
}
else if (Banish_Timer <= diff)
{
- Unit* temp = m_creature->getVictim();
+ Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
diff --git a/src/scripts/world/mob_generic_creature.cpp b/src/scripts/world/mob_generic_creature.cpp
index f3b0b864f78..48845050a8f 100644
--- a/src/scripts/world/mob_generic_creature.cpp
+++ b/src/scripts/world/mob_generic_creature.cpp
@@ -43,7 +43,7 @@ struct generic_creatureAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- if (!m_creature->IsWithinMeleeRange(who))
+ if (!me->IsWithinMeleeRange(who))
{
IsSelfRooted = true;
}
@@ -57,16 +57,16 @@ struct generic_creatureAI : public ScriptedAI
else GlobalCooldown = 0;
//Buff timer (only buff when we are alive and not in combat
- if (!m_creature->isInCombat() && m_creature->isAlive())
+ if (!me->isInCombat() && me->isAlive())
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
- SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
+ SpellEntry const *info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
- DoCastSpell(m_creature, info);
+ DoCastSpell(me, info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
@@ -82,52 +82,52 @@ struct generic_creatureAI : public ScriptedAI
return;
//If we are within range melee the target
- if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ if (me->IsWithinMeleeRange(me->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
- if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 30)
+ info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
+ else info = SelectSpell(me->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
- if (info && (rand() % (m_creature->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
+ if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
- if (Healing)DoCastSpell(m_creature, info);
- else DoCastSpell(m_creature->getVictim(), info);
+ if (Healing)DoCastSpell(me, info);
+ else DoCastSpell(me->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
+ else me->AttackerStateUpdate(me->getVictim());
- m_creature->resetAttackTimer();
+ me->resetAttackTimer();
}
}
else
{
//Only run this code if we arn't already casting
- if (!m_creature->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp ONLY 33% of the time
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 30 && rand() % 3 == 0)
+ info = SelectSpell(me, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
+ else info = SelectSpell(me->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
@@ -139,8 +139,8 @@ struct generic_creatureAI : public ScriptedAI
}
//Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->getVictim(),info);
+ if (Healing) DoCastSpell(me,info);
+ else DoCastSpell(me->getVictim(),info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
@@ -149,7 +149,7 @@ struct generic_creatureAI : public ScriptedAI
else if (IsSelfRooted)
{
//Cancel our current spell and then allow movement agian
- m_creature->InterruptNonMeleeSpells(false);
+ me->InterruptNonMeleeSpells(false);
IsSelfRooted = false;
}
}
diff --git a/src/scripts/world/npcs_special.cpp b/src/scripts/world/npcs_special.cpp
index 3ab437c0503..b3b9406ca00 100644
--- a/src/scripts/world/npcs_special.cpp
+++ b/src/scripts/world/npcs_special.cpp
@@ -143,7 +143,7 @@ struct npc_air_force_botsAI : public ScriptedAI
Creature* SummonGuard()
{
- Creature* pSummoned = m_creature->SummonCreature(m_pSpawnAssoc->m_uiSpawnedCreatureEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
+ Creature* pSummoned = me->SummonCreature(m_pSpawnAssoc->m_uiSpawnedCreatureEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
if (pSummoned)
m_uiSpawnedGUID = pSummoned->GetGUID();
@@ -158,7 +158,7 @@ struct npc_air_force_botsAI : public ScriptedAI
Creature* GetSummonedGuard()
{
- Creature* pCreature = Unit::GetCreature(*m_creature, m_uiSpawnedGUID);
+ Creature* pCreature = Unit::GetCreature(*me, m_uiSpawnedGUID);
if (pCreature && pCreature->isAlive())
return pCreature;
@@ -171,7 +171,7 @@ struct npc_air_force_botsAI : public ScriptedAI
if (!m_pSpawnAssoc)
return;
- if (pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho))
+ if (pWho->isTargetableForAttack() && me->IsHostileTo(pWho))
{
Player* pPlayerTarget = pWho->GetTypeId() == TYPEID_PLAYER ? CAST_PLR(pWho) : NULL;
@@ -189,7 +189,7 @@ struct npc_air_force_botsAI : public ScriptedAI
{
case SPAWNTYPE_ALARMBOT:
{
- if (!pWho->IsWithinDistInMap(m_creature, RANGE_GUARDS_MARK))
+ if (!pWho->IsWithinDistInMap(me, RANGE_GUARDS_MARK))
return;
Aura* pMarkAura = pWho->GetAura(SPELL_GUARDS_MARK);
@@ -224,7 +224,7 @@ struct npc_air_force_botsAI : public ScriptedAI
}
case SPAWNTYPE_TRIPWIRE_ROOFTOP:
{
- if (!pWho->IsWithinDistInMap(m_creature, RANGE_TRIPWIRE))
+ if (!pWho->IsWithinDistInMap(me, RANGE_TRIPWIRE))
return;
if (!pLastSpawnedGuard)
@@ -305,8 +305,8 @@ struct npc_chicken_cluckAI : public ScriptedAI
void Reset()
{
ResetFlagTimer = 120000;
- m_creature->setFaction(FACTION_CHICKEN);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->setFaction(FACTION_CHICKEN);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
}
void EnterCombat(Unit *who) {}
@@ -314,7 +314,7 @@ struct npc_chicken_cluckAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
// Reset flags after a certain time has passed so that the next player has to start the 'event' again
- if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
+ if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
{
if (ResetFlagTimer <= diff)
{
@@ -334,17 +334,17 @@ struct npc_chicken_cluckAI : public ScriptedAI
case TEXTEMOTE_CHICKEN:
if (pPlayer->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand()%30 == 1)
{
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- m_creature->setFaction(FACTION_FRIENDLY);
- DoScriptText(EMOTE_HELLO, m_creature);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->setFaction(FACTION_FRIENDLY);
+ DoScriptText(EMOTE_HELLO, me);
}
break;
case TEXTEMOTE_CHEER:
if (pPlayer->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE)
{
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- m_creature->setFaction(FACTION_FRIENDLY);
- DoScriptText(EMOTE_CLUCK_TEXT, m_creature);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->setFaction(FACTION_FRIENDLY);
+ DoScriptText(EMOTE_CLUCK_TEXT, me);
}
break;
}
@@ -391,16 +391,16 @@ struct npc_dancing_flamesAI : public ScriptedAI
{
active = true;
can_iteract = 3500;
- DoCast(m_creature, SPELL_BRAZIER, true);
- DoCast(m_creature, SPELL_FIERY_AURA, false);
+ DoCast(me, SPELL_BRAZIER, true);
+ DoCast(me, SPELL_FIERY_AURA, false);
float x, y, z;
- m_creature->GetPosition(x,y,z);
- m_creature->Relocate(x,y,z + 0.94f);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
+ me->GetPosition(x,y,z);
+ me->Relocate(x,y,z + 0.94f);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
WorldPacket data; //send update position to client
- m_creature->BuildHeartBeatMsg(&data);
- m_creature->SendMessageToSet(&data,true);
+ me->BuildHeartBeatMsg(&data);
+ me->SendMessageToSet(&data,true);
}
void UpdateAI(const uint32 diff)
@@ -410,7 +410,7 @@ struct npc_dancing_flamesAI : public ScriptedAI
if (can_iteract <= diff){
active = true;
can_iteract = 3500;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
} else can_iteract -= diff;
}
}
@@ -419,20 +419,20 @@ struct npc_dancing_flamesAI : public ScriptedAI
void ReceiveEmote(Player* pPlayer, uint32 emote)
{
- if (m_creature->IsWithinLOS(pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()) && m_creature->IsWithinDistInMap(pPlayer,30.0f))
+ if (me->IsWithinLOS(pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()) && me->IsWithinDistInMap(pPlayer,30.0f))
{
- m_creature->SetInFront(pPlayer);
+ me->SetInFront(pPlayer);
active = false;
WorldPacket data;
- m_creature->BuildHeartBeatMsg(&data);
- m_creature->SendMessageToSet(&data,true);
+ me->BuildHeartBeatMsg(&data);
+ me->SendMessageToSet(&data,true);
switch(emote)
{
- 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_KISS: me->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
+ case TEXTEMOTE_WAVE: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_BOW: me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_JOKE: me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
case TEXTEMOTE_DANCE:
{
if (!pPlayer->HasAura(SPELL_SEDUCTION))
@@ -547,7 +547,7 @@ struct npc_doctorAI : public ScriptedAI
Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void BeginEvent(Player* pPlayer);
@@ -575,29 +575,29 @@ struct npc_injured_patientAI : public ScriptedAI
Coord = NULL;
//no select
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//no regen health
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
//to make them lay with face down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
- uint32 mobId = m_creature->GetEntry();
+ uint32 mobId = me->GetEntry();
switch (mobId)
{ //lower max health
case 12923:
case 12938: //Injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75));
+ me->SetHealth(uint32(me->GetMaxHealth()*.75));
break;
case 12924:
case 12936: //Badly injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50));
+ me->SetHealth(uint32(me->GetMaxHealth()*.50));
break;
case 12925:
case 12937: //Critically injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25));
+ me->SetHealth(uint32(me->GetMaxHealth()*.25));
break;
}
}
@@ -606,38 +606,38 @@ struct npc_injured_patientAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
+ if (caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && spell->Id == 20804)
{
if ((CAST_PLR(caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (CAST_PLR(caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
if (Doctorguid)
- if (Creature* Doctor = Unit::GetCreature(*m_creature, Doctorguid))
- CAST_AI(npc_doctorAI, Doctor->AI())->PatientSaved(m_creature, CAST_PLR(caster), Coord);
+ if (Creature* Doctor = Unit::GetCreature(*me, Doctorguid))
+ CAST_AI(npc_doctorAI, Doctor->AI())->PatientSaved(me, CAST_PLR(caster), Coord);
//make not selectable
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//regen health
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
//stand up
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
- DoScriptText(RAND(SAY_DOC1,SAY_DOC2,SAY_DOC3), m_creature);
+ DoScriptText(RAND(SAY_DOC1,SAY_DOC2,SAY_DOC3), me);
- uint32 mobId = m_creature->GetEntry();
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ uint32 mobId = me->GetEntry();
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
switch (mobId)
{
case 12923:
case 12924:
case 12925:
- m_creature->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ);
+ me->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ);
break;
case 12936:
case 12937:
case 12938:
- m_creature->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ);
+ me->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ);
break;
}
}
@@ -646,21 +646,21 @@ struct 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)
+ if (me->isAlive() && me->GetHealth() > 6)
{
- m_creature->SetHealth(uint32(m_creature->GetHealth()-5));
+ me->SetHealth(uint32(me->GetHealth()-5));
}
- if (m_creature->isAlive() && m_creature->GetHealth() <= 6)
+ if (me->isAlive() && me->GetHealth() <= 6)
{
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setDeathState(JUST_DIED);
+ me->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
if (Doctorguid)
{
- if (Creature* Doctor = Unit::GetCreature((*m_creature), Doctorguid))
+ if (Creature* Doctor = Unit::GetCreature((*me), Doctorguid))
CAST_AI(npc_doctorAI, Doctor->AI())->PatientDied(Coord);
}
}
@@ -685,7 +685,7 @@ void npc_doctorAI::BeginEvent(Player* pPlayer)
PatientDiedCount = 0;
PatientSavedCount = 0;
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case DOCTOR_ALLIANCE:
for (uint8 i = 0; i < ALLIANCE_COORDS; ++i)
@@ -698,7 +698,7 @@ void npc_doctorAI::BeginEvent(Player* pPlayer)
}
Event = true;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void npc_doctorAI::PatientDied(Location* Point)
@@ -741,7 +741,7 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* pPlayer, Location* Po
std::list<uint64>::const_iterator itr;
for (itr = Patients.begin(); itr != Patients.end(); ++itr)
{
- if (Creature* Patient = Unit::GetCreature((*m_creature), *itr))
+ if (Creature* Patient = Unit::GetCreature((*me), *itr))
Patient->setDeathState(JUST_DIED);
}
}
@@ -781,7 +781,7 @@ void npc_doctorAI::UpdateAI(const uint32 diff)
std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
uint32 patientEntry = 0;
- switch(m_creature->GetEntry())
+ switch(me->GetEntry())
{
case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
@@ -792,7 +792,7 @@ void npc_doctorAI::UpdateAI(const uint32 diff)
Point = *itr;
- Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Patient = me->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (Patient)
{
@@ -800,7 +800,7 @@ void npc_doctorAI::UpdateAI(const uint32 diff)
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();
+ CAST_AI(npc_injured_patientAI, Patient->AI())->Doctorguid = me->GetGUID();
if (Point)
CAST_AI(npc_injured_patientAI, Patient->AI())->Coord = Point;
@@ -883,9 +883,9 @@ struct npc_garments_of_questsAI : public npc_escortAI
RunAwayTimer = 5000;
- m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
//expect database to have RegenHealth=0
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7));
+ me->SetHealth(int(me->GetMaxHealth()*0.7));
}
void EnterCombat(Unit *who) {}
@@ -895,7 +895,7 @@ struct npc_garments_of_questsAI : public npc_escortAI
if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1)
{
//not while in combat
- if (m_creature->isInCombat())
+ if (me->isInCombat())
return;
//nothing to be done now
@@ -904,21 +904,21 @@ struct npc_garments_of_questsAI : public npc_escortAI
if (pCaster->GetTypeId() == TYPEID_PLAYER)
{
- switch(m_creature->GetEntry())
+ switch(me->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);
+ DoScriptText(SAY_SHAYA_THANKS,me,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);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,me,pCaster);
bIsHealed = true;
}
}
@@ -928,14 +928,14 @@ struct npc_garments_of_questsAI : public npc_escortAI
{
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
{
- DoScriptText(SAY_ROBERTS_THANKS,m_creature,pCaster);
+ DoScriptText(SAY_ROBERTS_THANKS,me,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);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,me,pCaster);
bIsHealed = true;
}
}
@@ -945,14 +945,14 @@ struct npc_garments_of_questsAI : public npc_escortAI
{
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
{
- DoScriptText(SAY_DOLF_THANKS,m_creature,pCaster);
+ DoScriptText(SAY_DOLF_THANKS,me,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);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,me,pCaster);
bIsHealed = true;
}
}
@@ -962,14 +962,14 @@ struct npc_garments_of_questsAI : public npc_escortAI
{
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
{
- DoScriptText(SAY_KORJA_THANKS,m_creature,pCaster);
+ DoScriptText(SAY_KORJA_THANKS,me,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);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,me,pCaster);
bIsHealed = true;
}
}
@@ -979,14 +979,14 @@ struct npc_garments_of_questsAI : public npc_escortAI
{
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
{
- DoScriptText(SAY_DG_KEL_THANKS,m_creature,pCaster);
+ DoScriptText(SAY_DG_KEL_THANKS,me,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);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,me,pCaster);
bIsHealed = true;
}
}
@@ -995,7 +995,7 @@ struct npc_garments_of_questsAI : public npc_escortAI
//give quest credit, not expect any special quest objectives
if (bCanRun)
- CAST_PLR(pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
+ CAST_PLR(pCaster)->TalkedToCreature(me->GetEntry(),me->GetGUID());
}
}
}
@@ -1006,19 +1006,19 @@ struct npc_garments_of_questsAI : public npc_escortAI
void UpdateAI(const uint32 diff)
{
- if (bCanRun && !m_creature->isInCombat())
+ if (bCanRun && !me->isInCombat())
{
if (RunAwayTimer <= diff)
{
- if (Unit *pUnit = Unit::GetUnit(*m_creature,caster))
+ if (Unit *pUnit = Unit::GetUnit(*me,caster))
{
- switch(m_creature->GetEntry())
+ switch(me->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;
+ case ENTRY_SHAYA: DoScriptText(SAY_SHAYA_GOODBYE,me,pUnit); break;
+ case ENTRY_ROBERTS: DoScriptText(SAY_ROBERTS_GOODBYE,me,pUnit); break;
+ case ENTRY_DOLF: DoScriptText(SAY_DOLF_GOODBYE,me,pUnit); break;
+ case ENTRY_KORJA: DoScriptText(SAY_KORJA_GOODBYE,me,pUnit); break;
+ case ENTRY_DG_KEL: DoScriptText(SAY_DG_KEL_GOODBYE,me,pUnit); break;
}
Start(false,true,true);
@@ -1051,7 +1051,7 @@ struct npc_guardianAI : public ScriptedAI
void Reset()
{
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void EnterCombat(Unit *who)
@@ -1063,10 +1063,10 @@ struct npc_guardianAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (m_creature->isAttackReady())
+ if (me->isAttackReady())
{
- DoCast(m_creature->getVictim(), SPELL_DEATHTOUCH, true);
- m_creature->resetAttackTimer();
+ DoCast(me->getVictim(), SPELL_DEATHTOUCH, true);
+ me->resetAttackTimer();
}
}
};
@@ -1441,13 +1441,13 @@ struct npc_steam_tonkAI : public ScriptedAI
if (apply)
{
// Initialize the action bar without the melee attack command
- m_creature->InitCharmInfo();
- m_creature->GetCharmInfo()->InitEmptyActionBar(false);
+ me->InitCharmInfo();
+ me->GetCharmInfo()->InitEmptyActionBar(false);
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
}
else
- m_creature->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_AGGRESSIVE);
}
};
@@ -1463,7 +1463,7 @@ struct npc_tonk_mineAI : public ScriptedAI
{
npc_tonk_mineAI(Creature *c) : ScriptedAI(c)
{
- m_creature->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_PASSIVE);
}
uint32 ExplosionTimer;
@@ -1481,8 +1481,8 @@ struct npc_tonk_mineAI : public ScriptedAI
{
if (ExplosionTimer <= diff)
{
- DoCast(m_creature, SPELL_TONK_MINE_DETONATE, true);
- m_creature->setDeathState(DEAD); // unsummon it
+ DoCast(me, SPELL_TONK_MINE_DETONATE, true);
+ me->setDeathState(DEAD); // unsummon it
} else
ExplosionTimer -= diff;
}
@@ -1506,7 +1506,7 @@ struct npc_brewfest_revelerAI : public ScriptedAI
return;
if (emote == TEXTEMOTE_DANCE)
- m_creature->CastSpell(pPlayer, 41586, false);
+ me->CastSpell(pPlayer, 41586, false);
}
};
@@ -1532,13 +1532,13 @@ struct npc_winter_revelerAI : public ScriptedAI
if (emote == TEXTEMOTE_KISS)
{
- m_creature->CastSpell(m_creature, 26218, false);
+ me->CastSpell(me, 26218, false);
pPlayer->CastSpell(pPlayer, 26218, false);
switch (urand(0,2))
{
- case 0: m_creature->CastSpell(pPlayer, 26207, false); break;
- case 1: m_creature->CastSpell(pPlayer, 26206, false); break;
- case 2: m_creature->CastSpell(pPlayer, 45036, false); break;
+ case 0: me->CastSpell(pPlayer, 26207, false); break;
+ case 1: me->CastSpell(pPlayer, 26206, false); break;
+ case 2: me->CastSpell(pPlayer, 45036, false); break;
}
}
}
@@ -1580,7 +1580,7 @@ struct npc_snake_trap_serpentsAI : public ScriptedAI
Spawn = true;
SpellTimer = 0;
- CreatureInfo const *Info = m_creature->GetCreatureInfo();
+ CreatureInfo const *Info = me->GetCreatureInfo();
if (Info->Entry == C_VIPER)
IsViper = true;
@@ -1589,24 +1589,24 @@ struct npc_snake_trap_serpentsAI : public ScriptedAI
//Add delta to make them not all hit the same time
uint32 delta = (rand() % 7) * 100;
- m_creature->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, Info->baseattacktime + delta);
- m_creature->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER , Info->attackpower);
+ me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, Info->baseattacktime + delta);
+ me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER , Info->attackpower);
}
//Redefined for random target selection:
void MoveInLineOfSight(Unit *who)
{
- if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
if (!(rand() % RAND))
{
- m_creature->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
+ me->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
SpellTimer = (rand() % 10) * 100;
AttackStart(who);
}
@@ -1620,15 +1620,15 @@ struct npc_snake_trap_serpentsAI : public ScriptedAI
{
Spawn = false;
// Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
- if (!m_creature->getVictim() && m_creature->isSummon())
- if (Unit * Owner = CAST_SUM(m_creature)->GetSummoner())
+ if (!me->getVictim() && me->isSummon())
+ if (Unit * Owner = CAST_SUM(me)->GetSummoner())
if (Owner->getAttackerForHelper())
AttackStart(Owner->getAttackerForHelper());
}
- if (!m_creature->getVictim())
+ if (!me->getVictim())
{
- if (m_creature->isInCombat())
+ if (me->isInCombat())
DoStopAttack();
return;
}
@@ -1645,7 +1645,7 @@ struct npc_snake_trap_serpentsAI : public ScriptedAI
else
spell = SPELL_CRIPPLING_POISON;
- DoCast(m_creature->getVictim(), spell);
+ DoCast(me->getVictim(), spell);
}
SpellTimer = VIPER_TIMER;
@@ -1653,7 +1653,7 @@ struct npc_snake_trap_serpentsAI : public ScriptedAI
else //Venomous Snake
{
if (urand(0,2) == 0) //33% chance to cast
- DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON);
+ DoCast(me->getVictim(), SPELL_DEADLY_POISON);
SpellTimer = VENOMOUS_SNAKE_TIMER + (rand() %5)*100;
}
} else SpellTimer -= diff;
@@ -1685,25 +1685,25 @@ struct mob_mojoAI : public ScriptedAI
{
victimGUID = 0;
hearts = 15000;
- if (Unit* own = m_creature->GetOwner())
- m_creature->GetMotionMaster()->MoveFollow(own,0,0);
+ if (Unit* own = me->GetOwner())
+ me->GetMotionMaster()->MoveFollow(own,0,0);
}
void Aggro(Unit *who){}
void UpdateAI(const uint32 diff)
{
- if (m_creature->HasAura(20372))
+ if (me->HasAura(20372))
{
if (hearts <= diff)
{
- m_creature->RemoveAurasDueToSpell(20372);
+ me->RemoveAurasDueToSpell(20372);
hearts = 15000;
} hearts -= diff;
}
}
void ReceiveEmote(Player* pPlayer, uint32 emote)
{
- m_creature->HandleEmoteCommand(emote);
- Unit* own = m_creature->GetOwner();
+ me->HandleEmoteCommand(emote);
+ Unit* own = me->GetOwner();
if (!own || own->GetTypeId() != TYPEID_PLAYER || CAST_PLR(own)->GetTeam() != pPlayer->GetTeam())
return;
if (emote == TEXTEMOTE_KISS)
@@ -1724,17 +1724,17 @@ struct mob_mojoAI : public ScriptedAI
break;
case 7:whisp.append(SAY_RANDOM_MOJO7);break;
}
- m_creature->MonsterWhisper(whisp.c_str(),pPlayer->GetGUID());
+ me->MonsterWhisper(whisp.c_str(),pPlayer->GetGUID());
if (victimGUID)
{
Player* victim = Unit::GetPlayer(victimGUID);
if (victim)
victim->RemoveAura(43906);//remove polymorph frog thing
}
- m_creature->AddAura(43906,pPlayer);//add polymorph frog thing
+ me->AddAura(43906,pPlayer);//add polymorph frog thing
victimGUID = pPlayer->GetGUID();
- DoCast(m_creature, 20372, true);//tag.hearts
- m_creature->GetMotionMaster()->MoveFollow(pPlayer,0,0);
+ DoCast(me, 20372, true);//tag.hearts
+ me->GetMotionMaster()->MoveFollow(pPlayer,0,0);
hearts = 15000;
}
}
@@ -1775,7 +1775,7 @@ struct npc_mirror_image : CasterAI
if (owner && !me->hasUnitState(UNIT_STAT_FOLLOW))
{
me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, m_creature->GetFollowAngle(), MOTION_SLOT_ACTIVE);
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
}
}
};
@@ -1801,9 +1801,9 @@ struct npc_ebon_gargoyleAI : CasterAI
despawnTimer = 0;
// Find victim of Summon Gargoyle spell
std::list<Unit*> targets;
- Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_creature, m_creature, 30);
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_creature, targets, u_check);
- m_creature->VisitNearbyObject(30, searcher);
+ Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30);
+ Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check);
+ me->VisitNearbyObject(30, searcher);
for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
if ((*iter)->GetAura(49206,owner->GetGUID()))
{
@@ -1833,7 +1833,7 @@ struct npc_ebon_gargoyleAI : CasterAI
// Stop Fighting
me->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, true);
// Sanctuary
- me->CastSpell(m_creature, 54661, true);
+ me->CastSpell(me, 54661, true);
me->SetReactState(REACT_PASSIVE);
// Fly Away
@@ -1877,7 +1877,7 @@ struct npc_lightwellAI : public PassiveAI
void Reset()
{
- DoCast(m_creature, 59907, false); // Spell for Lightwell Charges
+ DoCast(me, 59907, false); // Spell for Lightwell Charges
}
};
@@ -1898,9 +1898,9 @@ struct npc_training_dummy : Scripted_NoMovementAI
uint32 DespawnTimer;
void Reset()
{
- m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave
- m_creature->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true);
+ me->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true);
ResetTimer = 10000;
DespawnTimer = 15000;
}
@@ -1929,8 +1929,8 @@ struct npc_training_dummy : Scripted_NoMovementAI
{
if (!UpdateVictim())
return;
- if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
- m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate
+ if (!me->hasUnitState(UNIT_STAT_STUNNED))
+ me->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate
if (m_Entry != 2674 && m_Entry != 2673)
{
@@ -1946,7 +1946,7 @@ struct npc_training_dummy : Scripted_NoMovementAI
else
{
if (DespawnTimer <= diff)
- m_creature->ForcedDespawn();
+ me->ForcedDespawn();
else
DespawnTimer -= diff;
}
@@ -1971,11 +1971,11 @@ struct npc_shadowfiendAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (m_creature->isSummon())
- if (Unit* pOwner = CAST_SUM(m_creature)->GetSummoner())
+ if (me->isSummon())
+ if (Unit* pOwner = CAST_SUM(me)->GetSummoner())
{
if (pOwner->HasAura(GLYPH_OF_SHADOWFIEND))
- if (damage >= m_creature->GetHealth())
+ if (damage >= me->GetHealth())
pOwner->CastSpell(pOwner,GLYPH_OF_SHADOWFIEND_MANA,true);
}
}