aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp88
-rw-r--r--src/bindings/scripts/scripts/boss/boss_emeriss.cpp312
-rw-r--r--src/bindings/scripts/scripts/boss/boss_lethon.cpp48
-rw-r--r--src/bindings/scripts/scripts/boss/boss_taerar.cpp612
-rw-r--r--src/bindings/scripts/scripts/boss/boss_ysondre.cpp492
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp2754
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.h432
-rw-r--r--src/bindings/scripts/scripts/creature/mob_generic_creature.cpp344
-rw-r--r--src/bindings/scripts/scripts/creature/simple_ai.cpp588
-rw-r--r--src/bindings/scripts/scripts/creature/simple_ai.h148
-rw-r--r--src/bindings/scripts/scripts/custom/custom_example.cpp554
-rw-r--r--src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp162
-rw-r--r--src/bindings/scripts/scripts/custom/test.cpp400
-rw-r--r--src/bindings/scripts/scripts/go/go_scripts.cpp418
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.cpp320
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.h50
-rw-r--r--src/bindings/scripts/scripts/guard/guards.cpp8234
-rw-r--r--src/bindings/scripts/scripts/item/item_scripts.cpp1058
-rw-r--r--src/bindings/scripts/scripts/item/item_test.cpp84
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.cpp608
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.h170
-rw-r--r--src/bindings/scripts/scripts/npc/npc_innkeeper.cpp288
-rw-r--r--src/bindings/scripts/scripts/npc/npc_professions.cpp2410
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp1756
-rw-r--r--src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp124
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp806
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp626
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp318
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp882
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp512
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h18
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp148
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp446
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp382
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp828
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp384
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h28
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp356
-rw-r--r--src/bindings/scripts/scripts/zone/azshara/azshara.cpp328
-rw-r--r--src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp306
-rw-r--r--src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp744
-rw-r--r--src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp772
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp136
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp730
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp5000
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp722
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp1604
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp1624
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp790
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp1178
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp538
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h68
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp1770
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp686
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp474
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp212
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp230
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp278
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp208
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp334
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp284
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp162
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp172
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp210
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp210
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp168
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp198
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp230
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp202
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp202
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp410
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp190
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp262
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp172
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp254
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp186
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp170
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp190
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp186
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp242
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp260
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp640
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp206
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp188
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp188
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp500
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp252
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp556
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp798
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp16
-rw-r--r--src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp882
-rw-r--r--src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp318
-rw-r--r--src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp364
-rw-r--r--src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp282
-rw-r--r--src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp314
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp274
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp248
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp338
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp1576
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h50
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp434
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp916
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h572
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp406
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp354
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp366
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp492
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h32
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp356
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp1832
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp1118
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp714
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp1844
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp676
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp812
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h52
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp454
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp130
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp446
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp594
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp510
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h32
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp340
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp156
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp312
-rw-r--r--src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp44
-rw-r--r--src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp196
-rw-r--r--src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp462
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp360
-rw-r--r--src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp196
-rw-r--r--src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp326
-rw-r--r--src/bindings/scripts/scripts/zone/felwood/felwood.cpp178
-rw-r--r--src/bindings/scripts/scripts/zone/feralas/feralas.cpp170
-rw-r--r--src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp268
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp562
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp1374
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h30
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp278
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp264
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp506
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp320
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp558
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp400
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp1076
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h26
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp664
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp1010
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp828
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h26
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp228
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp282
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp374
-rw-r--r--src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp186
-rw-r--r--src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp310
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp400
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp366
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp742
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp1736
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp74
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp66
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp1292
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp1346
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp908
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp2942
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h80
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp506
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp940
-rw-r--r--src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp1182
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp2734
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp804
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp466
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h58
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp382
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp194
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp188
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp298
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp216
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp210
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp298
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp402
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp180
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp194
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp266
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp634
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp242
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp430
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h42
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp514
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp176
-rw-r--r--src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp434
-rw-r--r--src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp128
-rw-r--r--src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp1136
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp430
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp404
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_feugen.cpp66
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp348
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp124
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp60
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp92
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp356
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp1084
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_lady_blaumeux.cpp294
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp432
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp492
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp360
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp320
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp334
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp398
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sir_zeliek.cpp292
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp70
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp98
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_thane_korthazz.cpp294
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp842
-rw-r--r--src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp458
-rw-r--r--src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp530
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp280
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp214
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp186
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp234
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp72
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp84
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp342
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp194
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp272
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp394
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp264
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_whitemane.cpp354
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp156
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp226
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scarlet_commander_mograine.cpp320
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp200
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp384
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp118
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp216
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp232
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp304
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp416
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp310
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp196
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp226
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp250
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp236
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp190
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h30
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp204
-rw-r--r--src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp318
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h24
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp304
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp234
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp422
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp1496
-rw-r--r--src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp882
-rw-r--r--src/bindings/scripts/scripts/zone/silithus/silithus.cpp298
-rw-r--r--src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp206
-rw-r--r--src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp200
-rw-r--r--src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp160
-rw-r--r--src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp544
-rw-r--r--src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp214
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp430
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp248
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp442
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp632
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp228
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp238
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp276
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp322
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp288
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp184
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp206
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h28
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp154
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp670
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp360
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp1566
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp1228
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp1314
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h86
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp550
-rw-r--r--src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp804
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp1212
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp756
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h38
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp448
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp430
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp396
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp576
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp1064
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp1090
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp3234
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp398
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h42
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp380
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp196
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp294
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp446
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp696
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp2720
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp380
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp286
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp280
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp542
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp628
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp1396
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp58
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h44
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp330
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp688
-rw-r--r--src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp798
-rw-r--r--src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp272
-rw-r--r--src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp176
-rw-r--r--src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp214
-rw-r--r--src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp374
-rw-r--r--src/bindings/scripts/scripts/zone/undercity/undercity.cpp520
-rw-r--r--src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp352
-rw-r--r--src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp314
-rw-r--r--src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp566
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp1048
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp802
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp1862
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp1458
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp608
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp1364
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h36
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp650
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp364
-rw-r--r--src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp448
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp422
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp184
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp184
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp512
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp200
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp594
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp544
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp622
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp502
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp302
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp1090
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp400
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp168
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h72
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp476
-rw-r--r--src/game/WorldSession.cpp3
354 files changed, 88882 insertions, 88879 deletions
diff --git a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
index 56b5908f6ca..117121d8530 100644
--- a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
+++ b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
@@ -1,44 +1,44 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Areatrigger_Scripts
-SD%Complete: 100
-SDComment: Scripts for areatriggers
-SDCategory: Areatrigger
-EndScriptData */
-
-/* ContentData
-at_test script test only
-EndContentData */
-
-#include "precompiled.h"
-
-bool ATtest(Player *player, AreaTriggerEntry *at)
-{
- player->Say("Hi!",LANG_UNIVERSAL);
- return true;
-}
-
-void AddSC_areatrigger_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="at_test";
- newscript->pAreaTrigger = ATtest;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Areatrigger_Scripts
+SD%Complete: 100
+SDComment: Scripts for areatriggers
+SDCategory: Areatrigger
+EndScriptData */
+
+/* ContentData
+at_test script test only
+EndContentData */
+
+#include "precompiled.h"
+
+bool ATtest(Player *player, AreaTriggerEntry *at)
+{
+ player->Say("Hi!",LANG_UNIVERSAL);
+ return true;
+}
+
+void AddSC_areatrigger_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="at_test";
+ newscript->pAreaTrigger = ATtest;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
index 25e0ec976e0..99b3a845f95 100644
--- a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
@@ -1,156 +1,156 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Emeriss
-SD%Complete: 90
-SDComment: Teleport function & Mark of Nature missing
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_VOLATILEINFECTION 24928
-#define SPELL_CORRUPTIONOFEARTH 24910
-
-struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI
-{
- boss_emerissAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 VolatileInfection_Timer;
- uint32 CorruptionofEarth1_Timer;
- uint32 CorruptionofEarth2_Timer;
- uint32 CorruptionofEarth3_Timer;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- VolatileInfection_Timer = 12000;
- CorruptionofEarth1_Timer = 0;
- CorruptionofEarth2_Timer = 0;
- CorruptionofEarth3_Timer = 0;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%8000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- }else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //VolatileInfection_Timer
- if (VolatileInfection_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
- VolatileInfection_Timer = 7000 + rand()%5000;
- }else VolatileInfection_Timer -= diff;
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (CorruptionofEarth1_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth1_Timer = 60000;
- } else CorruptionofEarth1_Timer -= diff;
- }
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (CorruptionofEarth2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth2_Timer = 60000;
- } else CorruptionofEarth2_Timer -= diff;
- }
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (CorruptionofEarth3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth3_Timer = 60000;
- } else CorruptionofEarth3_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_emeriss(Creature *_Creature)
-{
- return new boss_emerissAI (_Creature);
-}
-
-void AddSC_boss_emeriss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_emeriss";
- newscript->GetAI = GetAI_boss_emeriss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Emeriss
+SD%Complete: 90
+SDComment: Teleport function & Mark of Nature missing
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_VOLATILEINFECTION 24928
+#define SPELL_CORRUPTIONOFEARTH 24910
+
+struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI
+{
+ boss_emerissAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 VolatileInfection_Timer;
+ uint32 CorruptionofEarth1_Timer;
+ uint32 CorruptionofEarth2_Timer;
+ uint32 CorruptionofEarth3_Timer;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ VolatileInfection_Timer = 12000;
+ CorruptionofEarth1_Timer = 0;
+ CorruptionofEarth2_Timer = 0;
+ CorruptionofEarth3_Timer = 0;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%8000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ }else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //VolatileInfection_Timer
+ if (VolatileInfection_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
+ VolatileInfection_Timer = 7000 + rand()%5000;
+ }else VolatileInfection_Timer -= diff;
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (CorruptionofEarth1_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth1_Timer = 60000;
+ } else CorruptionofEarth1_Timer -= diff;
+ }
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (CorruptionofEarth2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth2_Timer = 60000;
+ } else CorruptionofEarth2_Timer -= diff;
+ }
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (CorruptionofEarth3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth3_Timer = 60000;
+ } else CorruptionofEarth3_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_emeriss(Creature *_Creature)
+{
+ return new boss_emerissAI (_Creature);
+}
+
+void AddSC_boss_emeriss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_emeriss";
+ newscript->GetAI = GetAI_boss_emeriss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_lethon.cpp b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
index 2aa40f5cb3b..2a6ab499c2d 100644
--- a/src/bindings/scripts/scripts/boss/boss_lethon.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Lethon
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Lethon
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/boss/boss_taerar.cpp b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
index ee6438087b9..67d3364dd66 100644
--- a/src/bindings/scripts/scripts/boss/boss_taerar.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
@@ -1,306 +1,306 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Taerar
-SD%Complete: 90
-SDComment: Mark of Nature & Teleport NYI
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-//Spells of Taerar
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_ARCANEBLAST 24857
-#define SPELL_BELLOWINGROAR 22686
-#define SPELL_SUMMONSHADE 24843
-
-//Spells of Shades of Taerar
-
-#define SPELL_POSIONCLOUD 24840
-#define SPELL_POSIONBREATH 20667
-
-struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI
-{
- boss_taerarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 ArcaneBlast_Timer;
- uint32 BellowingRoar_Timer;
- uint32 Shades_Timer;
- uint32 Summon1_Timer;
- uint32 Summon2_Timer;
- uint32 Summon3_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
- bool Shades;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- ArcaneBlast_Timer = 12000;
- BellowingRoar_Timer = 30000;
- Summon1_Timer = 0;
- Summon2_Timer = 0;
- Summon3_Timer = 0;
- Shades_Timer = 60000; //The time that Taerar is banished
- Shades = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonShades(Unit* victim)
- {
- Rand = rand()%15;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%15;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(15302, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (Shades && Shades_Timer < diff)
- {
- //Become unbanished again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = true;
- Shades = false;
- } else if (Shades)
- {
- Shades_Timer -= diff;
- //Do nothing while banished
- return;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%7000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- } else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //ArcaneBlast_Timer
- if (ArcaneBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEBLAST);
- ArcaneBlast_Timer = 7000 + rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- //BellowingRoar_Timer
- if (BellowingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
- BellowingRoar_Timer = 20000 + rand()%10000;
- } else BellowingRoar_Timer -= diff;
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (Summon1_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon1_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon1_Timer -= diff;
- }
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (Summon2_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon2_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon2_Timer -= diff;
- }
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (Summon3_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon3_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon3_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-// Shades of Taerar Script
-
-struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI
-{
- boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 PoisonCloud_Timer;
- uint32 PosionBreath_Timer;
-
- void Reset()
- {
- PoisonCloud_Timer = 8000;
- PosionBreath_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //PoisonCloud_Timer
- if (PoisonCloud_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POSIONCLOUD);
- PoisonCloud_Timer = 30000;
- }else PoisonCloud_Timer -= diff;
-
- //PosionBreath_Timer
- if (PosionBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POSIONBREATH);
- PosionBreath_Timer = 12000;
- }else PosionBreath_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_taerar(Creature *_Creature)
-{
- return new boss_taerarAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_shadeoftaerar(Creature *_Creature)
-{
- return new boss_shadeoftaerarAI (_Creature);
-}
-
-void AddSC_boss_taerar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_taerar";
- newscript->GetAI = GetAI_boss_taerar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_shade_of_taerar";
- newscript->GetAI = GetAI_boss_shadeoftaerar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Taerar
+SD%Complete: 90
+SDComment: Mark of Nature & Teleport NYI
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+//Spells of Taerar
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_ARCANEBLAST 24857
+#define SPELL_BELLOWINGROAR 22686
+#define SPELL_SUMMONSHADE 24843
+
+//Spells of Shades of Taerar
+
+#define SPELL_POSIONCLOUD 24840
+#define SPELL_POSIONBREATH 20667
+
+struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI
+{
+ boss_taerarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 ArcaneBlast_Timer;
+ uint32 BellowingRoar_Timer;
+ uint32 Shades_Timer;
+ uint32 Summon1_Timer;
+ uint32 Summon2_Timer;
+ uint32 Summon3_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+ bool Shades;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ ArcaneBlast_Timer = 12000;
+ BellowingRoar_Timer = 30000;
+ Summon1_Timer = 0;
+ Summon2_Timer = 0;
+ Summon3_Timer = 0;
+ Shades_Timer = 60000; //The time that Taerar is banished
+ Shades = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonShades(Unit* victim)
+ {
+ Rand = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(15302, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (Shades && Shades_Timer < diff)
+ {
+ //Become unbanished again
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = true;
+ Shades = false;
+ } else if (Shades)
+ {
+ Shades_Timer -= diff;
+ //Do nothing while banished
+ return;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%7000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ } else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //ArcaneBlast_Timer
+ if (ArcaneBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEBLAST);
+ ArcaneBlast_Timer = 7000 + rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ //BellowingRoar_Timer
+ if (BellowingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
+ BellowingRoar_Timer = 20000 + rand()%10000;
+ } else BellowingRoar_Timer -= diff;
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (Summon1_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon1_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon1_Timer -= diff;
+ }
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (Summon2_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon2_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon2_Timer -= diff;
+ }
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (Summon3_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon3_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon3_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+// Shades of Taerar Script
+
+struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI
+{
+ boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 PoisonCloud_Timer;
+ uint32 PosionBreath_Timer;
+
+ void Reset()
+ {
+ PoisonCloud_Timer = 8000;
+ PosionBreath_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //PoisonCloud_Timer
+ if (PoisonCloud_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POSIONCLOUD);
+ PoisonCloud_Timer = 30000;
+ }else PoisonCloud_Timer -= diff;
+
+ //PosionBreath_Timer
+ if (PosionBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POSIONBREATH);
+ PosionBreath_Timer = 12000;
+ }else PosionBreath_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_taerar(Creature *_Creature)
+{
+ return new boss_taerarAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_shadeoftaerar(Creature *_Creature)
+{
+ return new boss_shadeoftaerarAI (_Creature);
+}
+
+void AddSC_boss_taerar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_taerar";
+ newscript->GetAI = GetAI_boss_taerar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_shade_of_taerar";
+ newscript->GetAI = GetAI_boss_shadeoftaerar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
index 19513f552b2..3df1746bd76 100644
--- a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
@@ -1,246 +1,246 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Ysondre
-SD%Complete: 90
-SDComment: Mark of Nature & Teleport missing
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_LIGHTNINGWAVE 24819
-#define SPELL_SUMMONDRUIDS 24795
-
-//druid spells
-#define SPELL_MOONFIRE 21669
-
-// Ysondre script
-struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
-{
- boss_ysondreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 LightningWave_Timer;
- uint32 SummonDruids1_Timer;
- uint32 SummonDruids2_Timer;
- uint32 SummonDruids3_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- LightningWave_Timer = 12000;
- SummonDruids1_Timer = 0;
- SummonDruids2_Timer = 0;
- SummonDruids3_Timer = 0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonDruids(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(15260, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%7000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- }else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //LightningWave_Timer
- if (LightningWave_Timer < diff)
- {
- //Cast LIGHTNINGWAVE on a Random target
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_LIGHTNINGWAVE);
-
- LightningWave_Timer = 7000 + rand()%5000;
- }else LightningWave_Timer -= diff;
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (SummonDruids1_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids1_Timer = 60000;
- } else SummonDruids1_Timer -= diff;
- }
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (SummonDruids2_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids2_Timer = 60000;
- } else SummonDruids2_Timer -= diff;
- }
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (SummonDruids3_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids3_Timer = 60000;
- } else SummonDruids3_Timer -= diff;
- }
- DoMeleeAttackIfReady();
- }
-};
-// Summoned druid script
-struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI
-{
- mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MoonFire_Timer;
-
- void Reset()
- {
- MoonFire_Timer = 3000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //MoonFire_Timer
- if (MoonFire_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MOONFIRE);
- MoonFire_Timer = 5000;
- }else MoonFire_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_ysondre(Creature *_Creature)
-{
- return new boss_ysondreAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_dementeddruids(Creature *_Creature)
-{
- return new mob_dementeddruidsAI (_Creature);
-}
-
-void AddSC_boss_ysondre()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_ysondre";
- newscript->GetAI = GetAI_boss_ysondre;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_dementeddruids";
- newscript->GetAI = GetAI_mob_dementeddruids;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Ysondre
+SD%Complete: 90
+SDComment: Mark of Nature & Teleport missing
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_LIGHTNINGWAVE 24819
+#define SPELL_SUMMONDRUIDS 24795
+
+//druid spells
+#define SPELL_MOONFIRE 21669
+
+// Ysondre script
+struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
+{
+ boss_ysondreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 LightningWave_Timer;
+ uint32 SummonDruids1_Timer;
+ uint32 SummonDruids2_Timer;
+ uint32 SummonDruids3_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ LightningWave_Timer = 12000;
+ SummonDruids1_Timer = 0;
+ SummonDruids2_Timer = 0;
+ SummonDruids3_Timer = 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonDruids(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(15260, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%7000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ }else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //LightningWave_Timer
+ if (LightningWave_Timer < diff)
+ {
+ //Cast LIGHTNINGWAVE on a Random target
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_LIGHTNINGWAVE);
+
+ LightningWave_Timer = 7000 + rand()%5000;
+ }else LightningWave_Timer -= diff;
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (SummonDruids1_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids1_Timer = 60000;
+ } else SummonDruids1_Timer -= diff;
+ }
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (SummonDruids2_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids2_Timer = 60000;
+ } else SummonDruids2_Timer -= diff;
+ }
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (SummonDruids3_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids3_Timer = 60000;
+ } else SummonDruids3_Timer -= diff;
+ }
+ DoMeleeAttackIfReady();
+ }
+};
+// Summoned druid script
+struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI
+{
+ mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MoonFire_Timer;
+
+ void Reset()
+ {
+ MoonFire_Timer = 3000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //MoonFire_Timer
+ if (MoonFire_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MOONFIRE);
+ MoonFire_Timer = 5000;
+ }else MoonFire_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_ysondre(Creature *_Creature)
+{
+ return new boss_ysondreAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_dementeddruids(Creature *_Creature)
+{
+ return new mob_dementeddruidsAI (_Creature);
+}
+
+void AddSC_boss_ysondre()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ysondre";
+ newscript->GetAI = GetAI_boss_ysondre;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_dementeddruids";
+ newscript->GetAI = GetAI_mob_dementeddruids;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index 4d9421d645c..4086430ae74 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1,1377 +1,1377 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Mob_Event_AI
-SD%Complete: 90
-SDComment: Database Event AI
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-#include "mob_event_ai.h"
-
-#define EVENT_UPDATE_TIME 500
-#define SPELL_RUN_AWAY 8225
-
-struct EventHolder
-{
- EventHolder(EventAI_Event p) : Event(p), Time(0), Enabled(true){}
-
- EventAI_Event Event;
- uint32 Time;
- bool Enabled;
-};
-
-struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
-{
- Mob_EventAI(Creature *c, std::list<EventHolder> pEventList) : ScriptedAI(c)
- {
- EventList = pEventList;
- Phase = 0;
- CombatMovementEnabled = true;
- MeleeEnabled = true;
- AttackDistance = 0;
- AttackAngle = 0.0f;
-
- //Handle Spawned Events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
-
- Reset();
- }
-
- ~Mob_EventAI()
- {
- EventList.clear();
- }
-
- //Variables used by EventAI for handling events
- std::list<EventHolder> EventList; //Holder for events (stores enabled, time, and eventid)
- uint32 EventUpdateTime; //Time between event updates
- uint32 EventDiff; //Time between the last event call
-
- //Variables used by Events themselves
- uint8 Phase; //Current phase, max 32 phases
- bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
- bool MeleeEnabled; //If we allow melee auto attack
- uint32 AttackDistance; //Distance to attack from
- float AttackAngle; //Angle of attack
- uint32 TimetoFleeLeft; //For fleeing
-
- bool ProcessEvent(EventHolder& pHolder, Unit* pActionInvoker = NULL)
- {
- if (!pHolder.Enabled || pHolder.Time)
- return false;
-
- //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
- if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
- return false;
-
- //Store random here so that all random actions match up
- uint32 rnd = rand();
-
- //Return if chance for event is not met
- if (pHolder.Event.event_chance <= rnd % 100)
- return false;
-
- union
- {
- uint32 param1;
- int32 param1_s;
- };
-
- union
- {
- uint32 param2;
- int32 param2_s;
- };
-
- union
- {
- uint32 param3;
- int32 param3_s;
- };
-
- union
- {
- uint32 param4;
- int32 param4_s;
- };
-
- param1 = pHolder.Event.event_param1;
- param2 = pHolder.Event.event_param2;
- param3 = pHolder.Event.event_param3;
- param4 = pHolder.Event.event_param4;
-
- //Check event conditions based on the event type, also reset events
- switch (pHolder.Event.event_type)
- {
- case EVENT_T_TIMER:
- {
- if (!InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TIMER_OOC:
- {
- if (InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_HP:
- {
- if (!InCombat || !m_creature->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_MANA:
- {
- if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
- return false;
-
- uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_AGGRO:
- {
- }
- break;
- case EVENT_T_KILL:
- {
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- case EVENT_T_DEATH:
- {
- }
- break;
- case EVENT_T_EVADE:
- {
- }
- break;
- case EVENT_T_SPELLHIT:
- {
- //Spell hit is special case, param1 and param2 handled within EventAI::SpellHit
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_RANGE:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_OOC_LOS:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SPAWNED:
- {
- }
- break;
- case EVENT_T_TARGET_HP:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TARGET_CASTING:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
- return false;
-
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_HP:
- {
- if (!InCombat)
- return false;
-
- Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
-
- if (!pUnit)
- return false;
-
- pActionInvoker = pUnit;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_IS_CC:
- {
- if (!InCombat)
- return false;
-
- std::list<Creature*> pList = DoFindFriendlyCC(param2);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_MISSING_BUFF:
- {
- std::list<Creature*> pList = DoFindFriendlyMissingBuff(param2, param1);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SUMMONED_UNIT:
- {
- //Prevent event from occuring on no unit or non creatures
- if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
- return false;
-
- //Creature id doesn't match up
- if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
- return false;
-
- //Repeat Timers
- if (param2 == param3)
- {
- pHolder.Time = param2;
-
- }else if (param3 > param2)
- pHolder.Time = urand(param2, param3);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- default:
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: 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);
- break;
- }
-
- //Disable non-repeatable events
- if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
- pHolder.Enabled = false;
-
- //Process actions
- for (uint32 j = 0; j < MAX_ACTIONS; j++)
- ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
-
- return true;
- }
-
- inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
- {
- switch (rnd % 3)
- {
- case 0:
- return param1;
- break;
- case 1:
- return param2;
- break;
- case 2:
- return param3;
- break;
- }
- return 0;
- }
-
- inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker)
- {
- switch (Target)
- {
- case TARGET_T_SELF:
- return m_creature;
- break;
- case TARGET_T_HOSTILE:
- return m_creature->getVictim();
- break;
- case TARGET_T_HOSTILE_SECOND_AGGRO:
- return SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case TARGET_T_HOSTILE_LAST_AGGRO:
- return SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case TARGET_T_HOSTILE_RANDOM:
- return SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
- return SelectUnit(SELECT_TARGET_RANDOM,1);
- break;
- case TARGET_T_ACTION_INVOKER:
- return pActionInvoker;
- break;
- default:
- return NULL;
- break;
- };
- }
-
- void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
- {
- switch (type)
- {
- case ACTION_T_SAY:
- DoSay(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_YELL:
- DoYell(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_TEXTEMOTE:
- DoTextEmote(GetEventAIText(param1), pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_SOUND:
- DoPlaySoundToSet(m_creature, param1);
- break;
- case ACTION_T_EMOTE:
- m_creature->HandleEmoteCommand(param1);
- break;
- case ACTION_T_RANDOM_SAY:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoSay(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_YELL:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoYell(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_TEXTEMOTE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoTextEmote(GetEventAIText(temp), pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_SOUND:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoPlaySoundToSet(m_creature, temp);
- }
- break;
- case ACTION_T_RANDOM_EMOTE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- m_creature->HandleEmoteCommand(temp);
- }
- break;
- case ACTION_T_CAST:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
- Unit* caster = m_creature;
-
- if (!target)
- return;
-
- //Cast is always triggered if target is forced to cast on self
- if (param3 & CAST_FORCE_TARGET_SELF)
- {
- param3 |= CAST_TRIGGERED;
- caster = target;
- }
-
- //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
- bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
-
- // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
- if(param3 & CAST_AURA_NOT_PRESENT)
- {
- for(uint8 i = 0; i < 3; ++i)
- if(target->HasAura(param1, i))
- return;
- }
-
- if (canCast)
- {
- const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
-
- //Verify that spell exists
- if (tSpell)
- {
- //Check if cannot cast spell
- if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
- !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
- {
- //Melee current victim if flag not set
- if (!(param3 & CAST_NO_MELEE_IF_OOM))
- {
- AttackDistance = 0;
- AttackAngle = 0;
-
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
-
- }else
- {
- //Interrupt any previous spell
- if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
- caster->InterruptNonMeleeSpells(false);
-
- caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
- }
-
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
- }
- }
- break;
- case ACTION_T_SUMMON:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- Creature* pCreature = NULL;
-
- if (param3)
- pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
- else pCreature = pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_THREAT_SINGLE_PCT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- m_creature->getThreatManager().modifyThreatPercent(target, param1);
- }
- break;
- case ACTION_T_THREAT_ALL_PCT:
- {
- Unit* Temp = NULL;
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp)
- m_creature->getThreatManager().modifyThreatPercent(Temp, param1);
- }
- }
- break;
- case ACTION_T_QUEST_EVENT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->AreaExploredOrEventHappens(param1);
- }
- break;
- case ACTION_T_CASTCREATUREGO:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- break;
- case ACTION_T_SET_UNIT_FIELD:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (target)
- target->SetUInt32Value(param1, param2);
- }
- break;
- case ACTION_T_SET_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->SetFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_REMOVE_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_AUTO_ATTACK:
- {
- if (param1)
- MeleeEnabled = true;
- else MeleeEnabled = false;
- }
- break;
- case ACTION_T_COMBAT_MOVEMENT:
- {
- CombatMovementEnabled = param1;
-
- //Allow movement (create new targeted movement gen if none exist already)
- if (CombatMovementEnabled)
- {
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- }
- else
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
- }
- }
- break;
- case ACTION_T_SET_PHASE:
- {
- Phase = param1;
- }
- break;
- case ACTION_T_INC_PHASE:
- {
- Phase += param1;
-
- if (Phase > 31)
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_EVADE:
- {
- EnterEvadeMode();
- }
- break;
- case ACTION_T_FLEE:
- {
- TimetoFleeLeft = 8000;
- m_creature->DoFleeToGetAssistance();
- IsFleeing = true;
- }
- break;
- case ACTION_T_QUEST_EVENT_ALL:
- {
- Unit* Temp = NULL;
- if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
- {
- Temp = Unit::GetUnit((*m_creature),pActionInvoker->GetGUID());
- if( Temp )
- ((Player*)Temp)->GroupEventHappens(param1,m_creature);
- }
- }
- break;
- case ACTION_T_CASTCREATUREGO_ALL:
- {
- Unit* Temp = NULL;
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- }
- break;
- case ACTION_T_REMOVEAURASFROMSPELL:
- {
- Unit* target = GetTargetByType(param1, pActionInvoker);
-
- if (target)
- target->RemoveAurasDueToSpell(param2);
- }
- break;
- case ACTION_T_RANGED_MOVEMENT:
- {
- AttackDistance = param1;
- AttackAngle = ((float)param2/180)*M_PI;
-
- if (CombatMovementEnabled)
- {
- //Drop current movement gen
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- }
- break;
- case ACTION_T_RANDOM_PHASE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- Phase = temp;
- }
- break;
- case ACTION_T_RANDOM_PHASE_RANGE:
- {
- if (param2 > param1)
- {
- Phase = param1 + (rnd % (param2 - param1));
- }
- else if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_SUMMON_ID:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- //Duration
- Creature* pCreature = NULL;
-
- HM_NAMESPACE::hash_map<uint32, EventAI_Summon>::iterator i = EventAI_Summon_Map.find(param3);
-
- if (i == EventAI_Summon_Map.end())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
- return;
- }
-
- if ((*i).second.SpawnTimeSecs)
- pCreature = m_creature->SummonCreature(param1, (*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(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_KILLED_MONSTER:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
- }
- break;
- case ACTION_T_SET_INST_DATA:
- {
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData(param1, param2);
- }
- break;
- case ACTION_T_SET_INST_DATA64:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (!target)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
-
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData64(param1, target->GetGUID());
- }
- break;
- case ACTION_T_UPDATE_TEMPLATE:
- {
- if (m_creature->GetEntry() == param1)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
- }
- break;
- case ACTION_T_DIE:
- {
- if (m_creature->isDead())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- break;
- case ACTION_T_ZONE_COMBAT_PULSE:
- {
- if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- DoZoneInCombat();
- }
- break;
- }
- }
-
- void JustRespawned()
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Spawned Events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- void Reset()
- {
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
-
- //Handle Evade events and reset all events to enabled
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Reset all out of combat timers
- case EVENT_T_TIMER_OOC:
- {
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- }
- break;
- //default:
- //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
- //(*i).Enabled = true;
- //(*i).Time = 0;
- //break;
- }
- }
- }
-
- void EnterEvadeMode()
- {
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->LoadCreaturesAddon();
- if( m_creature->isAlive() )
- m_creature->GetMotionMaster()->MoveTargetedHome();
-
- m_creature->SetLootRecipient(NULL);
-
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Evade events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Evade
- case EVENT_T_EVADE:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- void JustDied(Unit* killer)
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Evade events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Evade
- case EVENT_T_DEATH:
- ProcessEvent(*i, killer);
- break;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Kill
- case EVENT_T_KILL:
- ProcessEvent(*i, victim);
- break;
- }
- }
-
- }
-
- void JustSummoned(Creature* pUnit)
- {
- if (!pUnit)
- return;
-
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Summoned
- case EVENT_T_SUMMONED_UNIT:
- ProcessEvent(*i, pUnit);
- break;
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- //Check for on combat start events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_AGGRO:
- (*i).Enabled = true;
- ProcessEvent(*i, who);
- break;
- //Reset all in combat timers
- case EVENT_T_TIMER:
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- break;
- //All normal events need to be re-enabled and their time set to 0
- default:
- (*i).Enabled = true;
- (*i).Time = 0;
- break;
- }
- }
-
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
- }
-
- void AttackStart(Unit *who)
- {
- if (!who)
- return;
-
- if (m_creature->Attack(who, MeleeEnabled))
- {
- //Begin melee attack if we are within range
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
-
- if (CombatMovementEnabled)
- {
- m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
- }
- else
- {
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || InCombat)
- return;
-
- //Check for OOC LOS Event
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_OOC_LOS:
- {
- if ((*i).Event.event_param1 && m_creature->IsHostileTo(who))
- break;
-
- if ((*i).Event.event_param2 && !m_creature->IsHostileTo(who))
- break;
-
- ProcessEvent(*i, who);
- }
- break;
- }
- }
-
- if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
- return;
-
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin melee attack if we are within range
- AttackStart(who);
- }
- }
- }
-
- void SpellHit(Unit* pUnit, const SpellEntry* pSpell)
- {
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Spell hit
- case EVENT_T_SPELLHIT:
- {
- //If spell id matches (or no spell id) & if spell school matches (or no spell school)
- if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
- if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
- ProcessEvent(*i, pUnit);
- }
- break;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we are in combat (also updates calls threat update code)
- bool Combat = InCombat ? (m_creature->SelectHostilTarget() && m_creature->getVictim()) : false;
-
- //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
- if (!m_creature->isAlive())
- return;
-
- if ((TimetoFleeLeft < diff || (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)) && IsFleeing)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetNoCallAssistence(false);
- m_creature->CallAssistence();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- IsFleeing = false;
- }
- else
- TimetoFleeLeft -= diff;
-
- if(IsFleeing)
- return;
-
- //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
- if (EventUpdateTime < diff)
- {
- EventDiff += diff;
-
- //Check for range based events
- //if (m_creature->GetDistance(m_creature->getVictim()) >
- if (Combat)
- {
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_RANGE:
- float dist = m_creature->GetDistance(m_creature->getVictim());
- if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- //Check for time based events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- //Decrement Timers
- if ((*i).Time)
-
- {
- if ((*i).Time > EventDiff)
- {
- //Do not decrement timers if event cannot trigger in this phase
- if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
- (*i).Time -= EventDiff;
- //Skip processing of events that have time remaining
- continue;
- }
- else (*i).Time = 0;
- }
-
- switch ((*i).Event.event_type)
- {
- //Events that are updated every EVENT_UPDATE_TIME
- case EVENT_T_TIMER_OOC:
- ProcessEvent(*i);
- break;
- case EVENT_T_TIMER:
- case EVENT_T_MANA:
- case EVENT_T_HP:
- case EVENT_T_TARGET_HP:
- case EVENT_T_TARGET_CASTING:
- case EVENT_T_FRIENDLY_HP:
- if( Combat )
- ProcessEvent(*i);
- break;
- }
- }
-
- EventDiff = 0;
- EventUpdateTime = EVENT_UPDATE_TIME;
- }else
- {
- EventDiff += diff;
- EventUpdateTime -= diff;
- }
-
- //Melee Auto-Attack
- if (Combat && MeleeEnabled)
- DoMeleeAttackIfReady();
-
- }
-};
-
-CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)
-{
- //Select events by creature id
- std::list<EventHolder> EventList;
- uint32 ID = _Creature->GetEntry();
-
- std::list<EventAI_Event>::iterator i;
-
- for (i = EventAI_Event_List.begin(); i != EventAI_Event_List.end(); ++i)
- {
- if ((*i).creature_id == ID)
- {
-//Debug check
-#ifndef _DEBUG
- if ((*i).event_flags & EFLAG_DEBUG_ONLY)
- continue;
-#endif
- if( _Creature->GetMap()->IsDungeon() )
- {
- if( _Creature->GetMap()->IsHeroic() )
- {
- if( (*i).event_flags & EFLAG_HEROIC )
- {
- EventList.push_back(EventHolder(*i));
- continue;
- }else if( (*i).event_flags & EFLAG_NORMAL )
- continue;
- }
- else
- {
- if( (*i).event_flags & EFLAG_NORMAL )
- {
- EventList.push_back(EventHolder(*i));
- continue;
- }else if( (*i).event_flags & EFLAG_HEROIC )
- continue;
- }
-
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set. Event Disabled.", _Creature->GetEntry(), (*i).event_id);
-
- continue;
- }
-
- EventList.push_back(EventHolder(*i));
- }
- }
-
- //EventAI is pointless to use without events and may cause crashes
- if (EventList.empty())
- {
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", _Creature->GetEntry());
-
- return NULL;
- }
-
- return new Mob_EventAI (_Creature, EventList);
-}
-
-void AddSC_mob_event()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="mob_eventai";
- newscript->GetAI = GetAI_Mob_EventAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Mob_Event_AI
+SD%Complete: 90
+SDComment: Database Event AI
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+#include "mob_event_ai.h"
+
+#define EVENT_UPDATE_TIME 500
+#define SPELL_RUN_AWAY 8225
+
+struct EventHolder
+{
+ EventHolder(EventAI_Event p) : Event(p), Time(0), Enabled(true){}
+
+ EventAI_Event Event;
+ uint32 Time;
+ bool Enabled;
+};
+
+struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
+{
+ Mob_EventAI(Creature *c, std::list<EventHolder> pEventList) : ScriptedAI(c)
+ {
+ EventList = pEventList;
+ Phase = 0;
+ CombatMovementEnabled = true;
+ MeleeEnabled = true;
+ AttackDistance = 0;
+ AttackAngle = 0.0f;
+
+ //Handle Spawned Events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_SPAWNED:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+
+ Reset();
+ }
+
+ ~Mob_EventAI()
+ {
+ EventList.clear();
+ }
+
+ //Variables used by EventAI for handling events
+ std::list<EventHolder> EventList; //Holder for events (stores enabled, time, and eventid)
+ uint32 EventUpdateTime; //Time between event updates
+ uint32 EventDiff; //Time between the last event call
+
+ //Variables used by Events themselves
+ uint8 Phase; //Current phase, max 32 phases
+ bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
+ bool MeleeEnabled; //If we allow melee auto attack
+ uint32 AttackDistance; //Distance to attack from
+ float AttackAngle; //Angle of attack
+ uint32 TimetoFleeLeft; //For fleeing
+
+ bool ProcessEvent(EventHolder& pHolder, Unit* pActionInvoker = NULL)
+ {
+ if (!pHolder.Enabled || pHolder.Time)
+ return false;
+
+ //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
+ if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
+ return false;
+
+ //Store random here so that all random actions match up
+ uint32 rnd = rand();
+
+ //Return if chance for event is not met
+ if (pHolder.Event.event_chance <= rnd % 100)
+ return false;
+
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+
+ union
+ {
+ uint32 param4;
+ int32 param4_s;
+ };
+
+ param1 = pHolder.Event.event_param1;
+ param2 = pHolder.Event.event_param2;
+ param3 = pHolder.Event.event_param3;
+ param4 = pHolder.Event.event_param4;
+
+ //Check event conditions based on the event type, also reset events
+ switch (pHolder.Event.event_type)
+ {
+ case EVENT_T_TIMER:
+ {
+ if (!InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TIMER_OOC:
+ {
+ if (InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_HP:
+ {
+ if (!InCombat || !m_creature->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_MANA:
+ {
+ if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
+ return false;
+
+ uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_AGGRO:
+ {
+ }
+ break;
+ case EVENT_T_KILL:
+ {
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ case EVENT_T_DEATH:
+ {
+ }
+ break;
+ case EVENT_T_EVADE:
+ {
+ }
+ break;
+ case EVENT_T_SPELLHIT:
+ {
+ //Spell hit is special case, param1 and param2 handled within EventAI::SpellHit
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_RANGE:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_OOC_LOS:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SPAWNED:
+ {
+ }
+ break;
+ case EVENT_T_TARGET_HP:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TARGET_CASTING:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
+ return false;
+
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_HP:
+ {
+ if (!InCombat)
+ return false;
+
+ Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
+
+ if (!pUnit)
+ return false;
+
+ pActionInvoker = pUnit;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_IS_CC:
+ {
+ if (!InCombat)
+ return false;
+
+ std::list<Creature*> pList = DoFindFriendlyCC(param2);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_MISSING_BUFF:
+ {
+ std::list<Creature*> pList = DoFindFriendlyMissingBuff(param2, param1);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SUMMONED_UNIT:
+ {
+ //Prevent event from occuring on no unit or non creatures
+ if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
+ return false;
+
+ //Creature id doesn't match up
+ if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
+ return false;
+
+ //Repeat Timers
+ if (param2 == param3)
+ {
+ pHolder.Time = param2;
+
+ }else if (param3 > param2)
+ pHolder.Time = urand(param2, param3);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ default:
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: 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);
+ break;
+ }
+
+ //Disable non-repeatable events
+ if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
+ pHolder.Enabled = false;
+
+ //Process actions
+ for (uint32 j = 0; j < MAX_ACTIONS; j++)
+ ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
+
+ return true;
+ }
+
+ inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
+ {
+ switch (rnd % 3)
+ {
+ case 0:
+ return param1;
+ break;
+ case 1:
+ return param2;
+ break;
+ case 2:
+ return param3;
+ break;
+ }
+ return 0;
+ }
+
+ inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker)
+ {
+ switch (Target)
+ {
+ case TARGET_T_SELF:
+ return m_creature;
+ break;
+ case TARGET_T_HOSTILE:
+ return m_creature->getVictim();
+ break;
+ case TARGET_T_HOSTILE_SECOND_AGGRO:
+ return SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case TARGET_T_HOSTILE_LAST_AGGRO:
+ return SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM:
+ return SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
+ return SelectUnit(SELECT_TARGET_RANDOM,1);
+ break;
+ case TARGET_T_ACTION_INVOKER:
+ return pActionInvoker;
+ break;
+ default:
+ return NULL;
+ break;
+ };
+ }
+
+ void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
+ {
+ switch (type)
+ {
+ case ACTION_T_SAY:
+ DoSay(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_YELL:
+ DoYell(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_TEXTEMOTE:
+ DoTextEmote(GetEventAIText(param1), pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_SOUND:
+ DoPlaySoundToSet(m_creature, param1);
+ break;
+ case ACTION_T_EMOTE:
+ m_creature->HandleEmoteCommand(param1);
+ break;
+ case ACTION_T_RANDOM_SAY:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoSay(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_YELL:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoYell(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_TEXTEMOTE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoTextEmote(GetEventAIText(temp), pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_SOUND:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoPlaySoundToSet(m_creature, temp);
+ }
+ break;
+ case ACTION_T_RANDOM_EMOTE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ m_creature->HandleEmoteCommand(temp);
+ }
+ break;
+ case ACTION_T_CAST:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+ Unit* caster = m_creature;
+
+ if (!target)
+ return;
+
+ //Cast is always triggered if target is forced to cast on self
+ if (param3 & CAST_FORCE_TARGET_SELF)
+ {
+ param3 |= CAST_TRIGGERED;
+ caster = target;
+ }
+
+ //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
+ bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
+
+ // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
+ if(param3 & CAST_AURA_NOT_PRESENT)
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ if(target->HasAura(param1, i))
+ return;
+ }
+
+ if (canCast)
+ {
+ const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
+
+ //Verify that spell exists
+ if (tSpell)
+ {
+ //Check if cannot cast spell
+ if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
+ !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
+ {
+ //Melee current victim if flag not set
+ if (!(param3 & CAST_NO_MELEE_IF_OOM))
+ {
+ AttackDistance = 0;
+ AttackAngle = 0;
+
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+
+ }else
+ {
+ //Interrupt any previous spell
+ if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
+ caster->InterruptNonMeleeSpells(false);
+
+ caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
+ }
+
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
+ }
+ }
+ break;
+ case ACTION_T_SUMMON:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ Creature* pCreature = NULL;
+
+ if (param3)
+ pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
+ else pCreature = pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_THREAT_SINGLE_PCT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ m_creature->getThreatManager().modifyThreatPercent(target, param1);
+ }
+ break;
+ case ACTION_T_THREAT_ALL_PCT:
+ {
+ Unit* Temp = NULL;
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ if (Temp)
+ m_creature->getThreatManager().modifyThreatPercent(Temp, param1);
+ }
+ }
+ break;
+ case ACTION_T_QUEST_EVENT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->AreaExploredOrEventHappens(param1);
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FIELD:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (target)
+ target->SetUInt32Value(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->SetFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_REMOVE_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_AUTO_ATTACK:
+ {
+ if (param1)
+ MeleeEnabled = true;
+ else MeleeEnabled = false;
+ }
+ break;
+ case ACTION_T_COMBAT_MOVEMENT:
+ {
+ CombatMovementEnabled = param1;
+
+ //Allow movement (create new targeted movement gen if none exist already)
+ if (CombatMovementEnabled)
+ {
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+ else
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->StopMoving();
+ }
+ }
+ break;
+ case ACTION_T_SET_PHASE:
+ {
+ Phase = param1;
+ }
+ break;
+ case ACTION_T_INC_PHASE:
+ {
+ Phase += param1;
+
+ if (Phase > 31)
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_EVADE:
+ {
+ EnterEvadeMode();
+ }
+ break;
+ case ACTION_T_FLEE:
+ {
+ TimetoFleeLeft = 8000;
+ m_creature->DoFleeToGetAssistance();
+ IsFleeing = true;
+ }
+ break;
+ case ACTION_T_QUEST_EVENT_ALL:
+ {
+ Unit* Temp = NULL;
+ if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
+ {
+ Temp = Unit::GetUnit((*m_creature),pActionInvoker->GetGUID());
+ if( Temp )
+ ((Player*)Temp)->GroupEventHappens(param1,m_creature);
+ }
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO_ALL:
+ {
+ Unit* Temp = NULL;
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ }
+ break;
+ case ACTION_T_REMOVEAURASFROMSPELL:
+ {
+ Unit* target = GetTargetByType(param1, pActionInvoker);
+
+ if (target)
+ target->RemoveAurasDueToSpell(param2);
+ }
+ break;
+ case ACTION_T_RANGED_MOVEMENT:
+ {
+ AttackDistance = param1;
+ AttackAngle = ((float)param2/180)*M_PI;
+
+ if (CombatMovementEnabled)
+ {
+ //Drop current movement gen
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ Phase = temp;
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE_RANGE:
+ {
+ if (param2 > param1)
+ {
+ Phase = param1 + (rnd % (param2 - param1));
+ }
+ else if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_SUMMON_ID:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ //Duration
+ Creature* pCreature = NULL;
+
+ HM_NAMESPACE::hash_map<uint32, EventAI_Summon>::iterator i = EventAI_Summon_Map.find(param3);
+
+ if (i == EventAI_Summon_Map.end())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
+ return;
+ }
+
+ if ((*i).second.SpawnTimeSecs)
+ pCreature = m_creature->SummonCreature(param1, (*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(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_KILLED_MONSTER:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
+ }
+ break;
+ case ACTION_T_SET_INST_DATA:
+ {
+ ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
+ if (!pInst)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_INST_DATA64:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (!target)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
+
+ if (!pInst)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData64(param1, target->GetGUID());
+ }
+ break;
+ case ACTION_T_UPDATE_TEMPLATE:
+ {
+ if (m_creature->GetEntry() == param1)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
+ }
+ break;
+ case ACTION_T_DIE:
+ {
+ if (m_creature->isDead())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ break;
+ case ACTION_T_ZONE_COMBAT_PULSE:
+ {
+ if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ DoZoneInCombat();
+ }
+ break;
+ }
+ }
+
+ void JustRespawned()
+ {
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Spawned Events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_SPAWNED:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ void Reset()
+ {
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+
+ //Handle Evade events and reset all events to enabled
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Reset all out of combat timers
+ case EVENT_T_TIMER_OOC:
+ {
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ }
+ break;
+ //default:
+ //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
+ //(*i).Enabled = true;
+ //(*i).Time = 0;
+ //break;
+ }
+ }
+ }
+
+ void EnterEvadeMode()
+ {
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->LoadCreaturesAddon();
+ if( m_creature->isAlive() )
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+
+ m_creature->SetLootRecipient(NULL);
+
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Evade events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Evade
+ case EVENT_T_EVADE:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Evade events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Evade
+ case EVENT_T_DEATH:
+ ProcessEvent(*i, killer);
+ break;
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Kill
+ case EVENT_T_KILL:
+ ProcessEvent(*i, victim);
+ break;
+ }
+ }
+
+ }
+
+ void JustSummoned(Creature* pUnit)
+ {
+ if (!pUnit)
+ return;
+
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Summoned
+ case EVENT_T_SUMMONED_UNIT:
+ ProcessEvent(*i, pUnit);
+ break;
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ //Check for on combat start events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_AGGRO:
+ (*i).Enabled = true;
+ ProcessEvent(*i, who);
+ break;
+ //Reset all in combat timers
+ case EVENT_T_TIMER:
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ break;
+ //All normal events need to be re-enabled and their time set to 0
+ default:
+ (*i).Enabled = true;
+ (*i).Time = 0;
+ break;
+ }
+ }
+
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if (!who)
+ return;
+
+ if (m_creature->Attack(who, MeleeEnabled))
+ {
+ //Begin melee attack if we are within range
+ m_creature->AddThreat(who, 0.0f);
+ m_creature->SetInCombatWith(who);
+ who->SetInCombatWith(m_creature);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+
+ if (CombatMovementEnabled)
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
+ }
+ else
+ {
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->StopMoving();
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || InCombat)
+ return;
+
+ //Check for OOC LOS Event
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_OOC_LOS:
+ {
+ if ((*i).Event.event_param1 && m_creature->IsHostileTo(who))
+ break;
+
+ if ((*i).Event.event_param2 && !m_creature->IsHostileTo(who))
+ break;
+
+ ProcessEvent(*i, who);
+ }
+ break;
+ }
+ }
+
+ if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
+ return;
+
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin melee attack if we are within range
+ AttackStart(who);
+ }
+ }
+ }
+
+ void SpellHit(Unit* pUnit, const SpellEntry* pSpell)
+ {
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Spell hit
+ case EVENT_T_SPELLHIT:
+ {
+ //If spell id matches (or no spell id) & if spell school matches (or no spell school)
+ if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
+ if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
+ ProcessEvent(*i, pUnit);
+ }
+ break;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we are in combat (also updates calls threat update code)
+ bool Combat = InCombat ? (m_creature->SelectHostilTarget() && m_creature->getVictim()) : false;
+
+ //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
+ if (!m_creature->isAlive())
+ return;
+
+ if ((TimetoFleeLeft < diff || (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)) && IsFleeing)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetNoCallAssistence(false);
+ m_creature->CallAssistence();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ IsFleeing = false;
+ }
+ else
+ TimetoFleeLeft -= diff;
+
+ if(IsFleeing)
+ return;
+
+ //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
+ if (EventUpdateTime < diff)
+ {
+ EventDiff += diff;
+
+ //Check for range based events
+ //if (m_creature->GetDistance(m_creature->getVictim()) >
+ if (Combat)
+ {
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_RANGE:
+ float dist = m_creature->GetDistance(m_creature->getVictim());
+ if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ //Check for time based events
+ for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ //Decrement Timers
+ if ((*i).Time)
+
+ {
+ if ((*i).Time > EventDiff)
+ {
+ //Do not decrement timers if event cannot trigger in this phase
+ if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
+ (*i).Time -= EventDiff;
+ //Skip processing of events that have time remaining
+ continue;
+ }
+ else (*i).Time = 0;
+ }
+
+ switch ((*i).Event.event_type)
+ {
+ //Events that are updated every EVENT_UPDATE_TIME
+ case EVENT_T_TIMER_OOC:
+ ProcessEvent(*i);
+ break;
+ case EVENT_T_TIMER:
+ case EVENT_T_MANA:
+ case EVENT_T_HP:
+ case EVENT_T_TARGET_HP:
+ case EVENT_T_TARGET_CASTING:
+ case EVENT_T_FRIENDLY_HP:
+ if( Combat )
+ ProcessEvent(*i);
+ break;
+ }
+ }
+
+ EventDiff = 0;
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ }else
+ {
+ EventDiff += diff;
+ EventUpdateTime -= diff;
+ }
+
+ //Melee Auto-Attack
+ if (Combat && MeleeEnabled)
+ DoMeleeAttackIfReady();
+
+ }
+};
+
+CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)
+{
+ //Select events by creature id
+ std::list<EventHolder> EventList;
+ uint32 ID = _Creature->GetEntry();
+
+ std::list<EventAI_Event>::iterator i;
+
+ for (i = EventAI_Event_List.begin(); i != EventAI_Event_List.end(); ++i)
+ {
+ if ((*i).creature_id == ID)
+ {
+//Debug check
+#ifndef _DEBUG
+ if ((*i).event_flags & EFLAG_DEBUG_ONLY)
+ continue;
+#endif
+ if( _Creature->GetMap()->IsDungeon() )
+ {
+ if( _Creature->GetMap()->IsHeroic() )
+ {
+ if( (*i).event_flags & EFLAG_HEROIC )
+ {
+ EventList.push_back(EventHolder(*i));
+ continue;
+ }else if( (*i).event_flags & EFLAG_NORMAL )
+ continue;
+ }
+ else
+ {
+ if( (*i).event_flags & EFLAG_NORMAL )
+ {
+ EventList.push_back(EventHolder(*i));
+ continue;
+ }else if( (*i).event_flags & EFLAG_HEROIC )
+ continue;
+ }
+
+ if (EAI_ErrorLevel > 1)
+ error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set. Event Disabled.", _Creature->GetEntry(), (*i).event_id);
+
+ continue;
+ }
+
+ EventList.push_back(EventHolder(*i));
+ }
+ }
+
+ //EventAI is pointless to use without events and may cause crashes
+ if (EventList.empty())
+ {
+ if (EAI_ErrorLevel > 1)
+ error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", _Creature->GetEntry());
+
+ return NULL;
+ }
+
+ return new Mob_EventAI (_Creature, EventList);
+}
+
+void AddSC_mob_event()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="mob_eventai";
+ newscript->GetAI = GetAI_Mob_EventAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h
index 10afd68f736..b063df8b585 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.h
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h
@@ -1,216 +1,216 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_EVENTAI_H
-#define SC_EVENTAI_H
-
-#define MAX_ACTIONS 3
-
-enum Event_Types
-{
- EVENT_T_TIMER = 0, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_TIMER_OOC = 1, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_HP = 2, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_MANA = 3, //ManaMax%,ManaMin% RepeatMin, RepeatMax
- EVENT_T_AGGRO = 4, //NONE
- EVENT_T_KILL = 5, //RepeatMin, RepeatMax
- EVENT_T_DEATH = 6, //NONE
- EVENT_T_EVADE = 7, //NONE
- EVENT_T_SPELLHIT = 8, //SpellID, School, RepeatMin, RepeatMax
- EVENT_T_RANGE = 9, //MinDist, MaxDist, RepeatMin, RepeatMax
- EVENT_T_OOC_LOS = 10, //NoHostile, NoFriendly, RepeatMin, RepeatMax
- EVENT_T_SPAWNED = 11, //NONE
- EVENT_T_TARGET_HP = 12, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_TARGET_CASTING = 13, //RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_HP = 14, //HPDeficit, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_IS_CC = 15, //DispelType, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_MISSING_BUFF = 16, //SpellId, Radius, RepeatMin, RepeatMax
- EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
- EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
- EVENT_T_QUEST_ACCEPT = 19, //QuestID
- EVENT_T_QUEST_COMPLETE = 20, //
-
- EVENT_T_END,
-};
-
-enum Action_Types
-{
- ACTION_T_NONE = 0, //No action
- ACTION_T_SAY = 1, //TextId
- ACTION_T_YELL = 2, //TextId
- ACTION_T_TEXTEMOTE = 3, //TextId
- ACTION_T_SOUND = 4, //SoundId
- ACTION_T_EMOTE = 5, //EmoteId
- ACTION_T_RANDOM_SAY = 6, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_YELL = 7, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_TEXTEMOTE = 8, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
- ACTION_T_CAST = 11, //SpellId, Target, CastFlags
- ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
- ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
- ACTION_T_THREAT_ALL_PCT = 14, //Threat%
- ACTION_T_QUEST_EVENT = 15, //QuestID, Target
- ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
- ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
- ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
- ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
- ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
- ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
- ACTION_T_SET_PHASE = 22, //Phase
- ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
- ACTION_T_EVADE = 24, //No Params
- ACTION_T_FLEE = 25, //No Params
- ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
- ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
- ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
- ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
- ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
- ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
- ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
- ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
- ACTION_T_SET_INST_DATA = 34, //Field, Data
- ACTION_T_SET_INST_DATA64 = 35, //Field, Target
- ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
- ACTION_T_DIE = 37, //No Params
- ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
-
- ACTION_T_END,
-};
-
-enum Target
-{
- //Self (m_creature)
- TARGET_T_SELF = 0, //Self cast
-
- //Hostile targets (if pet then returns pet owner)
- TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
- TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
-
- //Invoker targets (if pet then returns pet owner)
- TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
-
- //Hostile targets (including pets)
- TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
- TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
-
- TARGET_T_ACTION_INVOKER_WPET,
-
- TARGET_T_END
-};
-
-enum CastFlags
-{
- CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
- CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
- CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
- CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
- CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
-};
-
-enum EventFlags
-{
- EFLAG_REPEATABLE = 0x01, //Event repeats
- EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
- EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
- EFLAG_RESERVED_3 = 0x08,
- EFLAG_RESERVED_4 = 0x10,
- EFLAG_RESERVED_5 = 0x20,
- EFLAG_RESERVED_6 = 0x40,
- EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build of SD2 only
-};
-
-struct EventAI_Event
-{
- uint32 event_id;
-
- uint32 creature_id;
-
- uint16 event_type;
- uint32 event_inverse_phase_mask;
- uint8 event_chance;
- uint8 event_flags;
- union
- {
- uint32 event_param1;
- int32 event_param1_s;
- };
- union
- {
- uint32 event_param2;
- int32 event_param2_s;
- };
- union
- {
- uint32 event_param3;
- int32 event_param3_s;
- };
- union
- {
- uint32 event_param4;
- int32 event_param4_s;
- };
-
- struct _action
- {
- uint16 type;
- union
- {
- uint32 param1;
- int32 param1_s;
- };
- union
- {
- uint32 param2;
- int32 param2_s;
- };
- union
- {
- uint32 param3;
- int32 param3_s;
- };
- }action[MAX_ACTIONS];
-};
-
-//Event_Map
-extern std::list<EventAI_Event> EventAI_Event_List;
-
-struct EventAI_Summon
-{
- uint32 id;
-
- float position_x;
- float position_y;
- float position_z;
- float orientation;
- uint32 SpawnTimeSecs;
-};
-
-//EventSummon_Map
-extern HM_NAMESPACE::hash_map<uint32, EventAI_Summon> EventAI_Summon_Map;
-
-//EventAI Error handling
-extern uint32 EAI_ErrorLevel;
-/*
-
-struct EventAI_CreatureError
-{
- bool ListEmpty;
- bool NoInstance;
-};
-
-//Error prevention list
-extern HM_NAMESPACE::hash_map<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList;
-
-//Defines
-#define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature."
-*/
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_EVENTAI_H
+#define SC_EVENTAI_H
+
+#define MAX_ACTIONS 3
+
+enum Event_Types
+{
+ EVENT_T_TIMER = 0, //InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_TIMER_OOC = 1, //InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_HP = 2, //HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_MANA = 3, //ManaMax%,ManaMin% RepeatMin, RepeatMax
+ EVENT_T_AGGRO = 4, //NONE
+ EVENT_T_KILL = 5, //RepeatMin, RepeatMax
+ EVENT_T_DEATH = 6, //NONE
+ EVENT_T_EVADE = 7, //NONE
+ EVENT_T_SPELLHIT = 8, //SpellID, School, RepeatMin, RepeatMax
+ EVENT_T_RANGE = 9, //MinDist, MaxDist, RepeatMin, RepeatMax
+ EVENT_T_OOC_LOS = 10, //NoHostile, NoFriendly, RepeatMin, RepeatMax
+ EVENT_T_SPAWNED = 11, //NONE
+ EVENT_T_TARGET_HP = 12, //HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_TARGET_CASTING = 13, //RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_HP = 14, //HPDeficit, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_IS_CC = 15, //DispelType, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_MISSING_BUFF = 16, //SpellId, Radius, RepeatMin, RepeatMax
+ EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
+ EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
+ EVENT_T_QUEST_ACCEPT = 19, //QuestID
+ EVENT_T_QUEST_COMPLETE = 20, //
+
+ EVENT_T_END,
+};
+
+enum Action_Types
+{
+ ACTION_T_NONE = 0, //No action
+ ACTION_T_SAY = 1, //TextId
+ ACTION_T_YELL = 2, //TextId
+ ACTION_T_TEXTEMOTE = 3, //TextId
+ ACTION_T_SOUND = 4, //SoundId
+ ACTION_T_EMOTE = 5, //EmoteId
+ ACTION_T_RANDOM_SAY = 6, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_YELL = 7, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_TEXTEMOTE = 8, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_CAST = 11, //SpellId, Target, CastFlags
+ ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
+ ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
+ ACTION_T_THREAT_ALL_PCT = 14, //Threat%
+ ACTION_T_QUEST_EVENT = 15, //QuestID, Target
+ ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
+ ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
+ ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
+ ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
+ ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
+ ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
+ ACTION_T_SET_PHASE = 22, //Phase
+ ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
+ ACTION_T_EVADE = 24, //No Params
+ ACTION_T_FLEE = 25, //No Params
+ ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
+ ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
+ ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
+ ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
+ ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
+ ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
+ ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
+ ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
+ ACTION_T_SET_INST_DATA = 34, //Field, Data
+ ACTION_T_SET_INST_DATA64 = 35, //Field, Target
+ ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
+ ACTION_T_DIE = 37, //No Params
+ ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
+
+ ACTION_T_END,
+};
+
+enum Target
+{
+ //Self (m_creature)
+ TARGET_T_SELF = 0, //Self cast
+
+ //Hostile targets (if pet then returns pet owner)
+ TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
+ TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
+
+ //Invoker targets (if pet then returns pet owner)
+ TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
+
+ //Hostile targets (including pets)
+ TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
+ TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
+
+ TARGET_T_ACTION_INVOKER_WPET,
+
+ TARGET_T_END
+};
+
+enum CastFlags
+{
+ CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
+ CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
+ CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
+ CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
+ CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
+ CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+};
+
+enum EventFlags
+{
+ EFLAG_REPEATABLE = 0x01, //Event repeats
+ EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
+ EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
+ EFLAG_RESERVED_3 = 0x08,
+ EFLAG_RESERVED_4 = 0x10,
+ EFLAG_RESERVED_5 = 0x20,
+ EFLAG_RESERVED_6 = 0x40,
+ EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build of SD2 only
+};
+
+struct EventAI_Event
+{
+ uint32 event_id;
+
+ uint32 creature_id;
+
+ uint16 event_type;
+ uint32 event_inverse_phase_mask;
+ uint8 event_chance;
+ uint8 event_flags;
+ union
+ {
+ uint32 event_param1;
+ int32 event_param1_s;
+ };
+ union
+ {
+ uint32 event_param2;
+ int32 event_param2_s;
+ };
+ union
+ {
+ uint32 event_param3;
+ int32 event_param3_s;
+ };
+ union
+ {
+ uint32 event_param4;
+ int32 event_param4_s;
+ };
+
+ struct _action
+ {
+ uint16 type;
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+ }action[MAX_ACTIONS];
+};
+
+//Event_Map
+extern std::list<EventAI_Event> EventAI_Event_List;
+
+struct EventAI_Summon
+{
+ uint32 id;
+
+ float position_x;
+ float position_y;
+ float position_z;
+ float orientation;
+ uint32 SpawnTimeSecs;
+};
+
+//EventSummon_Map
+extern HM_NAMESPACE::hash_map<uint32, EventAI_Summon> EventAI_Summon_Map;
+
+//EventAI Error handling
+extern uint32 EAI_ErrorLevel;
+/*
+
+struct EventAI_CreatureError
+{
+ bool ListEmpty;
+ bool NoInstance;
+};
+
+//Error prevention list
+extern HM_NAMESPACE::hash_map<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList;
+
+//Defines
+#define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature."
+*/
+#endif
diff --git a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
index ace24b8a405..3f07390b06f 100644
--- a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
@@ -1,172 +1,172 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Generic_Creature
-SD%Complete: 80
-SDComment: Should be replaced with core based AI
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
-{
- generic_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
- uint32 BuffTimer; //This variable keeps track of buffs
- bool IsSelfRooted;
-
- void Reset()
- {
- GlobalCooldown = 0;
- BuffTimer = 0; //Rebuff as soon as we can
- IsSelfRooted = false;
- }
-
- void Aggro(Unit *who)
- {
- if (!m_creature->IsWithinDistInMap(who, ATTACK_DISTANCE))
- {
- IsSelfRooted = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Always decrease our global cooldown first
- if (GlobalCooldown > diff)
- GlobalCooldown -= diff;
- else GlobalCooldown = 0;
-
- //Buff timer (only buff when we are alive and not in combat
- if (!InCombat && m_creature->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);
-
- if (info && !GlobalCooldown)
- {
- //Cast the buff spell
- DoCastSpell(m_creature, info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
- //Set our timer to 10 minutes before rebuff
- BuffTimer = 600000;
- }//Try agian in 30 seconds
- else BuffTimer = 30000;
- }else BuffTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- //Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->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);
-
- //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);
-
- //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)
- {
- //Cast the spell
- if (Healing)DoCastSpell(m_creature, info);
- else DoCastSpell(m_creature->getVictim(), info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
- }
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
-
- m_creature->resetAttackTimer();
- }
- }
- else
- {
- //Only run this code if we arn't already casting
- if (!m_creature->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);
-
- //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, ATTACK_DISTANCE, 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 (!IsSelfRooted)
- {
- IsSelfRooted = true;
- }
-
- //Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->getVictim(),info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
-
- }//If no spells available and we arn't moving run to target
- else if (IsSelfRooted)
- {
- //Cancel our current spell and then allow movement agian
- m_creature->InterruptNonMeleeSpells(false);
- IsSelfRooted = false;
- }
- }
- }
- }
-};
-CreatureAI* GetAI_generic_creature(Creature *_Creature)
-{
- return new generic_creatureAI (_Creature);
-}
-
-
-void AddSC_generic_creature()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="generic_creature";
- newscript->GetAI = GetAI_generic_creature;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Generic_Creature
+SD%Complete: 80
+SDComment: Should be replaced with core based AI
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
+{
+ generic_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
+ uint32 BuffTimer; //This variable keeps track of buffs
+ bool IsSelfRooted;
+
+ void Reset()
+ {
+ GlobalCooldown = 0;
+ BuffTimer = 0; //Rebuff as soon as we can
+ IsSelfRooted = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (!m_creature->IsWithinDistInMap(who, ATTACK_DISTANCE))
+ {
+ IsSelfRooted = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Always decrease our global cooldown first
+ if (GlobalCooldown > diff)
+ GlobalCooldown -= diff;
+ else GlobalCooldown = 0;
+
+ //Buff timer (only buff when we are alive and not in combat
+ if (!InCombat && m_creature->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);
+
+ if (info && !GlobalCooldown)
+ {
+ //Cast the buff spell
+ DoCastSpell(m_creature, info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+ //Set our timer to 10 minutes before rebuff
+ BuffTimer = 600000;
+ }//Try agian in 30 seconds
+ else BuffTimer = 30000;
+ }else BuffTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ //Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->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);
+
+ //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);
+
+ //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)
+ {
+ //Cast the spell
+ if (Healing)DoCastSpell(m_creature, info);
+ else DoCastSpell(m_creature->getVictim(), info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+ }
+ else m_creature->AttackerStateUpdate(m_creature->getVictim());
+
+ m_creature->resetAttackTimer();
+ }
+ }
+ else
+ {
+ //Only run this code if we arn't already casting
+ if (!m_creature->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);
+
+ //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, ATTACK_DISTANCE, 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 (!IsSelfRooted)
+ {
+ IsSelfRooted = true;
+ }
+
+ //Cast spell
+ if (Healing) DoCastSpell(m_creature,info);
+ else DoCastSpell(m_creature->getVictim(),info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+
+ }//If no spells available and we arn't moving run to target
+ else if (IsSelfRooted)
+ {
+ //Cancel our current spell and then allow movement agian
+ m_creature->InterruptNonMeleeSpells(false);
+ IsSelfRooted = false;
+ }
+ }
+ }
+ }
+};
+CreatureAI* GetAI_generic_creature(Creature *_Creature)
+{
+ return new generic_creatureAI (_Creature);
+}
+
+
+void AddSC_generic_creature()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="generic_creature";
+ newscript->GetAI = GetAI_generic_creature;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.cpp b/src/bindings/scripts/scripts/creature/simple_ai.cpp
index c19fcc17fea..365b4269009 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/simple_ai.cpp
@@ -1,294 +1,294 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: SimpleAI
-SD%Complete: 100
-SDComment: Base Class for SimpleAI creatures
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-#include "simple_ai.h"
-
-SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
-{
- //Clear all data
- Aggro_Text[0] = NULL;
- Aggro_Text[1] = NULL;
- Aggro_Text[2] = NULL;
- Aggro_Say[0] = false;
- Aggro_Say[1] = false;
- Aggro_Say[2] = false;
- Aggro_Sound[0] = 0;
- Aggro_Sound[1] = 0;
- Aggro_Sound[2] = 0;
-
- Death_Text[0] = NULL;
- Death_Text[1] = NULL;
- Death_Text[2] = NULL;
- Death_Say[0] = false;
- Death_Say[1] = false;
- Death_Say[2] = false;
- Death_Sound[0] = 0;
- Death_Sound[1] = 0;
- Death_Sound[2] = 0;
- Death_Spell = 0;
- Death_Target_Type = 0;
-
- Kill_Text[0] = NULL;
- Kill_Text[1] = NULL;
- Kill_Text[2] = NULL;
- Kill_Say[0] = false;
- Kill_Say[1] = false;
- Kill_Say[2] = false;
- Kill_Sound[0] = 0;
- Kill_Sound[1] = 0;
- Kill_Sound[2] = 0;
- Kill_Spell = 0;
- Kill_Target_Type = 0;
-
- memset(Spell,0,sizeof(Spell));
-
- EnterEvadeMode();
-}
-
-void SimpleAI::Reset()
-{
-}
-
-void SimpleAI::Aggro(Unit *who)
-{
- //Reset cast timers
- if (Spell[0].First_Cast >= 0)
- Spell_Timer[0] = Spell[0].First_Cast;
- else Spell_Timer[0] = 1000;
- if (Spell[1].First_Cast >= 0)
- Spell_Timer[1] = Spell[1].First_Cast;
- else Spell_Timer[1] = 1000;
- if (Spell[2].First_Cast >= 0)
- Spell_Timer[2] = Spell[2].First_Cast;
- else Spell_Timer[2] = 1000;
- if (Spell[3].First_Cast >= 0)
- Spell_Timer[3] = Spell[3].First_Cast;
- else Spell_Timer[3] = 1000;
- if (Spell[4].First_Cast >= 0)
- Spell_Timer[4] = Spell[4].First_Cast;
- else Spell_Timer[4] = 1000;
- if (Spell[5].First_Cast >= 0)
- Spell_Timer[5] = Spell[5].First_Cast;
- else Spell_Timer[5] = 1000;
- if (Spell[6].First_Cast >= 0)
- Spell_Timer[6] = Spell[6].First_Cast;
- else Spell_Timer[6] = 1000;
- if (Spell[7].First_Cast >= 0)
- Spell_Timer[7] = Spell[7].First_Cast;
- else Spell_Timer[7] = 1000;
- if (Spell[8].First_Cast >= 0)
- Spell_Timer[8] = Spell[8].First_Cast;
- else Spell_Timer[8] = 1000;
- if (Spell[9].First_Cast >= 0)
- Spell_Timer[9] = Spell[9].First_Cast;
- else Spell_Timer[9] = 1000;
-
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Aggro_Text[random_text])
- if (Aggro_Say[random_text])
- DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
- else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
-
- //Random sound
- if (Aggro_Sound[random_text])
- DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
-}
-
-void SimpleAI::KilledUnit(Unit *victim)
-{
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Kill_Text[random_text])
- if (Kill_Say[random_text])
- DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
- else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
-
- //Random sound
- if (Kill_Sound[random_text])
- DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
-
- if (!Kill_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Kill_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case CAST_KILLEDUNIT_VICTIM:
- target = victim;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Kill_Spell);
-}
-
-void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
-{
- //Return if damage taken won't kill us
- if (m_creature->GetHealth() > damage)
- return;
-
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Death_Text[random_text])
- if (Death_Say[random_text])
- DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
- else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
-
- //Random sound
- if (Death_Sound[random_text])
- DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
-
- if (!Death_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Death_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case CAST_JUSTDIED_KILLER:
- target = killer;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Death_Spell);
-}
-
-void SimpleAI::UpdateAI(const uint32 diff)
-{
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Spells
- for (uint32 i = 0; i < 10; ++i)
- {
- //Spell not valid
- if (!Spell[i].Enabled || !Spell[i].Spell_Id)
- continue;
-
- 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)
- continue;
-
- //Check Current spell
- if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
- {
- Unit* target = NULL;
-
- switch (Spell[i].Cast_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- }
-
- //Target is ok, cast a spell on it and then do our random yell
- if (target)
- {
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(target, Spell[i].Spell_Id);
-
- //Yell and sound use the same number so that you can make
- //the creature yell with the correct sound effect attached
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Spell[i].Text[random_text])
- if (Spell[i].Say[random_text])
- DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
- else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
-
- //Random sound
- if (Spell[i].Text_Sound[random_text])
- DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
- }
-
- }
-
- //Spell will cast agian when the cooldown is up
- if (Spell[i].CooldownRandomAddition)
- Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
- else Spell_Timer[i] = Spell[i].Cooldown;
-
- }else Spell_Timer[i] -= diff;
-
- }
-
- DoMeleeAttackIfReady();
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: SimpleAI
+SD%Complete: 100
+SDComment: Base Class for SimpleAI creatures
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+#include "simple_ai.h"
+
+SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
+{
+ //Clear all data
+ Aggro_Text[0] = NULL;
+ Aggro_Text[1] = NULL;
+ Aggro_Text[2] = NULL;
+ Aggro_Say[0] = false;
+ Aggro_Say[1] = false;
+ Aggro_Say[2] = false;
+ Aggro_Sound[0] = 0;
+ Aggro_Sound[1] = 0;
+ Aggro_Sound[2] = 0;
+
+ Death_Text[0] = NULL;
+ Death_Text[1] = NULL;
+ Death_Text[2] = NULL;
+ Death_Say[0] = false;
+ Death_Say[1] = false;
+ Death_Say[2] = false;
+ Death_Sound[0] = 0;
+ Death_Sound[1] = 0;
+ Death_Sound[2] = 0;
+ Death_Spell = 0;
+ Death_Target_Type = 0;
+
+ Kill_Text[0] = NULL;
+ Kill_Text[1] = NULL;
+ Kill_Text[2] = NULL;
+ Kill_Say[0] = false;
+ Kill_Say[1] = false;
+ Kill_Say[2] = false;
+ Kill_Sound[0] = 0;
+ Kill_Sound[1] = 0;
+ Kill_Sound[2] = 0;
+ Kill_Spell = 0;
+ Kill_Target_Type = 0;
+
+ memset(Spell,0,sizeof(Spell));
+
+ EnterEvadeMode();
+}
+
+void SimpleAI::Reset()
+{
+}
+
+void SimpleAI::Aggro(Unit *who)
+{
+ //Reset cast timers
+ if (Spell[0].First_Cast >= 0)
+ Spell_Timer[0] = Spell[0].First_Cast;
+ else Spell_Timer[0] = 1000;
+ if (Spell[1].First_Cast >= 0)
+ Spell_Timer[1] = Spell[1].First_Cast;
+ else Spell_Timer[1] = 1000;
+ if (Spell[2].First_Cast >= 0)
+ Spell_Timer[2] = Spell[2].First_Cast;
+ else Spell_Timer[2] = 1000;
+ if (Spell[3].First_Cast >= 0)
+ Spell_Timer[3] = Spell[3].First_Cast;
+ else Spell_Timer[3] = 1000;
+ if (Spell[4].First_Cast >= 0)
+ Spell_Timer[4] = Spell[4].First_Cast;
+ else Spell_Timer[4] = 1000;
+ if (Spell[5].First_Cast >= 0)
+ Spell_Timer[5] = Spell[5].First_Cast;
+ else Spell_Timer[5] = 1000;
+ if (Spell[6].First_Cast >= 0)
+ Spell_Timer[6] = Spell[6].First_Cast;
+ else Spell_Timer[6] = 1000;
+ if (Spell[7].First_Cast >= 0)
+ Spell_Timer[7] = Spell[7].First_Cast;
+ else Spell_Timer[7] = 1000;
+ if (Spell[8].First_Cast >= 0)
+ Spell_Timer[8] = Spell[8].First_Cast;
+ else Spell_Timer[8] = 1000;
+ if (Spell[9].First_Cast >= 0)
+ Spell_Timer[9] = Spell[9].First_Cast;
+ else Spell_Timer[9] = 1000;
+
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Aggro_Text[random_text])
+ if (Aggro_Say[random_text])
+ DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
+ else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
+
+ //Random sound
+ if (Aggro_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
+}
+
+void SimpleAI::KilledUnit(Unit *victim)
+{
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Kill_Text[random_text])
+ if (Kill_Say[random_text])
+ DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
+ else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
+
+ //Random sound
+ if (Kill_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
+
+ if (!Kill_Spell)
+ return;
+
+ Unit* target = NULL;
+
+ switch (Kill_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case CAST_KILLEDUNIT_VICTIM:
+ target = victim;
+ break;
+ }
+
+ //Target is ok, cast a spell on it
+ if (target)
+ DoCast(target, Kill_Spell);
+}
+
+void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
+{
+ //Return if damage taken won't kill us
+ if (m_creature->GetHealth() > damage)
+ return;
+
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Death_Text[random_text])
+ if (Death_Say[random_text])
+ DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
+ else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
+
+ //Random sound
+ if (Death_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
+
+ if (!Death_Spell)
+ return;
+
+ Unit* target = NULL;
+
+ switch (Death_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case CAST_JUSTDIED_KILLER:
+ target = killer;
+ break;
+ }
+
+ //Target is ok, cast a spell on it
+ if (target)
+ DoCast(target, Death_Spell);
+}
+
+void SimpleAI::UpdateAI(const uint32 diff)
+{
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Spells
+ for (uint32 i = 0; i < 10; ++i)
+ {
+ //Spell not valid
+ if (!Spell[i].Enabled || !Spell[i].Spell_Id)
+ continue;
+
+ 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)
+ continue;
+
+ //Check Current spell
+ if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
+ {
+ Unit* target = NULL;
+
+ switch (Spell[i].Cast_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ }
+
+ //Target is ok, cast a spell on it and then do our random yell
+ if (target)
+ {
+ if (m_creature->IsNonMeleeSpellCasted(false))
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(target, Spell[i].Spell_Id);
+
+ //Yell and sound use the same number so that you can make
+ //the creature yell with the correct sound effect attached
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Spell[i].Text[random_text])
+ if (Spell[i].Say[random_text])
+ DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
+ else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
+
+ //Random sound
+ if (Spell[i].Text_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
+ }
+
+ }
+
+ //Spell will cast agian when the cooldown is up
+ if (Spell[i].CooldownRandomAddition)
+ Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
+ else Spell_Timer[i] = Spell[i].Cooldown;
+
+ }else Spell_Timer[i] -= diff;
+
+ }
+
+ DoMeleeAttackIfReady();
+}
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.h b/src/bindings/scripts/scripts/creature/simple_ai.h
index 421ef6313c5..49d0f0c4922 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.h
+++ b/src/bindings/scripts/scripts/creature/simple_ai.h
@@ -1,74 +1,74 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_SIMPLEAI_H
-#define SC_SIMPLEAI_H
-
-enum CastTarget
-{
- CAST_SELF = 0, //Self cast
- CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro)
- CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- CAST_HOSTILE_RANDOM, //Just any random target on our threat list
- CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
-
- //Special cases
- CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
- CAST_JUSTDIED_KILLER, //Only works within JustDied function
-};
-
-struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
-{
- SimpleAI(Creature *c);// : ScriptedAI(c);
-
- void Reset();
-
- void Aggro(Unit *who);
-
- void KilledUnit(Unit *victim);
-
- void DamageTaken(Unit *killer, uint32 &damage);
-
- void UpdateAI(const uint32 diff);
-
-public:
-
- char* Aggro_Text[3];
- bool Aggro_Say[3];
- uint32 Aggro_Sound[3];
-
- char* Death_Text[3];
- bool Death_Say[3];
- uint32 Death_Sound[3];
- uint32 Death_Spell;
- uint32 Death_Target_Type;
-
- char* Kill_Text[3];
- bool Kill_Say[3];
- uint32 Kill_Sound[3];
- uint32 Kill_Spell;
- uint32 Kill_Target_Type;
-
- struct SimpleAI_Spell
- {
- uint32 Spell_Id; //Spell ID to cast
- int32 First_Cast; //Delay for first cast
- uint32 Cooldown; //Cooldown between casts
- uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
- uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
- bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
- bool Enabled; //Spell enabled or disabled (default: false)
-
- //3 texts to many?
- char* Text[3];
- bool Say[3];
- uint32 Text_Sound[3];
- }Spell[10];
-
-protected:
- uint32 Spell_Timer[10];
-};
-
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_SIMPLEAI_H
+#define SC_SIMPLEAI_H
+
+enum CastTarget
+{
+ CAST_SELF = 0, //Self cast
+ CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro)
+ CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ CAST_HOSTILE_RANDOM, //Just any random target on our threat list
+ CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
+
+ //Special cases
+ CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
+ CAST_JUSTDIED_KILLER, //Only works within JustDied function
+};
+
+struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
+{
+ SimpleAI(Creature *c);// : ScriptedAI(c);
+
+ void Reset();
+
+ void Aggro(Unit *who);
+
+ void KilledUnit(Unit *victim);
+
+ void DamageTaken(Unit *killer, uint32 &damage);
+
+ void UpdateAI(const uint32 diff);
+
+public:
+
+ char* Aggro_Text[3];
+ bool Aggro_Say[3];
+ uint32 Aggro_Sound[3];
+
+ char* Death_Text[3];
+ bool Death_Say[3];
+ uint32 Death_Sound[3];
+ uint32 Death_Spell;
+ uint32 Death_Target_Type;
+
+ char* Kill_Text[3];
+ bool Kill_Say[3];
+ uint32 Kill_Sound[3];
+ uint32 Kill_Spell;
+ uint32 Kill_Target_Type;
+
+ struct SimpleAI_Spell
+ {
+ uint32 Spell_Id; //Spell ID to cast
+ int32 First_Cast; //Delay for first cast
+ uint32 Cooldown; //Cooldown between casts
+ uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
+ uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
+ bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
+ bool Enabled; //Spell enabled or disabled (default: false)
+
+ //3 texts to many?
+ char* Text[3];
+ bool Say[3];
+ uint32 Text_Sound[3];
+ }Spell[10];
+
+protected:
+ uint32 Spell_Timer[10];
+};
+
+#endif
diff --git a/src/bindings/scripts/scripts/custom/custom_example.cpp b/src/bindings/scripts/scripts/custom/custom_example.cpp
index b283d196ddf..133b2136a1c 100644
--- a/src/bindings/scripts/scripts/custom/custom_example.cpp
+++ b/src/bindings/scripts/scripts/custom/custom_example.cpp
@@ -1,277 +1,277 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Custom_Example
-SD%Complete: 100
-SDComment: Short custom scripting example
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-
-// **** This script is designed as an example for others to build on ****
-// **** Please modify whatever you'd like to as this script is only for developement ****
-
-// **** Script Info ****
-// This script is written in a way that it can be used for both friendly and hostile monsters
-// Its primary purpose is to show just how much you can really do with scripts
-// I recommend trying it out on both an agressive NPC and on friendly npc
-
-// **** Quick Info ****
-// Functions with Handled Function marked above them are functions that are called automatically by the core
-// Functions that are marked Custom Function are functions I've created to simplify code
-
-#define SPELL_BUFF 25661
-#define SPELL_ONE 12555
-#define SPELL_ONE_ALT 24099
-#define SPELL_TWO 10017
-#define SPELL_THREE 26027
-#define SPELL_ENRAGE 23537
-#define SPELL_BESERK 32309
-
-#define SAY_AGGRO "Let the games begin."
-#define SAY_RANDOM_0 "I see endless suffering. I see torment. I see rage. I see everything."
-#define SAY_RANDOM_1 "Muahahahaha"
-#define SAY_RANDOM_2 "These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets."
-#define SAY_RANDOM_3 "You are already dead."
-#define SAY_RANDOM_4 "Where to go? What to do? So many choices that all end in pain, end in death."
-#define SAY_BESERK "$N, I sentance you to death!"
-#define SAY_PHASE "The suffering has just begun!"
-
-#define GOSSIP_ITEM "I'm looking for a fight"
-#define SAY_DANCE "I always thought I was a good dancer"
-#define SAY_SALUTE "Move out Soldier!"
-
-struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
-{
- //*** HANDLED FUNCTION ***
- //This is the constructor, called only once when the creature is first created
- custom_exampleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- //*** CUSTOM VARIABLES ****
- //These variables are for use only by this individual script.
- //Nothing else will ever call them but us.
-
- uint32 Say_Timer; //Timer for random chat
- uint32 Rebuff_Timer; //Timer for rebuffing
- uint32 Spell_1_Timer; //Timer for spell 1 when in combat
- uint32 Spell_2_Timer; //Timer for spell 1 when in combat
- uint32 Spell_3_Timer; //Timer for spell 1 when in combat
- uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode
- uint32 Phase; //The current battle phase we are in
- uint32 Phase_Timer; //Timer until phase transition
-
- //*** HANDLED FUNCTION ***
- //This is called whenever the core decides we need to evade
- void Reset()
- {
- Phase = 1; //Start in phase 1
- Phase_Timer = 60000; //60 seconds
- Spell_1_Timer = 5000; //5 seconds
- Spell_2_Timer = 37000; //37 seconds
- Spell_3_Timer = 19000; //19 seconds
- Beserk_Timer = 120000; //2 minutes
- }
-
- //*** HANDLED FUNCTION ***
- //Attack Start is called whenever someone hits us.
- void Aggro(Unit *who)
- {
- //Say some stuff
- DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8280);
- }
-
- //*** HANDLED FUNCTION ***
- //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
- void UpdateAI(const uint32 diff)
- {
- //Out of combat timers
- if (!m_creature->getVictim())
- {
- //Random Say timer
- if (Say_Timer < diff)
- {
- //Random switch between 5 outcomes
- switch (rand()%5)
- {
- case 0:
- DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc
- break;
-
- case 1:
- DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8818);
- break;
-
- case 2:
- DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8041);
- break;
-
- case 3:
- DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8581);
- break;
-
- case 4:
- DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8791);
- break;
- }
-
- Say_Timer = 45000; //Say something agian in 45 seconds
- }else Say_Timer -= diff;
-
- //Rebuff timer
- if (Rebuff_Timer < diff)
- {
- DoCast(m_creature,SPELL_BUFF);
- Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
- }else Rebuff_Timer -= diff;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Spell 1 timer
- if (Spell_1_Timer < diff)
- {
- //Cast spell one on our current target.
- if (rand()%50 > 10)
- DoCast(m_creature->getVictim(),SPELL_ONE_ALT);
- else if (m_creature->GetDistance(m_creature->getVictim()) < 25)
- DoCast(m_creature->getVictim(),SPELL_ONE);
-
- Spell_1_Timer = 5000;
- }else Spell_1_Timer -= diff;
-
- //Spell 2 timer
- if (Spell_2_Timer < diff)
- {
- //Cast spell one on our current target.
- DoCast(m_creature->getVictim(),SPELL_TWO);
-
- Spell_2_Timer = 37000;
- }else Spell_2_Timer -= diff;
-
- //Spell 3 timer
- if (Phase > 1)
- if (Spell_3_Timer < diff)
- {
- //Cast spell one on our current target.
- DoCast(m_creature->getVictim(),SPELL_THREE);
-
- Spell_3_Timer = 19000;
- }else Spell_3_Timer -= diff;
-
- //Beserk timer
- if (Phase > 1)
- if (Beserk_Timer < diff)
- {
- //Say our line then cast uber death spell
- DoPlaySoundToSet(m_creature,8588);
- DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim());
- DoCast(m_creature->getVictim(),SPELL_BESERK);
-
- //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
- Beserk_Timer = 12000;
- }else Beserk_Timer -= diff;
-
- //Phase timer
- if (Phase == 1)
- if (Phase_Timer < diff)
- {
- //Go to next phase
- Phase++;
- DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ENRAGE);
- }else Phase_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//This is the GetAI method used by all scripts that involve AI
-//It is called every time a new creature using this script is created
-CreatureAI* GetAI_custom_example(Creature *_Creature)
-{
- return new custom_exampleAI (_Creature);
-}
-
-//This function is called when the player clicks an option on the gossip menu
-void SendDefaultMenu_custom_example(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- //Set our faction to hostile twoards all
- _Creature->setFaction(24);
- _Creature->Attack(player, true);
- player->PlayerTalkClass->CloseGossip();
- }
-}
-
-//This function is called when the player clicks an option on the gossip menu
-bool GossipSelect_custom_example(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (sender == GOSSIP_SENDER_MAIN)
- SendDefaultMenu_custom_example(player, _Creature, action);
-
- return true;
-}
-
-//This function is called when the player opens the gossip menu
-bool GossipHello_custom_example(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
-
- return true;
-}
-
-//Our Recive emote function
-bool ReceiveEmote_custom_example(Player *player, Creature *_Creature, uint32 emote)
-{
- _Creature->HandleEmoteCommand(emote);
-
- if (emote == TEXTEMOTE_DANCE)
- ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
-
- if (emote == TEXTEMOTE_SALUTE)
- ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
-
- return true;
-}
-
-//This is the actual function called only once durring InitScripts()
-//It must define all handled functions that are to be run in this script
-//For example if you want this Script to handle Emotes you must include
-//newscript->ReciveEmote = My_Emote_Function;
-void AddSC_custom_example()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="custom_example";
- newscript->GetAI = GetAI_custom_example;
- newscript->pGossipHello = &GossipHello_custom_example;
- newscript->pGossipSelect = &GossipSelect_custom_example;
- newscript->pReceiveEmote = &ReceiveEmote_custom_example;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Custom_Example
+SD%Complete: 100
+SDComment: Short custom scripting example
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+
+// **** This script is designed as an example for others to build on ****
+// **** Please modify whatever you'd like to as this script is only for developement ****
+
+// **** Script Info ****
+// This script is written in a way that it can be used for both friendly and hostile monsters
+// Its primary purpose is to show just how much you can really do with scripts
+// I recommend trying it out on both an agressive NPC and on friendly npc
+
+// **** Quick Info ****
+// Functions with Handled Function marked above them are functions that are called automatically by the core
+// Functions that are marked Custom Function are functions I've created to simplify code
+
+#define SPELL_BUFF 25661
+#define SPELL_ONE 12555
+#define SPELL_ONE_ALT 24099
+#define SPELL_TWO 10017
+#define SPELL_THREE 26027
+#define SPELL_ENRAGE 23537
+#define SPELL_BESERK 32309
+
+#define SAY_AGGRO "Let the games begin."
+#define SAY_RANDOM_0 "I see endless suffering. I see torment. I see rage. I see everything."
+#define SAY_RANDOM_1 "Muahahahaha"
+#define SAY_RANDOM_2 "These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets."
+#define SAY_RANDOM_3 "You are already dead."
+#define SAY_RANDOM_4 "Where to go? What to do? So many choices that all end in pain, end in death."
+#define SAY_BESERK "$N, I sentance you to death!"
+#define SAY_PHASE "The suffering has just begun!"
+
+#define GOSSIP_ITEM "I'm looking for a fight"
+#define SAY_DANCE "I always thought I was a good dancer"
+#define SAY_SALUTE "Move out Soldier!"
+
+struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
+{
+ //*** HANDLED FUNCTION ***
+ //This is the constructor, called only once when the creature is first created
+ custom_exampleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ //*** CUSTOM VARIABLES ****
+ //These variables are for use only by this individual script.
+ //Nothing else will ever call them but us.
+
+ uint32 Say_Timer; //Timer for random chat
+ uint32 Rebuff_Timer; //Timer for rebuffing
+ uint32 Spell_1_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_2_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_3_Timer; //Timer for spell 1 when in combat
+ uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode
+ uint32 Phase; //The current battle phase we are in
+ uint32 Phase_Timer; //Timer until phase transition
+
+ //*** HANDLED FUNCTION ***
+ //This is called whenever the core decides we need to evade
+ void Reset()
+ {
+ Phase = 1; //Start in phase 1
+ Phase_Timer = 60000; //60 seconds
+ Spell_1_Timer = 5000; //5 seconds
+ Spell_2_Timer = 37000; //37 seconds
+ Spell_3_Timer = 19000; //19 seconds
+ Beserk_Timer = 120000; //2 minutes
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Attack Start is called whenever someone hits us.
+ void Aggro(Unit *who)
+ {
+ //Say some stuff
+ DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8280);
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
+ void UpdateAI(const uint32 diff)
+ {
+ //Out of combat timers
+ if (!m_creature->getVictim())
+ {
+ //Random Say timer
+ if (Say_Timer < diff)
+ {
+ //Random switch between 5 outcomes
+ switch (rand()%5)
+ {
+ case 0:
+ DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc
+ break;
+
+ case 1:
+ DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8818);
+ break;
+
+ case 2:
+ DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8041);
+ break;
+
+ case 3:
+ DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8581);
+ break;
+
+ case 4:
+ DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8791);
+ break;
+ }
+
+ Say_Timer = 45000; //Say something agian in 45 seconds
+ }else Say_Timer -= diff;
+
+ //Rebuff timer
+ if (Rebuff_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BUFF);
+ Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
+ }else Rebuff_Timer -= diff;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Spell 1 timer
+ if (Spell_1_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ if (rand()%50 > 10)
+ DoCast(m_creature->getVictim(),SPELL_ONE_ALT);
+ else if (m_creature->GetDistance(m_creature->getVictim()) < 25)
+ DoCast(m_creature->getVictim(),SPELL_ONE);
+
+ Spell_1_Timer = 5000;
+ }else Spell_1_Timer -= diff;
+
+ //Spell 2 timer
+ if (Spell_2_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_TWO);
+
+ Spell_2_Timer = 37000;
+ }else Spell_2_Timer -= diff;
+
+ //Spell 3 timer
+ if (Phase > 1)
+ if (Spell_3_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_THREE);
+
+ Spell_3_Timer = 19000;
+ }else Spell_3_Timer -= diff;
+
+ //Beserk timer
+ if (Phase > 1)
+ if (Beserk_Timer < diff)
+ {
+ //Say our line then cast uber death spell
+ DoPlaySoundToSet(m_creature,8588);
+ DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim());
+ DoCast(m_creature->getVictim(),SPELL_BESERK);
+
+ //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
+ Beserk_Timer = 12000;
+ }else Beserk_Timer -= diff;
+
+ //Phase timer
+ if (Phase == 1)
+ if (Phase_Timer < diff)
+ {
+ //Go to next phase
+ Phase++;
+ DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ENRAGE);
+ }else Phase_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//This is the GetAI method used by all scripts that involve AI
+//It is called every time a new creature using this script is created
+CreatureAI* GetAI_custom_example(Creature *_Creature)
+{
+ return new custom_exampleAI (_Creature);
+}
+
+//This function is called when the player clicks an option on the gossip menu
+void SendDefaultMenu_custom_example(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ //Set our faction to hostile twoards all
+ _Creature->setFaction(24);
+ _Creature->Attack(player, true);
+ player->PlayerTalkClass->CloseGossip();
+ }
+}
+
+//This function is called when the player clicks an option on the gossip menu
+bool GossipSelect_custom_example(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu_custom_example(player, _Creature, action);
+
+ return true;
+}
+
+//This function is called when the player opens the gossip menu
+bool GossipHello_custom_example(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+
+ return true;
+}
+
+//Our Recive emote function
+bool ReceiveEmote_custom_example(Player *player, Creature *_Creature, uint32 emote)
+{
+ _Creature->HandleEmoteCommand(emote);
+
+ if (emote == TEXTEMOTE_DANCE)
+ ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
+
+ if (emote == TEXTEMOTE_SALUTE)
+ ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
+
+ return true;
+}
+
+//This is the actual function called only once durring InitScripts()
+//It must define all handled functions that are to be run in this script
+//For example if you want this Script to handle Emotes you must include
+//newscript->ReciveEmote = My_Emote_Function;
+void AddSC_custom_example()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="custom_example";
+ newscript->GetAI = GetAI_custom_example;
+ newscript->pGossipHello = &GossipHello_custom_example;
+ newscript->pGossipSelect = &GossipSelect_custom_example;
+ newscript->pReceiveEmote = &ReceiveEmote_custom_example;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp b/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
index 5a75d78f1e6..c8cfe711fc9 100644
--- a/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
+++ b/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
@@ -1,81 +1,81 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Custom_Gossip_Codebox
-SD%Complete: 100
-SDComment: Show a codebox in gossip option
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-#include <cstring>
-
-//This function is called when the player opens the gossip menubool
-bool GossipHello_custom_gossip_codebox(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM_EXTENDED(0, "A quiz: what's your name?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
- player->ADD_GOSSIP_ITEM(0, "I'm not interested", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
- return true;
-}
-
-//This function is called when the player clicks an option on the gossip menubool
-bool GossipSelect_custom_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF+2)
- {
- _Creature->Say("Normal select, guess you're not interested.", LANG_UNIVERSAL, 0);
- player->CLOSE_GOSSIP_MENU();
- }
- return true;
-}
-
-bool GossipSelectWithCode_custom_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
-{
- if(sender == GOSSIP_SENDER_MAIN)
- {
- if(action == GOSSIP_ACTION_INFO_DEF+1)
- {
- if(std::strcmp(sCode, player->GetName())!=0)
- {
- _Creature->Say("Wrong!", LANG_UNIVERSAL, 0);
- _Creature->CastSpell(player, 12826, true);
- }
- else
- {
- _Creature->Say("You're right, you are allowed to see my inner secrets.", LANG_UNIVERSAL, 0);
- _Creature->CastSpell(player, 26990, true);
- }
- player->CLOSE_GOSSIP_MENU();
- return true;
- }
- }
- return false;
-}
-
-void AddSC_custom_gossip_codebox()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="custom_gossip_codebox";
- newscript->pGossipHello = &GossipHello_custom_gossip_codebox;
- newscript->pGossipSelect = &GossipSelect_custom_gossip_codebox;
- newscript->pGossipSelectWithCode = &GossipSelectWithCode_custom_gossip_codebox;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Custom_Gossip_Codebox
+SD%Complete: 100
+SDComment: Show a codebox in gossip option
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include <cstring>
+
+//This function is called when the player opens the gossip menubool
+bool GossipHello_custom_gossip_codebox(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM_EXTENDED(0, "A quiz: what's your name?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
+ player->ADD_GOSSIP_ITEM(0, "I'm not interested", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+ return true;
+}
+
+//This function is called when the player clicks an option on the gossip menubool
+bool GossipSelect_custom_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ _Creature->Say("Normal select, guess you're not interested.", LANG_UNIVERSAL, 0);
+ player->CLOSE_GOSSIP_MENU();
+ }
+ return true;
+}
+
+bool GossipSelectWithCode_custom_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
+{
+ if(sender == GOSSIP_SENDER_MAIN)
+ {
+ if(action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ if(std::strcmp(sCode, player->GetName())!=0)
+ {
+ _Creature->Say("Wrong!", LANG_UNIVERSAL, 0);
+ _Creature->CastSpell(player, 12826, true);
+ }
+ else
+ {
+ _Creature->Say("You're right, you are allowed to see my inner secrets.", LANG_UNIVERSAL, 0);
+ _Creature->CastSpell(player, 26990, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ return true;
+ }
+ }
+ return false;
+}
+
+void AddSC_custom_gossip_codebox()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="custom_gossip_codebox";
+ newscript->pGossipHello = &GossipHello_custom_gossip_codebox;
+ newscript->pGossipSelect = &GossipSelect_custom_gossip_codebox;
+ newscript->pGossipSelectWithCode = &GossipSelectWithCode_custom_gossip_codebox;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/custom/test.cpp b/src/bindings/scripts/scripts/custom/test.cpp
index 37d6dae893d..52d5c7d6f4f 100644
--- a/src/bindings/scripts/scripts/custom/test.cpp
+++ b/src/bindings/scripts/scripts/custom/test.cpp
@@ -1,200 +1,200 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Test
-SD%Complete: 100
-SDComment: Script used for testing escortAI
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-#include "../npc/npc_escortAI.h"
-
-struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
-{
- public:
-
- // CreatureAI functions
- npc_testAI(Creature *c) : npc_escortAI(c) {Reset();}
-
- uint32 DeathCoilTimer;
- uint32 ChatTimer;
-
- // Pure Virtual Functions
- void WaypointReached(uint32 i)
- {
- switch (i)
- {
- case 1:
- m_creature->Say("Hmm a nice day for a walk alright", LANG_UNIVERSAL, 0);
- break;
-
- case 3:
- {
- m_creature->Say("Wild Felboar attack!", LANG_UNIVERSAL, 0);
- Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
-
- temp->AI()->AttackStart(m_creature);
- }
- break;
-
- case 4:
- {
- m_creature->Say("Time for me to go! See ya around $N!", LANG_UNIVERSAL, PlayerGUID);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
-
- Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID);
- if (temp)
- {
- temp->MonsterSay("Bye Bye!", LANG_UNIVERSAL, 0);
- temp->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- }
- }
- break;
- }
- }
-
- void Aggro(Unit*)
- {
- if (IsBeingEscorted)
- m_creature->Say("Help $N! I'm under attack!", LANG_UNIVERSAL, PlayerGUID);
- else m_creature->Say("Die scum!", LANG_UNIVERSAL, 0);
- }
-
- void Reset()
- {
- DeathCoilTimer = 4000;
- ChatTimer = 4000;
- }
-
- void JustDied(Unit* killer)
- {
- if (IsBeingEscorted)
- {
- //killer = m_creature when player got to far from creature
- if (killer == m_creature)
- {
- Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
- if( pTemp )
- DoWhisper("How dare you leave me like that! I hate you! =*(", pTemp);
- }
- else m_creature->Say("...no...how could you let me die $N", LANG_UNIVERSAL, PlayerGUID);
- }
- else m_creature->Say("ugh...", LANG_UNIVERSAL, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Must update npc_escortAI
- npc_escortAI::UpdateAI(diff);
-
- //Combat check
- if (InCombat && m_creature->getVictim())
- {
- if (DeathCoilTimer < diff)
- {
- m_creature->Say("Taste death!", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature->getVictim(), 33130, false);
-
- DeathCoilTimer = 4000;
- }else DeathCoilTimer -= diff;
- }else
- {
- //Out of combat but being escorted
- if (IsBeingEscorted)
- if (ChatTimer < diff)
- {
- if (m_creature->HasAura(3593, 0))
- {
- m_creature->Say("Fireworks!", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature, 11540, false);
- }else
- {
- m_creature->Say("Hmm, I think I could use a buff", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature, 3593, false);
- }
-
- ChatTimer = 12000;
- }else ChatTimer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_test(Creature *_Creature)
-{
- npc_testAI* testAI = new npc_testAI(_Creature);
-
- testAI->AddWaypoint(0, 1231, -4419, 23);
- testAI->AddWaypoint(1, 1198, -4440, 23, 0);
- testAI->AddWaypoint(2, 1208, -4392, 23);
- testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
- testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
-
- return (CreatureAI*)testAI;
-}
-
-bool GossipHello_npc_test(Player *player, Creature *_Creature)
-{
- player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
- _Creature->prepareGossipMenu(player,0);
-
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(Attack, Defend, Run)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, NoDefend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, Defend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
-
- _Creature->sendPreparedGossip( player );
- return true;
-}
-
-bool GossipSelect_npc_test(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
-
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
-
- if (action == GOSSIP_ACTION_INFO_DEF+3)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, true, false, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
- return false;
-}
-
-void AddSC_test()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="test";
- newscript->GetAI = GetAI_test;
- newscript->pGossipHello = &GossipHello_npc_test;
- newscript->pGossipSelect = &GossipSelect_npc_test;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Test
+SD%Complete: 100
+SDComment: Script used for testing escortAI
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include "../npc/npc_escortAI.h"
+
+struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
+{
+ public:
+
+ // CreatureAI functions
+ npc_testAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ uint32 DeathCoilTimer;
+ uint32 ChatTimer;
+
+ // Pure Virtual Functions
+ void WaypointReached(uint32 i)
+ {
+ switch (i)
+ {
+ case 1:
+ m_creature->Say("Hmm a nice day for a walk alright", LANG_UNIVERSAL, 0);
+ break;
+
+ case 3:
+ {
+ m_creature->Say("Wild Felboar attack!", LANG_UNIVERSAL, 0);
+ Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
+
+ temp->AI()->AttackStart(m_creature);
+ }
+ break;
+
+ case 4:
+ {
+ m_creature->Say("Time for me to go! See ya around $N!", LANG_UNIVERSAL, PlayerGUID);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+
+ Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID);
+ if (temp)
+ {
+ temp->MonsterSay("Bye Bye!", LANG_UNIVERSAL, 0);
+ temp->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ }
+ }
+ break;
+ }
+ }
+
+ void Aggro(Unit*)
+ {
+ if (IsBeingEscorted)
+ m_creature->Say("Help $N! I'm under attack!", LANG_UNIVERSAL, PlayerGUID);
+ else m_creature->Say("Die scum!", LANG_UNIVERSAL, 0);
+ }
+
+ void Reset()
+ {
+ DeathCoilTimer = 4000;
+ ChatTimer = 4000;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (IsBeingEscorted)
+ {
+ //killer = m_creature when player got to far from creature
+ if (killer == m_creature)
+ {
+ Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
+ if( pTemp )
+ DoWhisper("How dare you leave me like that! I hate you! =*(", pTemp);
+ }
+ else m_creature->Say("...no...how could you let me die $N", LANG_UNIVERSAL, PlayerGUID);
+ }
+ else m_creature->Say("ugh...", LANG_UNIVERSAL, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Must update npc_escortAI
+ npc_escortAI::UpdateAI(diff);
+
+ //Combat check
+ if (InCombat && m_creature->getVictim())
+ {
+ if (DeathCoilTimer < diff)
+ {
+ m_creature->Say("Taste death!", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature->getVictim(), 33130, false);
+
+ DeathCoilTimer = 4000;
+ }else DeathCoilTimer -= diff;
+ }else
+ {
+ //Out of combat but being escorted
+ if (IsBeingEscorted)
+ if (ChatTimer < diff)
+ {
+ if (m_creature->HasAura(3593, 0))
+ {
+ m_creature->Say("Fireworks!", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature, 11540, false);
+ }else
+ {
+ m_creature->Say("Hmm, I think I could use a buff", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature, 3593, false);
+ }
+
+ ChatTimer = 12000;
+ }else ChatTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_test(Creature *_Creature)
+{
+ npc_testAI* testAI = new npc_testAI(_Creature);
+
+ testAI->AddWaypoint(0, 1231, -4419, 23);
+ testAI->AddWaypoint(1, 1198, -4440, 23, 0);
+ testAI->AddWaypoint(2, 1208, -4392, 23);
+ testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
+ testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
+
+ return (CreatureAI*)testAI;
+}
+
+bool GossipHello_npc_test(Player *player, Creature *_Creature)
+{
+ player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
+ _Creature->prepareGossipMenu(player,0);
+
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(Attack, Defend, Run)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, NoDefend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, Defend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+
+ _Creature->sendPreparedGossip( player );
+ return true;
+}
+
+bool GossipSelect_npc_test(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+3)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, true, false, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+ return false;
+}
+
+void AddSC_test()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="test";
+ newscript->GetAI = GetAI_test;
+ newscript->pGossipHello = &GossipHello_npc_test;
+ newscript->pGossipSelect = &GossipSelect_npc_test;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp
index 8f6d274955b..f07aff74f5f 100644
--- a/src/bindings/scripts/scripts/go/go_scripts.cpp
+++ b/src/bindings/scripts/scripts/go/go_scripts.cpp
@@ -1,209 +1,209 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: GO_Scripts
-SD%Complete: 100
-SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089
-SDCategory: Game Objects
-EndScriptData */
-
-/* ContentData
-go_northern_crystal_pylon
-go_eastern_crystal_pylon
-go_western_crystal_pylon
-go_barov_journal
-go_field_repair_bot_74A
-go_orb_of_command
-go_tablet_of_madness
-go_tablet_of_the_seven
-go_teleporter
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## go_crystal_pylons (3x)
-######*/
-
-bool GOHello_go_northern_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4285);
-
- return true;
-}
-
-bool GOHello_go_eastern_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4287);
-
- return true;
-}
-
-bool GOHello_go_western_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4288);
-
- return true;
-}
-
-/*######
-## go_barov_journal
-######*/
-
-bool GOHello_go_barov_journal(Player *player, GameObject* _GO)
-{
- if(player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086))
- {
- player->CastSpell(player,26095,false);
- }
- return true;
-}
-
-/*######
-## go_field_repair_bot_74A
-######*/
-
-bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO)
-{
- if(player->HasSkill(SKILL_ENGINERING) && player->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !player->HasSpell(22704))
- {
- player->CastSpell(player,22864,false);
- }
- return true;
-}
-
-/*######
-## go_orb_of_command
-######*/
-
-bool GOHello_go_orb_of_command(Player *player, GameObject* _GO)
-{
- if( player->GetQuestRewardStatus(7761) )
- player->CastSpell(player,23460,true);
-
- return true;
-}
-
-/*######
-## go_tablet_of_madness
-######*/
-
-bool GOHello_go_tablet_of_madness(Player *player, GameObject* _GO)
-{
- if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
- {
- player->CastSpell(player,24267,false);
- }
- return true;
-}
-
-/*######
-## go_tablet_of_the_seven
-######*/
-
-//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
-bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
- return true;
-
- if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
- player->CastSpell(player,15065,false);
-
- return true;
-}
-
-/*######
-## go_teleporter
-######*/
-
-bool GOHello_go_teleporter(Player *player, GameObject* _GO)
-{
- player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
- return false;
-}
-
-void AddSC_go_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="go_northern_crystal_pylon";
- newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_eastern_crystal_pylon";
- newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_western_crystal_pylon";
- newscript->pGOHello = &GOHello_go_western_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_barov_journal";
- newscript->pGOHello = &GOHello_go_barov_journal;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_field_repair_bot_74A";
- newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_orb_of_command";
- newscript->pGOHello = &GOHello_go_orb_of_command;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_tablet_of_madness";
- newscript->pGOHello = GOHello_go_tablet_of_madness;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_tablet_of_the_seven";
- newscript->pGOHello = GOHello_go_tablet_of_the_seven;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_teleporter";
- newscript->pGOHello = GOHello_go_teleporter;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: GO_Scripts
+SD%Complete: 100
+SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089
+SDCategory: Game Objects
+EndScriptData */
+
+/* ContentData
+go_northern_crystal_pylon
+go_eastern_crystal_pylon
+go_western_crystal_pylon
+go_barov_journal
+go_field_repair_bot_74A
+go_orb_of_command
+go_tablet_of_madness
+go_tablet_of_the_seven
+go_teleporter
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## go_crystal_pylons (3x)
+######*/
+
+bool GOHello_go_northern_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4285);
+
+ return true;
+}
+
+bool GOHello_go_eastern_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4287);
+
+ return true;
+}
+
+bool GOHello_go_western_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4288);
+
+ return true;
+}
+
+/*######
+## go_barov_journal
+######*/
+
+bool GOHello_go_barov_journal(Player *player, GameObject* _GO)
+{
+ if(player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086))
+ {
+ player->CastSpell(player,26095,false);
+ }
+ return true;
+}
+
+/*######
+## go_field_repair_bot_74A
+######*/
+
+bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO)
+{
+ if(player->HasSkill(SKILL_ENGINERING) && player->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !player->HasSpell(22704))
+ {
+ player->CastSpell(player,22864,false);
+ }
+ return true;
+}
+
+/*######
+## go_orb_of_command
+######*/
+
+bool GOHello_go_orb_of_command(Player *player, GameObject* _GO)
+{
+ if( player->GetQuestRewardStatus(7761) )
+ player->CastSpell(player,23460,true);
+
+ return true;
+}
+
+/*######
+## go_tablet_of_madness
+######*/
+
+bool GOHello_go_tablet_of_madness(Player *player, GameObject* _GO)
+{
+ if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
+ {
+ player->CastSpell(player,24267,false);
+ }
+ return true;
+}
+
+/*######
+## go_tablet_of_the_seven
+######*/
+
+//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
+bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
+ return true;
+
+ if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
+ player->CastSpell(player,15065,false);
+
+ return true;
+}
+
+/*######
+## go_teleporter
+######*/
+
+bool GOHello_go_teleporter(Player *player, GameObject* _GO)
+{
+ player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
+ return false;
+}
+
+void AddSC_go_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="go_northern_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_eastern_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_western_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_western_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_barov_journal";
+ newscript->pGOHello = &GOHello_go_barov_journal;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_field_repair_bot_74A";
+ newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_orb_of_command";
+ newscript->pGOHello = &GOHello_go_orb_of_command;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_tablet_of_madness";
+ newscript->pGOHello = GOHello_go_tablet_of_madness;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_tablet_of_the_seven";
+ newscript->pGOHello = GOHello_go_tablet_of_the_seven;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_teleporter";
+ newscript->pGOHello = GOHello_go_teleporter;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp
index 7504ff49452..5777a886cbe 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.cpp
+++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp
@@ -1,160 +1,160 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Guard_AI
-SD%Complete: 90
-SDComment:
-SDCategory: Guards
-EndScriptData */
-
-#include "precompiled.h"
-#include "guard_ai.h"
-
-// **** This script is for use within every single guard to save coding time ****
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-void guardAI::Reset()
-{
- GlobalCooldown = 0;
- BuffTimer = 0; //Rebuff as soon as we can
-}
-
-void guardAI::Aggro(Unit *who)
-{
-}
-
-void guardAI::JustDied(Unit *Killer)
-{
- //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
- if( Killer->GetTypeId() == TYPEID_PLAYER )
- m_creature->SendZoneUnderAttackMessage((Player*)Killer);
- else if( Unit *owner = Killer->GetOwner() )
- {
- if( owner->GetTypeId() == TYPEID_PLAYER )
- m_creature->SendZoneUnderAttackMessage((Player*)owner);
- }
-}
-
-void guardAI::UpdateAI(const uint32 diff)
-{
- //Always decrease our global cooldown first
- if (GlobalCooldown > diff)
- GlobalCooldown -= diff;
- else GlobalCooldown = 0;
-
- //Buff timer (only buff when we are alive and not in combat
- if (m_creature->isAlive() && !InCombat)
- 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);
-
- if (info && !GlobalCooldown)
- {
- //Cast the buff spell
- DoCastSpell(m_creature, info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
- //Set our timer to 10 minutes before rebuff
- BuffTimer = 600000;
- } //Try agian in 30 seconds
- else BuffTimer = 30000;
- }else BuffTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- 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);
-
- //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);
-
- //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);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
- }
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
-
- m_creature->resetAttackTimer();
- }
- }
- else
- {
- //Only run this code if we arn't already casting
- if (!m_creature->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);
-
- //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, ATTACK_DISTANCE, 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)
- {
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveIdle();
- }
-
- //Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->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)
- {
- //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());
- }
- }
- }
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Guard_AI
+SD%Complete: 90
+SDComment:
+SDCategory: Guards
+EndScriptData */
+
+#include "precompiled.h"
+#include "guard_ai.h"
+
+// **** This script is for use within every single guard to save coding time ****
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+void guardAI::Reset()
+{
+ GlobalCooldown = 0;
+ BuffTimer = 0; //Rebuff as soon as we can
+}
+
+void guardAI::Aggro(Unit *who)
+{
+}
+
+void guardAI::JustDied(Unit *Killer)
+{
+ //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
+ if( Killer->GetTypeId() == TYPEID_PLAYER )
+ m_creature->SendZoneUnderAttackMessage((Player*)Killer);
+ else if( Unit *owner = Killer->GetOwner() )
+ {
+ if( owner->GetTypeId() == TYPEID_PLAYER )
+ m_creature->SendZoneUnderAttackMessage((Player*)owner);
+ }
+}
+
+void guardAI::UpdateAI(const uint32 diff)
+{
+ //Always decrease our global cooldown first
+ if (GlobalCooldown > diff)
+ GlobalCooldown -= diff;
+ else GlobalCooldown = 0;
+
+ //Buff timer (only buff when we are alive and not in combat
+ if (m_creature->isAlive() && !InCombat)
+ 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);
+
+ if (info && !GlobalCooldown)
+ {
+ //Cast the buff spell
+ DoCastSpell(m_creature, info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+ //Set our timer to 10 minutes before rebuff
+ BuffTimer = 600000;
+ } //Try agian in 30 seconds
+ else BuffTimer = 30000;
+ }else BuffTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ 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);
+
+ //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);
+
+ //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);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+ }
+ else m_creature->AttackerStateUpdate(m_creature->getVictim());
+
+ m_creature->resetAttackTimer();
+ }
+ }
+ else
+ {
+ //Only run this code if we arn't already casting
+ if (!m_creature->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);
+
+ //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, ATTACK_DISTANCE, 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)
+ {
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MoveIdle();
+ }
+
+ //Cast spell
+ if (Healing) DoCastSpell(m_creature,info);
+ else DoCastSpell(m_creature->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)
+ {
+ //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());
+ }
+ }
+ }
+}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.h b/src/bindings/scripts/scripts/guard/guard_ai.h
index a6ba365e9a6..57e7bdc226b 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.h
+++ b/src/bindings/scripts/scripts/guard/guard_ai.h
@@ -1,25 +1,25 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_GUARDAI_H
-#define SC_GUARDAI_H
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-struct TRINITY_DLL_DECL guardAI : public ScriptedAI
-{
- guardAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
- uint32 BuffTimer; //This variable keeps track of buffs
-
- void Reset();
-
- void Aggro(Unit *who);
-
- void JustDied(Unit *Killer);
-
- void UpdateAI(const uint32 diff);
-};
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_GUARDAI_H
+#define SC_GUARDAI_H
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+struct TRINITY_DLL_DECL guardAI : public ScriptedAI
+{
+ guardAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
+ uint32 BuffTimer; //This variable keeps track of buffs
+
+ void Reset();
+
+ void Aggro(Unit *who);
+
+ void JustDied(Unit *Killer);
+
+ void UpdateAI(const uint32 diff);
+};
+#endif
diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp
index b0565b9bf3e..a6922be362d 100644
--- a/src/bindings/scripts/scripts/guard/guards.cpp
+++ b/src/bindings/scripts/scripts/guard/guards.cpp
@@ -1,4117 +1,4117 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Guards
-SD%Complete: 100
-SDComment: All Guard gossip data, quite some npc_text-id's still missing, adding constantly as new id's are known. CombatAI should be organized better for future.
-SDCategory: Guards
-EndScriptData */
-
-/* ContentData
-guard_azuremyst
-guard_bluffwatcher
-guard_contested
-guard_darnassus
-guard_dunmorogh
-guard_durotar
-guard_elwynnforest
-guard_eversong
-guard_exodar
-guard_ironforge
-guard_mulgore
-guard_orgrimmar
-guard_shattrath
-guard_shattrath_aldor
-guard_shattrath_scryer
-guard_silvermoon
-guard_stormwind
-guard_teldrassil
-guard_tirisfal
-guard_undercity
-EndContentData */
-
-#include "precompiled.h"
-#include "guard_ai.h"
-
-//script spesific action
-#define GOSSIP_ACTION_TAVERN 101
-#define GOSSIP_ACTION_GEMMERCHANT 102
-#define GOSSIP_ACTION_MANALOOM 103
-
-//script spesific sender
-#define GOSSIP_SENDER_SEC_GEMMERCHANT 101
-#define GOSSIP_SENDER_SEC_AUCTIONHOUSE 102
-
-//script spesific gossip text
-#define GOSSIP_TEXT_TAVERN "Worlds End Tavern"
-#define GOSSIP_TEXT_BANKSCYERS "Scyers bank"
-#define GOSSIP_TEXT_BANKALDOR "Aldor Bank"
-#define GOSSIP_TEXT_INNSCYERS "Scyers Inn"
-#define GOSSIP_TEXT_INNALDOR "Aldor Inn"
-#define GOSSIP_TEXT_STABLESCYERS "Scyers Stable"
-#define GOSSIP_TEXT_STABLEALDOR "Aldor Stable"
-#define GOSSIP_TEXT_BATTLEMASTERALLIANCE "Alliance Battlemasters"
-#define GOSSIP_TEXT_BATTLEMASTERHORDE "Horde Battlemasters"
-#define GOSSIP_TEXT_BATTLEMASTERARENA "Arena Battlemasters"
-#define GOSSIP_TEXT_MANALOOM "Mana Loom"
-#define GOSSIP_TEXT_ALCHEMYLAB "Alchemy Lab"
-#define GOSSIP_TEXT_GEMMERCHANT "Gem Merchant"
-#define GOSSIP_TEXT_GEMSCYERS "Scyers Gem Merchant"
-#define GOSSIP_TEXT_GEMALDOR "Aldor Gem Merchant"
-
-#define GOSSIP_TEXT_AH_SILVERMOON_1 "Western Auction House"
-#define GOSSIP_TEXT_AH_SILVERMOON_2 "Royal Exchange Auction House"
-
-#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
-#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
-
-//common used for guards in main cities
-void DoReplyToTextEmote(Creature *_Creature,uint32 em)
-{
- switch(em)
- {
- case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
- case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
- case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
- case TEXTEMOTE_RUDE:
- case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
- }
-}
-
-/*******************************************************
- * guard_azuremyst start
- *******************************************************/
-
-bool GossipHello_guard_azuremyst(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10066,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank");
- player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master
- player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos");
- player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam");
- player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan");
- player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina");
- player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10076,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(10087,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius");
- player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon");
- player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid");
- player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas");
- player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan");
- player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun");
- player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada");
- player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal");
- player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso");
- player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce");
- player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg");
- player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo");
- player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema");
- player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna");
- player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting
- player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii");
- player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo");
- player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi");
- player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf");
- player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly");
- player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_azuremyst(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_azuremyst(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_azuremyst(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_azuremyst(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_azuremyst end
- *******************************************************/
-
-CreatureAI* GetAI_guard_azuremyst(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_bluffwatcher start
- *******************************************************/
-
-bool GossipHello_guard_bluffwatcher(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank");
- player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind master
- player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost");
- player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information");
- player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn");
- player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox");
- player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
- player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master
- player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa");
- player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable master
- player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug");
- player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem");
- player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey");
- player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe");
- player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders");
- player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
- player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
- player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
- player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits");
- player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warrior
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
- player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy");
- player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy");
- player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen");
- player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters");
- player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing");
- player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle");
- player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism");
- player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
- player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mining
- player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology");
- player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta");
- player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
- player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_bluffwatcher(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_bluffwatcher end
- *******************************************************/
-
-CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_contested start
- *******************************************************/
-
-struct TRINITY_DLL_DECL guard_contested : public guardAI
-{
- guard_contested(Creature *c) : guardAI(c) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if ( who->isAttackingPlayer() )
- {
- if(who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID() && GUID_HIPART(who->GetOwnerGUID())==HIGHGUID_PLAYER)
- {
- m_creature->AddThreat(who, 0.0f);
- if(Unit* owner = who->GetOwner())
- m_creature->AddThreat(owner, 0.0f);
-
- if(!m_creature->isInCombat())
- {
- if (m_creature->GetEntry() == 15184) //Cenarion Hold Infantry
- {
- srand (time(NULL));
- if (rand()%100 <= 30)
- {
- DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
- }
- else if (rand()%100 > 30 && rand()%100 < 50)
- {
- DoSay("Please tell me that you didn`t just do what I think you just did. Please tell me that I`m not going to have to hurt you...", LANG_UNIVERSAL,NULL);
- }
- else if (rand()%100 >= 50)
- {
- DoSay("As if we don`t have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
- }
- }
- else
- {
- SpellEntry const *spell = m_creature->reachWithSpellAttack(who);
- DoCastSpell(who, spell);
- }
- }
- DoStartAttackAndMovement(who);
- }
- }
- }
-};
-/*******************************************************
- * guard_contested end
- *******************************************************/
-
-CreatureAI* GetAI_guard_contested(Creature *_Creature)
-{
- return new guard_contested (_Creature);
-}
-
-/*******************************************************
- * guard_darnassus start
- *******************************************************/
-
-bool GossipHello_guard_darnassus(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3016, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House");
- player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank");
- player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Wind master
- player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village");
- player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Guild master
- player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master");
- player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn");
- player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox");
- player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin");
- player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire");
- player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7519, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4264, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(4273, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield");
- player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart");
- player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas");
- player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer");
- player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer");
- player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon");
- player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer");
- player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace");
- player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer");
- player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer");
- player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer");
- player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer");
- player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
- player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer");
- player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer");
- player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer");
- player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
- player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor");
- player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_darnassus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_darnassus(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_darnassus end
- *******************************************************/
-
-CreatureAI* GetAI_guard_darnassus(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_dunmorogh start
- *******************************************************/
-
-bool GossipHello_guard_dunmorogh(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4287,_Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4288,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
- player->SEND_GOSSIP_MENU(4289,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery");
- player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint");
- player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4300,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart");
- player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle");
- player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer");
- player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol");
- player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan");
- player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog");
- player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe");
- player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire");
- player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor");
- player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear");
- player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol");
- player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter");
- player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_GOSSIP_MENU(4308,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone");
- player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_GOSSIP_MENU(4312,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_GOSSIP_MENU(4313,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_dunmorogh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_dunmorogh(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_dunmorogh end
- *******************************************************/
-
-CreatureAI* GetAI_guard_dunmorogh(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_durotar start
- *******************************************************/
-
-bool GossipHello_guard_durotar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(4037,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4032,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
- player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn");
- player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my");
- player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4035,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4036,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar");
- player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa");
- player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin");
- player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak");
- player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart");
- player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust");
- player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar");
- player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan");
- player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk");
- player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_GOSSIP_MENU(4022,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak");
- player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk");
- player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki");
- player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki");
- player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn");
- player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_GOSSIP_MENU(4030,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_GOSSIP_MENU(4031,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_durotar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_durotar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_durotar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_durotar(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_durotar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_durotar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_elwynnforest start
- *******************************************************/
-
-bool GossipHello_guard_elwynnforest(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4260,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
- player->SEND_GOSSIP_MENU(4261,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn");
- player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma");
- player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_GOSSIP_MENU(4265,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt");
- player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm");
- player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta");
- player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius");
- player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe");
- player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Warrior
- player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac");
- player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory");
- player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus");
- player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas");
- player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4277,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle");
- player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown");
- player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy");
- player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder");
- player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner");
- player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin");
- player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_elwynnforest(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_elwynnforest(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_elwynnforest end
- *******************************************************/
-
-CreatureAI* GetAI_guard_elwynnforest(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_eversong start
- *******************************************************/
-
-bool GossipHello_guard_eversong(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler
- player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming");
- player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Guild master
- player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn");
- player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos");
- player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia");
- player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel");
- player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene");
- player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris");
- player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria");
- player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus");
- player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren");
- player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge");
- player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra");
- player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Engineering
- player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria");
- player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel");
- player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia");
- player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein");
- player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn");
- player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine");
- player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_eversong(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_eversong(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_eversong(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_eversong(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_eversong end
- *******************************************************/
-
-CreatureAI* GetAI_guard_eversong(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_exodar start
- *******************************************************/
-
-bool GossipHello_guard_exodar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House");
- player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank");
- player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master");
- player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master
- player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master");
- player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn");
- player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox");
- player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid");
- player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir");
- player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9533, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9555, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom");
- player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer");
- player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer");
- player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer");
- player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer");
- player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer");
- player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer");
- player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer");
- player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer");
- player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer");
- player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer");
- player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer");
- player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer");
- player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer");
- player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer");
- player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer");
- player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer");
- player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer");
- player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer");
- player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_exodar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_exodar(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_exodar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_exodar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_ironforge start
- *******************************************************/
-
-bool GossipHello_guard_ironforge(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_IRONFORGE_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2760, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House");
- player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault");
- player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Tram
- player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram");
- player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master
- player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master");
- player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master
- player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center");
- player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Inn
- player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern");
- player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox");
- player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand");
- player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer
- player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf");
- player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Class Trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Profession Trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2793, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard");
- player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood");
- player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris");
- player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms");
- player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer");
- player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer");
- player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms");
- player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Shaman
- player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer");
- //incorrect id
- player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks");
- player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge");
- player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle");
- player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery");
- player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets");
- player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician");
- player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman");
- player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician");
- player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
- player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Minning
- player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild");
- player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
- player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier");
- player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_ironforge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_ironforge(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_ironforge end
- *******************************************************/
-
-CreatureAI* GetAI_guard_ironforge(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_mulgore start
- *******************************************************/
-
-bool GossipHello_guard_mulgore(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4051,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
- player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn");
- player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa");
- player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(4069,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(4070,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem");
- player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane");
- player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Shaman
- player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser");
- player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warrior
- player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof");
- player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_GOSSIP_MENU(4058,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride");
- player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof");
- player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater");
- player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide");
- player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mining
- player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut");
- player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
- player->SEND_GOSSIP_MENU(4068,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_mulgore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_mulgore(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_mulgore(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_mulgore(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_mulgore end
- *******************************************************/
-
-CreatureAI* GetAI_guard_mulgore(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_orgrimmar start
- *******************************************************/
-
-bool GossipHello_guard_orgrimmar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar");
- player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //wind rider
- player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower");
- player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //guild master
- player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy");
- player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn");
- player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //mailbox
- player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox");
- player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //auction house
- player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House");
- player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin
- player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower");
- player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //weapon master
- player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi");
- player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //stable master
- player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha");
- player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge
- player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends");
- player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2599,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2594,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall");
- player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge");
- player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge");
- player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Shaman
- player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress");
- player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood");
- player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave");
- player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Paladin
- player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom");
- player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions");
- player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil");
- player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit");
- player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks");
- player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop");
- player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest");
- player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing");
- player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum");
- player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
- player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining");
- player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
- player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods");
- player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_orgrimmar(player, _Creature, action); break;
- }
- return true;
-}
-
-bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == HORDE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
-/*******************************************************
- * guard_orgrimmar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath start
- *******************************************************/
-
-bool GossipHello_guard_shattrath(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10379, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master");
- player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(10386, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEALDOR , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLESCYERS , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10387, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMALDOR , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMSCYERS , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10697, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
- player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
- }
-}
-
-void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
- player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
- }
-}
-
-void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
- player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
- player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
- break;
- }
-}
-
-void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- }
-}
-
-void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters");
- player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters");
- player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters");
- player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID());
- break;
- }
-}
-
-void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
- player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant");
- player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID());
- }
-}
-
-bool GossipSelect_guard_shattrath(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BANK: SendBankMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_STABLEMASTER: SendStableMasterMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_GEMMERCHANT: SendGemMerchantMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_MAILBOX: SendMailboxMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath_aldor
- *******************************************************/
-
-#define SPELL_BANISHED_SHATTRATH_A 36642
-#define SPELL_BANISHED_SHATTRATH_S 36671
-#define SPELL_BANISH_TELEPORT 36643
-#define SPELL_EXILE 39533
-
-struct TRINITY_DLL_DECL guard_shattrath_aldorAI : public guardAI
-{
- guard_shattrath_aldorAI(Creature *c) : guardAI(c) { Reset(); }
-
- uint32 Exile_Timer;
- uint32 Banish_Timer;
- uint64 playerGUID;
- bool CanTeleport;
-
- void Reset()
- {
- Banish_Timer = 5000;
- Exile_Timer = 8500;
- playerGUID = 0;
- CanTeleport = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( CanTeleport )
- {
- if( Exile_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
- {
- temp->CastSpell(temp,SPELL_EXILE,true);
- temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
- }
- playerGUID = 0;
- Exile_Timer = 8500;
- CanTeleport = false;
- }else Exile_Timer -= diff;
- }
- else if( Banish_Timer < diff )
- {
- Unit* temp = m_creature->getVictim();
- if( temp && temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp,SPELL_BANISHED_SHATTRATH_A);
- Banish_Timer = 9000;
- playerGUID = temp->GetGUID();
- if( playerGUID )
- CanTeleport = true;
- }
- }else Banish_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GossipHello_guard_shattrath_aldor(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
- player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox");
- //unknown
- player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master");
- player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
- player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_aldor(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_aldor(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath_aldor end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath_aldor(Creature *_Creature)
-{
- return new guard_shattrath_aldorAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath_scryer
- *******************************************************/
-
-struct TRINITY_DLL_DECL guard_shattrath_scryerAI : public guardAI
-{
- guard_shattrath_scryerAI(Creature *c) : guardAI(c) { Reset(); }
-
- uint32 Exile_Timer;
- uint32 Banish_Timer;
- uint64 playerGUID;
- bool CanTeleport;
-
- void Reset()
- {
- Banish_Timer = 5000;
- Exile_Timer = 8500;
- playerGUID = 0;
- CanTeleport = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( CanTeleport )
- {
- if( Exile_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
- {
- temp->CastSpell(temp,SPELL_EXILE,true);
- temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
- }
- playerGUID = 0;
- Exile_Timer = 8500;
- CanTeleport = false;
- }else Exile_Timer -= diff;
- }
- else if( Banish_Timer < diff )
- {
- Unit* temp = m_creature->getVictim();
- if( temp && temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp,SPELL_BANISHED_SHATTRATH_S);
- Banish_Timer = 9000;
- playerGUID = temp->GetGUID();
- if( playerGUID )
- CanTeleport = true;
- }
- }else Banish_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GossipHello_guard_shattrath_scryer(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10430, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank");
- player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn");
- player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
- player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox");
- player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master");
- player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10438, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant");
- player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_scryer(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_scryer(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath_scryer end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath_scryer(Creature *_Creature)
-{
- return new guard_shattrath_scryerAI (_Creature);
-}
-
-/*******************************************************
- * guard_silvermoon start
- *******************************************************/
-
-bool GossipHello_guard_silvermoon(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_1 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_2 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank");
- player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine");
- player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_1 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_2 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox");
- player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn");
- player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer
- player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda");
- player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Wind master
- player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master");
- player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9331, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9338, _Creature->GetGUID());
- break;
- }
-}
-
-void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House");
- player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House");
- player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID());
- }
-}
-
-void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn");
- player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern");
- player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID());
- }
-}
-
-void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker");
- player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine");
- player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas");
- player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi");
- player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra");
- player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis");
- player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma");
- player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer");
- player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer");
- player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer");
- player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor");
- player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_silvermoon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_AUCTIONHOUSE: SendAuctionhouseMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_silvermoon(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_silvermoon end
- *******************************************************/
-
-CreatureAI* GetAI_guard_silvermoon(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_stormwind start
- *******************************************************/
-
-bool GossipHello_guard_stormwind(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STORMWIND_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House");
- player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank");
- player->SEND_GOSSIP_MENU(764,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram
- player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram");
- player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose");
- player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master
- player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master");
- player->SEND_GOSSIP_MENU(879,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master
- player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center");
- player->SEND_GOSSIP_MENU(882,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox");
- player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield");
- player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer
- player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping");
- player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge
- player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall");
- player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7499,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Class trainers
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(898,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Profession trainers
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(918,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist");
- player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem");
- player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran");
- player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum");
- player->SEND_GOSSIP_MENU(899,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Rogue
- player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House");
- player->SEND_GOSSIP_MENU(900,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Warrior
- player->SEND_POI(-8624.54, 402.61, 6, 6, 0, "Pig and Whistle Tavern");
- player->SEND_GOSSIP_MENU(901,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Druid
- player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park");
- player->SEND_GOSSIP_MENU(902,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light");
- player->SEND_GOSSIP_MENU(903,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Paladin
- player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light");
- player->SEND_GOSSIP_MENU(904,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Hunter
- player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge");
- player->SEND_GOSSIP_MENU(905,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Warlock
- player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb");
- player->SEND_GOSSIP_MENU(906,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Shaman
- player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes");
- //incorrect id
- player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs");
- player->SEND_GOSSIP_MENU(919,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge");
- player->SEND_GOSSIP_MENU(920,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern");
- player->SEND_GOSSIP_MENU(921,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell");
- player->SEND_GOSSIP_MENU(941,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle");
- player->SEND_GOSSIP_MENU(922,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller");
- player->SEND_GOSSIP_MENU(923,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland");
- player->SEND_GOSSIP_MENU(940,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs");
- player->SEND_GOSSIP_MENU(924,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide");
- player->SEND_GOSSIP_MENU(925,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand");
- player->SEND_GOSSIP_MENU(927,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide");
- player->SEND_GOSSIP_MENU(928,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles");
- player->SEND_GOSSIP_MENU(929,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_stormwind(player, _Creature, action); break;
- }
- return true;
-}
-
-bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == ALLIANCE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
-/*******************************************************
- * guard_stormwind end
- *******************************************************/
-
-CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_teldrassil start
- *******************************************************/
-
-bool GossipHello_guard_teldrassil(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FERRY , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4316,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4317,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Rut`theran
- player->SEND_GOSSIP_MENU(4318,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn");
- player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //stable master
- player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne");
- player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal");
- player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar");
- player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight");
- player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong");
- player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade");
- player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper");
- player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin");
- player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye");
- player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie");
- player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
- player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf");
- player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver");
- player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver");
- player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
- player->SEND_GOSSIP_MENU(4337,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_teldrassil(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_teldrassil(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_teldrassil(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_teldrassil(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_teldrassil end
- *******************************************************/
-
-CreatureAI* GetAI_guard_teldrassil(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_tirisfal start
- *******************************************************/
-
-bool GossipHello_guard_tirisfal(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(4097,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4074,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //bat handler
- player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern");
- player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus");
- player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4096,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong");
- player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl");
- player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call");
- player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch");
- player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon");
- player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise");
- player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_GOSSIP_MENU(4083,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom");
- player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela");
- player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen");
- player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza");
- player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart");
- player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart");
- player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise");
- player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_tirisfal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_tirisfal(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_tirisfal(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_tirisfal(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_tirisfal end
- *******************************************************/
-
-CreatureAI* GetAI_guard_tirisfal(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_undercity start
- *******************************************************/
-
-bool GossipHello_guard_undercity(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank");
- player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler
- player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler");
- player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master");
- player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn");
- player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox");
- player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House");
- player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin
- player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin");
- player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master
- player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald");
- player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Stable master
- player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray");
- player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane");
- player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler");
- player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw");
- player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers");
- player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers");
- player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers");
- player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers");
- player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers");
- player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium");
- player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer");
- player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer");
- player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer");
- player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer");
- player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer");
- player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer");
- player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer");
- player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer");
- player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer");
- player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_undercity(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_undercity(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_undercity end
- *******************************************************/
-
-CreatureAI* GetAI_guard_undercity(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * AddSC
- *******************************************************/
-
-void AddSC_guards()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="guard_azuremyst";
- newscript->pGossipHello = &GossipHello_guard_azuremyst;
- newscript->pGossipSelect = &GossipSelect_guard_azuremyst;
- newscript->GetAI = GetAI_guard_azuremyst;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_bluffwatcher";
- newscript->pGossipHello = &GossipHello_guard_bluffwatcher;
- newscript->pGossipSelect = &GossipSelect_guard_bluffwatcher;
- newscript->GetAI = GetAI_guard_bluffwatcher;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_contested";
- newscript->GetAI = GetAI_guard_contested;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_darnassus";
- newscript->pGossipHello = &GossipHello_guard_darnassus;
- newscript->pGossipSelect = &GossipSelect_guard_darnassus;
- newscript->GetAI = GetAI_guard_darnassus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_dunmorogh";
- newscript->pGossipHello = &GossipHello_guard_dunmorogh;
- newscript->pGossipSelect = &GossipSelect_guard_dunmorogh;
- newscript->GetAI = GetAI_guard_dunmorogh;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_durotar";
- newscript->pGossipHello = &GossipHello_guard_durotar;
- newscript->pGossipSelect = &GossipSelect_guard_durotar;
- newscript->GetAI = GetAI_guard_durotar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_elwynnforest";
- newscript->pGossipHello = &GossipHello_guard_elwynnforest;
- newscript->pGossipSelect = &GossipSelect_guard_elwynnforest;
- newscript->GetAI = GetAI_guard_elwynnforest;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_eversong";
- newscript->pGossipHello = &GossipHello_guard_eversong;
- newscript->pGossipSelect = &GossipSelect_guard_eversong;
- newscript->GetAI = GetAI_guard_eversong;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_exodar";
- newscript->pGossipHello = &GossipHello_guard_exodar;
- newscript->pGossipSelect = &GossipSelect_guard_exodar;
- newscript->GetAI = GetAI_guard_exodar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_ironforge";
- newscript->pGossipHello = &GossipHello_guard_ironforge;
- newscript->pGossipSelect = &GossipSelect_guard_ironforge;
- newscript->GetAI = GetAI_guard_ironforge;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_mulgore";
- newscript->pGossipHello = &GossipHello_guard_mulgore;
- newscript->pGossipSelect = &GossipSelect_guard_mulgore;
- newscript->GetAI = GetAI_guard_mulgore;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_orgrimmar";
- newscript->pGossipHello = &GossipHello_guard_orgrimmar;
- newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
- newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
- newscript->GetAI = GetAI_guard_orgrimmar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath";
- newscript->pGossipHello = &GossipHello_guard_shattrath;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath;
- newscript->GetAI = GetAI_guard_shattrath;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath_aldor";
- newscript->GetAI = GetAI_guard_shattrath_aldor;
- newscript->pGossipHello = &GossipHello_guard_shattrath_aldor;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath_aldor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath_scryer";
- newscript->GetAI = GetAI_guard_shattrath_scryer;
- newscript->pGossipHello = &GossipHello_guard_shattrath_scryer;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath_scryer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_silvermoon";
- newscript->pGossipHello = &GossipHello_guard_silvermoon;
- newscript->pGossipSelect = &GossipSelect_guard_silvermoon;
- newscript->GetAI = GetAI_guard_silvermoon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_stormwind";
- newscript->pGossipHello = &GossipHello_guard_stormwind;
- newscript->pGossipSelect = &GossipSelect_guard_stormwind;
- newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
- newscript->GetAI = GetAI_guard_stormwind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_teldrassil";
- newscript->pGossipHello = &GossipHello_guard_teldrassil;
- newscript->pGossipSelect = &GossipSelect_guard_teldrassil;
- newscript->GetAI = GetAI_guard_teldrassil;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_tirisfal";
- newscript->pGossipHello = &GossipHello_guard_tirisfal;
- newscript->pGossipSelect = &GossipSelect_guard_tirisfal;
- newscript->GetAI = GetAI_guard_tirisfal;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_undercity";
- newscript->pGossipHello = &GossipHello_guard_undercity;
- newscript->pGossipSelect = &GossipSelect_guard_undercity;
- newscript->GetAI = GetAI_guard_undercity;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Guards
+SD%Complete: 100
+SDComment: All Guard gossip data, quite some npc_text-id's still missing, adding constantly as new id's are known. CombatAI should be organized better for future.
+SDCategory: Guards
+EndScriptData */
+
+/* ContentData
+guard_azuremyst
+guard_bluffwatcher
+guard_contested
+guard_darnassus
+guard_dunmorogh
+guard_durotar
+guard_elwynnforest
+guard_eversong
+guard_exodar
+guard_ironforge
+guard_mulgore
+guard_orgrimmar
+guard_shattrath
+guard_shattrath_aldor
+guard_shattrath_scryer
+guard_silvermoon
+guard_stormwind
+guard_teldrassil
+guard_tirisfal
+guard_undercity
+EndContentData */
+
+#include "precompiled.h"
+#include "guard_ai.h"
+
+//script spesific action
+#define GOSSIP_ACTION_TAVERN 101
+#define GOSSIP_ACTION_GEMMERCHANT 102
+#define GOSSIP_ACTION_MANALOOM 103
+
+//script spesific sender
+#define GOSSIP_SENDER_SEC_GEMMERCHANT 101
+#define GOSSIP_SENDER_SEC_AUCTIONHOUSE 102
+
+//script spesific gossip text
+#define GOSSIP_TEXT_TAVERN "Worlds End Tavern"
+#define GOSSIP_TEXT_BANKSCYERS "Scyers bank"
+#define GOSSIP_TEXT_BANKALDOR "Aldor Bank"
+#define GOSSIP_TEXT_INNSCYERS "Scyers Inn"
+#define GOSSIP_TEXT_INNALDOR "Aldor Inn"
+#define GOSSIP_TEXT_STABLESCYERS "Scyers Stable"
+#define GOSSIP_TEXT_STABLEALDOR "Aldor Stable"
+#define GOSSIP_TEXT_BATTLEMASTERALLIANCE "Alliance Battlemasters"
+#define GOSSIP_TEXT_BATTLEMASTERHORDE "Horde Battlemasters"
+#define GOSSIP_TEXT_BATTLEMASTERARENA "Arena Battlemasters"
+#define GOSSIP_TEXT_MANALOOM "Mana Loom"
+#define GOSSIP_TEXT_ALCHEMYLAB "Alchemy Lab"
+#define GOSSIP_TEXT_GEMMERCHANT "Gem Merchant"
+#define GOSSIP_TEXT_GEMSCYERS "Scyers Gem Merchant"
+#define GOSSIP_TEXT_GEMALDOR "Aldor Gem Merchant"
+
+#define GOSSIP_TEXT_AH_SILVERMOON_1 "Western Auction House"
+#define GOSSIP_TEXT_AH_SILVERMOON_2 "Royal Exchange Auction House"
+
+#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
+#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
+
+//common used for guards in main cities
+void DoReplyToTextEmote(Creature *_Creature,uint32 em)
+{
+ switch(em)
+ {
+ case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
+ case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
+ case TEXTEMOTE_RUDE:
+ case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
+ }
+}
+
+/*******************************************************
+ * guard_azuremyst start
+ *******************************************************/
+
+bool GossipHello_guard_azuremyst(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10066,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank");
+ player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master
+ player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos");
+ player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam");
+ player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan");
+ player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina");
+ player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10076,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(10087,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius");
+ player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon");
+ player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid");
+ player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas");
+ player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan");
+ player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
+ player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun");
+ player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada");
+ player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal");
+ player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso");
+ player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce");
+ player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg");
+ player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo");
+ player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema");
+ player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna");
+ player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting
+ player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii");
+ player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo");
+ player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi");
+ player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf");
+ player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly");
+ player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_azuremyst(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_azuremyst(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_azuremyst(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_azuremyst(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_azuremyst end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_azuremyst(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_bluffwatcher start
+ *******************************************************/
+
+bool GossipHello_guard_bluffwatcher(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank");
+ player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind master
+ player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost");
+ player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information");
+ player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn");
+ player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox");
+ player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
+ player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
+ player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master
+ player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa");
+ player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable master
+ player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug");
+ player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem");
+ player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey");
+ player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe");
+ player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders");
+ player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
+ player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits");
+ player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warrior
+ player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy");
+ player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy");
+ player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen");
+ player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters");
+ player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing");
+ player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle");
+ player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism");
+ player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
+ player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mining
+ player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology");
+ player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
+ player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta");
+ player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
+ player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_bluffwatcher(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_bluffwatcher end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_contested start
+ *******************************************************/
+
+struct TRINITY_DLL_DECL guard_contested : public guardAI
+{
+ guard_contested(Creature *c) : guardAI(c) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if ( who->isAttackingPlayer() )
+ {
+ if(who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID() && GUID_HIPART(who->GetOwnerGUID())==HIGHGUID_PLAYER)
+ {
+ m_creature->AddThreat(who, 0.0f);
+ if(Unit* owner = who->GetOwner())
+ m_creature->AddThreat(owner, 0.0f);
+
+ if(!m_creature->isInCombat())
+ {
+ if (m_creature->GetEntry() == 15184) //Cenarion Hold Infantry
+ {
+ srand (time(NULL));
+ if (rand()%100 <= 30)
+ {
+ DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
+ }
+ else if (rand()%100 > 30 && rand()%100 < 50)
+ {
+ DoSay("Please tell me that you didn`t just do what I think you just did. Please tell me that I`m not going to have to hurt you...", LANG_UNIVERSAL,NULL);
+ }
+ else if (rand()%100 >= 50)
+ {
+ DoSay("As if we don`t have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
+ }
+ }
+ else
+ {
+ SpellEntry const *spell = m_creature->reachWithSpellAttack(who);
+ DoCastSpell(who, spell);
+ }
+ }
+ DoStartAttackAndMovement(who);
+ }
+ }
+ }
+};
+/*******************************************************
+ * guard_contested end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_contested(Creature *_Creature)
+{
+ return new guard_contested (_Creature);
+}
+
+/*******************************************************
+ * guard_darnassus start
+ *******************************************************/
+
+bool GossipHello_guard_darnassus(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3016, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House");
+ player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank");
+ player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Wind master
+ player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village");
+ player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Guild master
+ player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master");
+ player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Inn
+ player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn");
+ player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
+ player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox");
+ player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
+ player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin");
+ player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
+ player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire");
+ player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7519, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4264, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(4273, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield");
+ player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart");
+ player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas");
+ player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer");
+ player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer");
+ player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon");
+ player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer");
+ player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace");
+ player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
+ player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer");
+ player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
+ player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
+ player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer");
+ player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
+ player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer");
+ player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
+ player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer");
+ player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
+ player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor");
+ player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_darnassus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_darnassus(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_darnassus end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_darnassus(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_dunmorogh start
+ *******************************************************/
+
+bool GossipHello_guard_dunmorogh(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4287,_Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4288,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
+ player->SEND_GOSSIP_MENU(4289,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery");
+ player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint");
+ player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4300,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart");
+ player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle");
+ player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
+ player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer");
+ player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol");
+ player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan");
+ player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog");
+ player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe");
+ player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire");
+ player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor");
+ player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear");
+ player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol");
+ player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter");
+ player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_GOSSIP_MENU(4308,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone");
+ player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_GOSSIP_MENU(4312,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_GOSSIP_MENU(4313,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_dunmorogh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_dunmorogh(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_dunmorogh end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_dunmorogh(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_durotar start
+ *******************************************************/
+
+bool GossipHello_guard_durotar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(4037,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4032,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
+ player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn");
+ player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
+ player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my");
+ player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4035,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4036,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar");
+ player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa");
+ player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin");
+ player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak");
+ player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
+ player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart");
+ player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust");
+ player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar");
+ player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan");
+ player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk");
+ player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_GOSSIP_MENU(4022,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak");
+ player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk");
+ player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki");
+ player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki");
+ player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn");
+ player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_GOSSIP_MENU(4030,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_GOSSIP_MENU(4031,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_durotar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_durotar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_durotar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_durotar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_durotar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_durotar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_elwynnforest start
+ *******************************************************/
+
+bool GossipHello_guard_elwynnforest(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4260,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
+ player->SEND_GOSSIP_MENU(4261,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn");
+ player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma");
+ player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_GOSSIP_MENU(4265,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt");
+ player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm");
+ player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta");
+ player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius");
+ player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe");
+ player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Warrior
+ player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac");
+ player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory");
+ player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus");
+ player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas");
+ player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4277,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle");
+ player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown");
+ player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy");
+ player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder");
+ player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner");
+ player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin");
+ player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_elwynnforest(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_elwynnforest(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_elwynnforest end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_elwynnforest(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_eversong start
+ *******************************************************/
+
+bool GossipHello_guard_eversong(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler
+ player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming");
+ player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Guild master
+ player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn");
+ player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
+ player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos");
+ player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia");
+ player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel");
+ player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene");
+ player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris");
+ player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria");
+ player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus");
+ player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren");
+ player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge");
+ player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra");
+ player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Engineering
+ player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria");
+ player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel");
+ player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia");
+ player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein");
+ player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn");
+ player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine");
+ player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_eversong(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_eversong(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_eversong(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_eversong(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_eversong end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_eversong(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_exodar start
+ *******************************************************/
+
+bool GossipHello_guard_exodar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House");
+ player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank");
+ player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master");
+ player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master
+ player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master");
+ player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Inn
+ player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn");
+ player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
+ player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox");
+ player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
+ player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid");
+ player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
+ player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir");
+ player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(9533, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(9555, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //A
+ player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom");
+ player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //EOS
+ player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //WSG
+ player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer");
+ player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer");
+ player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer");
+ player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer");
+ player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer");
+ player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
+ player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer");
+ player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer");
+ player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer");
+ player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer");
+ player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer");
+ player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer");
+ player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer");
+ player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
+ player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer");
+ player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer");
+ player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer");
+ player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer");
+ player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_exodar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_exodar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_exodar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_exodar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_ironforge start
+ *******************************************************/
+
+bool GossipHello_guard_ironforge(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_IRONFORGE_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2760, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
+ player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House");
+ player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault");
+ player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Tram
+ player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram");
+ player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master
+ player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master");
+ player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master
+ player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center");
+ player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Inn
+ player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern");
+ player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
+ player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox");
+ player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
+ player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand");
+ player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer
+ player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf");
+ player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Class Trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Profession Trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2793, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard");
+ player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood");
+ player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris");
+ player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
+ player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer");
+ player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer");
+ player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Shaman
+ player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer");
+ //incorrect id
+ player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks");
+ player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge");
+ player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle");
+ player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery");
+ player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets");
+ player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician");
+ player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman");
+ player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician");
+ player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Minning
+ player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild");
+ player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier");
+ player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_ironforge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_ironforge(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_ironforge end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_ironforge(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_mulgore start
+ *******************************************************/
+
+bool GossipHello_guard_mulgore(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4051,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
+ player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn");
+ player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
+ player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa");
+ player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(4069,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(4070,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem");
+ player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane");
+ player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Shaman
+ player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser");
+ player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warrior
+ player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof");
+ player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_GOSSIP_MENU(4058,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride");
+ player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof");
+ player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater");
+ player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
+ player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide");
+ player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mining
+ player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
+ player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut");
+ player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
+ player->SEND_GOSSIP_MENU(4068,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_mulgore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_mulgore(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_mulgore(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_mulgore(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_mulgore end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_mulgore(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_orgrimmar start
+ *******************************************************/
+
+bool GossipHello_guard_orgrimmar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar");
+ player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //wind rider
+ player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower");
+ player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //guild master
+ player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy");
+ player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn");
+ player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //mailbox
+ player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox");
+ player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //auction house
+ player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House");
+ player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin
+ player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower");
+ player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //weapon master
+ player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi");
+ player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //stable master
+ player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha");
+ player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge
+ player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends");
+ player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2599,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2594,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall");
+ player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge");
+ player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge");
+ player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Shaman
+ player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress");
+ player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood");
+ player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave");
+ player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Paladin
+ player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom");
+ player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions");
+ player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil");
+ player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit");
+ player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks");
+ player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop");
+ player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest");
+ player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing");
+ player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum");
+ player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining");
+ player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods");
+ player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_orgrimmar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( player->GetTeam() == HORDE )
+ DoReplyToTextEmote(_Creature,emote);
+ return true;
+}
+
+/*******************************************************
+ * guard_orgrimmar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath start
+ *******************************************************/
+
+bool GossipHello_guard_shattrath(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10379, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master");
+ player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(10386, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEALDOR , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLESCYERS , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10387, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMALDOR , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMSCYERS , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10697, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
+ }
+}
+
+void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
+ }
+}
+
+void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ }
+}
+
+void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters");
+ player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters");
+ player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters");
+ player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant");
+ player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID());
+ }
+}
+
+bool GossipSelect_guard_shattrath(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BANK: SendBankMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_STABLEMASTER: SendStableMasterMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_GEMMERCHANT: SendGemMerchantMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_MAILBOX: SendMailboxMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath_aldor
+ *******************************************************/
+
+#define SPELL_BANISHED_SHATTRATH_A 36642
+#define SPELL_BANISHED_SHATTRATH_S 36671
+#define SPELL_BANISH_TELEPORT 36643
+#define SPELL_EXILE 39533
+
+struct TRINITY_DLL_DECL guard_shattrath_aldorAI : public guardAI
+{
+ guard_shattrath_aldorAI(Creature *c) : guardAI(c) { Reset(); }
+
+ uint32 Exile_Timer;
+ uint32 Banish_Timer;
+ uint64 playerGUID;
+ bool CanTeleport;
+
+ void Reset()
+ {
+ Banish_Timer = 5000;
+ Exile_Timer = 8500;
+ playerGUID = 0;
+ CanTeleport = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( CanTeleport )
+ {
+ if( Exile_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
+ {
+ temp->CastSpell(temp,SPELL_EXILE,true);
+ temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
+ }
+ playerGUID = 0;
+ Exile_Timer = 8500;
+ CanTeleport = false;
+ }else Exile_Timer -= diff;
+ }
+ else if( Banish_Timer < diff )
+ {
+ Unit* temp = m_creature->getVictim();
+ if( temp && temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp,SPELL_BANISHED_SHATTRATH_A);
+ Banish_Timer = 9000;
+ playerGUID = temp->GetGUID();
+ if( playerGUID )
+ CanTeleport = true;
+ }
+ }else Banish_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GossipHello_guard_shattrath_aldor(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox");
+ //unknown
+ player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master");
+ player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_aldor(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_aldor(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath_aldor end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath_aldor(Creature *_Creature)
+{
+ return new guard_shattrath_aldorAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath_scryer
+ *******************************************************/
+
+struct TRINITY_DLL_DECL guard_shattrath_scryerAI : public guardAI
+{
+ guard_shattrath_scryerAI(Creature *c) : guardAI(c) { Reset(); }
+
+ uint32 Exile_Timer;
+ uint32 Banish_Timer;
+ uint64 playerGUID;
+ bool CanTeleport;
+
+ void Reset()
+ {
+ Banish_Timer = 5000;
+ Exile_Timer = 8500;
+ playerGUID = 0;
+ CanTeleport = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( CanTeleport )
+ {
+ if( Exile_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
+ {
+ temp->CastSpell(temp,SPELL_EXILE,true);
+ temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
+ }
+ playerGUID = 0;
+ Exile_Timer = 8500;
+ CanTeleport = false;
+ }else Exile_Timer -= diff;
+ }
+ else if( Banish_Timer < diff )
+ {
+ Unit* temp = m_creature->getVictim();
+ if( temp && temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp,SPELL_BANISHED_SHATTRATH_S);
+ Banish_Timer = 9000;
+ playerGUID = temp->GetGUID();
+ if( playerGUID )
+ CanTeleport = true;
+ }
+ }else Banish_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GossipHello_guard_shattrath_scryer(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10430, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank");
+ player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn");
+ player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox");
+ player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master");
+ player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10438, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant");
+ player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_scryer(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_scryer(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath_scryer end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath_scryer(Creature *_Creature)
+{
+ return new guard_shattrath_scryerAI (_Creature);
+}
+
+/*******************************************************
+ * guard_silvermoon start
+ *******************************************************/
+
+bool GossipHello_guard_silvermoon(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_1 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_2 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank");
+ player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine");
+ player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_1 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_2 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox");
+ player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn");
+ player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer
+ player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda");
+ player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Wind master
+ player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master");
+ player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(9331, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(9338, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House");
+ player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House");
+ player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID());
+ }
+}
+
+void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn");
+ player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern");
+ player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID());
+ }
+}
+
+void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //A
+ player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //EOS
+ player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //WSG
+ player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker");
+ player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine");
+ player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas");
+ player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi");
+ player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra");
+ player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis");
+ player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma");
+ player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer");
+ player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
+ player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer");
+ player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor");
+ player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_silvermoon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_AUCTIONHOUSE: SendAuctionhouseMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_silvermoon(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_silvermoon end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_silvermoon(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_stormwind start
+ *******************************************************/
+
+bool GossipHello_guard_stormwind(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STORMWIND_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
+ player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House");
+ player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank");
+ player->SEND_GOSSIP_MENU(764,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram
+ player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram");
+ player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose");
+ player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master
+ player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master");
+ player->SEND_GOSSIP_MENU(879,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master
+ player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center");
+ player->SEND_GOSSIP_MENU(882,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
+ player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox");
+ player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
+ player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield");
+ player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer
+ player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping");
+ player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge
+ player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall");
+ player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7499,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Class trainers
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(898,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Profession trainers
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(918,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist");
+ player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem");
+ player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran");
+ player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum");
+ player->SEND_GOSSIP_MENU(899,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Rogue
+ player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House");
+ player->SEND_GOSSIP_MENU(900,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Warrior
+ player->SEND_POI(-8624.54, 402.61, 6, 6, 0, "Pig and Whistle Tavern");
+ player->SEND_GOSSIP_MENU(901,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Druid
+ player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park");
+ player->SEND_GOSSIP_MENU(902,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light");
+ player->SEND_GOSSIP_MENU(903,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Paladin
+ player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light");
+ player->SEND_GOSSIP_MENU(904,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Hunter
+ player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge");
+ player->SEND_GOSSIP_MENU(905,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Warlock
+ player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb");
+ player->SEND_GOSSIP_MENU(906,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Shaman
+ player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes");
+ //incorrect id
+ player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs");
+ player->SEND_GOSSIP_MENU(919,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge");
+ player->SEND_GOSSIP_MENU(920,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern");
+ player->SEND_GOSSIP_MENU(921,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell");
+ player->SEND_GOSSIP_MENU(941,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle");
+ player->SEND_GOSSIP_MENU(922,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller");
+ player->SEND_GOSSIP_MENU(923,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland");
+ player->SEND_GOSSIP_MENU(940,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs");
+ player->SEND_GOSSIP_MENU(924,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_GOSSIP_MENU(925,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand");
+ player->SEND_GOSSIP_MENU(927,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_GOSSIP_MENU(928,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles");
+ player->SEND_GOSSIP_MENU(929,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_stormwind(player, _Creature, action); break;
+ }
+ return true;
+}
+
+bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( player->GetTeam() == ALLIANCE )
+ DoReplyToTextEmote(_Creature,emote);
+ return true;
+}
+
+/*******************************************************
+ * guard_stormwind end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_teldrassil start
+ *******************************************************/
+
+bool GossipHello_guard_teldrassil(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FERRY , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4316,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4317,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Rut`theran
+ player->SEND_GOSSIP_MENU(4318,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn");
+ player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //stable master
+ player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne");
+ player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal");
+ player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar");
+ player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight");
+ player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong");
+ player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade");
+ player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper");
+ player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
+ player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin");
+ player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
+ player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye");
+ player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
+ player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie");
+ player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
+ player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
+ player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf");
+ player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver");
+ player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver");
+ player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
+ player->SEND_GOSSIP_MENU(4337,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_teldrassil(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_teldrassil(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_teldrassil(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_teldrassil(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_teldrassil end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_teldrassil(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_tirisfal start
+ *******************************************************/
+
+bool GossipHello_guard_tirisfal(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(4097,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4074,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //bat handler
+ player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern");
+ player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
+ player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus");
+ player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4096,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong");
+ player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Priest
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl");
+ player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call");
+ player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch");
+ player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon");
+ player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise");
+ player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_GOSSIP_MENU(4083,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom");
+ player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela");
+ player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen");
+ player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza");
+ player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart");
+ player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart");
+ player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise");
+ player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_tirisfal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_tirisfal(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_tirisfal(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_tirisfal(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_tirisfal end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_tirisfal(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_undercity start
+ *******************************************************/
+
+bool GossipHello_guard_undercity(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank");
+ player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler
+ player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler");
+ player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master");
+ player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn");
+ player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox");
+ player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
+ player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House");
+ player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin
+ player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin");
+ player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master
+ player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald");
+ player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Stable master
+ player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray");
+ player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane");
+ player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler");
+ player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw");
+ player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers");
+ player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Priest
+ player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers");
+ player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
+ player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers");
+ player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
+ player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers");
+ player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers");
+ player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium");
+ player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer");
+ player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer");
+ player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer");
+ player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer");
+ player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer");
+ player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer");
+ player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer");
+ player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_undercity(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_undercity(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_undercity end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_undercity(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * AddSC
+ *******************************************************/
+
+void AddSC_guards()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_azuremyst";
+ newscript->pGossipHello = &GossipHello_guard_azuremyst;
+ newscript->pGossipSelect = &GossipSelect_guard_azuremyst;
+ newscript->GetAI = GetAI_guard_azuremyst;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_bluffwatcher";
+ newscript->pGossipHello = &GossipHello_guard_bluffwatcher;
+ newscript->pGossipSelect = &GossipSelect_guard_bluffwatcher;
+ newscript->GetAI = GetAI_guard_bluffwatcher;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_contested";
+ newscript->GetAI = GetAI_guard_contested;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_darnassus";
+ newscript->pGossipHello = &GossipHello_guard_darnassus;
+ newscript->pGossipSelect = &GossipSelect_guard_darnassus;
+ newscript->GetAI = GetAI_guard_darnassus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_dunmorogh";
+ newscript->pGossipHello = &GossipHello_guard_dunmorogh;
+ newscript->pGossipSelect = &GossipSelect_guard_dunmorogh;
+ newscript->GetAI = GetAI_guard_dunmorogh;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_durotar";
+ newscript->pGossipHello = &GossipHello_guard_durotar;
+ newscript->pGossipSelect = &GossipSelect_guard_durotar;
+ newscript->GetAI = GetAI_guard_durotar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_elwynnforest";
+ newscript->pGossipHello = &GossipHello_guard_elwynnforest;
+ newscript->pGossipSelect = &GossipSelect_guard_elwynnforest;
+ newscript->GetAI = GetAI_guard_elwynnforest;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_eversong";
+ newscript->pGossipHello = &GossipHello_guard_eversong;
+ newscript->pGossipSelect = &GossipSelect_guard_eversong;
+ newscript->GetAI = GetAI_guard_eversong;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_exodar";
+ newscript->pGossipHello = &GossipHello_guard_exodar;
+ newscript->pGossipSelect = &GossipSelect_guard_exodar;
+ newscript->GetAI = GetAI_guard_exodar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_ironforge";
+ newscript->pGossipHello = &GossipHello_guard_ironforge;
+ newscript->pGossipSelect = &GossipSelect_guard_ironforge;
+ newscript->GetAI = GetAI_guard_ironforge;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_mulgore";
+ newscript->pGossipHello = &GossipHello_guard_mulgore;
+ newscript->pGossipSelect = &GossipSelect_guard_mulgore;
+ newscript->GetAI = GetAI_guard_mulgore;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_orgrimmar";
+ newscript->pGossipHello = &GossipHello_guard_orgrimmar;
+ newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
+ newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
+ newscript->GetAI = GetAI_guard_orgrimmar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath";
+ newscript->pGossipHello = &GossipHello_guard_shattrath;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath;
+ newscript->GetAI = GetAI_guard_shattrath;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath_aldor";
+ newscript->GetAI = GetAI_guard_shattrath_aldor;
+ newscript->pGossipHello = &GossipHello_guard_shattrath_aldor;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath_aldor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath_scryer";
+ newscript->GetAI = GetAI_guard_shattrath_scryer;
+ newscript->pGossipHello = &GossipHello_guard_shattrath_scryer;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath_scryer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_silvermoon";
+ newscript->pGossipHello = &GossipHello_guard_silvermoon;
+ newscript->pGossipSelect = &GossipSelect_guard_silvermoon;
+ newscript->GetAI = GetAI_guard_silvermoon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_stormwind";
+ newscript->pGossipHello = &GossipHello_guard_stormwind;
+ newscript->pGossipSelect = &GossipSelect_guard_stormwind;
+ newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
+ newscript->GetAI = GetAI_guard_stormwind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_teldrassil";
+ newscript->pGossipHello = &GossipHello_guard_teldrassil;
+ newscript->pGossipSelect = &GossipSelect_guard_teldrassil;
+ newscript->GetAI = GetAI_guard_teldrassil;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_tirisfal";
+ newscript->pGossipHello = &GossipHello_guard_tirisfal;
+ newscript->pGossipSelect = &GossipSelect_guard_tirisfal;
+ newscript->GetAI = GetAI_guard_tirisfal;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_undercity";
+ newscript->pGossipHello = &GossipHello_guard_undercity;
+ newscript->pGossipSelect = &GossipSelect_guard_undercity;
+ newscript->GetAI = GetAI_guard_undercity;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp
index 435f313b0c1..730f1aee52d 100644
--- a/src/bindings/scripts/scripts/item/item_scripts.cpp
+++ b/src/bindings/scripts/scripts/item/item_scripts.cpp
@@ -1,529 +1,529 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Item_Scripts
-SD%Complete: 100
-SDComment: Items for a range of different items. See content below (in script)
-SDCategory: Items
-EndScriptData */
-
-/* ContentData
-item_area_52_special(i28132) Prevents abuse of this item
-item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525)
-item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse
-item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
-item_disciplinary_rod Prevents abuse
-item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
-item_flying_machine(i34060,i34061) Engineering crafted flying machines
-item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
-item_muiseks_vessel Cast on creature, they must be dead(q 3123,3124,3125,3126,3127)
-item_protovoltaic_magneto_collector Prevents abuse
-item_razorthorn_flayer_gland Quest Discovering Your Roots (q11520) and Rediscovering Your Roots (q11521). Prevents abuse
-item_tame_beast_rods(many) Prevent cast on any other creature than the intended (for all tame beast quests)
-item_soul_cannon(i32825) Prevents abuse of this item
-item_sparrowhawk_net(i32321) Quest To Catch A Sparrowhawk (q10987). Prevents abuse
-item_voodoo_charm Provide proper error message and target(q2561)
-item_vorenthals_presence(i30259) Prevents abuse of this item
-item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520)
-item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse
-EndContentData */
-
-#include "precompiled.h"
-#include "SpellMgr.h"
-#include "Spell.h"
-#include "WorldPacket.h"
-
-/*#####
-# item_area_52_special
-#####*/
-
-bool ItemUse_item_area_52_special(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if ( player->GetAreaId() == 3803 )
- {
- return false;
- }
- else
- {
- player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL);
- return true;
- }
-}
-
-/*#####
-# item_attuned_crystal_cores
-#####*/
-
-bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_blackwhelp_net
-#####*/
-
-bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 21387 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_draenei_fishing_net
-#####*/
-
-//This is just a hack and should be removed from here.
-//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
-bool ItemUse_item_draenei_fishing_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- //if( targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
- //targets.getGOTarget()->GetGOInfo()->type == GAMEOBJECT_TYPE_SPELL_FOCUS && targets.getGOTarget()->GetEntry() == 181616 )
- //{
- if( player->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE )
- {
- if( rand()%100 < 35 )
- {
- Creature *Murloc = player->SummonCreature(17102,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- if( Murloc )
- Murloc->AI()->AttackStart(player);
- }
- else
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 23614, 1);
- if( msg == EQUIP_ERR_OK )
- {
- Item* item = player->StoreNewItem(dest,23614,true);
- if( item )
- player->SendNewItem(item,1,false,true);
- }else
- player->SendEquipError(msg,NULL,NULL);
- }
- }
- //}
- return false;
-}
-
-/*#####
-# item_disciplinary_rod
-#####*/
-
-bool ItemUse_item_disciplinary_rod(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- (targets.getUnitTarget()->GetEntry() == 15941 || targets.getUnitTarget()->GetEntry() == 15945) )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_nether_wraith_beacon
-#####*/
-
-bool ItemUse_item_nether_wraith_beacon(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
- {
- Creature *Nether;
- Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
- Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()-20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
- if (Nether)
- ((CreatureAI*)Nether->AI())->AttackStart(player);
- }
- return false;
-}
-
-/*#####
-# item_flying_machine
-#####*/
-
-bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- uint32 itemId = _Item->GetEntry();
- if( itemId == 34060 )
- if( player->GetBaseSkillValue(SKILL_RIDING) >= 225 )
- return false;
-
- if( itemId == 34061 )
- if( player->GetBaseSkillValue(SKILL_RIDING) == 300 )
- return false;
-
- debug_log("SD2: Player attempt to use item %u, but did not meet riding requirement",itemId);
- player->SendEquipError(EQUIP_ERR_ERR_CANT_EQUIP_SKILL,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_gor_dreks_ointment
-#####*/
-
-bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_muiseks_vessel
-#####*/
-
-bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- Unit* uTarget = targets.getUnitTarget();
- uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
- uint32 cEntry = 0;
- uint32 cEntry2 = 0;
- uint32 cEntry3 = 0;
- uint32 cEntry4 = 0;
-
- if(itemSpell)
- {
- switch(itemSpell)
- {
- case 11885: //Wandering Forest Walker
- cEntry = 7584;
- break;
- case 11886: //Owlbeasts
- cEntry = 2927;
- cEntry2 = 2928;
- cEntry3 = 2929;
- cEntry4 = 7808;
- break;
- case 11887: //Freyfeather Hippogryphs
- cEntry = 5300;
- cEntry2 = 5304;
- cEntry3 = 5305;
- cEntry4 = 5306;
- break;
- case 11888: //Sprite Dragon Sprite Darters
- cEntry = 5276;
- cEntry2 = 5278;
- break;
- case 11889: //Zapped Land Walker Land Walker Zapped Cliff Giant Cliff Giant
- cEntry = 5357;
- cEntry2 = 5358;
- cEntry3 = 14640;
- cEntry4 = 14604;
- break;
- }
- if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() &&
- (uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) )
- {
- ((Creature*)uTarget)->RemoveCorpse();
- return false;
- }
- }
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_razorthorn_flayer_gland
-#####*/
-
-bool ItemUse_item_razorthorn_flayer_gland(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 24922 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_tame_beast_rods
-#####*/
-
-bool ItemUse_item_tame_beast_rods(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
- uint32 cEntry = 0;
-
- if(itemSpell)
- {
- switch(itemSpell)
- {
- case 19548: cEntry = 1196; break; //Ice Claw Bear
- case 19674: cEntry = 1126; break; //Large Crag Boar
- case 19687: cEntry = 1201; break; //Snow Leopard
- case 19688: cEntry = 2956; break; //Adult Plainstrider
- case 19689: cEntry = 2959; break; //Prairie Stalker
- case 19692: cEntry = 2970; break; //Swoop
- case 19693: cEntry = 1998; break; //Webwood Lurker
- case 19694: cEntry = 3099; break; //Dire Mottled Boar
- case 19696: cEntry = 3107; break; //Surf Crawler
- case 19697: cEntry = 3126; break; //Armored Scorpid
- case 19699: cEntry = 2043; break; //Nightsaber Stalker
- case 19700: cEntry = 1996; break; //Strigid Screecher
- case 30646: cEntry = 17217; break; //Barbed Crawler
- case 30653: cEntry = 17374; break; //Greater Timberstrider
- case 30654: cEntry = 17203; break; //Nightstalker
- case 30099: cEntry = 15650; break; //Crazed Dragonhawk
- case 30102: cEntry = 15652; break; //Elder Springpaw
- case 30105: cEntry = 16353; break; //Mistbat
- }
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == cEntry )
- return false;
- }
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_protovoltaic_magneto_collector
-#####*/
-
-bool ItemUse_item_protovoltaic_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 21729 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_soul_cannon
-#####*/
-
-bool ItemUse_item_soul_cannon(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- // allow use
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 22357 )
- return false;
-
- // error
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_sparrowhawk_net
-#####*/
-
-bool ItemUse_item_sparrowhawk_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 22979 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_voodoo_charm
-#####*/
-
-bool ItemUse_item_voodoo_charm(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && targets.getUnitTarget()->isDead() &&
- targets.getUnitTarget()->GetEntry()==7318 )
- return false;
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_vorenthals_presence
-#####*/
-
-bool ItemUse_item_vorenthals_presence(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- // allow use
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 20132 )
- return false;
-
- // error
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_yehkinyas_bramble
-#####*/
-
-bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if (player->GetQuestStatus(3520) == QUEST_STATUS_INCOMPLETE)
- {
- Unit * unit_target = targets.getUnitTarget();
- if( unit_target &&
- unit_target->GetTypeId()==TYPEID_UNIT &&
- unit_target->isDead() &&
- // cast only on corpse 5307 or 5308
- (unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) )
- {
- ((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
- return false; // all ok
- }
- }
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(10699); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Bad target
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_zezzak_shard
-#####*/
-
-bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 19440 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-void AddSC_item_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="item_area_52_special";
- newscript->pItemUse = ItemUse_item_area_52_special;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_attuned_crystal_cores";
- newscript->pItemUse = ItemUse_item_attuned_crystal_cores;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_blackwhelp_net";
- newscript->pItemUse = ItemUse_item_blackwhelp_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_disciplinary_rod";
- newscript->pItemUse = ItemUse_item_disciplinary_rod;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_draenei_fishing_net";
- newscript->pItemUse = ItemUse_item_draenei_fishing_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_nether_wraith_beacon";
- newscript->pItemUse = ItemUse_item_nether_wraith_beacon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_flying_machine";
- newscript->pItemUse = ItemUse_item_flying_machine;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_gor_dreks_ointment";
- newscript->pItemUse = ItemUse_item_gor_dreks_ointment;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_muiseks_vessel";
- newscript->pItemUse = ItemUse_item_muiseks_vessel;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_razorthorn_flayer_gland";
- newscript->pItemUse = ItemUse_item_razorthorn_flayer_gland;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_tame_beast_rods";
- newscript->pItemUse = ItemUse_item_tame_beast_rods;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_protovoltaic_magneto_collector";
- newscript->pItemUse = ItemUse_item_protovoltaic_magneto_collector;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_soul_cannon";
- newscript->pItemUse = ItemUse_item_soul_cannon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_sparrowhawk_net";
- newscript->pItemUse = ItemUse_item_sparrowhawk_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_voodoo_charm";
- newscript->pItemUse = ItemUse_item_voodoo_charm;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_vorenthals_presence";
- newscript->pItemUse = ItemUse_item_vorenthals_presence;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_yehkinyas_bramble";
- newscript->pItemUse = ItemUse_item_yehkinyas_bramble;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_zezzaks_shard";
- newscript->pItemUse = ItemUse_item_zezzak_shard;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Item_Scripts
+SD%Complete: 100
+SDComment: Items for a range of different items. See content below (in script)
+SDCategory: Items
+EndScriptData */
+
+/* ContentData
+item_area_52_special(i28132) Prevents abuse of this item
+item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525)
+item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse
+item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
+item_disciplinary_rod Prevents abuse
+item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
+item_flying_machine(i34060,i34061) Engineering crafted flying machines
+item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
+item_muiseks_vessel Cast on creature, they must be dead(q 3123,3124,3125,3126,3127)
+item_protovoltaic_magneto_collector Prevents abuse
+item_razorthorn_flayer_gland Quest Discovering Your Roots (q11520) and Rediscovering Your Roots (q11521). Prevents abuse
+item_tame_beast_rods(many) Prevent cast on any other creature than the intended (for all tame beast quests)
+item_soul_cannon(i32825) Prevents abuse of this item
+item_sparrowhawk_net(i32321) Quest To Catch A Sparrowhawk (q10987). Prevents abuse
+item_voodoo_charm Provide proper error message and target(q2561)
+item_vorenthals_presence(i30259) Prevents abuse of this item
+item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520)
+item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse
+EndContentData */
+
+#include "precompiled.h"
+#include "SpellMgr.h"
+#include "Spell.h"
+#include "WorldPacket.h"
+
+/*#####
+# item_area_52_special
+#####*/
+
+bool ItemUse_item_area_52_special(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if ( player->GetAreaId() == 3803 )
+ {
+ return false;
+ }
+ else
+ {
+ player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL);
+ return true;
+ }
+}
+
+/*#####
+# item_attuned_crystal_cores
+#####*/
+
+bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_blackwhelp_net
+#####*/
+
+bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 21387 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_draenei_fishing_net
+#####*/
+
+//This is just a hack and should be removed from here.
+//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
+bool ItemUse_item_draenei_fishing_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ //if( targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
+ //targets.getGOTarget()->GetGOInfo()->type == GAMEOBJECT_TYPE_SPELL_FOCUS && targets.getGOTarget()->GetEntry() == 181616 )
+ //{
+ if( player->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE )
+ {
+ if( rand()%100 < 35 )
+ {
+ Creature *Murloc = player->SummonCreature(17102,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if( Murloc )
+ Murloc->AI()->AttackStart(player);
+ }
+ else
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 23614, 1);
+ if( msg == EQUIP_ERR_OK )
+ {
+ Item* item = player->StoreNewItem(dest,23614,true);
+ if( item )
+ player->SendNewItem(item,1,false,true);
+ }else
+ player->SendEquipError(msg,NULL,NULL);
+ }
+ }
+ //}
+ return false;
+}
+
+/*#####
+# item_disciplinary_rod
+#####*/
+
+bool ItemUse_item_disciplinary_rod(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ (targets.getUnitTarget()->GetEntry() == 15941 || targets.getUnitTarget()->GetEntry() == 15945) )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_nether_wraith_beacon
+#####*/
+
+bool ItemUse_item_nether_wraith_beacon(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
+ {
+ Creature *Nether;
+ Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
+ Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()-20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
+ if (Nether)
+ ((CreatureAI*)Nether->AI())->AttackStart(player);
+ }
+ return false;
+}
+
+/*#####
+# item_flying_machine
+#####*/
+
+bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ uint32 itemId = _Item->GetEntry();
+ if( itemId == 34060 )
+ if( player->GetBaseSkillValue(SKILL_RIDING) >= 225 )
+ return false;
+
+ if( itemId == 34061 )
+ if( player->GetBaseSkillValue(SKILL_RIDING) == 300 )
+ return false;
+
+ debug_log("SD2: Player attempt to use item %u, but did not meet riding requirement",itemId);
+ player->SendEquipError(EQUIP_ERR_ERR_CANT_EQUIP_SKILL,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_gor_dreks_ointment
+#####*/
+
+bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_muiseks_vessel
+#####*/
+
+bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ Unit* uTarget = targets.getUnitTarget();
+ uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
+ uint32 cEntry = 0;
+ uint32 cEntry2 = 0;
+ uint32 cEntry3 = 0;
+ uint32 cEntry4 = 0;
+
+ if(itemSpell)
+ {
+ switch(itemSpell)
+ {
+ case 11885: //Wandering Forest Walker
+ cEntry = 7584;
+ break;
+ case 11886: //Owlbeasts
+ cEntry = 2927;
+ cEntry2 = 2928;
+ cEntry3 = 2929;
+ cEntry4 = 7808;
+ break;
+ case 11887: //Freyfeather Hippogryphs
+ cEntry = 5300;
+ cEntry2 = 5304;
+ cEntry3 = 5305;
+ cEntry4 = 5306;
+ break;
+ case 11888: //Sprite Dragon Sprite Darters
+ cEntry = 5276;
+ cEntry2 = 5278;
+ break;
+ case 11889: //Zapped Land Walker Land Walker Zapped Cliff Giant Cliff Giant
+ cEntry = 5357;
+ cEntry2 = 5358;
+ cEntry3 = 14640;
+ cEntry4 = 14604;
+ break;
+ }
+ if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() &&
+ (uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) )
+ {
+ ((Creature*)uTarget)->RemoveCorpse();
+ return false;
+ }
+ }
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_razorthorn_flayer_gland
+#####*/
+
+bool ItemUse_item_razorthorn_flayer_gland(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 24922 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_tame_beast_rods
+#####*/
+
+bool ItemUse_item_tame_beast_rods(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
+ uint32 cEntry = 0;
+
+ if(itemSpell)
+ {
+ switch(itemSpell)
+ {
+ case 19548: cEntry = 1196; break; //Ice Claw Bear
+ case 19674: cEntry = 1126; break; //Large Crag Boar
+ case 19687: cEntry = 1201; break; //Snow Leopard
+ case 19688: cEntry = 2956; break; //Adult Plainstrider
+ case 19689: cEntry = 2959; break; //Prairie Stalker
+ case 19692: cEntry = 2970; break; //Swoop
+ case 19693: cEntry = 1998; break; //Webwood Lurker
+ case 19694: cEntry = 3099; break; //Dire Mottled Boar
+ case 19696: cEntry = 3107; break; //Surf Crawler
+ case 19697: cEntry = 3126; break; //Armored Scorpid
+ case 19699: cEntry = 2043; break; //Nightsaber Stalker
+ case 19700: cEntry = 1996; break; //Strigid Screecher
+ case 30646: cEntry = 17217; break; //Barbed Crawler
+ case 30653: cEntry = 17374; break; //Greater Timberstrider
+ case 30654: cEntry = 17203; break; //Nightstalker
+ case 30099: cEntry = 15650; break; //Crazed Dragonhawk
+ case 30102: cEntry = 15652; break; //Elder Springpaw
+ case 30105: cEntry = 16353; break; //Mistbat
+ }
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == cEntry )
+ return false;
+ }
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_protovoltaic_magneto_collector
+#####*/
+
+bool ItemUse_item_protovoltaic_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 21729 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_soul_cannon
+#####*/
+
+bool ItemUse_item_soul_cannon(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ // allow use
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 22357 )
+ return false;
+
+ // error
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_sparrowhawk_net
+#####*/
+
+bool ItemUse_item_sparrowhawk_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 22979 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_voodoo_charm
+#####*/
+
+bool ItemUse_item_voodoo_charm(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && targets.getUnitTarget()->isDead() &&
+ targets.getUnitTarget()->GetEntry()==7318 )
+ return false;
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_vorenthals_presence
+#####*/
+
+bool ItemUse_item_vorenthals_presence(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ // allow use
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 20132 )
+ return false;
+
+ // error
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_yehkinyas_bramble
+#####*/
+
+bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if (player->GetQuestStatus(3520) == QUEST_STATUS_INCOMPLETE)
+ {
+ Unit * unit_target = targets.getUnitTarget();
+ if( unit_target &&
+ unit_target->GetTypeId()==TYPEID_UNIT &&
+ unit_target->isDead() &&
+ // cast only on corpse 5307 or 5308
+ (unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) )
+ {
+ ((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
+ return false; // all ok
+ }
+ }
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(10699); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Bad target
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_zezzak_shard
+#####*/
+
+bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 19440 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+void AddSC_item_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="item_area_52_special";
+ newscript->pItemUse = ItemUse_item_area_52_special;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_attuned_crystal_cores";
+ newscript->pItemUse = ItemUse_item_attuned_crystal_cores;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_blackwhelp_net";
+ newscript->pItemUse = ItemUse_item_blackwhelp_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_disciplinary_rod";
+ newscript->pItemUse = ItemUse_item_disciplinary_rod;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_draenei_fishing_net";
+ newscript->pItemUse = ItemUse_item_draenei_fishing_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_nether_wraith_beacon";
+ newscript->pItemUse = ItemUse_item_nether_wraith_beacon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_flying_machine";
+ newscript->pItemUse = ItemUse_item_flying_machine;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_gor_dreks_ointment";
+ newscript->pItemUse = ItemUse_item_gor_dreks_ointment;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_muiseks_vessel";
+ newscript->pItemUse = ItemUse_item_muiseks_vessel;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_razorthorn_flayer_gland";
+ newscript->pItemUse = ItemUse_item_razorthorn_flayer_gland;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_tame_beast_rods";
+ newscript->pItemUse = ItemUse_item_tame_beast_rods;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_protovoltaic_magneto_collector";
+ newscript->pItemUse = ItemUse_item_protovoltaic_magneto_collector;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_soul_cannon";
+ newscript->pItemUse = ItemUse_item_soul_cannon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_sparrowhawk_net";
+ newscript->pItemUse = ItemUse_item_sparrowhawk_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_voodoo_charm";
+ newscript->pItemUse = ItemUse_item_voodoo_charm;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_vorenthals_presence";
+ newscript->pItemUse = ItemUse_item_vorenthals_presence;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_yehkinyas_bramble";
+ newscript->pItemUse = ItemUse_item_yehkinyas_bramble;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_zezzaks_shard";
+ newscript->pItemUse = ItemUse_item_zezzak_shard;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/item/item_test.cpp b/src/bindings/scripts/scripts/item/item_test.cpp
index 2841f3bed64..a1e3b6c13c1 100644
--- a/src/bindings/scripts/scripts/item/item_test.cpp
+++ b/src/bindings/scripts/scripts/item/item_test.cpp
@@ -1,42 +1,42 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Item_Test
-SD%Complete: 100
-SDComment: Used for Testing Item Scripts
-SDCategory: Items
-EndScriptData */
-
-#include "precompiled.h"
-
-extern void LoadDatabase();
-
-bool ItemUse_item_test(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- LoadDatabase();
- return true;
-}
-
-void AddSC_item_test()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="item_test";
- newscript->pItemUse = ItemUse_item_test;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Item_Test
+SD%Complete: 100
+SDComment: Used for Testing Item Scripts
+SDCategory: Items
+EndScriptData */
+
+#include "precompiled.h"
+
+extern void LoadDatabase();
+
+bool ItemUse_item_test(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ LoadDatabase();
+ return true;
+}
+
+void AddSC_item_test()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="item_test";
+ newscript->pItemUse = ItemUse_item_test;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
index 9be59296dbb..44ffae1784d 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
@@ -1,304 +1,304 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-/* ScriptData
-SDName: Npc_EscortAI
-SD%Complete: 100
-SDComment:
-SDCategory: Npc
-EndScriptData */
-
-#include "precompiled.h"
-#include "npc_escortAI.h"
-
-#define WP_LAST_POINT -1
-#define MAX_PLAYER_DISTANCE 50
-
-bool npc_escortAI::IsVisible(Unit* who) const
-{
- if (!who)
- return false;
-
- return (m_creature->GetDistance(who) < VISIBLE_RANGE) && who->isVisibleForOrDetect(m_creature,true);
-}
-
-void npc_escortAI::AttackStart(Unit *who)
-{
- if (!who)
- return;
-
- if (IsBeingEscorted && !Defend)
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- if ( m_creature->Attack(who, true) )
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveChase(who);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- InCombat = true;
-
- //Store last position
- m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
-
- debug_log("SD2: EscortAI has entered combat via Attack and stored last location");
-
- Aggro(who);
- }
- }
-}
-
-void npc_escortAI::MoveInLineOfSight(Unit *who)
-{
- if (IsBeingEscorted && !Attack)
- return;
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin attack
- if ( m_creature->Attack(who, true) )
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveChase(who);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- InCombat = true;
-
- //Store last position
- m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
- debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
-
- Aggro(who);
- }
- }
- }
-}
-
-void npc_escortAI::JustRespawned()
-{
- InCombat = false;
- IsBeingEscorted = false;
- IsOnHold = false;
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- Reset();
-}
-
-void npc_escortAI::EnterEvadeMode()
-{
- InCombat = false;
-
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->SetLootRecipient(NULL);
-
- if (IsBeingEscorted)
- {
- debug_log("SD2: EscortAI has left combat and is now returning to last point");
- Returning = true;
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
-
- }else
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveTargetedHome();
- }
-
- Reset();
-}
-
-void npc_escortAI::UpdateAI(const uint32 diff)
-{
- //Waypoint Updating
- if (IsBeingEscorted && !InCombat && WaitTimer && !Returning)
- if (WaitTimer <= diff)
- {
- if (ReconnectWP)
- {
- //Correct movement speed
- if (Run)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
-
- //Continue with waypoints
- if( !IsOnHold )
- {
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Reconnect WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- WaitTimer = 0;
- ReconnectWP = false;
- return;
- }
- }
-
- //End of the line, Despawn self then immediatly respawn
- if (CurrentWP == WaypointList.end())
- {
- debug_log("SD2: EscortAI reached end of waypoints");
-
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- m_creature->Respawn();
- m_creature->GetMotionMaster()->Clear(true);
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- IsBeingEscorted = false;
- WaitTimer = 0;
- return;
- }
-
- if( !IsOnHold )
- {
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- WaitTimer = 0;
- }
- }else WaitTimer -= diff;
-
- //Check if player is within range
- if (IsBeingEscorted && !InCombat && PlayerGUID)
- if (PlayerTimer < diff)
- {
- Unit* p = Unit::GetUnit(*m_creature, PlayerGUID);
-
- if (!p || m_creature->GetDistance(p) > MAX_PLAYER_DISTANCE)
- {
- JustDied(m_creature);
- IsBeingEscorted = false;
-
- debug_log("SD2: EscortAI Evaded back to spawn point because player was to far away or not found");
-
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- m_creature->Respawn();
- m_creature->GetMotionMaster()->Clear(true);
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- PlayerTimer = 1000;
- }else PlayerTimer -= diff;
-
- //Check if we have a current target
- if( m_creature->isAlive() && m_creature->SelectHostilTarget() && m_creature->getVictim())
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- if( m_creature->isAttackReady() )
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
- }
-}
-
-void npc_escortAI::MovementInform(uint32 type, uint32 id)
-{
- if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
- return;
-
- //Original position reached, continue waypoint movement
- if (id == WP_LAST_POINT)
- {
- debug_log("SD2: EscortAI has returned to original position before combat");
- ReconnectWP = true;
- Returning = false;
- WaitTimer = 1;
-
- }else
- {
- //Make sure that we are still on the right waypoint
- if (CurrentWP->id != id)
- {
- debug_log("SD2 ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id);
- return;
- }
-
- debug_log("SD2: EscortAI Waypoint %d reached", CurrentWP->id);
-
- //Call WP function
- WaypointReached(CurrentWP->id);
-
- WaitTimer = CurrentWP->WaitTimeMs + 1;
-
- ++CurrentWP;
- }
-}
-
-void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs)
-{
- Escort_Waypoint t(id, x, y, z, WaitTimeMs);
-
- WaypointList.push_back(t);
-}
-
-void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
-{
- if (InCombat)
- {
- debug_log("SD2 ERROR: EscortAI attempt to Start while in combat");
- return;
- }
-
- if (WaypointList.empty())
- {
- debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints");
- return;
- }
-
- Attack = bAttack;
- Defend = bDefend;
- Run = bRun;
- PlayerGUID = pGUID;
-
- debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID);
-
- CurrentWP = WaypointList.begin();
-
- //Set initial speed
- if (Run)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
-
- //Start WP
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- IsBeingEscorted = true;
- ReconnectWP = false;
- Returning = false;
- IsOnHold = false;
-
- //Disable gossip
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+/* ScriptData
+SDName: Npc_EscortAI
+SD%Complete: 100
+SDComment:
+SDCategory: Npc
+EndScriptData */
+
+#include "precompiled.h"
+#include "npc_escortAI.h"
+
+#define WP_LAST_POINT -1
+#define MAX_PLAYER_DISTANCE 50
+
+bool npc_escortAI::IsVisible(Unit* who) const
+{
+ if (!who)
+ return false;
+
+ return (m_creature->GetDistance(who) < VISIBLE_RANGE) && who->isVisibleForOrDetect(m_creature,true);
+}
+
+void npc_escortAI::AttackStart(Unit *who)
+{
+ if (!who)
+ return;
+
+ if (IsBeingEscorted && !Defend)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ if ( m_creature->Attack(who, true) )
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveChase(who);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ InCombat = true;
+
+ //Store last position
+ m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
+
+ debug_log("SD2: EscortAI has entered combat via Attack and stored last location");
+
+ Aggro(who);
+ }
+ }
+}
+
+void npc_escortAI::MoveInLineOfSight(Unit *who)
+{
+ if (IsBeingEscorted && !Attack)
+ return;
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin attack
+ if ( m_creature->Attack(who, true) )
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveChase(who);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ InCombat = true;
+
+ //Store last position
+ m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
+ debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
+
+ Aggro(who);
+ }
+ }
+ }
+}
+
+void npc_escortAI::JustRespawned()
+{
+ InCombat = false;
+ IsBeingEscorted = false;
+ IsOnHold = false;
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ Reset();
+}
+
+void npc_escortAI::EnterEvadeMode()
+{
+ InCombat = false;
+
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->SetLootRecipient(NULL);
+
+ if (IsBeingEscorted)
+ {
+ debug_log("SD2: EscortAI has left combat and is now returning to last point");
+ Returning = true;
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
+
+ }else
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+ }
+
+ Reset();
+}
+
+void npc_escortAI::UpdateAI(const uint32 diff)
+{
+ //Waypoint Updating
+ if (IsBeingEscorted && !InCombat && WaitTimer && !Returning)
+ if (WaitTimer <= diff)
+ {
+ if (ReconnectWP)
+ {
+ //Correct movement speed
+ if (Run)
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
+ //Continue with waypoints
+ if( !IsOnHold )
+ {
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Reconnect WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ WaitTimer = 0;
+ ReconnectWP = false;
+ return;
+ }
+ }
+
+ //End of the line, Despawn self then immediatly respawn
+ if (CurrentWP == WaypointList.end())
+ {
+ debug_log("SD2: EscortAI reached end of waypoints");
+
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->Respawn();
+ m_creature->GetMotionMaster()->Clear(true);
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ IsBeingEscorted = false;
+ WaitTimer = 0;
+ return;
+ }
+
+ if( !IsOnHold )
+ {
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ WaitTimer = 0;
+ }
+ }else WaitTimer -= diff;
+
+ //Check if player is within range
+ if (IsBeingEscorted && !InCombat && PlayerGUID)
+ if (PlayerTimer < diff)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, PlayerGUID);
+
+ if (!p || m_creature->GetDistance(p) > MAX_PLAYER_DISTANCE)
+ {
+ JustDied(m_creature);
+ IsBeingEscorted = false;
+
+ debug_log("SD2: EscortAI Evaded back to spawn point because player was to far away or not found");
+
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->Respawn();
+ m_creature->GetMotionMaster()->Clear(true);
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ PlayerTimer = 1000;
+ }else PlayerTimer -= diff;
+
+ //Check if we have a current target
+ if( m_creature->isAlive() && m_creature->SelectHostilTarget() && m_creature->getVictim())
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ if( m_creature->isAttackReady() )
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+ }
+}
+
+void npc_escortAI::MovementInform(uint32 type, uint32 id)
+{
+ if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
+ return;
+
+ //Original position reached, continue waypoint movement
+ if (id == WP_LAST_POINT)
+ {
+ debug_log("SD2: EscortAI has returned to original position before combat");
+ ReconnectWP = true;
+ Returning = false;
+ WaitTimer = 1;
+
+ }else
+ {
+ //Make sure that we are still on the right waypoint
+ if (CurrentWP->id != id)
+ {
+ debug_log("SD2 ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id);
+ return;
+ }
+
+ debug_log("SD2: EscortAI Waypoint %d reached", CurrentWP->id);
+
+ //Call WP function
+ WaypointReached(CurrentWP->id);
+
+ WaitTimer = CurrentWP->WaitTimeMs + 1;
+
+ ++CurrentWP;
+ }
+}
+
+void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs)
+{
+ Escort_Waypoint t(id, x, y, z, WaitTimeMs);
+
+ WaypointList.push_back(t);
+}
+
+void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
+{
+ if (InCombat)
+ {
+ debug_log("SD2 ERROR: EscortAI attempt to Start while in combat");
+ return;
+ }
+
+ if (WaypointList.empty())
+ {
+ debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints");
+ return;
+ }
+
+ Attack = bAttack;
+ Defend = bDefend;
+ Run = bRun;
+ PlayerGUID = pGUID;
+
+ debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID);
+
+ CurrentWP = WaypointList.begin();
+
+ //Set initial speed
+ if (Run)
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
+ //Start WP
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ IsBeingEscorted = true;
+ ReconnectWP = false;
+ Returning = false;
+ IsOnHold = false;
+
+ //Disable gossip
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h
index aa6dd553992..73928f7e2f8 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.h
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h
@@ -1,85 +1,85 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_ESCORTAI_H
-#define SC_ESCORTAI_H
-
-struct Escort_Waypoint
-{
- Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
- {
- id = _id;
- x = _x;
- y = _y;
- z = _z;
- WaitTimeMs = _w;
- }
-
- uint32 id;
- float x;
- float y;
- float z;
- uint32 WaitTimeMs;
-};
-
-struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
-{
- public:
-
- // Pure Virtual Functions
- virtual void WaypointReached(uint32) = 0;
-
- virtual void Aggro(Unit*) = 0;
-
- virtual void Reset() = 0;
-
- // CreatureAI functions
- npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000) {m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);}
-
- bool IsVisible(Unit*) const;
-
- void AttackStart(Unit*);
-
- void MoveInLineOfSight(Unit*);
-
- void JustRespawned();
-
- void EnterEvadeMode();
-
- void UpdateAI(const uint32);
-
- void MovementInform(uint32, uint32);
-
- // EscortAI functions
- void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
-
- void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
-
- // EscortAI variables
- protected:
- uint64 PlayerGUID;
- bool IsBeingEscorted;
- bool IsOnHold;
-
- private:
- uint32 WaitTimer;
- uint32 PlayerTimer;
-
- struct
- {
- float x;
- float y;
- float z;
- }LastPos;
-
- std::list<Escort_Waypoint> WaypointList;
- std::list<Escort_Waypoint>::iterator CurrentWP;
-
- bool Attack;
- bool Defend;
- bool Returning;
- bool ReconnectWP;
- bool Run;
-};
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_ESCORTAI_H
+#define SC_ESCORTAI_H
+
+struct Escort_Waypoint
+{
+ Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
+ {
+ id = _id;
+ x = _x;
+ y = _y;
+ z = _z;
+ WaitTimeMs = _w;
+ }
+
+ uint32 id;
+ float x;
+ float y;
+ float z;
+ uint32 WaitTimeMs;
+};
+
+struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
+{
+ public:
+
+ // Pure Virtual Functions
+ virtual void WaypointReached(uint32) = 0;
+
+ virtual void Aggro(Unit*) = 0;
+
+ virtual void Reset() = 0;
+
+ // CreatureAI functions
+ npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000) {m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);}
+
+ bool IsVisible(Unit*) const;
+
+ void AttackStart(Unit*);
+
+ void MoveInLineOfSight(Unit*);
+
+ void JustRespawned();
+
+ void EnterEvadeMode();
+
+ void UpdateAI(const uint32);
+
+ void MovementInform(uint32, uint32);
+
+ // EscortAI functions
+ void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
+
+ void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
+
+ // EscortAI variables
+ protected:
+ uint64 PlayerGUID;
+ bool IsBeingEscorted;
+ bool IsOnHold;
+
+ private:
+ uint32 WaitTimer;
+ uint32 PlayerTimer;
+
+ struct
+ {
+ float x;
+ float y;
+ float z;
+ }LastPos;
+
+ std::list<Escort_Waypoint> WaypointList;
+ std::list<Escort_Waypoint>::iterator CurrentWP;
+
+ bool Attack;
+ bool Defend;
+ bool Returning;
+ bool ReconnectWP;
+ bool Run;
+};
+#endif
diff --git a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
index e7bb90caad4..d0faf45c792 100644
--- a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
@@ -1,144 +1,144 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npc_Innkeeper
-SD%Complete: 50
-SDComment: This script are currently not in use. EventSystem cannot be used on Windows build of SD2
-SDCategory: NPCs
-EndScriptData */
-
-#include "precompiled.h"
-
-#define HALLOWEEN_EVENTID 12
-#define SPELL_TRICK_OR_TREATED 24755
-#define SPELL_TREAT 24715
-
-#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
-#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
-#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
-#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
-
-bool isEventActive()
-{
- /*
- const GameEvent::ActiveEvents *ActiveEventsList = gameeventmgr.GetActiveEventList();
- GameEvent::ActiveEvents::const_iterator itr;
- for (itr = ActiveEventsList->begin(); itr != ActiveEventsList->end(); ++itr)
- {
- if (*itr==HALLOWEEN_EVENTID)
- {
- return true;
- }
- }*/
- return false;
-}
-
-bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
- {
- char* localizedEntry;
- switch (player->GetSession()->GetSessionDbLocaleIndex())
- {
- case 0:
- localizedEntry=LOCALE_TRICK_OR_TREAT_0;
- break;
- case 2:
- localizedEntry=LOCALE_TRICK_OR_TREAT_2;
- break;
- case 3:
- localizedEntry=LOCALE_TRICK_OR_TREAT_3;
- break;
- case 6:
- localizedEntry=LOCALE_TRICK_OR_TREAT_6;
- break;
- default:
- localizedEntry=LOCALE_TRICK_OR_TREAT_0;
- }
-
- player->ADD_GOSSIP_ITEM(0, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
- }
-
- player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
-
- // either trick or treat, 50% chance
- if(rand()%2)
- {
- player->CastSpell(player, SPELL_TREAT, true);
- }
- else
- {
- int32 trickspell=0;
- switch (rand()%9) // note that female characters can get male costumes and vice versa
- {
- case 0:
- trickspell=24753; // cannot cast, random 30sec
- break;
- case 1:
- trickspell=24713; // lepper gnome costume
- break;
- case 2:
- trickspell=24735; // male ghost costume
- break;
- case 3:
- trickspell=24736; // female ghostcostume
- break;
- case 4:
- trickspell=24710; // male ninja costume
- break;
- case 5:
- trickspell=24711; // female ninja costume
- break;
- case 6:
- trickspell=24708; // male pirate costume
- break;
- case 7:
- trickspell=24709; // female pirate costume
- break;
- case 8:
- trickspell=24723; // skeleton costume
- break;
- }
- player->CastSpell(player, trickspell, true);
- }
- return true; // prevent Trinity core handling
- }
- return false; // the player didn't select "trick or treat" or cheated, normal core handling
-}
-
-void AddSC_npc_innkeeper()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="npc_innkeeper";
- newscript->pGossipHello = &GossipHello_npc_innkeeper;
- newscript->pGossipSelect = &GossipSelect_npc_innkeeper;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npc_Innkeeper
+SD%Complete: 50
+SDComment: This script are currently not in use. EventSystem cannot be used on Windows build of SD2
+SDCategory: NPCs
+EndScriptData */
+
+#include "precompiled.h"
+
+#define HALLOWEEN_EVENTID 12
+#define SPELL_TRICK_OR_TREATED 24755
+#define SPELL_TREAT 24715
+
+#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
+#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
+#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
+#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
+
+bool isEventActive()
+{
+ /*
+ const GameEvent::ActiveEvents *ActiveEventsList = gameeventmgr.GetActiveEventList();
+ GameEvent::ActiveEvents::const_iterator itr;
+ for (itr = ActiveEventsList->begin(); itr != ActiveEventsList->end(); ++itr)
+ {
+ if (*itr==HALLOWEEN_EVENTID)
+ {
+ return true;
+ }
+ }*/
+ return false;
+}
+
+bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ {
+ char* localizedEntry;
+ switch (player->GetSession()->GetSessionDbLocaleIndex())
+ {
+ case 0:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_0;
+ break;
+ case 2:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_2;
+ break;
+ case 3:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_3;
+ break;
+ case 6:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_6;
+ break;
+ default:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_0;
+ }
+
+ player->ADD_GOSSIP_ITEM(0, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
+ }
+
+ player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
+
+ // either trick or treat, 50% chance
+ if(rand()%2)
+ {
+ player->CastSpell(player, SPELL_TREAT, true);
+ }
+ else
+ {
+ int32 trickspell=0;
+ switch (rand()%9) // note that female characters can get male costumes and vice versa
+ {
+ case 0:
+ trickspell=24753; // cannot cast, random 30sec
+ break;
+ case 1:
+ trickspell=24713; // lepper gnome costume
+ break;
+ case 2:
+ trickspell=24735; // male ghost costume
+ break;
+ case 3:
+ trickspell=24736; // female ghostcostume
+ break;
+ case 4:
+ trickspell=24710; // male ninja costume
+ break;
+ case 5:
+ trickspell=24711; // female ninja costume
+ break;
+ case 6:
+ trickspell=24708; // male pirate costume
+ break;
+ case 7:
+ trickspell=24709; // female pirate costume
+ break;
+ case 8:
+ trickspell=24723; // skeleton costume
+ break;
+ }
+ player->CastSpell(player, trickspell, true);
+ }
+ return true; // prevent Trinity core handling
+ }
+ return false; // the player didn't select "trick or treat" or cheated, normal core handling
+}
+
+void AddSC_npc_innkeeper()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="npc_innkeeper";
+ newscript->pGossipHello = &GossipHello_npc_innkeeper;
+ newscript->pGossipSelect = &GossipSelect_npc_innkeeper;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_professions.cpp b/src/bindings/scripts/scripts/npc/npc_professions.cpp
index 579b53ad139..c06d65b0462 100644
--- a/src/bindings/scripts/scripts/npc/npc_professions.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_professions.cpp
@@ -1,1205 +1,1205 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npc_Professions
-SD%Complete: 80
-SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
-SDCategory: NPCs
-EndScriptData */
-
-#include "precompiled.h"
-
-/*
-A few notes for future developement:
-- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
-there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
-- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
-*/
-
-/*
--- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226;
-*/
-
-/*###
-# to be removed from here (->ncp_text). This is data for database projects.
-###*/
-#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
-
-#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
-#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
-#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
-
-#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
-#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
-#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
-
-/*###
-# generic defines
-###*/
-
-#define GOSSIP_SENDER_LEARN 50
-#define GOSSIP_SENDER_UNLEARN 51
-#define GOSSIP_SENDER_CHECK 52
-
-/*###
-# gossip item and box texts
-###*/
-
-#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
-#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
-#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
-#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
-#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
-#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
-
-#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
-#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
-#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
-#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
-
-#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
-#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
-#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
-#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
-#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
-#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
-#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
-
-#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking"
-#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
-#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking"
-#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
-#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking"
-#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
-
-#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
-#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
-#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
-#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
-#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
-#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
-
-#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering"
-#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering"
-
-/*###
-# spells defines
-###*/
-
-#define S_WEAPON 9787
-#define S_ARMOR 9788
-#define S_HAMMER 17040
-#define S_AXE 17041
-#define S_SWORD 17039
-
-#define S_LEARN_WEAPON 9789
-#define S_LEARN_ARMOR 9790
-#define S_LEARN_HAMMER 39099
-#define S_LEARN_AXE 39098
-#define S_LEARN_SWORD 39097
-
-#define S_UNLEARN_WEAPON 36436
-#define S_UNLEARN_ARMOR 36435
-#define S_UNLEARN_HAMMER 36441
-#define S_UNLEARN_AXE 36439
-#define S_UNLEARN_SWORD 36438
-
-#define S_REP_ARMOR 17451
-#define S_REP_WEAPON 17452
-
-#define REP_ARMOR 46
-#define REP_WEAPON 289
-#define REP_HAMMER 569
-#define REP_AXE 570
-#define REP_SWORD 571
-
-#define S_DRAGON 10656
-#define S_ELEMENTAL 10658
-#define S_TRIBAL 10660
-
-#define S_LEARN_DRAGON 10657
-#define S_LEARN_ELEMENTAL 10659
-#define S_LEARN_TRIBAL 10661
-
-#define S_UNLEARN_DRAGON 36434
-#define S_UNLEARN_ELEMENTAL 36328
-#define S_UNLEARN_TRIBAL 36433
-
-#define S_GOBLIN 20222
-#define S_GNOMISH 20219
-
-#define S_LEARN_GOBLIN 20221
-#define S_LEARN_GNOMISH 20220
-
-#define S_SPELLFIRE 26797
-#define S_MOONCLOTH 26798
-#define S_SHADOWEAVE 26801
-
-#define S_LEARN_SPELLFIRE 26796
-#define S_LEARN_MOONCLOTH 26799
-#define S_LEARN_SHADOWEAVE 26800
-
-#define S_UNLEARN_SPELLFIRE 41299
-#define S_UNLEARN_MOONCLOTH 41558
-#define S_UNLEARN_SHADOWEAVE 41559
-
-#define S_TRANSMUTE 28672
-#define S_ELIXIR 28677
-#define S_POTION 28675
-
-#define S_LEARN_TRANSMUTE 28674
-#define S_LEARN_ELIXIR 28678
-#define S_LEARN_POTION 28676
-
-#define S_UNLEARN_TRANSMUTE 41565
-#define S_UNLEARN_ELIXIR 41564
-#define S_UNLEARN_POTION 41563
-
-/*###
-# formulas to calculate unlearning cost
-###*/
-
-int32 DoLearnCost(Player *player) //tailor, alchemy
-{
- return 200000;
-}
-
-int32 DoHighUnlearnCost(Player *player) //tailor, alchemy
-{
- return 1500000;
-}
-
-int32 DoMedUnlearnCost(Player *player) //blacksmith, leatherwork
-{
- uint32 level = player->getLevel();
- if(level < 51)
- return 250000;
- else if (level < 66)
- return 500000;
- else
- return 1000000;
-}
-
-int32 DoLowUnlearnCost(Player *player) //blacksmith
-{
- uint32 level = player->getLevel();
- if (level < 66)
- return 50000;
- else
- return 100000;
-}
-
-/*###
-# unlearning related profession spells
-###*/
-
-bool EquippedOk(Player* player, uint32 spellId)
-{
- SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId);
-
- if( !spell )
- return false;
-
- for(int i=0; i<3; i++)
- {
- uint32 reqSpell = spell->EffectTriggerSpell[i];
- if( !reqSpell )
- continue;
-
- Item* pItem;
- for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
- {
- pItem = player->GetItemByPos( INVENTORY_SLOT_BAG_0, j );
- if( pItem )
- if( pItem->GetProto()->RequiredSpell == reqSpell )
- {
- //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
- debug_log("SD2: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId);
- return false;
- }
- }
- }
- return true;
-}
-
-void ProfessionUnlearnSpells(Player *player, uint32 type)
-{
- switch (type)
- {
- case 36436: // S_UNLEARN_WEAPON
- player->removeSpell(36125); // Light Earthforged Blade
- player->removeSpell(36128); // Light Emberforged Hammer
- player->removeSpell(36126); // Light Skyforged Axe
- break;
- case 36435: // S_UNLEARN_ARMOR
- player->removeSpell(36122); // Earthforged Leggings
- player->removeSpell(36129); // Heavy Earthforged Breastplate
- player->removeSpell(36130); // Stormforged Hauberk
- player->removeSpell(34533); // Breastplate of Kings
- player->removeSpell(34529); // Nether Chain Shirt
- player->removeSpell(34534); // Bulwark of Kings
- player->removeSpell(36257); // Bulwark of the Ancient Kings
- player->removeSpell(36256); // Embrace of the Twisting Nether
- player->removeSpell(34530); // Twisting Nether Chain Shirt
- player->removeSpell(36124); // Windforged Leggings
- break;
- case 36441: // S_UNLEARN_HAMMER
- player->removeSpell(36262); // Dragonstrike
- player->removeSpell(34546); // Dragonmaw
- player->removeSpell(34545); // Drakefist Hammer
- player->removeSpell(36136); // Lavaforged Warhammer
- player->removeSpell(34547); // Thunder
- player->removeSpell(34567); // Deep Thunder
- player->removeSpell(36263); // Stormherald
- player->removeSpell(36137); // Great Earthforged Hammer
- break;
- case 36439: // S_UNLEARN_AXE
- player->removeSpell(36260); // Wicked Edge of the Planes
- player->removeSpell(34562); // Black Planar Edge
- player->removeSpell(34541); // The Planar Edge
- player->removeSpell(36134); // Stormforged Axe
- player->removeSpell(36135); // Skyforged Great Axe
- player->removeSpell(36261); // Bloodmoon
- player->removeSpell(34543); // Lunar Crescent
- player->removeSpell(34544); // Mooncleaver
- break;
- case 36438: // S_UNLEARN_SWORD
- player->removeSpell(36258); // Blazefury
- player->removeSpell(34537); // Blazeguard
- player->removeSpell(34535); // Fireguard
- player->removeSpell(36131); // Windforged Rapier
- player->removeSpell(36133); // Stoneforged Claymore
- player->removeSpell(34538); // Lionheart Blade
- player->removeSpell(34540); // Lionheart Champion
- player->removeSpell(36259); // Lionheart Executioner
- break;
- case 36434: // S_UNLEARN_DRAGON
- player->removeSpell(36076); // Dragonstrike Leggings
- player->removeSpell(36079); // Golden Dragonstrike Breastplate
- player->removeSpell(35576); // Ebon Netherscale Belt
- player->removeSpell(35577); // Ebon Netherscale Bracers
- player->removeSpell(35575); // Ebon Netherscale Breastplate
- player->removeSpell(35582); // Netherstrike Belt
- player->removeSpell(35584); // Netherstrike Bracers
- player->removeSpell(35580); // Netherstrike Breastplate
- break;
- case 36328: // S_UNLEARN_ELEMENTAL
- player->removeSpell(36074); // Blackstorm Leggings
- player->removeSpell(36077); // Primalstorm Breastplate
- player->removeSpell(35590); // Primalstrike Belt
- player->removeSpell(35591); // Primalstrike Bracers
- player->removeSpell(35589); // Primalstrike Vest
- break;
- case 36433: // S_UNLEARN_TRIBAL
- player->removeSpell(35585); // Windhawk Hauberk
- player->removeSpell(35587); // Windhawk Belt
- player->removeSpell(35588); // Windhawk Bracers
- player->removeSpell(36075); // Wildfeather Leggings
- player->removeSpell(36078); // Living Crystal Breastplate
- break;
- case 41299: // S_UNLEARN_SPELLFIRE
- player->removeSpell(26752); // Spellfire Belt
- player->removeSpell(26753); // Spellfire Gloves
- player->removeSpell(26754); // Spellfire Robe
- break;
- case 41558: // S_UNLEARN_MOONCLOTH
- player->removeSpell(26760); // Primal Mooncloth Belt
- player->removeSpell(26761); // Primal Mooncloth Shoulders
- player->removeSpell(26762); // Primal Mooncloth Robe
- break;
- case 41559: // S_UNLEARN_SHADOWEAVE
- player->removeSpell(26756); // Frozen Shadoweave Shoulders
- player->removeSpell(26757); // Frozen Shadoweave Boots
- player->removeSpell(26758); // Frozen Shadoweave Robe
- break;
- }
-}
-
-/*###
-# start menues alchemy
-###*/
-
-bool HasAlchemySpell(Player *player)
-{
- if(player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_alchemy(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY)>=350 && player->getLevel() > 67)
- {
- if (player->GetQuestRewardStatus(10899) || player->GetQuestRewardStatus(10902) || player->GetQuestRewardStatus(10897))
- {
- switch (eCreature)
- {
- case 22427: //Zarevhi
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
- if (player->HasSpell(S_TRANSMUTE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- case 19052: //Lorokeem
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
- if (player->HasSpell(S_ELIXIR))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
- break;
- case 17909: //Lauranna Thar'well
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
- if (player->HasSpell(S_POTION))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
- break;
- }
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Alchemy
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_TRANSMUTE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_TRANSMUTE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_ELIXIR) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_ELIXIR, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(!player->HasSpell(S_POTION) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_POTION, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Alchemy
- case GOSSIP_ACTION_INFO_DEF + 4:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_TRANSMUTE, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_ELIXIR, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_POTION, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22427:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 19052:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 17909:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22427: //Zarevhi
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 19052: //Lorokeem
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 17909: //Lauranna Thar'well
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues blacksmith
-###*/
-
-bool HasWeaponSub(Player *player)
-{
- if (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_blacksmith(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
- //WEAPONSMITH & ARMORSMITH
- if(player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=225)
- {
- switch (eCreature)
- {
- case 11145: //Myolor Sunderfury
- case 11176: //Krathok Moltenfist
- if(!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) == REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- if(!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) == REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- break;
- case 11146: //Ironus Coldsteel
- case 11178: //Borgosh Corebender
- if(player->HasSpell(S_WEAPON))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
- break;
- case 5164: //Grumnus Steelshaper
- case 11177: //Okothos Ironrager
- if(player->HasSpell(S_ARMOR))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- }
- }
- //WEAPONSMITH SPEC
- if(player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=250)
- {
- switch (eCreature)
- {
- case 11191: //Lilith the Lithe
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 5);
- if(player->HasSpell(S_HAMMER))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 8);
- break;
- case 11192: //Kilram
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 6);
- if(player->HasSpell(S_AXE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 9);
- break;
- case 11193: //Seril Scourgebane
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 7);
- if(player->HasSpell(S_SWORD))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 10);
- break;
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Armor/Weapon
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_ARMOR))
- {
- player->CastSpell(player, S_LEARN_ARMOR, true);
- //_Creature->CastSpell(player, S_REP_ARMOR, true);
- }
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_WEAPON))
- {
- player->CastSpell(player, S_LEARN_WEAPON, true);
- //_Creature->CastSpell(player, S_REP_WEAPON, true);
- }
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Armor/Weapon
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(HasWeaponSub(player))
- {
- //unknown textID (TALK_MUST_UNLEARN_WEAPON)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- //Temporary, not offilike
- _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID());
- }
- else if( EquippedOk(player,S_UNLEARN_WEAPON) )
- {
- if( player->GetMoney() >= DoLowUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_WEAPON, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_WEAPON);
- player->ModifyMoney(-DoLowUnlearnCost(player));
- _Creature->CastSpell(player, S_REP_ARMOR, true);
- player->CLOSE_GOSSIP_MENU();
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- }
- else
- {
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- }
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- if( EquippedOk(player,S_UNLEARN_ARMOR) )
- {
- if( player->GetMoney() >= DoLowUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_ARMOR, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_ARMOR);
- player->ModifyMoney(-DoLowUnlearnCost(player));
- _Creature->CastSpell(player, S_REP_WEAPON, true);
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Learn Hammer/Axe/Sword
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->CastSpell(player, S_LEARN_HAMMER, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->CastSpell(player, S_LEARN_AXE, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 7:
- player->CastSpell(player, S_LEARN_SWORD, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Hammer/Axe/Sword
- case GOSSIP_ACTION_INFO_DEF + 8:
- if( EquippedOk(player,S_UNLEARN_HAMMER) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_HAMMER, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_HAMMER);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 9:
- if( EquippedOk(player,S_UNLEARN_AXE) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_AXE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_AXE);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 10:
- if( EquippedOk(player,S_UNLEARN_SWORD) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_SWORD, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SWORD);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 11191:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_HAMMER_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11192:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_AXE_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11193:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_SWORD_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 11146: //Ironus Coldsteel
- case 11178: //Borgosh Corebender
- case 5164: //Grumnus Steelshaper
- case 11177: //Okothos Ironrager
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player),false);
- //unknown textID (TALK_UNLEARN_AXEORWEAPON)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
-
- case 11191:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_HAMMER_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11192:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_AXE_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11193:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_SWORD_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
- }
- return true;
-}
-
-/*bool QuestComplete_npc_prof_blacksmith( Player *player, Creature *_Creature, Quest const *_Quest )
-{
- if ( (_Quest->GetQuestId() == 5283) || (_Quest->GetQuestId() == 5301) ) //armorsmith
- _Creature->CastSpell(player, 17451, true);
-
- if ( (_Quest->GetQuestId() == 5284) || (_Quest->GetQuestId() == 5302) ) //weaponsmith
- _Creature->CastSpell(player, 17452, true);
-
- return true;
-}*/
-
-/*###
-# start menues leatherworking
-###*/
-
-bool GossipHello_npc_prof_leather(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if(player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING)>=250 && player->getLevel() > 49 )
- {
- switch (eCreature)
- {
- case 7866: //Peter Galen
- case 7867: //Thorkaf Dragoneye
- if(player->HasSpell(S_DRAGON))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 1);
- break;
- case 7868: //Sarah Tanner
- case 7869: //Brumn Winterhoof
- if(player->HasSpell(S_ELEMENTAL))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 2);
- break;
- case 7870: //Caryssia Moonhunter
- case 7871: //Se'Jib
- if(player->HasSpell(S_TRIBAL))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
- break;
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Unlearn Leather
- case GOSSIP_ACTION_INFO_DEF + 1:
- if( EquippedOk(player,S_UNLEARN_DRAGON) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_DRAGON, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_DRAGON);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if( EquippedOk(player,S_UNLEARN_ELEMENTAL) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_ELEMENTAL, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_ELEMENTAL);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if( EquippedOk(player,S_UNLEARN_TRIBAL) )
- {
- if(player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_TRIBAL, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_TRIBAL);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmUnlearn_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 7866: //Peter Galen
- case 7867: //Thorkaf Dragoneye
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 7868: //Sarah Tanner
- case 7869: //Brumn Winterhoof
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 7870: //Caryssia Moonhunter
- case 7871: //Se'Jib
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_leather(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_leather(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues tailoring
-###*/
-
-bool HasTailorSpell(Player *player)
-{
- if (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_tailor(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if (_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
- //TAILORING SPEC
- if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING)>=350 && player->getLevel() > 59)
- {
- if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
- {
- switch (eCreature)
- {
- case 22213: //Gidge Spellweaver
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
- if (player->HasSpell(S_SPELLFIRE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- case 22208: //Nasmara Moonsong
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
- if (player->HasSpell(S_MOONCLOTH))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
- break;
- case 22212: //Andrion Darkspinner
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
- if (player->HasSpell(S_SHADOWEAVE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
- break;
- }
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Tailor
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_SPELLFIRE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_SPELLFIRE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_MOONCLOTH) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_MOONCLOTH, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(!player->HasSpell(S_SHADOWEAVE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_SHADOWEAVE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Tailor
- case GOSSIP_ACTION_INFO_DEF + 4:
- if( EquippedOk(player,S_UNLEARN_SPELLFIRE) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_SPELLFIRE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SPELLFIRE);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- if( EquippedOk(player,S_UNLEARN_MOONCLOTH) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_MOONCLOTH, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_MOONCLOTH);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- if( EquippedOk(player,S_UNLEARN_SHADOWEAVE) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_SHADOWEAVE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SHADOWEAVE);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22213:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22208:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22212:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22213: //Gidge Spellweaver
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22208: //Nasmara Moonsong
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22212: //Andrion Darkspinner
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action,BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_tailor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues for GO (engineering and leatherworking)
-###*/
-
-/*bool GOHello_go_soothsaying_for_dummies(Player *player, GameObject* _GO)
-{
- player->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0);
-
- player->SEND_GOSSIP_MENU(5584, _GO->GetGUID());
-
- return true;
-}*/
-
-/*###
-#
-###*/
-
-void AddSC_npc_professions()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_alchemy";
- newscript->pGossipHello = &GossipHello_npc_prof_alchemy;
- newscript->pGossipSelect = &GossipSelect_npc_prof_alchemy;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_blacksmith";
- newscript->pGossipHello = &GossipHello_npc_prof_blacksmith;
- newscript->pGossipSelect = &GossipSelect_npc_prof_blacksmith;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_leather";
- newscript->pGossipHello = &GossipHello_npc_prof_leather;
- newscript->pGossipSelect = &GossipSelect_npc_prof_leather;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_tailor";
- newscript->pGossipHello = &GossipHello_npc_prof_tailor;
- newscript->pGossipSelect = &GossipSelect_npc_prof_tailor;
- m_scripts[nrscripts++] = newscript;
-
- /*newscript = new Script;
- newscript->Name="go_soothsaying_for_dummies";
- newscript->pGOHello = &GOHello_go_soothsaying_for_dummies;
- //newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies;
- m_scripts[nrscripts++] = newscript;*/
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npc_Professions
+SD%Complete: 80
+SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
+SDCategory: NPCs
+EndScriptData */
+
+#include "precompiled.h"
+
+/*
+A few notes for future developement:
+- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
+there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
+- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
+*/
+
+/*
+-- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226;
+*/
+
+/*###
+# to be removed from here (->ncp_text). This is data for database projects.
+###*/
+#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
+
+#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
+#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
+#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
+
+#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
+#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
+#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
+
+/*###
+# generic defines
+###*/
+
+#define GOSSIP_SENDER_LEARN 50
+#define GOSSIP_SENDER_UNLEARN 51
+#define GOSSIP_SENDER_CHECK 52
+
+/*###
+# gossip item and box texts
+###*/
+
+#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
+#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
+#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
+#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
+#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
+#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
+
+#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
+#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
+#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
+#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
+
+#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
+#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
+#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
+#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
+#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
+#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
+#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
+
+#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking"
+#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
+#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking"
+#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
+#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking"
+#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
+
+#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
+#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
+#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
+#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
+#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
+#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
+
+#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering"
+#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering"
+
+/*###
+# spells defines
+###*/
+
+#define S_WEAPON 9787
+#define S_ARMOR 9788
+#define S_HAMMER 17040
+#define S_AXE 17041
+#define S_SWORD 17039
+
+#define S_LEARN_WEAPON 9789
+#define S_LEARN_ARMOR 9790
+#define S_LEARN_HAMMER 39099
+#define S_LEARN_AXE 39098
+#define S_LEARN_SWORD 39097
+
+#define S_UNLEARN_WEAPON 36436
+#define S_UNLEARN_ARMOR 36435
+#define S_UNLEARN_HAMMER 36441
+#define S_UNLEARN_AXE 36439
+#define S_UNLEARN_SWORD 36438
+
+#define S_REP_ARMOR 17451
+#define S_REP_WEAPON 17452
+
+#define REP_ARMOR 46
+#define REP_WEAPON 289
+#define REP_HAMMER 569
+#define REP_AXE 570
+#define REP_SWORD 571
+
+#define S_DRAGON 10656
+#define S_ELEMENTAL 10658
+#define S_TRIBAL 10660
+
+#define S_LEARN_DRAGON 10657
+#define S_LEARN_ELEMENTAL 10659
+#define S_LEARN_TRIBAL 10661
+
+#define S_UNLEARN_DRAGON 36434
+#define S_UNLEARN_ELEMENTAL 36328
+#define S_UNLEARN_TRIBAL 36433
+
+#define S_GOBLIN 20222
+#define S_GNOMISH 20219
+
+#define S_LEARN_GOBLIN 20221
+#define S_LEARN_GNOMISH 20220
+
+#define S_SPELLFIRE 26797
+#define S_MOONCLOTH 26798
+#define S_SHADOWEAVE 26801
+
+#define S_LEARN_SPELLFIRE 26796
+#define S_LEARN_MOONCLOTH 26799
+#define S_LEARN_SHADOWEAVE 26800
+
+#define S_UNLEARN_SPELLFIRE 41299
+#define S_UNLEARN_MOONCLOTH 41558
+#define S_UNLEARN_SHADOWEAVE 41559
+
+#define S_TRANSMUTE 28672
+#define S_ELIXIR 28677
+#define S_POTION 28675
+
+#define S_LEARN_TRANSMUTE 28674
+#define S_LEARN_ELIXIR 28678
+#define S_LEARN_POTION 28676
+
+#define S_UNLEARN_TRANSMUTE 41565
+#define S_UNLEARN_ELIXIR 41564
+#define S_UNLEARN_POTION 41563
+
+/*###
+# formulas to calculate unlearning cost
+###*/
+
+int32 DoLearnCost(Player *player) //tailor, alchemy
+{
+ return 200000;
+}
+
+int32 DoHighUnlearnCost(Player *player) //tailor, alchemy
+{
+ return 1500000;
+}
+
+int32 DoMedUnlearnCost(Player *player) //blacksmith, leatherwork
+{
+ uint32 level = player->getLevel();
+ if(level < 51)
+ return 250000;
+ else if (level < 66)
+ return 500000;
+ else
+ return 1000000;
+}
+
+int32 DoLowUnlearnCost(Player *player) //blacksmith
+{
+ uint32 level = player->getLevel();
+ if (level < 66)
+ return 50000;
+ else
+ return 100000;
+}
+
+/*###
+# unlearning related profession spells
+###*/
+
+bool EquippedOk(Player* player, uint32 spellId)
+{
+ SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId);
+
+ if( !spell )
+ return false;
+
+ for(int i=0; i<3; i++)
+ {
+ uint32 reqSpell = spell->EffectTriggerSpell[i];
+ if( !reqSpell )
+ continue;
+
+ Item* pItem;
+ for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
+ {
+ pItem = player->GetItemByPos( INVENTORY_SLOT_BAG_0, j );
+ if( pItem )
+ if( pItem->GetProto()->RequiredSpell == reqSpell )
+ {
+ //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
+ debug_log("SD2: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId);
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+void ProfessionUnlearnSpells(Player *player, uint32 type)
+{
+ switch (type)
+ {
+ case 36436: // S_UNLEARN_WEAPON
+ player->removeSpell(36125); // Light Earthforged Blade
+ player->removeSpell(36128); // Light Emberforged Hammer
+ player->removeSpell(36126); // Light Skyforged Axe
+ break;
+ case 36435: // S_UNLEARN_ARMOR
+ player->removeSpell(36122); // Earthforged Leggings
+ player->removeSpell(36129); // Heavy Earthforged Breastplate
+ player->removeSpell(36130); // Stormforged Hauberk
+ player->removeSpell(34533); // Breastplate of Kings
+ player->removeSpell(34529); // Nether Chain Shirt
+ player->removeSpell(34534); // Bulwark of Kings
+ player->removeSpell(36257); // Bulwark of the Ancient Kings
+ player->removeSpell(36256); // Embrace of the Twisting Nether
+ player->removeSpell(34530); // Twisting Nether Chain Shirt
+ player->removeSpell(36124); // Windforged Leggings
+ break;
+ case 36441: // S_UNLEARN_HAMMER
+ player->removeSpell(36262); // Dragonstrike
+ player->removeSpell(34546); // Dragonmaw
+ player->removeSpell(34545); // Drakefist Hammer
+ player->removeSpell(36136); // Lavaforged Warhammer
+ player->removeSpell(34547); // Thunder
+ player->removeSpell(34567); // Deep Thunder
+ player->removeSpell(36263); // Stormherald
+ player->removeSpell(36137); // Great Earthforged Hammer
+ break;
+ case 36439: // S_UNLEARN_AXE
+ player->removeSpell(36260); // Wicked Edge of the Planes
+ player->removeSpell(34562); // Black Planar Edge
+ player->removeSpell(34541); // The Planar Edge
+ player->removeSpell(36134); // Stormforged Axe
+ player->removeSpell(36135); // Skyforged Great Axe
+ player->removeSpell(36261); // Bloodmoon
+ player->removeSpell(34543); // Lunar Crescent
+ player->removeSpell(34544); // Mooncleaver
+ break;
+ case 36438: // S_UNLEARN_SWORD
+ player->removeSpell(36258); // Blazefury
+ player->removeSpell(34537); // Blazeguard
+ player->removeSpell(34535); // Fireguard
+ player->removeSpell(36131); // Windforged Rapier
+ player->removeSpell(36133); // Stoneforged Claymore
+ player->removeSpell(34538); // Lionheart Blade
+ player->removeSpell(34540); // Lionheart Champion
+ player->removeSpell(36259); // Lionheart Executioner
+ break;
+ case 36434: // S_UNLEARN_DRAGON
+ player->removeSpell(36076); // Dragonstrike Leggings
+ player->removeSpell(36079); // Golden Dragonstrike Breastplate
+ player->removeSpell(35576); // Ebon Netherscale Belt
+ player->removeSpell(35577); // Ebon Netherscale Bracers
+ player->removeSpell(35575); // Ebon Netherscale Breastplate
+ player->removeSpell(35582); // Netherstrike Belt
+ player->removeSpell(35584); // Netherstrike Bracers
+ player->removeSpell(35580); // Netherstrike Breastplate
+ break;
+ case 36328: // S_UNLEARN_ELEMENTAL
+ player->removeSpell(36074); // Blackstorm Leggings
+ player->removeSpell(36077); // Primalstorm Breastplate
+ player->removeSpell(35590); // Primalstrike Belt
+ player->removeSpell(35591); // Primalstrike Bracers
+ player->removeSpell(35589); // Primalstrike Vest
+ break;
+ case 36433: // S_UNLEARN_TRIBAL
+ player->removeSpell(35585); // Windhawk Hauberk
+ player->removeSpell(35587); // Windhawk Belt
+ player->removeSpell(35588); // Windhawk Bracers
+ player->removeSpell(36075); // Wildfeather Leggings
+ player->removeSpell(36078); // Living Crystal Breastplate
+ break;
+ case 41299: // S_UNLEARN_SPELLFIRE
+ player->removeSpell(26752); // Spellfire Belt
+ player->removeSpell(26753); // Spellfire Gloves
+ player->removeSpell(26754); // Spellfire Robe
+ break;
+ case 41558: // S_UNLEARN_MOONCLOTH
+ player->removeSpell(26760); // Primal Mooncloth Belt
+ player->removeSpell(26761); // Primal Mooncloth Shoulders
+ player->removeSpell(26762); // Primal Mooncloth Robe
+ break;
+ case 41559: // S_UNLEARN_SHADOWEAVE
+ player->removeSpell(26756); // Frozen Shadoweave Shoulders
+ player->removeSpell(26757); // Frozen Shadoweave Boots
+ player->removeSpell(26758); // Frozen Shadoweave Robe
+ break;
+ }
+}
+
+/*###
+# start menues alchemy
+###*/
+
+bool HasAlchemySpell(Player *player)
+{
+ if(player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_alchemy(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+
+ if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY)>=350 && player->getLevel() > 67)
+ {
+ if (player->GetQuestRewardStatus(10899) || player->GetQuestRewardStatus(10902) || player->GetQuestRewardStatus(10897))
+ {
+ switch (eCreature)
+ {
+ case 22427: //Zarevhi
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ if (player->HasSpell(S_TRANSMUTE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ case 19052: //Lorokeem
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ if (player->HasSpell(S_ELIXIR))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ break;
+ case 17909: //Lauranna Thar'well
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ if (player->HasSpell(S_POTION))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ break;
+ }
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Alchemy
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_TRANSMUTE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_TRANSMUTE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_ELIXIR) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_ELIXIR, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(!player->HasSpell(S_POTION) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_POTION, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Alchemy
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_TRANSMUTE, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_ELIXIR, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_POTION, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22427:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 19052:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 17909:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22427: //Zarevhi
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 19052: //Lorokeem
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 17909: //Lauranna Thar'well
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues blacksmith
+###*/
+
+bool HasWeaponSub(Player *player)
+{
+ if (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_blacksmith(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+ //WEAPONSMITH & ARMORSMITH
+ if(player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=225)
+ {
+ switch (eCreature)
+ {
+ case 11145: //Myolor Sunderfury
+ case 11176: //Krathok Moltenfist
+ if(!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) == REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ if(!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) == REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ break;
+ case 11146: //Ironus Coldsteel
+ case 11178: //Borgosh Corebender
+ if(player->HasSpell(S_WEAPON))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ break;
+ case 5164: //Grumnus Steelshaper
+ case 11177: //Okothos Ironrager
+ if(player->HasSpell(S_ARMOR))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ }
+ }
+ //WEAPONSMITH SPEC
+ if(player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=250)
+ {
+ switch (eCreature)
+ {
+ case 11191: //Lilith the Lithe
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ if(player->HasSpell(S_HAMMER))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 8);
+ break;
+ case 11192: //Kilram
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ if(player->HasSpell(S_AXE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 9);
+ break;
+ case 11193: //Seril Scourgebane
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 7);
+ if(player->HasSpell(S_SWORD))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 10);
+ break;
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Armor/Weapon
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_ARMOR))
+ {
+ player->CastSpell(player, S_LEARN_ARMOR, true);
+ //_Creature->CastSpell(player, S_REP_ARMOR, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_WEAPON))
+ {
+ player->CastSpell(player, S_LEARN_WEAPON, true);
+ //_Creature->CastSpell(player, S_REP_WEAPON, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Armor/Weapon
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(HasWeaponSub(player))
+ {
+ //unknown textID (TALK_MUST_UNLEARN_WEAPON)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ //Temporary, not offilike
+ _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID());
+ }
+ else if( EquippedOk(player,S_UNLEARN_WEAPON) )
+ {
+ if( player->GetMoney() >= DoLowUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_WEAPON, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_WEAPON);
+ player->ModifyMoney(-DoLowUnlearnCost(player));
+ _Creature->CastSpell(player, S_REP_ARMOR, true);
+ player->CLOSE_GOSSIP_MENU();
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ }
+ else
+ {
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if( EquippedOk(player,S_UNLEARN_ARMOR) )
+ {
+ if( player->GetMoney() >= DoLowUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_ARMOR, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_ARMOR);
+ player->ModifyMoney(-DoLowUnlearnCost(player));
+ _Creature->CastSpell(player, S_REP_WEAPON, true);
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Learn Hammer/Axe/Sword
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ player->CastSpell(player, S_LEARN_HAMMER, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ player->CastSpell(player, S_LEARN_AXE, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7:
+ player->CastSpell(player, S_LEARN_SWORD, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Hammer/Axe/Sword
+ case GOSSIP_ACTION_INFO_DEF + 8:
+ if( EquippedOk(player,S_UNLEARN_HAMMER) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_HAMMER, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_HAMMER);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9:
+ if( EquippedOk(player,S_UNLEARN_AXE) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_AXE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_AXE);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10:
+ if( EquippedOk(player,S_UNLEARN_SWORD) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_SWORD, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SWORD);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 11191:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_HAMMER_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11192:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_AXE_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11193:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_SWORD_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 11146: //Ironus Coldsteel
+ case 11178: //Borgosh Corebender
+ case 5164: //Grumnus Steelshaper
+ case 11177: //Okothos Ironrager
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player),false);
+ //unknown textID (TALK_UNLEARN_AXEORWEAPON)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+
+ case 11191:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_HAMMER_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11192:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_AXE_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11193:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_SWORD_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*bool QuestComplete_npc_prof_blacksmith( Player *player, Creature *_Creature, Quest const *_Quest )
+{
+ if ( (_Quest->GetQuestId() == 5283) || (_Quest->GetQuestId() == 5301) ) //armorsmith
+ _Creature->CastSpell(player, 17451, true);
+
+ if ( (_Quest->GetQuestId() == 5284) || (_Quest->GetQuestId() == 5302) ) //weaponsmith
+ _Creature->CastSpell(player, 17452, true);
+
+ return true;
+}*/
+
+/*###
+# start menues leatherworking
+###*/
+
+bool GossipHello_npc_prof_leather(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+
+ if(player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING)>=250 && player->getLevel() > 49 )
+ {
+ switch (eCreature)
+ {
+ case 7866: //Peter Galen
+ case 7867: //Thorkaf Dragoneye
+ if(player->HasSpell(S_DRAGON))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ break;
+ case 7868: //Sarah Tanner
+ case 7869: //Brumn Winterhoof
+ if(player->HasSpell(S_ELEMENTAL))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ break;
+ case 7870: //Caryssia Moonhunter
+ case 7871: //Se'Jib
+ if(player->HasSpell(S_TRIBAL))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ break;
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Unlearn Leather
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if( EquippedOk(player,S_UNLEARN_DRAGON) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_DRAGON, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_DRAGON);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if( EquippedOk(player,S_UNLEARN_ELEMENTAL) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_ELEMENTAL, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_ELEMENTAL);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if( EquippedOk(player,S_UNLEARN_TRIBAL) )
+ {
+ if(player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_TRIBAL, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_TRIBAL);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 7866: //Peter Galen
+ case 7867: //Thorkaf Dragoneye
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 7868: //Sarah Tanner
+ case 7869: //Brumn Winterhoof
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 7870: //Caryssia Moonhunter
+ case 7871: //Se'Jib
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_leather(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_leather(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues tailoring
+###*/
+
+bool HasTailorSpell(Player *player)
+{
+ if (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_tailor(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if (_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+ //TAILORING SPEC
+ if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING)>=350 && player->getLevel() > 59)
+ {
+ if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
+ {
+ switch (eCreature)
+ {
+ case 22213: //Gidge Spellweaver
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ if (player->HasSpell(S_SPELLFIRE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ case 22208: //Nasmara Moonsong
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ if (player->HasSpell(S_MOONCLOTH))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ break;
+ case 22212: //Andrion Darkspinner
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ if (player->HasSpell(S_SHADOWEAVE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ break;
+ }
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Tailor
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_SPELLFIRE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_SPELLFIRE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_MOONCLOTH) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_MOONCLOTH, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(!player->HasSpell(S_SHADOWEAVE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_SHADOWEAVE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Tailor
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if( EquippedOk(player,S_UNLEARN_SPELLFIRE) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_SPELLFIRE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SPELLFIRE);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ if( EquippedOk(player,S_UNLEARN_MOONCLOTH) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_MOONCLOTH, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_MOONCLOTH);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ if( EquippedOk(player,S_UNLEARN_SHADOWEAVE) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_SHADOWEAVE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SHADOWEAVE);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22213:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22208:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22212:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22213: //Gidge Spellweaver
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22208: //Nasmara Moonsong
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22212: //Andrion Darkspinner
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action,BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_tailor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues for GO (engineering and leatherworking)
+###*/
+
+/*bool GOHello_go_soothsaying_for_dummies(Player *player, GameObject* _GO)
+{
+ player->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0);
+
+ player->SEND_GOSSIP_MENU(5584, _GO->GetGUID());
+
+ return true;
+}*/
+
+/*###
+#
+###*/
+
+void AddSC_npc_professions()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_alchemy";
+ newscript->pGossipHello = &GossipHello_npc_prof_alchemy;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_alchemy;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_blacksmith";
+ newscript->pGossipHello = &GossipHello_npc_prof_blacksmith;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_blacksmith;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_leather";
+ newscript->pGossipHello = &GossipHello_npc_prof_leather;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_leather;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_tailor";
+ newscript->pGossipHello = &GossipHello_npc_prof_tailor;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_tailor;
+ m_scripts[nrscripts++] = newscript;
+
+ /*newscript = new Script;
+ newscript->Name="go_soothsaying_for_dummies";
+ newscript->pGOHello = &GOHello_go_soothsaying_for_dummies;
+ //newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies;
+ m_scripts[nrscripts++] = newscript;*/
+}
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index e97bb4b52ef..3e1cb0a9165 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -1,878 +1,878 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npcs_Special
-SD%Complete: 100
-SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage)
-SDCategory: NPCs
-EndScriptData
-*/
-
-/* ContentData
-npc_chicken_cluck 100% support for quest 3861 (Cluck!)
-npc_dancing_flames 100% midsummer event NPC
-npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
-npc_injured_patient 100% patients for triage-quests (6622 and 6624)
-npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
-npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
-npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
-npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
-EndContentData */
-
-#include "precompiled.h"
-
-/*########
-# npc_chicken_cluck
-#########*/
-
-#define QUEST_CLUCK 3861
-#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?"
-#define EMOTE_H_HELLO "looks at you unexpectadly."
-#define CLUCK_TEXT2 "starts pecking at the feed."
-#define FACTION_FRIENDLY 84
-#define FACTION_CHICKEN 31
-
-struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
-{
- npc_chicken_cluckAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ResetFlagTimer;
-
- void Reset()
- {
- ResetFlagTimer = 120000;
-
- m_creature->setFaction(FACTION_CHICKEN);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- }
-
- void Aggro(Unit *who) {}
-
- 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(ResetFlagTimer < diff)
- EnterEvadeMode();
- else ResetFlagTimer -= diff;
- }
-
- if(m_creature->SelectHostilTarget() && m_creature->getVictim())
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
-{
- return new npc_chicken_cluckAI(_Creature);
-}
-
-bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
-{
- if( emote == TEXTEMOTE_CHICKEN )
- {
- if( player->GetTeam() == ALLIANCE )
- {
- if( rand()%30 == 1 )
- {
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0);
- }
- }
- } else
- _Creature->MonsterTextEmote(EMOTE_H_HELLO,0);
- }
- if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(CLUCK_TEXT2, 0);
- }
-
- return true;
-}
-
-bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
-{
- if(_Quest->GetQuestId() == QUEST_CLUCK)
- ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
-
- return true;
-}
-
-bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest)
-{
- if(_Quest->GetQuestId() == QUEST_CLUCK)
- ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
-
- return true;
-}
-
-/*######
-## npc_dancing_flames
-######*/
-
-bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *_Creature, uint32 emote )
-{
- if( emote == TEXTEMOTE_DANCE )
- _Creature->CastSpell(player,47057,false);
-
- return true;
-}
-
-/*######
-## Triage quest
-######*/
-
-#define SAY_DOC1 "I'm saved! Thank you, doctor!"
-#define SAY_DOC2 "HOORAY! I AM SAVED!"
-#define SAY_DOC3 "Sweet, sweet embrace... take me..."
-
-struct Location
-{
- float x, y, z, o;
-};
-
-#define DOCTOR_ALLIANCE 12939
-
-static Location AllianceCoords[]=
-{
- { // Top-far-right bunk as seen from entrance
- -3757.38, -4533.05, 14.16, 3.62
- },
- { // Top-far-left bunk
- -3754.36, -4539.13, 14.16, 5.13
- },
- { // Far-right bunk
- -3749.54, -4540.25, 14.28, 3.34
- },
- { // Right bunk near entrance
- -3742.10, -4536.85, 14.28, 3.64
- },
- { // Far-left bunk
- -3755.89, -4529.07, 14.05, 0.57
- },
- { // Mid-left bunk
- -3749.51, -4527.08, 14.07, 5.26
- },
- { // Left bunk near entrance
- -3746.37, -4525.35, 14.16, 5.22
- },
-};
-
-#define ALLIANCE_COORDS 7
-
-//alliance run to where
-#define A_RUNTOX -3742.96
-#define A_RUNTOY -4531.52
-#define A_RUNTOZ 11.91
-
-#define DOCTOR_HORDE 12920
-
-static Location HordeCoords[]=
-{
- { // Left, Behind
- -1013.75, -3492.59, 62.62, 4.34
- },
- { // Right, Behind
- -1017.72, -3490.92, 62.62, 4.34
- },
- { // Left, Mid
- -1015.77, -3497.15, 62.82, 4.34
- },
- { // Right, Mid
- -1019.51, -3495.49, 62.82, 4.34
- },
- { // Left, front
- -1017.25, -3500.85, 62.98, 4.34
- },
- { // Right, Front
- -1020.95, -3499.21, 62.98, 4.34
- }
-};
-
-#define HORDE_COORDS 6
-
-//horde run to where
-#define H_RUNTOX -1016.44
-#define H_RUNTOY -3508.48
-#define H_RUNTOZ 62.96
-
-const uint32 AllianceSoldierId[3] =
-{
- 12938, // 12938 Injured Alliance Soldier
- 12936, // 12936 Badly injured Alliance Soldier
- 12937 // 12937 Critically injured Alliance Soldier
-};
-
-const uint32 HordeSoldierId[3] =
-{
- 12923, //12923 Injured Soldier
- 12924, //12924 Badly injured Soldier
- 12925 //12925 Critically injured Soldier
-};
-
-/*######
-## npc_doctor (handles both Gustaf Vanhowzen and Gregory Victor)
-######*/
-
-struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
-{
- uint64 Playerguid;
-
- uint32 SummonPatient_Timer;
- uint32 SummonPatientCount;
- uint32 PatientDiedCount;
- uint32 PatientSavedCount;
-
- bool Event;
-
- std::list<uint64> Patients;
- std::vector<Location*> Coordinates;
-
- npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset(){}
-
- void BeginEvent(Player* player);
- void PatientDied(Location* Point);
- void PatientSaved(Creature* soldier, Player* player, Location* Point);
- void UpdateAI(const uint32 diff);
-
- void Aggro(Unit* who){}
-};
-
-/*#####
-## npc_injured_patient (handles all the patients, no matter Horde or Alliance)
-#####*/
-
-struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
-{
- npc_injured_patientAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 Doctorguid;
-
- Location* Coord;
-
- void Reset()
- {
- Doctorguid = 0;
-
- Coord = NULL;
- //no select
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //no regen health
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //to make them lay with face down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
-
- uint32 mobId = m_creature->GetEntry();
-
- switch (mobId)
- { //lower max health
- case 12923:
- case 12938: //Injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75));
- break;
- case 12924:
- case 12936: //Badly injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50));
- break;
- case 12925:
- case 12937: //Critically injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25));
- break;
- }
- }
-
- void Aggro(Unit* who){}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
- {
- if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
- {
- if(Doctorguid)
- {
- Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
- if(Doctor)
- ((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
- }
- }
- //make not selectable
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //regen health
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //stand up
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
- DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL);
-
- uint32 mobId = m_creature->GetEntry();
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- switch (mobId)
- {
- case 12923:
- case 12924:
- case 12925:
- m_creature->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);
- break;
- }
- }
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (m_creature->isAlive() && m_creature->GetHealth() > 6)
- { //lower HP on every world tick makes it a useful counter, not officlone though
- m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
- }
-
- if (m_creature->isAlive() && m_creature->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);
-
- if(Doctorguid)
- {
- Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
- if(Doctor)
- ((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_injured_patient(Creature *_Creature)
-{
- return new npc_injured_patientAI (_Creature);
-}
-
-/*
-npc_doctor (continue)
-*/
-
-void npc_doctorAI::BeginEvent(Player* player)
-{
- Playerguid = player->GetGUID();
-
- SummonPatient_Timer = 10000;
- SummonPatientCount = 0;
- PatientDiedCount = 0;
- PatientSavedCount = 0;
-
- switch(m_creature->GetEntry())
- {
- case DOCTOR_ALLIANCE:
- for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
- Coordinates.push_back(&AllianceCoords[i]);
- break;
-
- case DOCTOR_HORDE:
- for(uint8 i = 0; i < HORDE_COORDS; ++i)
- Coordinates.push_back(&HordeCoords[i]);
- break;
- }
-
- Event = true;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-}
-
-void npc_doctorAI::PatientDied(Location* Point)
-{
- Player* player = ((Player*)Unit::GetUnit((*m_creature), Playerguid));
- if(player && ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)))
- {
- PatientDiedCount++;
- if (PatientDiedCount > 5 && Event)
- {
- if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(6624);
- else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(6622);
-
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- Coordinates.push_back(Point);
- }
-}
-
-void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
-{
- if(player && Playerguid == player->GetGUID())
- {
- if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
- {
- PatientSavedCount++;
- if(PatientSavedCount == 15)
- {
- if(!Patients.empty())
- {
- std::list<uint64>::iterator itr;
- for(itr = Patients.begin(); itr != Patients.end(); ++itr)
- {
- Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr));
- if( Patient )
- Patient->setDeathState(JUST_DIED);
- }
- }
-
- if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(6624);
- else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(6622);
-
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- Coordinates.push_back(Point);
- }
- }
-}
-
-void npc_doctorAI::UpdateAI(const uint32 diff)
-{
- if(Event && SummonPatientCount >= 20)
- {
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- if(Event)
- if(SummonPatient_Timer < diff)
- {
- Creature* Patient = NULL;
- Location* Point = NULL;
-
- if(Coordinates.empty())
- return;
-
- std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
- uint32 patientEntry = 0;
-
- switch(m_creature->GetEntry())
- {
- case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
- case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
- default:
- error_log("SD2: Invalid entry for Triage doctor. Please check your database");
- return;
- }
-
- Point = *itr;
-
- Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
-
- if(Patient)
- {
- Patients.push_back(Patient->GetGUID());
- ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
- if(Point)
- ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
- Coordinates.erase(itr);
- }
- SummonPatient_Timer = 10000;
- SummonPatientCount++;
- }else SummonPatient_Timer -= diff;
-}
-
-bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
-{
- if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
- ((npc_doctorAI*)creature->AI())->BeginEvent(player);
-
- return true;
-}
-
-CreatureAI* GetAI_npc_doctor(Creature *_Creature)
-{
- return new npc_doctorAI (_Creature);
-}
-
-/*######
-## npc_guardian
-######*/
-
-#define SPELL_DEATHTOUCH 5
-#define SAY_AGGRO "This area is closed!"
-
-struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
-{
- npc_guardianAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (m_creature->isAttackReady())
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_DEATHTOUCH, true);
- m_creature->resetAttackTimer();
- }
- }
-};
-
-CreatureAI* GetAI_npc_guardian(Creature *_Creature)
-{
- return new npc_guardianAI (_Creature);
-}
-
-/*######
-## npc_mount_vendor
-######*/
-
-bool GossipHello_npc_mount_vendor(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- bool canBuy;
- canBuy = false;
- uint32 vendor = _Creature->GetEntry();
- uint8 race = player->getRace();
-
- switch (vendor)
- {
- case 384: //Katie Hunter
- case 1460: //Unger Statforth
- case 2357: //Merideth Carlson
- case 4885: //Gregor MacVince
- if (player->GetReputationRank(72) != REP_EXALTED && race != RACE_HUMAN)
- player->SEND_GOSSIP_MENU(5855, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 1261: //Veron Amberstill
- if (player->GetReputationRank(47) != REP_EXALTED && race != RACE_DWARF)
- player->SEND_GOSSIP_MENU(5856, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 3362: //Ogunaro Wolfrunner
- if (player->GetReputationRank(76) != REP_EXALTED && race != RACE_ORC)
- player->SEND_GOSSIP_MENU(5841, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 3685: //Harb Clawhoof
- if (player->GetReputationRank(81) != REP_EXALTED && race != RACE_TAUREN)
- player->SEND_GOSSIP_MENU(5843, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 4730: //Lelanai
- if (player->GetReputationRank(69) != REP_EXALTED && race != RACE_NIGHTELF)
- player->SEND_GOSSIP_MENU(5844, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 4731: //Zachariah Post
- if (player->GetReputationRank(68) != REP_EXALTED && race != RACE_UNDEAD_PLAYER)
- player->SEND_GOSSIP_MENU(5840, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 7952: //Zjolnir
- if (player->GetReputationRank(530) != REP_EXALTED && race != RACE_TROLL)
- player->SEND_GOSSIP_MENU(5842, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 7955: //Milli Featherwhistle
- if (player->GetReputationRank(54) != REP_EXALTED && race != RACE_GNOME)
- player->SEND_GOSSIP_MENU(5857, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 16264: //Winaestra
- if (player->GetReputationRank(911) != REP_EXALTED && race != RACE_BLOODELF)
- player->SEND_GOSSIP_MENU(10305, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 17584: //Torallius the Pack Handler
- if (player->GetReputationRank(930) != REP_EXALTED && race != RACE_DRAENEI)
- player->SEND_GOSSIP_MENU(10239, _Creature->GetGUID());
- else canBuy = true;
- break;
- }
-
- if (canBuy)
- {
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM( 1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- }
- return true;
-}
-
-bool GossipSelect_npc_mount_vendor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-## npc_rogue_trainer
-######*/
-
-bool GossipHello_npc_rogue_trainer(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isTrainer() )
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- if( _Creature->isCanTrainingAndResetTalentsOf(player) )
- player->ADD_GOSSIP_ITEM(2, "I wish to unlearn my talents", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
-
- if( player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126,1) && !player->GetQuestRewardStatus(6681) )
- {
- player->ADD_GOSSIP_ITEM(0, "<Take the letter>", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(5996, _Creature->GetGUID());
- } else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_rogue_trainer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch( action )
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,21100,false);
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_OPTION_UNLEARNTALENTS:
- player->CLOSE_GOSSIP_MENU();
- player->SendTalentWipeConfirm( _Creature->GetGUID() );
- break;
- }
- return true;
-}
-
-/*######
-## npc_sayge
-######*/
-
-#define SPELL_DMG 23768 //dmg
-#define SPELL_RES 23769 //res
-#define SPELL_ARM 23767 //arm
-#define SPELL_SPI 23738 //spi
-#define SPELL_INT 23766 //int
-#define SPELL_STM 23737 //stm
-#define SPELL_STR 23735 //str
-#define SPELL_AGI 23736 //agi
-#define SPELL_FORTUNE 23765 //faire fortune
-
-bool GossipHello_npc_sayge(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->HasSpellCooldown(SPELL_INT) ||
- player->HasSpellCooldown(SPELL_ARM) ||
- player->HasSpellCooldown(SPELL_DMG) ||
- player->HasSpellCooldown(SPELL_RES) ||
- player->HasSpellCooldown(SPELL_STR) ||
- player->HasSpellCooldown(SPELL_AGI) ||
- player->HasSpellCooldown(SPELL_STM) ||
- player->HasSpellCooldown(SPELL_SPI) )
- player->SEND_GOSSIP_MENU(7393, _Creature->GetGUID());
- else
- {
- player->ADD_GOSSIP_ITEM(0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(7339, _Creature->GetGUID());
- }
-
- return true;
-}
-
-void SendAction_npc_sayge(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "Slay the Man", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(0, "Turn him over to liege", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->ADD_GOSSIP_ITEM(0, "Confiscate the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->ADD_GOSSIP_ITEM(0, "Let him go and have the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(7340, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Execute your friend painfully", GOSSIP_SENDER_MAIN+1, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Execute your friend painlessly", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Let your friend go", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7341, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "Confront the diplomat", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Show not so quiet defiance", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Remain quiet", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7361, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Speak against your brother openly", GOSSIP_SENDER_MAIN+6, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Help your brother in", GOSSIP_SENDER_MAIN+7, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Keep your brother out without letting him know", GOSSIP_SENDER_MAIN+8, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7362, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "Take credit, keep gold", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Take credit, share the gold", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Let the knight take credit", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7363, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(0, "Thanks", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(7364, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- _Creature->CastSpell(player, SPELL_FORTUNE, false);
- player->SEND_GOSSIP_MENU(7365, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_npc_sayge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN:
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+1:
- _Creature->CastSpell(player, SPELL_DMG, false);
- player->AddSpellCooldown(SPELL_DMG,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+2:
- _Creature->CastSpell(player, SPELL_RES, false);
- player->AddSpellCooldown(SPELL_RES,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+3:
- _Creature->CastSpell(player, SPELL_ARM, false);
- player->AddSpellCooldown(SPELL_ARM,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+4:
- _Creature->CastSpell(player, SPELL_SPI, false);
- player->AddSpellCooldown(SPELL_SPI,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+5:
- _Creature->CastSpell(player, SPELL_INT, false);
- player->AddSpellCooldown(SPELL_INT,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+6:
- _Creature->CastSpell(player, SPELL_STM, false);
- player->AddSpellCooldown(SPELL_STM,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+7:
- _Creature->CastSpell(player, SPELL_STR, false);
- player->AddSpellCooldown(SPELL_STR,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+8:
- _Creature->CastSpell(player, SPELL_AGI, false);
- player->AddSpellCooldown(SPELL_AGI,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- }
- return true;
-}
-
-void AddSC_npcs_special()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_chicken_cluck";
- newscript->GetAI = GetAI_npc_chicken_cluck;
- newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
- newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
- newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_dancing_flames";
- newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_injured_patient";
- newscript->GetAI = GetAI_npc_injured_patient;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_doctor";
- newscript->GetAI = GetAI_npc_doctor;
- newscript->pQuestAccept = &QuestAccept_npc_doctor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_guardian";
- newscript->GetAI = GetAI_npc_guardian;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_mount_vendor";
- newscript->pGossipHello = &GossipHello_npc_mount_vendor;
- newscript->pGossipSelect = &GossipSelect_npc_mount_vendor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_rogue_trainer";
- newscript->pGossipHello = &GossipHello_npc_rogue_trainer;
- newscript->pGossipSelect = &GossipSelect_npc_rogue_trainer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_sayge";
- newscript->pGossipHello = &GossipHello_npc_sayge;
- newscript->pGossipSelect = &GossipSelect_npc_sayge;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npcs_Special
+SD%Complete: 100
+SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage)
+SDCategory: NPCs
+EndScriptData
+*/
+
+/* ContentData
+npc_chicken_cluck 100% support for quest 3861 (Cluck!)
+npc_dancing_flames 100% midsummer event NPC
+npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
+npc_injured_patient 100% patients for triage-quests (6622 and 6624)
+npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
+npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
+npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
+npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
+EndContentData */
+
+#include "precompiled.h"
+
+/*########
+# npc_chicken_cluck
+#########*/
+
+#define QUEST_CLUCK 3861
+#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?"
+#define EMOTE_H_HELLO "looks at you unexpectadly."
+#define CLUCK_TEXT2 "starts pecking at the feed."
+#define FACTION_FRIENDLY 84
+#define FACTION_CHICKEN 31
+
+struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
+{
+ npc_chicken_cluckAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ResetFlagTimer;
+
+ void Reset()
+ {
+ ResetFlagTimer = 120000;
+
+ m_creature->setFaction(FACTION_CHICKEN);
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ }
+
+ void Aggro(Unit *who) {}
+
+ 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(ResetFlagTimer < diff)
+ EnterEvadeMode();
+ else ResetFlagTimer -= diff;
+ }
+
+ if(m_creature->SelectHostilTarget() && m_creature->getVictim())
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
+{
+ return new npc_chicken_cluckAI(_Creature);
+}
+
+bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
+{
+ if( emote == TEXTEMOTE_CHICKEN )
+ {
+ if( player->GetTeam() == ALLIANCE )
+ {
+ if( rand()%30 == 1 )
+ {
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->setFaction(FACTION_FRIENDLY);
+ _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0);
+ }
+ }
+ } else
+ _Creature->MonsterTextEmote(EMOTE_H_HELLO,0);
+ }
+ if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->setFaction(FACTION_FRIENDLY);
+ _Creature->MonsterTextEmote(CLUCK_TEXT2, 0);
+ }
+
+ return true;
+}
+
+bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
+{
+ if(_Quest->GetQuestId() == QUEST_CLUCK)
+ ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
+
+ return true;
+}
+
+bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest)
+{
+ if(_Quest->GetQuestId() == QUEST_CLUCK)
+ ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
+
+ return true;
+}
+
+/*######
+## npc_dancing_flames
+######*/
+
+bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *_Creature, uint32 emote )
+{
+ if( emote == TEXTEMOTE_DANCE )
+ _Creature->CastSpell(player,47057,false);
+
+ return true;
+}
+
+/*######
+## Triage quest
+######*/
+
+#define SAY_DOC1 "I'm saved! Thank you, doctor!"
+#define SAY_DOC2 "HOORAY! I AM SAVED!"
+#define SAY_DOC3 "Sweet, sweet embrace... take me..."
+
+struct Location
+{
+ float x, y, z, o;
+};
+
+#define DOCTOR_ALLIANCE 12939
+
+static Location AllianceCoords[]=
+{
+ { // Top-far-right bunk as seen from entrance
+ -3757.38, -4533.05, 14.16, 3.62
+ },
+ { // Top-far-left bunk
+ -3754.36, -4539.13, 14.16, 5.13
+ },
+ { // Far-right bunk
+ -3749.54, -4540.25, 14.28, 3.34
+ },
+ { // Right bunk near entrance
+ -3742.10, -4536.85, 14.28, 3.64
+ },
+ { // Far-left bunk
+ -3755.89, -4529.07, 14.05, 0.57
+ },
+ { // Mid-left bunk
+ -3749.51, -4527.08, 14.07, 5.26
+ },
+ { // Left bunk near entrance
+ -3746.37, -4525.35, 14.16, 5.22
+ },
+};
+
+#define ALLIANCE_COORDS 7
+
+//alliance run to where
+#define A_RUNTOX -3742.96
+#define A_RUNTOY -4531.52
+#define A_RUNTOZ 11.91
+
+#define DOCTOR_HORDE 12920
+
+static Location HordeCoords[]=
+{
+ { // Left, Behind
+ -1013.75, -3492.59, 62.62, 4.34
+ },
+ { // Right, Behind
+ -1017.72, -3490.92, 62.62, 4.34
+ },
+ { // Left, Mid
+ -1015.77, -3497.15, 62.82, 4.34
+ },
+ { // Right, Mid
+ -1019.51, -3495.49, 62.82, 4.34
+ },
+ { // Left, front
+ -1017.25, -3500.85, 62.98, 4.34
+ },
+ { // Right, Front
+ -1020.95, -3499.21, 62.98, 4.34
+ }
+};
+
+#define HORDE_COORDS 6
+
+//horde run to where
+#define H_RUNTOX -1016.44
+#define H_RUNTOY -3508.48
+#define H_RUNTOZ 62.96
+
+const uint32 AllianceSoldierId[3] =
+{
+ 12938, // 12938 Injured Alliance Soldier
+ 12936, // 12936 Badly injured Alliance Soldier
+ 12937 // 12937 Critically injured Alliance Soldier
+};
+
+const uint32 HordeSoldierId[3] =
+{
+ 12923, //12923 Injured Soldier
+ 12924, //12924 Badly injured Soldier
+ 12925 //12925 Critically injured Soldier
+};
+
+/*######
+## npc_doctor (handles both Gustaf Vanhowzen and Gregory Victor)
+######*/
+
+struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
+{
+ uint64 Playerguid;
+
+ uint32 SummonPatient_Timer;
+ uint32 SummonPatientCount;
+ uint32 PatientDiedCount;
+ uint32 PatientSavedCount;
+
+ bool Event;
+
+ std::list<uint64> Patients;
+ std::vector<Location*> Coordinates;
+
+ npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset(){}
+
+ void BeginEvent(Player* player);
+ void PatientDied(Location* Point);
+ void PatientSaved(Creature* soldier, Player* player, Location* Point);
+ void UpdateAI(const uint32 diff);
+
+ void Aggro(Unit* who){}
+};
+
+/*#####
+## npc_injured_patient (handles all the patients, no matter Horde or Alliance)
+#####*/
+
+struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
+{
+ npc_injured_patientAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 Doctorguid;
+
+ Location* Coord;
+
+ void Reset()
+ {
+ Doctorguid = 0;
+
+ Coord = NULL;
+ //no select
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //no regen health
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //to make them lay with face down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+
+ uint32 mobId = m_creature->GetEntry();
+
+ switch (mobId)
+ { //lower max health
+ case 12923:
+ case 12938: //Injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75));
+ break;
+ case 12924:
+ case 12936: //Badly injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50));
+ break;
+ case 12925:
+ case 12937: //Critically injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25));
+ break;
+ }
+ }
+
+ void Aggro(Unit* who){}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
+ {
+ if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ {
+ if(Doctorguid)
+ {
+ Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
+ if(Doctor)
+ ((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
+ }
+ }
+ //make not selectable
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //regen health
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //stand up
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL);
+
+ uint32 mobId = m_creature->GetEntry();
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ switch (mobId)
+ {
+ case 12923:
+ case 12924:
+ case 12925:
+ m_creature->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);
+ break;
+ }
+ }
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (m_creature->isAlive() && m_creature->GetHealth() > 6)
+ { //lower HP on every world tick makes it a useful counter, not officlone though
+ m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
+ }
+
+ if (m_creature->isAlive() && m_creature->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);
+
+ if(Doctorguid)
+ {
+ Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
+ if(Doctor)
+ ((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_injured_patient(Creature *_Creature)
+{
+ return new npc_injured_patientAI (_Creature);
+}
+
+/*
+npc_doctor (continue)
+*/
+
+void npc_doctorAI::BeginEvent(Player* player)
+{
+ Playerguid = player->GetGUID();
+
+ SummonPatient_Timer = 10000;
+ SummonPatientCount = 0;
+ PatientDiedCount = 0;
+ PatientSavedCount = 0;
+
+ switch(m_creature->GetEntry())
+ {
+ case DOCTOR_ALLIANCE:
+ for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
+ Coordinates.push_back(&AllianceCoords[i]);
+ break;
+
+ case DOCTOR_HORDE:
+ for(uint8 i = 0; i < HORDE_COORDS; ++i)
+ Coordinates.push_back(&HordeCoords[i]);
+ break;
+ }
+
+ Event = true;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+}
+
+void npc_doctorAI::PatientDied(Location* Point)
+{
+ Player* player = ((Player*)Unit::GetUnit((*m_creature), Playerguid));
+ if(player && ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)))
+ {
+ PatientDiedCount++;
+ if (PatientDiedCount > 5 && Event)
+ {
+ if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
+ player->FailQuest(6624);
+ else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
+ player->FailQuest(6622);
+
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ Coordinates.push_back(Point);
+ }
+}
+
+void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
+{
+ if(player && Playerguid == player->GetGUID())
+ {
+ if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ {
+ PatientSavedCount++;
+ if(PatientSavedCount == 15)
+ {
+ if(!Patients.empty())
+ {
+ std::list<uint64>::iterator itr;
+ for(itr = Patients.begin(); itr != Patients.end(); ++itr)
+ {
+ Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr));
+ if( Patient )
+ Patient->setDeathState(JUST_DIED);
+ }
+ }
+
+ if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(6624);
+ else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(6622);
+
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ Coordinates.push_back(Point);
+ }
+ }
+}
+
+void npc_doctorAI::UpdateAI(const uint32 diff)
+{
+ if(Event && SummonPatientCount >= 20)
+ {
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ if(Event)
+ if(SummonPatient_Timer < diff)
+ {
+ Creature* Patient = NULL;
+ Location* Point = NULL;
+
+ if(Coordinates.empty())
+ return;
+
+ std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
+ uint32 patientEntry = 0;
+
+ switch(m_creature->GetEntry())
+ {
+ case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
+ case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
+ default:
+ error_log("SD2: Invalid entry for Triage doctor. Please check your database");
+ return;
+ }
+
+ Point = *itr;
+
+ Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+
+ if(Patient)
+ {
+ Patients.push_back(Patient->GetGUID());
+ ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
+ if(Point)
+ ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
+ Coordinates.erase(itr);
+ }
+ SummonPatient_Timer = 10000;
+ SummonPatientCount++;
+ }else SummonPatient_Timer -= diff;
+}
+
+bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
+{
+ if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
+ ((npc_doctorAI*)creature->AI())->BeginEvent(player);
+
+ return true;
+}
+
+CreatureAI* GetAI_npc_doctor(Creature *_Creature)
+{
+ return new npc_doctorAI (_Creature);
+}
+
+/*######
+## npc_guardian
+######*/
+
+#define SPELL_DEATHTOUCH 5
+#define SAY_AGGRO "This area is closed!"
+
+struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
+{
+ npc_guardianAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (m_creature->isAttackReady())
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_DEATHTOUCH, true);
+ m_creature->resetAttackTimer();
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_guardian(Creature *_Creature)
+{
+ return new npc_guardianAI (_Creature);
+}
+
+/*######
+## npc_mount_vendor
+######*/
+
+bool GossipHello_npc_mount_vendor(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ bool canBuy;
+ canBuy = false;
+ uint32 vendor = _Creature->GetEntry();
+ uint8 race = player->getRace();
+
+ switch (vendor)
+ {
+ case 384: //Katie Hunter
+ case 1460: //Unger Statforth
+ case 2357: //Merideth Carlson
+ case 4885: //Gregor MacVince
+ if (player->GetReputationRank(72) != REP_EXALTED && race != RACE_HUMAN)
+ player->SEND_GOSSIP_MENU(5855, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 1261: //Veron Amberstill
+ if (player->GetReputationRank(47) != REP_EXALTED && race != RACE_DWARF)
+ player->SEND_GOSSIP_MENU(5856, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 3362: //Ogunaro Wolfrunner
+ if (player->GetReputationRank(76) != REP_EXALTED && race != RACE_ORC)
+ player->SEND_GOSSIP_MENU(5841, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 3685: //Harb Clawhoof
+ if (player->GetReputationRank(81) != REP_EXALTED && race != RACE_TAUREN)
+ player->SEND_GOSSIP_MENU(5843, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 4730: //Lelanai
+ if (player->GetReputationRank(69) != REP_EXALTED && race != RACE_NIGHTELF)
+ player->SEND_GOSSIP_MENU(5844, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 4731: //Zachariah Post
+ if (player->GetReputationRank(68) != REP_EXALTED && race != RACE_UNDEAD_PLAYER)
+ player->SEND_GOSSIP_MENU(5840, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 7952: //Zjolnir
+ if (player->GetReputationRank(530) != REP_EXALTED && race != RACE_TROLL)
+ player->SEND_GOSSIP_MENU(5842, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 7955: //Milli Featherwhistle
+ if (player->GetReputationRank(54) != REP_EXALTED && race != RACE_GNOME)
+ player->SEND_GOSSIP_MENU(5857, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 16264: //Winaestra
+ if (player->GetReputationRank(911) != REP_EXALTED && race != RACE_BLOODELF)
+ player->SEND_GOSSIP_MENU(10305, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 17584: //Torallius the Pack Handler
+ if (player->GetReputationRank(930) != REP_EXALTED && race != RACE_DRAENEI)
+ player->SEND_GOSSIP_MENU(10239, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ }
+
+ if (canBuy)
+ {
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM( 1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ }
+ return true;
+}
+
+bool GossipSelect_npc_mount_vendor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+## npc_rogue_trainer
+######*/
+
+bool GossipHello_npc_rogue_trainer(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isTrainer() )
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ if( _Creature->isCanTrainingAndResetTalentsOf(player) )
+ player->ADD_GOSSIP_ITEM(2, "I wish to unlearn my talents", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
+
+ if( player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126,1) && !player->GetQuestRewardStatus(6681) )
+ {
+ player->ADD_GOSSIP_ITEM(0, "<Take the letter>", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(5996, _Creature->GetGUID());
+ } else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_rogue_trainer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch( action )
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,21100,false);
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_OPTION_UNLEARNTALENTS:
+ player->CLOSE_GOSSIP_MENU();
+ player->SendTalentWipeConfirm( _Creature->GetGUID() );
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_sayge
+######*/
+
+#define SPELL_DMG 23768 //dmg
+#define SPELL_RES 23769 //res
+#define SPELL_ARM 23767 //arm
+#define SPELL_SPI 23738 //spi
+#define SPELL_INT 23766 //int
+#define SPELL_STM 23737 //stm
+#define SPELL_STR 23735 //str
+#define SPELL_AGI 23736 //agi
+#define SPELL_FORTUNE 23765 //faire fortune
+
+bool GossipHello_npc_sayge(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->HasSpellCooldown(SPELL_INT) ||
+ player->HasSpellCooldown(SPELL_ARM) ||
+ player->HasSpellCooldown(SPELL_DMG) ||
+ player->HasSpellCooldown(SPELL_RES) ||
+ player->HasSpellCooldown(SPELL_STR) ||
+ player->HasSpellCooldown(SPELL_AGI) ||
+ player->HasSpellCooldown(SPELL_STM) ||
+ player->HasSpellCooldown(SPELL_SPI) )
+ player->SEND_GOSSIP_MENU(7393, _Creature->GetGUID());
+ else
+ {
+ player->ADD_GOSSIP_ITEM(0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(7339, _Creature->GetGUID());
+ }
+
+ return true;
+}
+
+void SendAction_npc_sayge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "Slay the Man", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, "Turn him over to liege", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->ADD_GOSSIP_ITEM(0, "Confiscate the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->ADD_GOSSIP_ITEM(0, "Let him go and have the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(7340, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Execute your friend painfully", GOSSIP_SENDER_MAIN+1, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Execute your friend painlessly", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Let your friend go", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7341, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "Confront the diplomat", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Show not so quiet defiance", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Remain quiet", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7361, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Speak against your brother openly", GOSSIP_SENDER_MAIN+6, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Help your brother in", GOSSIP_SENDER_MAIN+7, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Keep your brother out without letting him know", GOSSIP_SENDER_MAIN+8, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7362, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "Take credit, keep gold", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Take credit, share the gold", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Let the knight take credit", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7363, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM(0, "Thanks", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(7364, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ _Creature->CastSpell(player, SPELL_FORTUNE, false);
+ player->SEND_GOSSIP_MENU(7365, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_npc_sayge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN:
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+1:
+ _Creature->CastSpell(player, SPELL_DMG, false);
+ player->AddSpellCooldown(SPELL_DMG,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+2:
+ _Creature->CastSpell(player, SPELL_RES, false);
+ player->AddSpellCooldown(SPELL_RES,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+3:
+ _Creature->CastSpell(player, SPELL_ARM, false);
+ player->AddSpellCooldown(SPELL_ARM,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+4:
+ _Creature->CastSpell(player, SPELL_SPI, false);
+ player->AddSpellCooldown(SPELL_SPI,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+5:
+ _Creature->CastSpell(player, SPELL_INT, false);
+ player->AddSpellCooldown(SPELL_INT,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+6:
+ _Creature->CastSpell(player, SPELL_STM, false);
+ player->AddSpellCooldown(SPELL_STM,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+7:
+ _Creature->CastSpell(player, SPELL_STR, false);
+ player->AddSpellCooldown(SPELL_STR,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+8:
+ _Creature->CastSpell(player, SPELL_AGI, false);
+ player->AddSpellCooldown(SPELL_AGI,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ }
+ return true;
+}
+
+void AddSC_npcs_special()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_chicken_cluck";
+ newscript->GetAI = GetAI_npc_chicken_cluck;
+ newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
+ newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
+ newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_dancing_flames";
+ newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_injured_patient";
+ newscript->GetAI = GetAI_npc_injured_patient;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_doctor";
+ newscript->GetAI = GetAI_npc_doctor;
+ newscript->pQuestAccept = &QuestAccept_npc_doctor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_guardian";
+ newscript->GetAI = GetAI_npc_guardian;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_mount_vendor";
+ newscript->pGossipHello = &GossipHello_npc_mount_vendor;
+ newscript->pGossipSelect = &GossipSelect_npc_mount_vendor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_rogue_trainer";
+ newscript->pGossipHello = &GossipHello_npc_rogue_trainer;
+ newscript->pGossipSelect = &GossipSelect_npc_rogue_trainer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_sayge";
+ newscript->pGossipHello = &GossipHello_npc_sayge;
+ newscript->pGossipSelect = &GossipSelect_npc_sayge;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
index 0577c1ddbdf..98597afae3a 100644
--- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
@@ -1,62 +1,62 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Alterac_Mountains
-SD%Complete: 100
-SDComment: Quest support: 6681
-SDCategory: Alterac Mountains
-EndScriptData */
-
-/* ContentData
-npc_ravenholdt
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_ravenholdt
-######*/
-
-struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
-{
- npc_ravenholdtAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- void Reset() { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( who->GetTypeId() == TYPEID_PLAYER )
- if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
- ((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
- }
-
- void Aggro(Unit* who) { }
-};
-CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature)
-{
- return new npc_ravenholdtAI (_Creature);
-}
-
-void AddSC_alterac_mountains()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_ravenholdt";
- newscript->GetAI = GetAI_npc_ravenholdt;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Alterac_Mountains
+SD%Complete: 100
+SDComment: Quest support: 6681
+SDCategory: Alterac Mountains
+EndScriptData */
+
+/* ContentData
+npc_ravenholdt
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_ravenholdt
+######*/
+
+struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
+{
+ npc_ravenholdtAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( who->GetTypeId() == TYPEID_PLAYER )
+ if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
+ ((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
+ }
+
+ void Aggro(Unit* who) { }
+};
+CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature)
+{
+ return new npc_ravenholdtAI (_Creature);
+}
+
+void AddSC_alterac_mountains()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_ravenholdt";
+ newscript->GetAI = GetAI_npc_ravenholdt;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
index 782e89ce9d9..6be5a32ef2b 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
@@ -1,403 +1,403 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Exarch_Maladaar
-SD%Complete: 95
-SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player.
-SDCategory: Auchindoun, Auchenai Crypts
-EndScriptData */
-
-/* ContentData
-mob_stolen_soul
-boss_exarch_maladaar
-mob_avatar_of_martyred
-EndContentData */
-
-#include "precompiled.h"
-
-#define SPELL_MOONFIRE 37328
-#define SPELL_FIREBALL 37329
-#define SPELL_MIND_FLAY 37330
-#define SPELL_HEMORRHAGE 37331
-#define SPELL_FROSTSHOCK 37332
-#define SPELL_CURSE_OF_AGONY 37334
-#define SPELL_MORTAL_STRIKE 37335
-#define SPELL_FREEZING_TRAP 37368
-#define SPELL_HAMMER_OF_JUSTICE 37369
-
-struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI
-{
- mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint8 myClass;
- uint32 Class_Timer;
-
- void Reset()
- {
- Class_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- { }
-
- void SetMyClass(uint8 myclass)
- {
- myClass = myclass;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Class_Timer < diff )
- {
- switch( myClass )
- {
- case CLASS_WARRIOR:
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- Class_Timer = 6000;
- break;
- case CLASS_PALADIN:
- DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
- Class_Timer = 6000;
- break;
- case CLASS_HUNTER:
- DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
- Class_Timer = 20000;
- break;
- case CLASS_ROGUE:
- DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
- Class_Timer = 10000;
- break;
- case CLASS_PRIEST:
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
- Class_Timer = 5000;
- break;
- case CLASS_SHAMAN:
- DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK);
- Class_Timer = 8000;
- break;
- case CLASS_MAGE:
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
- Class_Timer = 5000;
- break;
- case CLASS_WARLOCK:
- DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY);
- Class_Timer = 20000;
- break;
- case CLASS_DRUID:
- DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
- Class_Timer = 10000;
- break;
- }
- }else Class_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_stolen_soul(Creature *_Creature)
-{
- return new mob_stolen_soulAI (_Creature);
-}
-
-#define SAY_INTRO "You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them."
-#define SOUND_INTRO 10509
-#define SAY_SUMMON "Rise my fallen brothers. Take form and fight!"
-#define SOUND_SUMMON 10512
-
-#define SAY_AGGRO_1 "You will pay with your life!"
-#define SOUND_AGGRO_1 10513
-#define SAY_AGGRO_2 "There's no turning back now!"
-#define SOUND_AGGRO_2 10514
-#define SAY_AGGRO_3 "Serve your penitence!"
-#define SOUND_AGGRO_3 10515
-
-#define SAY_ROAR "Let your mind be clouded."
-#define SOUND_ROAR 10510
-#define SAY_SOUL_CLEAVE "Stare into the darkness of your soul."
-#define SOUND_SOUL_CLEAVE 10511
-
-#define SAY_SLAY_1 "These walls will be your doom."
-#define SOUND_SLAY_1 10516
-#define SAY_SLAY_2 "<laugh> Now, you'll stay for eternity!"
-#define SOUND_SLAY_2 10517
-
-#define SAY_DEATH "This is... where.. I belong..."
-#define SOUND_DEATH 10518
-
-#define SPELL_RIBBON_OF_SOULS 32422
-#define SPELL_SOUL_SCREAM 32421
-
-#define SPELL_STOLEN_SOUL 32346
-#define SPELL_STOLEN_SOUL_VISUAL 32395
-
-#define SPELL_SUMMON_AVATAR 32424
-
-#define ENTRY_STOLEN_SOUL 18441
-
-struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
-{
- boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 soulmodel;
- uint64 soulholder;
- uint8 soulclass;
-
- uint32 Fear_timer;
- uint32 Ribbon_of_Souls_timer;
- uint32 StolenSoul_Timer;
-
- bool HasTaunted;
- bool Avatar_summoned;
-
- void Reset()
- {
- soulmodel = 0;
- soulholder = 0;
- soulclass = 0;
-
- Fear_timer = 20000;
- Ribbon_of_Souls_timer = 5000;
- StolenSoul_Timer = 30000;
-
- HasTaunted = false;
- Avatar_summoned = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if( !HasTaunted && m_creature->IsWithinDistInMap(who, 150.0) )
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- HasTaunted = true;
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_STOLEN_SOUL )
- {
- //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
- summoned->SetDisplayId(soulmodel);
- summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
-
- if( Unit *target = Unit::GetUnit(*m_creature,soulholder) )
- summoned->AI()->AttackStart(target);
-
- ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- //When Exarch Maladar is defeated D'ore appear.
- DoSpawnCreature(19412,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN, 600000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( !Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25) )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- DoCast(m_creature, SPELL_SUMMON_AVATAR);
- Avatar_summoned = true;
- StolenSoul_Timer = 45000;
- }
-
- if( StolenSoul_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( target->GetTypeId() == TYPEID_PLAYER )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- uint32 i = urand(1,2);
- if( i == 1 )
- {
- DoYell(SAY_ROAR, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_ROAR);
- }
- else
- {
- DoYell(SAY_SOUL_CLEAVE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SOUL_CLEAVE);
- }
-
- soulmodel = target->GetDisplayId();
- soulholder = target->GetGUID();
- soulclass = target->getClass();
-
- DoCast(target,SPELL_STOLEN_SOUL);
- DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
-
- StolenSoul_Timer = 45000;
- } else StolenSoul_Timer = 1000;
- }
- }else StolenSoul_Timer -= diff;
-
- if( Ribbon_of_Souls_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_RIBBON_OF_SOULS);
-
- Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
- }else Ribbon_of_Souls_timer -= diff;
-
- if( Fear_timer < diff )
- {
- DoCast(m_creature,SPELL_SOUL_SCREAM);
- Fear_timer = 25000 + rand()% 10000;
- }else Fear_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature)
-{
- return new boss_exarch_maladaarAI (_Creature);
-}
-
-#define SPELL_MORTAL_STRIKE 16856
-#define SPELL_SUNDER_ARMOR 16145
-
-struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
-{
- mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mortal_Strike_timer;
-
- void Reset()
- {
- Mortal_Strike_timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(Mortal_Strike_timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- Mortal_Strike_timer = 10000 + rand()%20 * 1000;
- }else Mortal_Strike_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_avatar_of_martyred(Creature *_Creature)
-{
- return new mob_avatar_of_martyredAI (_Creature);
-}
-
-void AddSC_boss_exarch_maladaar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_exarch_maladaar";
- newscript->GetAI = GetAI_boss_exarch_maladaar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_avatar_of_martyred";
- newscript->GetAI = GetAI_mob_avatar_of_martyred;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_stolen_soul";
- newscript->GetAI = GetAI_mob_stolen_soul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Exarch_Maladaar
+SD%Complete: 95
+SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player.
+SDCategory: Auchindoun, Auchenai Crypts
+EndScriptData */
+
+/* ContentData
+mob_stolen_soul
+boss_exarch_maladaar
+mob_avatar_of_martyred
+EndContentData */
+
+#include "precompiled.h"
+
+#define SPELL_MOONFIRE 37328
+#define SPELL_FIREBALL 37329
+#define SPELL_MIND_FLAY 37330
+#define SPELL_HEMORRHAGE 37331
+#define SPELL_FROSTSHOCK 37332
+#define SPELL_CURSE_OF_AGONY 37334
+#define SPELL_MORTAL_STRIKE 37335
+#define SPELL_FREEZING_TRAP 37368
+#define SPELL_HAMMER_OF_JUSTICE 37369
+
+struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI
+{
+ mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint8 myClass;
+ uint32 Class_Timer;
+
+ void Reset()
+ {
+ Class_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ { }
+
+ void SetMyClass(uint8 myclass)
+ {
+ myClass = myclass;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Class_Timer < diff )
+ {
+ switch( myClass )
+ {
+ case CLASS_WARRIOR:
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_PALADIN:
+ DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_HUNTER:
+ DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
+ Class_Timer = 20000;
+ break;
+ case CLASS_ROGUE:
+ DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
+ Class_Timer = 10000;
+ break;
+ case CLASS_PRIEST:
+ DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ Class_Timer = 5000;
+ break;
+ case CLASS_SHAMAN:
+ DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK);
+ Class_Timer = 8000;
+ break;
+ case CLASS_MAGE:
+ DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ Class_Timer = 5000;
+ break;
+ case CLASS_WARLOCK:
+ DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY);
+ Class_Timer = 20000;
+ break;
+ case CLASS_DRUID:
+ DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
+ Class_Timer = 10000;
+ break;
+ }
+ }else Class_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_stolen_soul(Creature *_Creature)
+{
+ return new mob_stolen_soulAI (_Creature);
+}
+
+#define SAY_INTRO "You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them."
+#define SOUND_INTRO 10509
+#define SAY_SUMMON "Rise my fallen brothers. Take form and fight!"
+#define SOUND_SUMMON 10512
+
+#define SAY_AGGRO_1 "You will pay with your life!"
+#define SOUND_AGGRO_1 10513
+#define SAY_AGGRO_2 "There's no turning back now!"
+#define SOUND_AGGRO_2 10514
+#define SAY_AGGRO_3 "Serve your penitence!"
+#define SOUND_AGGRO_3 10515
+
+#define SAY_ROAR "Let your mind be clouded."
+#define SOUND_ROAR 10510
+#define SAY_SOUL_CLEAVE "Stare into the darkness of your soul."
+#define SOUND_SOUL_CLEAVE 10511
+
+#define SAY_SLAY_1 "These walls will be your doom."
+#define SOUND_SLAY_1 10516
+#define SAY_SLAY_2 "<laugh> Now, you'll stay for eternity!"
+#define SOUND_SLAY_2 10517
+
+#define SAY_DEATH "This is... where.. I belong..."
+#define SOUND_DEATH 10518
+
+#define SPELL_RIBBON_OF_SOULS 32422
+#define SPELL_SOUL_SCREAM 32421
+
+#define SPELL_STOLEN_SOUL 32346
+#define SPELL_STOLEN_SOUL_VISUAL 32395
+
+#define SPELL_SUMMON_AVATAR 32424
+
+#define ENTRY_STOLEN_SOUL 18441
+
+struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
+{
+ boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 soulmodel;
+ uint64 soulholder;
+ uint8 soulclass;
+
+ uint32 Fear_timer;
+ uint32 Ribbon_of_Souls_timer;
+ uint32 StolenSoul_Timer;
+
+ bool HasTaunted;
+ bool Avatar_summoned;
+
+ void Reset()
+ {
+ soulmodel = 0;
+ soulholder = 0;
+ soulclass = 0;
+
+ Fear_timer = 20000;
+ Ribbon_of_Souls_timer = 5000;
+ StolenSoul_Timer = 30000;
+
+ HasTaunted = false;
+ Avatar_summoned = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if( !HasTaunted && m_creature->IsWithinDistInMap(who, 150.0) )
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ HasTaunted = true;
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_STOLEN_SOUL )
+ {
+ //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
+ summoned->SetDisplayId(soulmodel);
+ summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
+
+ if( Unit *target = Unit::GetUnit(*m_creature,soulholder) )
+ summoned->AI()->AttackStart(target);
+
+ ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ //When Exarch Maladar is defeated D'ore appear.
+ DoSpawnCreature(19412,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( !Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25) )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ DoCast(m_creature, SPELL_SUMMON_AVATAR);
+ Avatar_summoned = true;
+ StolenSoul_Timer = 45000;
+ }
+
+ if( StolenSoul_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( target->GetTypeId() == TYPEID_PLAYER )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ uint32 i = urand(1,2);
+ if( i == 1 )
+ {
+ DoYell(SAY_ROAR, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ROAR);
+ }
+ else
+ {
+ DoYell(SAY_SOUL_CLEAVE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SOUL_CLEAVE);
+ }
+
+ soulmodel = target->GetDisplayId();
+ soulholder = target->GetGUID();
+ soulclass = target->getClass();
+
+ DoCast(target,SPELL_STOLEN_SOUL);
+ DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+
+ StolenSoul_Timer = 45000;
+ } else StolenSoul_Timer = 1000;
+ }
+ }else StolenSoul_Timer -= diff;
+
+ if( Ribbon_of_Souls_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_RIBBON_OF_SOULS);
+
+ Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
+ }else Ribbon_of_Souls_timer -= diff;
+
+ if( Fear_timer < diff )
+ {
+ DoCast(m_creature,SPELL_SOUL_SCREAM);
+ Fear_timer = 25000 + rand()% 10000;
+ }else Fear_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature)
+{
+ return new boss_exarch_maladaarAI (_Creature);
+}
+
+#define SPELL_MORTAL_STRIKE 16856
+#define SPELL_SUNDER_ARMOR 16145
+
+struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
+{
+ mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mortal_Strike_timer;
+
+ void Reset()
+ {
+ Mortal_Strike_timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(Mortal_Strike_timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ Mortal_Strike_timer = 10000 + rand()%20 * 1000;
+ }else Mortal_Strike_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_avatar_of_martyred(Creature *_Creature)
+{
+ return new mob_avatar_of_martyredAI (_Creature);
+}
+
+void AddSC_boss_exarch_maladaar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_exarch_maladaar";
+ newscript->GetAI = GetAI_boss_exarch_maladaar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_avatar_of_martyred";
+ newscript->GetAI = GetAI_mob_avatar_of_martyred;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_stolen_soul";
+ newscript->GetAI = GetAI_mob_stolen_soul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
index 3e4d96f9fc0..71ad1e8ffc2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
@@ -1,313 +1,313 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_NexusPrince_Shaffar
-SD%Complete: 80
-SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro.
-SDCategory: Auchindoun, Mana Tombs
-EndScriptData */
-
-/* ContentData
-boss_nexusprince_shaffar
-mob_ethereal_beacon
-EndContentData */
-
-#include "precompiled.h"
-
-#define SAY_INTRO "What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally."
-#define SOUND_INTRO 10539
-
-#define SAY_AGGRO_1 "We have not yet been properly introduced."
-#define SOUND_AGGRO_1 10541
-#define SAY_AGGRO_2 "An epic battle. How exciting!"
-#define SOUND_AGGRO_2 10542
-#define SAY_AGGRO_3 "I have longed for a good adventure."
-#define SOUND_AGGRO_3 10543
-
-#define SAY_SLAY_1 "It has been... entertaining."
-#define SOUND_SLAY_1 10544
-#define SAY_SLAY_2 "And now we part company."
-#define SOUND_SLAY_2 10545
-
-#define SAY_SUMMON "I have such fascinating things to show you."
-#define SOUND_SUMMON 10540
-
-#define SAY_DEAD "I must bid you... farewell."
-#define SOUND_DEAD 10546
-
-#define SPELL_BLINK 34605
-#define SPELL_FROSTBOLT 32364
-#define SPELL_FIREBALL 32363
-#define SPELL_FROSTNOVA 32365
-
-#define SPELL_ETHEREAL_BEACON 32371 // Summon 18431
-#define SPELL_ETHEREAL_BEACON_VISUAL 32368
-
-#define ENTRY_BEACON 18431
-
-struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
-{
- boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Blink_Timer;
- uint32 Beacon_Timer;
- uint32 FireBall_Timer;
- uint32 Frostbolt_Timer;
- uint32 FrostNova_Timer;
-
- bool HasTaunted;
- bool CanBlink;
-
- void Reset()
- {
- Blink_Timer = 1500;
- Beacon_Timer = 10000;
- FireBall_Timer = 8000;
- Frostbolt_Timer = 4000;
- FrostNova_Timer = 15000;
-
- HasTaunted = false;
- CanBlink = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- HasTaunted = true;
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_BEACON )
- {
- summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
-
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- summoned->AI()->AttackStart(target);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEAD);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( FrostNova_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoCast(m_creature,SPELL_FROSTNOVA);
- FrostNova_Timer = 17500 + rand()%7500;
- CanBlink = true;
- }else FrostNova_Timer -= diff;
-
- if( Frostbolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- Frostbolt_Timer = 4500 + rand()%1500;
- }else Frostbolt_Timer -= diff;
-
- if( FireBall_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALL);
- FireBall_Timer = 4500 + rand()%1500;
- }else FireBall_Timer -= diff;
-
- if( CanBlink )
- {
- if( Blink_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoCast(m_creature,SPELL_BLINK);
- Blink_Timer = 1000 + rand()%1500;
- CanBlink = false;
- }else Blink_Timer -= diff;
- }
-
- if( Beacon_Timer < diff)
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- if( !urand(0,3) )
- {
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
- }
- DoCast(m_creature,SPELL_ETHEREAL_BEACON);
-
- Beacon_Timer = 10000;
- }else Beacon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
-{
- return new boss_nexusprince_shaffarAI (_Creature);
-}
-
-#define SPELL_ARCANE_BOLT 15254
-#define SPELL_ETHEREAL_APPRENTICE 32372 // Summon 18430
-
-struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
-{
- mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- bool HeroicMode;
- bool CanEvade;
- uint32 Apprentice_Timer;
- uint32 ArcaneBolt_Timer;
-
- void Reset()
- {
- if( CanEvade )
- m_creature->SetVisibility(VISIBILITY_OFF);
-
- CanEvade = false;
- Apprentice_Timer = (HeroicMode ? 10000 : 20000);
- ArcaneBolt_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(m_creature->getVictim());
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ArcaneBolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT);
- ArcaneBolt_Timer = 2000 + rand()%2500;
- }else ArcaneBolt_Timer -= diff;
-
- if( Apprentice_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true);
- if( m_creature->GetOwner() )
- ((Pet*)m_creature)->SetDuration(0);
- CanEvade = true;
- }else Apprentice_Timer -= diff;
-
- if( CanEvade )
- EnterEvadeMode();
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_ethereal_beacon(Creature *_Creature)
-{
- return new mob_ethereal_beaconAI (_Creature);
-}
-
-void AddSC_boss_nexusprince_shaffar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_nexusprince_shaffar";
- newscript->GetAI = GetAI_boss_nexusprince_shaffar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ethereal_beacon";
- newscript->GetAI = GetAI_mob_ethereal_beacon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_NexusPrince_Shaffar
+SD%Complete: 80
+SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro.
+SDCategory: Auchindoun, Mana Tombs
+EndScriptData */
+
+/* ContentData
+boss_nexusprince_shaffar
+mob_ethereal_beacon
+EndContentData */
+
+#include "precompiled.h"
+
+#define SAY_INTRO "What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally."
+#define SOUND_INTRO 10539
+
+#define SAY_AGGRO_1 "We have not yet been properly introduced."
+#define SOUND_AGGRO_1 10541
+#define SAY_AGGRO_2 "An epic battle. How exciting!"
+#define SOUND_AGGRO_2 10542
+#define SAY_AGGRO_3 "I have longed for a good adventure."
+#define SOUND_AGGRO_3 10543
+
+#define SAY_SLAY_1 "It has been... entertaining."
+#define SOUND_SLAY_1 10544
+#define SAY_SLAY_2 "And now we part company."
+#define SOUND_SLAY_2 10545
+
+#define SAY_SUMMON "I have such fascinating things to show you."
+#define SOUND_SUMMON 10540
+
+#define SAY_DEAD "I must bid you... farewell."
+#define SOUND_DEAD 10546
+
+#define SPELL_BLINK 34605
+#define SPELL_FROSTBOLT 32364
+#define SPELL_FIREBALL 32363
+#define SPELL_FROSTNOVA 32365
+
+#define SPELL_ETHEREAL_BEACON 32371 // Summon 18431
+#define SPELL_ETHEREAL_BEACON_VISUAL 32368
+
+#define ENTRY_BEACON 18431
+
+struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
+{
+ boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Blink_Timer;
+ uint32 Beacon_Timer;
+ uint32 FireBall_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 FrostNova_Timer;
+
+ bool HasTaunted;
+ bool CanBlink;
+
+ void Reset()
+ {
+ Blink_Timer = 1500;
+ Beacon_Timer = 10000;
+ FireBall_Timer = 8000;
+ Frostbolt_Timer = 4000;
+ FrostNova_Timer = 15000;
+
+ HasTaunted = false;
+ CanBlink = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ HasTaunted = true;
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_BEACON )
+ {
+ summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
+
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ summoned->AI()->AttackStart(target);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEAD);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( FrostNova_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoCast(m_creature,SPELL_FROSTNOVA);
+ FrostNova_Timer = 17500 + rand()%7500;
+ CanBlink = true;
+ }else FrostNova_Timer -= diff;
+
+ if( Frostbolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ Frostbolt_Timer = 4500 + rand()%1500;
+ }else Frostbolt_Timer -= diff;
+
+ if( FireBall_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALL);
+ FireBall_Timer = 4500 + rand()%1500;
+ }else FireBall_Timer -= diff;
+
+ if( CanBlink )
+ {
+ if( Blink_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoCast(m_creature,SPELL_BLINK);
+ Blink_Timer = 1000 + rand()%1500;
+ CanBlink = false;
+ }else Blink_Timer -= diff;
+ }
+
+ if( Beacon_Timer < diff)
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ if( !urand(0,3) )
+ {
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+ }
+ DoCast(m_creature,SPELL_ETHEREAL_BEACON);
+
+ Beacon_Timer = 10000;
+ }else Beacon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
+{
+ return new boss_nexusprince_shaffarAI (_Creature);
+}
+
+#define SPELL_ARCANE_BOLT 15254
+#define SPELL_ETHEREAL_APPRENTICE 32372 // Summon 18430
+
+struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
+{
+ mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ bool CanEvade;
+ uint32 Apprentice_Timer;
+ uint32 ArcaneBolt_Timer;
+
+ void Reset()
+ {
+ if( CanEvade )
+ m_creature->SetVisibility(VISIBILITY_OFF);
+
+ CanEvade = false;
+ Apprentice_Timer = (HeroicMode ? 10000 : 20000);
+ ArcaneBolt_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ArcaneBolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT);
+ ArcaneBolt_Timer = 2000 + rand()%2500;
+ }else ArcaneBolt_Timer -= diff;
+
+ if( Apprentice_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true);
+ if( m_creature->GetOwner() )
+ ((Pet*)m_creature)->SetDuration(0);
+ CanEvade = true;
+ }else Apprentice_Timer -= diff;
+
+ if( CanEvade )
+ EnterEvadeMode();
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_ethereal_beacon(Creature *_Creature)
+{
+ return new mob_ethereal_beaconAI (_Creature);
+}
+
+void AddSC_boss_nexusprince_shaffar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_nexusprince_shaffar";
+ newscript->GetAI = GetAI_boss_nexusprince_shaffar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ethereal_beacon";
+ newscript->GetAI = GetAI_mob_ethereal_beacon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
index bc54a420617..fc245d20222 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
@@ -1,159 +1,159 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Pandemonius
-SD%Complete: 75
-SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged.
-SDCategory: Auchindoun, Mana Tombs
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO_1 "I will feed on your soul."
-#define SOUND_AGGRO_1 10561
-#define SAY_AGGRO_2 "So... full of life!"
-#define SOUND_AGGRO_2 10562
-#define SAY_AGGRO_3 "Do not... resist."
-#define SOUND_AGGRO_3 10563
-
-#define SAY_KILL_1 "Yes! I am... empowered!"
-#define SOUND_KILL_1 10564
-#define SAY_KILL_2 "More... I must have more!"
-#define SOUND_KILL_2 10565
-
-#define SAY_DEATH "To the void... once... more.."
-#define SOUND_DEATH 10566
-
-#define EMOTE_DARK_SHELL "shifts into the void..."
-
-#define SPELL_VOID_BLAST 32325
-#define H_SPELL_VOID_BLAST 38760
-#define SPELL_DARK_SHELL 32358
-#define H_SPELL_DARK_SHELL 38759
-
-struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI
-{
- boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- bool HeroicMode;
- uint32 VoidBlast_Timer;
- uint32 DarkShell_Timer;
- uint32 VoidBlast_Counter;
-
- void Reset()
- {
- VoidBlast_Timer = 30000;
- DarkShell_Timer = 20000;
- VoidBlast_Counter = 0;
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
-
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( VoidBlast_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
- {
- DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST);
- VoidBlast_Timer = 500;
- ++VoidBlast_Counter;
- }
-
- if( VoidBlast_Counter == 5 )
- {
- VoidBlast_Timer = 25000+rand()%10000;
- VoidBlast_Counter = 0;
- }
- }else VoidBlast_Timer -= diff;
-
- if( !VoidBlast_Counter )
- {
- if( DarkShell_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoTextEmote(EMOTE_DARK_SHELL,NULL,true);
- DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL);
- DarkShell_Timer = 20000;
- }else DarkShell_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_pandemonius(Creature *_Creature)
-{
- return new boss_pandemoniusAI (_Creature);
-}
-
-void AddSC_boss_pandemonius()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_pandemonius";
- newscript->GetAI = GetAI_boss_pandemonius;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Pandemonius
+SD%Complete: 75
+SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged.
+SDCategory: Auchindoun, Mana Tombs
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO_1 "I will feed on your soul."
+#define SOUND_AGGRO_1 10561
+#define SAY_AGGRO_2 "So... full of life!"
+#define SOUND_AGGRO_2 10562
+#define SAY_AGGRO_3 "Do not... resist."
+#define SOUND_AGGRO_3 10563
+
+#define SAY_KILL_1 "Yes! I am... empowered!"
+#define SOUND_KILL_1 10564
+#define SAY_KILL_2 "More... I must have more!"
+#define SOUND_KILL_2 10565
+
+#define SAY_DEATH "To the void... once... more.."
+#define SOUND_DEATH 10566
+
+#define EMOTE_DARK_SHELL "shifts into the void..."
+
+#define SPELL_VOID_BLAST 32325
+#define H_SPELL_VOID_BLAST 38760
+#define SPELL_DARK_SHELL 32358
+#define H_SPELL_DARK_SHELL 38759
+
+struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI
+{
+ boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ uint32 VoidBlast_Timer;
+ uint32 DarkShell_Timer;
+ uint32 VoidBlast_Counter;
+
+ void Reset()
+ {
+ VoidBlast_Timer = 30000;
+ DarkShell_Timer = 20000;
+ VoidBlast_Counter = 0;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( VoidBlast_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
+ {
+ DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST);
+ VoidBlast_Timer = 500;
+ ++VoidBlast_Counter;
+ }
+
+ if( VoidBlast_Counter == 5 )
+ {
+ VoidBlast_Timer = 25000+rand()%10000;
+ VoidBlast_Counter = 0;
+ }
+ }else VoidBlast_Timer -= diff;
+
+ if( !VoidBlast_Counter )
+ {
+ if( DarkShell_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoTextEmote(EMOTE_DARK_SHELL,NULL,true);
+ DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL);
+ DarkShell_Timer = 20000;
+ }else DarkShell_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_pandemonius(Creature *_Creature)
+{
+ return new boss_pandemoniusAI (_Creature);
+}
+
+void AddSC_boss_pandemonius()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_pandemonius";
+ newscript->GetAI = GetAI_boss_pandemonius;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
index 6065a1a75c0..2832816a2d6 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
@@ -1,441 +1,441 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Darkweaver_Syth
-SD%Complete: 85
-SDComment: Shock spells/times need more work. Heroic not implemented.
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_SUMMON "I have pets..<squawk>..of my own!"
-#define SOUND_SUMMON 10502
-
-#define SAY_AGGRO_1 "Hrrmm.. Time to.. hrrm.. make my move."
-#define SOUND_AGGRO_1 10503
-#define SAY_AGGRO_2 "Nice pets..hrm.. Yes! <squawking>"
-#define SOUND_AGGRO_2 10504
-#define SAY_AGGRO_3 "Nice pets have.. weapons. No so..<squawk>..nice."
-#define SOUND_AGGRO_3 10505
-
-#define SAY_SLAY_1 "Death.. meeting life is.. <squawking>"
-#define SOUND_SLAY_1 10506
-#define SAY_SLAY_2 "Uhn.. Be free..<squawk>"
-#define SOUND_SLAY_2 10507
-
-#define SAY_DEATH "No more life..hrm. No more pain. <squawks weakly>"
-#define SOUND_DEATH 10508
-
-#define SPELL_FROST_SHOCK 37865
-#define SPELL_FLAME_SHOCK 34354
-#define SPELL_SHADOW_SHOCK 30138
-#define SPELL_ARCANE_SHOCK 37132
-
-#define SPELL_CHAIN_LIGHTNING 39945
-
-#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203
-#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205
-#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204
-#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206
-
-#define SPELL_FLAME_BUFFET 33526
-#define H_SPELL_FLAME_BUFFET 38141
-#define SPELL_ARCANE_BUFFET 33527
-#define H_SPELL_ARCANE_BUFFET 38138
-#define SPELL_FROST_BUFFET 33528
-#define H_SPELL_FROST_BUFFET 38142
-#define SPELL_SHADOW_BUFFET 33529
-#define H_SPELL_SHADOW_BUFFET 38143
-
-struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
-{
- boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 flameshock_timer;
- uint32 arcaneshock_timer;
- uint32 frostshock_timer;
- uint32 shadowshock_timer;
- uint32 chainlightning_timer;
-
- bool summon90;
- bool summon50;
- bool summon10;
-
- void Reset()
- {
- flameshock_timer = 2000;
- arcaneshock_timer = 4000;
- frostshock_timer = 6000;
- shadowshock_timer = 8000;
- chainlightning_timer = 15000;
-
- summon90 = false;
- summon50 = false;
- summon10 = false;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- summoned->AI()->AttackStart(target);
-
- }
-
- void SythSummoning()
- {
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front
- DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back
- DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left
- DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90)
- {
- SythSummoning();
- summon90 = true;
- }
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50)
- {
- SythSummoning();
- summon50 = true;
- }
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10)
- {
- SythSummoning();
- summon10 = true;
- }
-
- if( flameshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_SHOCK);
-
- flameshock_timer = 10000 + rand()%5000;
- }else flameshock_timer -= diff;
-
- if( arcaneshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_SHOCK);
-
- arcaneshock_timer = 10000 + rand()%5000;
- }else arcaneshock_timer -= diff;
-
- if( frostshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_SHOCK);
-
- frostshock_timer = 10000 + rand()%5000;
- }else frostshock_timer -= diff;
-
- if( shadowshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_SHOCK);
-
- shadowshock_timer = 10000 + rand()%5000;
- }else shadowshock_timer -= diff;
-
- if( chainlightning_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_CHAIN_LIGHTNING);
-
- chainlightning_timer = 25000;
- }else chainlightning_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_darkweaver_syth(Creature *_Creature)
-{
- return new boss_darkweaver_sythAI (_Creature);
-}
-
-/* ELEMENTALS */
-
-struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI
-{
- mob_syth_fireAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 flameshock_timer;
- uint32 flamebuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- flameshock_timer = 2500;
- flamebuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(flameshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_SHOCK);
-
- flameshock_timer = 5000;
- }else flameshock_timer -= diff;
-
- if(flamebuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_BUFFET);
-
- flamebuffet_timer = 5000;
- }else flamebuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
-{
- return new mob_syth_fireAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
-{
- mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 arcaneshock_timer;
- uint32 arcanebuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
- arcaneshock_timer = 2500;
- arcanebuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(arcaneshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_SHOCK);
-
- arcaneshock_timer = 5000;
- }else arcaneshock_timer -= diff;
-
- if(arcanebuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_BUFFET);
-
- arcanebuffet_timer = 5000;
- }else arcanebuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
-{
- return new mob_syth_arcaneAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
-{
- mob_syth_frostAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 frostshock_timer;
- uint32 frostbuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- frostshock_timer = 2500;
- frostbuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(frostshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_SHOCK);
-
- frostshock_timer = 5000;
- }else frostshock_timer -= diff;
-
- if(frostbuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_BUFFET);
-
- frostbuffet_timer = 5000;
- }else frostbuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
-{
- return new mob_syth_frostAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
-{
- mob_syth_shadowAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 shadowshock_timer;
- uint32 shadowbuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- shadowshock_timer = 2500;
- shadowbuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(shadowshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_SHOCK);
-
- shadowshock_timer = 5000;
- }else shadowshock_timer -= diff;
-
- if(shadowbuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_BUFFET);
-
- shadowbuffet_timer = 5000;
- }else shadowbuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_shadow(Creature *_Creature)
-{
- return new mob_syth_shadowAI (_Creature);
-}
-
-void AddSC_boss_darkweaver_syth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_darkweaver_syth";
- newscript->GetAI = GetAI_boss_darkweaver_syth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_fire";
- newscript->GetAI = GetAI_mob_syth_arcane;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_arcane";
- newscript->GetAI = GetAI_mob_syth_arcane;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_frost";
- newscript->GetAI = GetAI_mob_syth_frost;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_shadow";
- newscript->GetAI = GetAI_mob_syth_shadow;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Darkweaver_Syth
+SD%Complete: 85
+SDComment: Shock spells/times need more work. Heroic not implemented.
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_SUMMON "I have pets..<squawk>..of my own!"
+#define SOUND_SUMMON 10502
+
+#define SAY_AGGRO_1 "Hrrmm.. Time to.. hrrm.. make my move."
+#define SOUND_AGGRO_1 10503
+#define SAY_AGGRO_2 "Nice pets..hrm.. Yes! <squawking>"
+#define SOUND_AGGRO_2 10504
+#define SAY_AGGRO_3 "Nice pets have.. weapons. No so..<squawk>..nice."
+#define SOUND_AGGRO_3 10505
+
+#define SAY_SLAY_1 "Death.. meeting life is.. <squawking>"
+#define SOUND_SLAY_1 10506
+#define SAY_SLAY_2 "Uhn.. Be free..<squawk>"
+#define SOUND_SLAY_2 10507
+
+#define SAY_DEATH "No more life..hrm. No more pain. <squawks weakly>"
+#define SOUND_DEATH 10508
+
+#define SPELL_FROST_SHOCK 37865
+#define SPELL_FLAME_SHOCK 34354
+#define SPELL_SHADOW_SHOCK 30138
+#define SPELL_ARCANE_SHOCK 37132
+
+#define SPELL_CHAIN_LIGHTNING 39945
+
+#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203
+#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205
+#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204
+#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206
+
+#define SPELL_FLAME_BUFFET 33526
+#define H_SPELL_FLAME_BUFFET 38141
+#define SPELL_ARCANE_BUFFET 33527
+#define H_SPELL_ARCANE_BUFFET 38138
+#define SPELL_FROST_BUFFET 33528
+#define H_SPELL_FROST_BUFFET 38142
+#define SPELL_SHADOW_BUFFET 33529
+#define H_SPELL_SHADOW_BUFFET 38143
+
+struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
+{
+ boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 flameshock_timer;
+ uint32 arcaneshock_timer;
+ uint32 frostshock_timer;
+ uint32 shadowshock_timer;
+ uint32 chainlightning_timer;
+
+ bool summon90;
+ bool summon50;
+ bool summon10;
+
+ void Reset()
+ {
+ flameshock_timer = 2000;
+ arcaneshock_timer = 4000;
+ frostshock_timer = 6000;
+ shadowshock_timer = 8000;
+ chainlightning_timer = 15000;
+
+ summon90 = false;
+ summon50 = false;
+ summon10 = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ summoned->AI()->AttackStart(target);
+
+ }
+
+ void SythSummoning()
+ {
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front
+ DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back
+ DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left
+ DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90)
+ {
+ SythSummoning();
+ summon90 = true;
+ }
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50)
+ {
+ SythSummoning();
+ summon50 = true;
+ }
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10)
+ {
+ SythSummoning();
+ summon10 = true;
+ }
+
+ if( flameshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_SHOCK);
+
+ flameshock_timer = 10000 + rand()%5000;
+ }else flameshock_timer -= diff;
+
+ if( arcaneshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_SHOCK);
+
+ arcaneshock_timer = 10000 + rand()%5000;
+ }else arcaneshock_timer -= diff;
+
+ if( frostshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_SHOCK);
+
+ frostshock_timer = 10000 + rand()%5000;
+ }else frostshock_timer -= diff;
+
+ if( shadowshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 10000 + rand()%5000;
+ }else shadowshock_timer -= diff;
+
+ if( chainlightning_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_CHAIN_LIGHTNING);
+
+ chainlightning_timer = 25000;
+ }else chainlightning_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_darkweaver_syth(Creature *_Creature)
+{
+ return new boss_darkweaver_sythAI (_Creature);
+}
+
+/* ELEMENTALS */
+
+struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI
+{
+ mob_syth_fireAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 flameshock_timer;
+ uint32 flamebuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ flameshock_timer = 2500;
+ flamebuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(flameshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_SHOCK);
+
+ flameshock_timer = 5000;
+ }else flameshock_timer -= diff;
+
+ if(flamebuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_BUFFET);
+
+ flamebuffet_timer = 5000;
+ }else flamebuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
+{
+ return new mob_syth_fireAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
+{
+ mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 arcaneshock_timer;
+ uint32 arcanebuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ arcaneshock_timer = 2500;
+ arcanebuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(arcaneshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_SHOCK);
+
+ arcaneshock_timer = 5000;
+ }else arcaneshock_timer -= diff;
+
+ if(arcanebuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_BUFFET);
+
+ arcanebuffet_timer = 5000;
+ }else arcanebuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
+{
+ return new mob_syth_arcaneAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
+{
+ mob_syth_frostAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 frostshock_timer;
+ uint32 frostbuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ frostshock_timer = 2500;
+ frostbuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(frostshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_SHOCK);
+
+ frostshock_timer = 5000;
+ }else frostshock_timer -= diff;
+
+ if(frostbuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_BUFFET);
+
+ frostbuffet_timer = 5000;
+ }else frostbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
+{
+ return new mob_syth_frostAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
+{
+ mob_syth_shadowAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 shadowshock_timer;
+ uint32 shadowbuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ shadowshock_timer = 2500;
+ shadowbuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(shadowshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 5000;
+ }else shadowshock_timer -= diff;
+
+ if(shadowbuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_BUFFET);
+
+ shadowbuffet_timer = 5000;
+ }else shadowbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_shadow(Creature *_Creature)
+{
+ return new mob_syth_shadowAI (_Creature);
+}
+
+void AddSC_boss_darkweaver_syth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_darkweaver_syth";
+ newscript->GetAI = GetAI_boss_darkweaver_syth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_fire";
+ newscript->GetAI = GetAI_mob_syth_arcane;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_arcane";
+ newscript->GetAI = GetAI_mob_syth_arcane;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_frost";
+ newscript->GetAI = GetAI_mob_syth_frost;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_shadow";
+ newscript->GetAI = GetAI_mob_syth_shadow;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
index 5a5ae7edd06..8c5f5157d25 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
@@ -1,256 +1,256 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Talon_King_Ikiss
-SD%Complete: 80
-SDComment: Heroic supported. Some details missing, but most are spell related.
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sethekk_halls.h"
-
-#define SAY_INTRO "<squawk>..Trinkets yes pretty Trinkets..<squawk>..power, great power.<squawk>..power in Trinkets..<squawk>"
-#define SOUND_INTRO 10557
-
-#define SAY_AGGRO_1 "You make war on Ikiss?..<squawk>"
-#define SOUND_AGGRO_1 10554
-#define SAY_AGGRO_2 "Ikiss cut you pretty..<squawk>..slice you. Yes!"
-#define SOUND_AGGRO_2 10555
-#define SAY_AGGRO_3 "No escape for..<squawk>..for you"
-#define SOUND_AGGRO_3 10556
-
-#define SAY_SLAY_1 "You die..<squawk>..stay away from Trinkets"
-#define SOUND_SLAY_1 10558
-#define SAY_SLAY_2 "<squawk>"
-#define SOUND_SLAY_2 10559
-
-#define SAY_DEATH "Ikiss will not..<squawk>..die"
-#define SOUND_DEATH 10560
-
-#define EMOTE_ARCANE_EXP "begins to channel arcane energy..."
-
-#define SPELL_BLINK 38194
-#define SPELL_BLINK_TELEPORT 38203
-#define SPELL_MANA_SHIELD 38151
-#define SPELL_ARCANE_BUBBLE 9438
-#define H_SPELL_SLOW 35032
-
-#define SPELL_POLYMORPH 38245
-#define H_SPELL_POLYMORPH 43309
-
-#define SPELL_ARCANE_VOLLEY 35059
-#define H_SPELL_ARCANE_VOLLEY 40424
-
-#define SPELL_ARCANE_EXPLOSION 38197
-#define H_SPELL_ARCANE_EXPLOSION 40425
-
-struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
-{
- boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- bool HeroicMode;
-
- uint32 ArcaneVolley_Timer;
- uint32 Sheep_Timer;
- uint32 Blink_Timer;
- uint32 Slow_Timer;
-
- bool ManaShield;
- bool Blink;
- bool Intro;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- ArcaneVolley_Timer = 5000;
- Sheep_Timer = 8000;
- Blink_Timer = 35000;
- Slow_Timer = 15000+rand()%15000;
- Blink = false;
- Intro = false;
- ManaShield = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if(!Intro && m_creature->IsWithinDistInMap(who, 100))
- {
- Intro = true;
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
-
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
-
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
-
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Blink )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION);
- m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true);
- Blink = false;
- }
-
- if( ArcaneVolley_Timer < diff )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY);
- ArcaneVolley_Timer = 10000+rand()%5000;
- }else ArcaneVolley_Timer -= diff;
-
- if( Sheep_Timer < diff )
- {
- //second top aggro target in normal, random target in heroic correct?
- Unit *target = NULL;
- if( HeroicMode ? target = SelectUnit(SELECT_TARGET_RANDOM,0) : target = SelectUnit(SELECT_TARGET_TOPAGGRO,1) )
- DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH);
- Sheep_Timer = 15000+rand()%2500;
- }else Sheep_Timer -= diff;
-
- //may not be correct time to cast
- if( !ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) )
- {
- DoCast(m_creature,SPELL_MANA_SHIELD);
- ManaShield = true;
- }
-
- if( HeroicMode )
- {
- if( Slow_Timer < diff )
- {
- DoCast(m_creature,H_SPELL_SLOW);
- Slow_Timer = 15000+rand()%25000;
- }else Slow_Timer -= diff;
- }
-
- if( Blink_Timer < diff )
- {
- DoTextEmote(EMOTE_ARCANE_EXP,NULL,true);
-
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- //Spell doesn't work, but we use for visual effect at least
- DoCast(target,SPELL_BLINK);
-
- float X = target->GetPositionX();
- float Y = target->GetPositionY();
- float Z = target->GetPositionZ();
-
- m_creature->Relocate(X,Y,Z);
- m_creature->SendMonsterMove(X, Y, Z, 0, 0, 0);
-
- DoCast(target,SPELL_BLINK_TELEPORT);
- Blink = true;
- }
- Blink_Timer = 35000+rand()%5000;
- }else Blink_Timer -= diff;
-
- if( !Blink )
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_talon_king_ikiss(Creature *_Creature)
-{
- return new boss_talon_king_ikissAI (_Creature);
-}
-
-void AddSC_boss_talon_king_ikiss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_talon_king_ikiss";
- newscript->GetAI = GetAI_boss_talon_king_ikiss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Talon_King_Ikiss
+SD%Complete: 80
+SDComment: Heroic supported. Some details missing, but most are spell related.
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sethekk_halls.h"
+
+#define SAY_INTRO "<squawk>..Trinkets yes pretty Trinkets..<squawk>..power, great power.<squawk>..power in Trinkets..<squawk>"
+#define SOUND_INTRO 10557
+
+#define SAY_AGGRO_1 "You make war on Ikiss?..<squawk>"
+#define SOUND_AGGRO_1 10554
+#define SAY_AGGRO_2 "Ikiss cut you pretty..<squawk>..slice you. Yes!"
+#define SOUND_AGGRO_2 10555
+#define SAY_AGGRO_3 "No escape for..<squawk>..for you"
+#define SOUND_AGGRO_3 10556
+
+#define SAY_SLAY_1 "You die..<squawk>..stay away from Trinkets"
+#define SOUND_SLAY_1 10558
+#define SAY_SLAY_2 "<squawk>"
+#define SOUND_SLAY_2 10559
+
+#define SAY_DEATH "Ikiss will not..<squawk>..die"
+#define SOUND_DEATH 10560
+
+#define EMOTE_ARCANE_EXP "begins to channel arcane energy..."
+
+#define SPELL_BLINK 38194
+#define SPELL_BLINK_TELEPORT 38203
+#define SPELL_MANA_SHIELD 38151
+#define SPELL_ARCANE_BUBBLE 9438
+#define H_SPELL_SLOW 35032
+
+#define SPELL_POLYMORPH 38245
+#define H_SPELL_POLYMORPH 43309
+
+#define SPELL_ARCANE_VOLLEY 35059
+#define H_SPELL_ARCANE_VOLLEY 40424
+
+#define SPELL_ARCANE_EXPLOSION 38197
+#define H_SPELL_ARCANE_EXPLOSION 40425
+
+struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
+{
+ boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool HeroicMode;
+
+ uint32 ArcaneVolley_Timer;
+ uint32 Sheep_Timer;
+ uint32 Blink_Timer;
+ uint32 Slow_Timer;
+
+ bool ManaShield;
+ bool Blink;
+ bool Intro;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ ArcaneVolley_Timer = 5000;
+ Sheep_Timer = 8000;
+ Blink_Timer = 35000;
+ Slow_Timer = 15000+rand()%15000;
+ Blink = false;
+ Intro = false;
+ ManaShield = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if(!Intro && m_creature->IsWithinDistInMap(who, 100))
+ {
+ Intro = true;
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Blink )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION);
+ m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true);
+ Blink = false;
+ }
+
+ if( ArcaneVolley_Timer < diff )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY);
+ ArcaneVolley_Timer = 10000+rand()%5000;
+ }else ArcaneVolley_Timer -= diff;
+
+ if( Sheep_Timer < diff )
+ {
+ //second top aggro target in normal, random target in heroic correct?
+ Unit *target = NULL;
+ if( HeroicMode ? target = SelectUnit(SELECT_TARGET_RANDOM,0) : target = SelectUnit(SELECT_TARGET_TOPAGGRO,1) )
+ DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH);
+ Sheep_Timer = 15000+rand()%2500;
+ }else Sheep_Timer -= diff;
+
+ //may not be correct time to cast
+ if( !ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) )
+ {
+ DoCast(m_creature,SPELL_MANA_SHIELD);
+ ManaShield = true;
+ }
+
+ if( HeroicMode )
+ {
+ if( Slow_Timer < diff )
+ {
+ DoCast(m_creature,H_SPELL_SLOW);
+ Slow_Timer = 15000+rand()%25000;
+ }else Slow_Timer -= diff;
+ }
+
+ if( Blink_Timer < diff )
+ {
+ DoTextEmote(EMOTE_ARCANE_EXP,NULL,true);
+
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Spell doesn't work, but we use for visual effect at least
+ DoCast(target,SPELL_BLINK);
+
+ float X = target->GetPositionX();
+ float Y = target->GetPositionY();
+ float Z = target->GetPositionZ();
+
+ m_creature->Relocate(X,Y,Z);
+ m_creature->SendMonsterMove(X, Y, Z, 0, 0, 0);
+
+ DoCast(target,SPELL_BLINK_TELEPORT);
+ Blink = true;
+ }
+ Blink_Timer = 35000+rand()%5000;
+ }else Blink_Timer -= diff;
+
+ if( !Blink )
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_talon_king_ikiss(Creature *_Creature)
+{
+ return new boss_talon_king_ikissAI (_Creature);
+}
+
+void AddSC_boss_talon_king_ikiss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_talon_king_ikiss";
+ newscript->GetAI = GetAI_boss_talon_king_ikiss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
index 73aafca29f7..f609ecac1f2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
@@ -1,9 +1,9 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SETHEKK_HALLS_H
-#define DEF_SETHEKK_HALLS_H
-
-#define DATA_IKISSDOOREVENT 1
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SETHEKK_HALLS_H
+#define DEF_SETHEKK_HALLS_H
+
+#define DATA_IKISSDOOREVENT 1
+#endif
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
index 59906713f34..b49d18445c2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
@@ -1,74 +1,74 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance - Sethekk Halls
-SD%Complete: 50
-SDComment: Instance Data for Sethekk Halls instance
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sethekk_halls.h"
-
-#define IKISS_DOOR 177203
-
-struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
-{
- instance_sethekk_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- GameObject *IkissDoor;
-
- void Initialize()
- {
- IkissDoor = NULL;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case IKISS_DOOR:
- IkissDoor = go;
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_IKISSDOOREVENT:
- if( IkissDoor )
- IkissDoor->SetGoState(0);
- break;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_sethekk_halls(Map* map)
-{
- return new instance_sethekk_halls(map);
-}
-
-void AddSC_instance_sethekk_halls()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_sethekk_halls";
- newscript->GetInstanceData = GetInstanceData_instance_sethekk_halls;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance - Sethekk Halls
+SD%Complete: 50
+SDComment: Instance Data for Sethekk Halls instance
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sethekk_halls.h"
+
+#define IKISS_DOOR 177203
+
+struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
+{
+ instance_sethekk_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ GameObject *IkissDoor;
+
+ void Initialize()
+ {
+ IkissDoor = NULL;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case IKISS_DOOR:
+ IkissDoor = go;
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_IKISSDOOREVENT:
+ if( IkissDoor )
+ IkissDoor->SetGoState(0);
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_sethekk_halls(Map* map)
+{
+ return new instance_sethekk_halls(map);
+}
+
+void AddSC_instance_sethekk_halls()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_sethekk_halls";
+ newscript->GetInstanceData = GetInstanceData_instance_sethekk_halls;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
index e8116c0c946..afa7b996915 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
@@ -1,223 +1,223 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ambassador_Hellmaw
-SD%Complete: 75
-SDComment: Waypoints after Intro not implemented. Enrage spell missing/not known
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SAY_INTRO "Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!"
-#define SOUND_INTRO 10473
-
-#define SAY_AGGRO1 "Pathetic mortals! You will pay dearly!"
-#define SOUND_AGGRO1 10475
-#define SAY_AGGRO2 "I will break you!"
-#define SOUND_AGGRO2 10476
-#define SAY_AGGRO3 "Finally! Something to relieve the tedium!"
-#define SOUND_AGGRO3 10477
-
-#define SAY_HELP "Aid me, you fools, before it's too late!"
-#define SOUND_HELP 10474
-
-#define SAY_SLAY1 "Do you fear death?"
-#define SOUND_SLAY1 10478
-#define SAY_SLAY2 "This is the part I enjoy most."
-#define SOUND_SLAY2 10479
-
-#define SAY_DEATH "Do not...grow...overconfident, mortal."
-#define SOUND_DEATH 10480
-
-#define SPELL_BANISH 30231
-#define SPELL_CORROSIVE_ACID 23313
-#define SPELL_FEAR 33547
-#define SPELL_ENRAGE 0 //need to find proper spell
-
-struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
-{
- boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- bool HeroicMode;
-
- uint32 EventCheck_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 Fear_Timer;
- uint32 Enrage_Timer;
- bool Intro;
- bool IsBanished;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- EventCheck_Timer = 5000;
- CorrosiveAcid_Timer = 25000;
- Fear_Timer = 40000;
- Enrage_Timer = 180000;
- Intro = false;
- IsBanished = false;
-
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_HELLMAW) == NOT_STARTED )
- {
- DoCast(m_creature,SPELL_BANISH);
- IsBanished = true;
- }
- else pInstance->SetData(TYPE_HELLMAW,FAIL);
-
- if( pInstance->GetData(TYPE_OVERSEER) == DONE )
- {
- if( m_creature->HasAura(SPELL_BANISH,0) )
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
- Intro = true;
- }
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if( type != POINT_MOTION_TYPE )
- return;
- }
-
- void DoIntro()
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
-
- if( m_creature->HasAura(SPELL_BANISH,0) )
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
-
- IsBanished = false;
- Intro = true;
-
- if( pInstance )
- pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(TYPE_HELLMAW, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Intro )
- {
- if( EventCheck_Timer < diff )
- {
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_OVERSEER) == DONE )
- DoIntro();
- }
- EventCheck_Timer = 5000;
- }else EventCheck_Timer -= diff;
- }
-
- if( !InCombat && !IsBanished )
- {
- //this is where we add MovePoint()
- //DoWhine("I haz no mount!", LANG_UNIVERSAL, NULL);
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( CorrosiveAcid_Timer < diff )
- {
- DoCast(m_creature,SPELL_CORROSIVE_ACID);
- CorrosiveAcid_Timer = 25000;
- }else CorrosiveAcid_Timer -= diff;
-
- if( Fear_Timer < diff )
- {
- DoCast(m_creature,SPELL_FEAR);
- Fear_Timer = 35000;
- }else Fear_Timer -= diff;
-
- /*if( HeroicMode )
- {
- if( Enrage_Timer < diff )
- {
- DoCast(m_creature,SPELL_ENRAGE);
- }else Enrage_Timer -= diff;
- }*/
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ambassador_hellmaw(Creature *_Creature)
-{
- return new boss_ambassador_hellmawAI (_Creature);
-}
-
-void AddSC_boss_ambassador_hellmaw()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ambassador_hellmaw";
- newscript->GetAI = GetAI_boss_ambassador_hellmaw;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ambassador_Hellmaw
+SD%Complete: 75
+SDComment: Waypoints after Intro not implemented. Enrage spell missing/not known
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SAY_INTRO "Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!"
+#define SOUND_INTRO 10473
+
+#define SAY_AGGRO1 "Pathetic mortals! You will pay dearly!"
+#define SOUND_AGGRO1 10475
+#define SAY_AGGRO2 "I will break you!"
+#define SOUND_AGGRO2 10476
+#define SAY_AGGRO3 "Finally! Something to relieve the tedium!"
+#define SOUND_AGGRO3 10477
+
+#define SAY_HELP "Aid me, you fools, before it's too late!"
+#define SOUND_HELP 10474
+
+#define SAY_SLAY1 "Do you fear death?"
+#define SOUND_SLAY1 10478
+#define SAY_SLAY2 "This is the part I enjoy most."
+#define SOUND_SLAY2 10479
+
+#define SAY_DEATH "Do not...grow...overconfident, mortal."
+#define SOUND_DEATH 10480
+
+#define SPELL_BANISH 30231
+#define SPELL_CORROSIVE_ACID 23313
+#define SPELL_FEAR 33547
+#define SPELL_ENRAGE 0 //need to find proper spell
+
+struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
+{
+ boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ bool HeroicMode;
+
+ uint32 EventCheck_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 Fear_Timer;
+ uint32 Enrage_Timer;
+ bool Intro;
+ bool IsBanished;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ EventCheck_Timer = 5000;
+ CorrosiveAcid_Timer = 25000;
+ Fear_Timer = 40000;
+ Enrage_Timer = 180000;
+ Intro = false;
+ IsBanished = false;
+
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_HELLMAW) == NOT_STARTED )
+ {
+ DoCast(m_creature,SPELL_BANISH);
+ IsBanished = true;
+ }
+ else pInstance->SetData(TYPE_HELLMAW,FAIL);
+
+ if( pInstance->GetData(TYPE_OVERSEER) == DONE )
+ {
+ if( m_creature->HasAura(SPELL_BANISH,0) )
+ m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
+ Intro = true;
+ }
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if( type != POINT_MOTION_TYPE )
+ return;
+ }
+
+ void DoIntro()
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+
+ if( m_creature->HasAura(SPELL_BANISH,0) )
+ m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
+
+ IsBanished = false;
+ Intro = true;
+
+ if( pInstance )
+ pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(TYPE_HELLMAW, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Intro )
+ {
+ if( EventCheck_Timer < diff )
+ {
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_OVERSEER) == DONE )
+ DoIntro();
+ }
+ EventCheck_Timer = 5000;
+ }else EventCheck_Timer -= diff;
+ }
+
+ if( !InCombat && !IsBanished )
+ {
+ //this is where we add MovePoint()
+ //DoWhine("I haz no mount!", LANG_UNIVERSAL, NULL);
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( CorrosiveAcid_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_CORROSIVE_ACID);
+ CorrosiveAcid_Timer = 25000;
+ }else CorrosiveAcid_Timer -= diff;
+
+ if( Fear_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_FEAR);
+ Fear_Timer = 35000;
+ }else Fear_Timer -= diff;
+
+ /*if( HeroicMode )
+ {
+ if( Enrage_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ }else Enrage_Timer -= diff;
+ }*/
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ambassador_hellmaw(Creature *_Creature)
+{
+ return new boss_ambassador_hellmawAI (_Creature);
+}
+
+void AddSC_boss_ambassador_hellmaw()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ambassador_hellmaw";
+ newscript->GetAI = GetAI_boss_ambassador_hellmaw;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
index 86f4aae1381..41cafdf49b1 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
@@ -1,191 +1,191 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Blackheart_the_Inciter
-SD%Complete: 75
-SDComment: Incite Chaos not functional since core lacks Mind Control support
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SPELL_INCITE_CHAOS 33676
-#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party
-#define SPELL_CHARGE 33709
-#define SPELL_WAR_STOMP 33707
-
-#define SAY_AGGRO1 "You be dead people!"
-#define SAY_AGGRO2 "Time to kill!"
-#define SAY_AGGRO3 "I see dead people!"
-#define SAY_SLAY1 "No coming back for you!"
-#define SAY_SLAY2 "Nice try!"
-#define SAY_SLAY3 "Now you gone for good!"
-#define SAY_DEATH "This...no...good.."
-
-#define SOUND_AGGRO1 10498
-#define SOUND_AGGRO2 10497
-#define SOUND_AGGRO3 10488
-#define SOUND_SLAY1 10489
-#define SOUND_SLAY2 10490
-#define SOUND_SLAY3 10499
-#define SOUND_DEATH 10491
-
-struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI
-{
- boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- bool InciteChaos;
- uint32 InciteChaos_Timer;
- uint32 InciteChaosWait_Timer;
- uint32 Charge_Timer;
- uint32 Knockback_Timer;
-
- void Reset()
- {
- InciteChaos = false;
- InciteChaos_Timer = 20000;
- InciteChaosWait_Timer = 15000;
- Charge_Timer = 5000;
- Knockback_Timer = 15000;
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( InciteChaos )
- {
- if( InciteChaosWait_Timer < diff )
- {
- InciteChaos = false;
- InciteChaosWait_Timer = 15000;
- }else InciteChaosWait_Timer -= diff;
-
- return;
- }
-
- if( InciteChaos_Timer < diff )
- {
- DoCast(m_creature, SPELL_INCITE_CHAOS);
-
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- for( std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr )
- {
- Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if( target && target->GetTypeId() == TYPEID_PLAYER )
- target->CastSpell(target,SPELL_INCITE_CHAOS_B,true);
- }
-
- DoResetThreat();
- InciteChaos = true;
- InciteChaos_Timer = 40000;
- return;
- }else InciteChaos_Timer -= diff;
-
- //Charge_Timer
- if( Charge_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
- DoCast(target, SPELL_CHARGE);
- Charge_Timer = 25000;
- }else Charge_Timer -= diff;
-
- //Knockback_Timer
- if( Knockback_Timer < diff )
- {
- DoCast(m_creature, SPELL_WAR_STOMP);
- Knockback_Timer = 20000;
- }else Knockback_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_blackheart_the_inciter(Creature *_Creature)
-{
- return new boss_blackheart_the_inciterAI (_Creature);
-}
-
-void AddSC_boss_blackheart_the_inciter()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_blackheart_the_inciter";
- newscript->GetAI = GetAI_boss_blackheart_the_inciter;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Blackheart_the_Inciter
+SD%Complete: 75
+SDComment: Incite Chaos not functional since core lacks Mind Control support
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SPELL_INCITE_CHAOS 33676
+#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party
+#define SPELL_CHARGE 33709
+#define SPELL_WAR_STOMP 33707
+
+#define SAY_AGGRO1 "You be dead people!"
+#define SAY_AGGRO2 "Time to kill!"
+#define SAY_AGGRO3 "I see dead people!"
+#define SAY_SLAY1 "No coming back for you!"
+#define SAY_SLAY2 "Nice try!"
+#define SAY_SLAY3 "Now you gone for good!"
+#define SAY_DEATH "This...no...good.."
+
+#define SOUND_AGGRO1 10498
+#define SOUND_AGGRO2 10497
+#define SOUND_AGGRO3 10488
+#define SOUND_SLAY1 10489
+#define SOUND_SLAY2 10490
+#define SOUND_SLAY3 10499
+#define SOUND_DEATH 10491
+
+struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI
+{
+ boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ bool InciteChaos;
+ uint32 InciteChaos_Timer;
+ uint32 InciteChaosWait_Timer;
+ uint32 Charge_Timer;
+ uint32 Knockback_Timer;
+
+ void Reset()
+ {
+ InciteChaos = false;
+ InciteChaos_Timer = 20000;
+ InciteChaosWait_Timer = 15000;
+ Charge_Timer = 5000;
+ Knockback_Timer = 15000;
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( InciteChaos )
+ {
+ if( InciteChaosWait_Timer < diff )
+ {
+ InciteChaos = false;
+ InciteChaosWait_Timer = 15000;
+ }else InciteChaosWait_Timer -= diff;
+
+ return;
+ }
+
+ if( InciteChaos_Timer < diff )
+ {
+ DoCast(m_creature, SPELL_INCITE_CHAOS);
+
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ for( std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr )
+ {
+ Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if( target && target->GetTypeId() == TYPEID_PLAYER )
+ target->CastSpell(target,SPELL_INCITE_CHAOS_B,true);
+ }
+
+ DoResetThreat();
+ InciteChaos = true;
+ InciteChaos_Timer = 40000;
+ return;
+ }else InciteChaos_Timer -= diff;
+
+ //Charge_Timer
+ if( Charge_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
+ DoCast(target, SPELL_CHARGE);
+ Charge_Timer = 25000;
+ }else Charge_Timer -= diff;
+
+ //Knockback_Timer
+ if( Knockback_Timer < diff )
+ {
+ DoCast(m_creature, SPELL_WAR_STOMP);
+ Knockback_Timer = 20000;
+ }else Knockback_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_blackheart_the_inciter(Creature *_Creature)
+{
+ return new boss_blackheart_the_inciterAI (_Creature);
+}
+
+void AddSC_boss_blackheart_the_inciter()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_blackheart_the_inciter";
+ newscript->GetAI = GetAI_boss_blackheart_the_inciter;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
index cdea78ce916..af8c2807a1e 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
@@ -1,414 +1,414 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grandmaster_Vorpil
-SD%Complete: 100
-SDComment:
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SAY_INTRO "Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!"
-#define SAY_AGGRO1 "I'll make an offering of your blood!"
-#define SAY_AGGRO2 "You'll be a fine example, for the others."
-#define SAY_AGGRO3 "Good, a worthy sacrifice."
-#define SAY_HELP "Come to my aid, heed your master now!"
-#define SAY_SLAY1 "I serve with pride."
-#define SAY_SLAY2 "Your death is for the greater cause!"
-#define SAY_DEATH "I give my life... Gladly."
-
-#define SOUND_INTRO 10522
-#define SOUND_AGGRO1 10524
-#define SOUND_AGGRO2 10525
-#define SOUND_AGGRO3 10526
-#define SOUND_HELP 10523
-#define SOUND_SLAY1 10527
-#define SOUND_SLAY2 10528
-#define SOUND_DEATH 10529
-
-#define SPELL_RAIN_OF_FIRE 33617
-#define H_SPELL_RAIN_OF_FIRE 39363
-
-#define SPELL_DRAWN_SHADOWS 33563
-#define SPELL_SHADOWBOLT_VOLLEY 33841
-
-#define MOB_VOID_TRAVELER 19226
-#define SPELL_SACRIFICE 33587
-#define SPELL_SHADOW_NOVA 33846
-#define SPELL_HEALVORPIL 33783
-#define H_SPELL_HEALVORPIL 39364
-
-#define MOB_VOID_PORTAL 19224
-#define SPELL_VOID_PORTAL_VISUAL 33569
-
-float VorpilPosition[1][3] =
-{
- {-252.8820,-264.3030,17.1}
-};
-
-float VoidPortalCoords[5][3] =
-{
- {-283.5894, -239.5718, 12.7},
- {-306.5853, -258.4539, 12.7},
- {-295.8789, -269.0899, 12.7},
- {-209.3401, -262.7564, 17.1},
- {-261.4533, -297.3298, 17.1}
-};
-
-struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
-{
- boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Intro = false;
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool Intro;
- bool sumportals;
- bool HeroicMode;
-
- uint32 ShadowBoltVolley_Timer;
- uint32 DrawnShadows_Timer;
- uint32 sumportals_Timer;
- uint32 summonTraveler_Timer;
- uint64 PortalsGuid[5];
-
- void summonPortals()
- {
- for (int i = 0;i<5;i++)
- {
- Creature *Portal = NULL;
- Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
- PortalsGuid[i] = Portal->GetGUID();
- Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
- }
- sumportals = true;
- summonTraveler_Timer = 5000;
- }
-
- void destroyPortals()
- {
- for (int i = 0;i < 5; i ++)
- {
- Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
- if (Portal)
- if (Portal->isAlive())
- Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- PortalsGuid[i] = 0;
- }
- }
-
- void spawnVoidTraveler()
- {
- srand( (unsigned) time(NULL) ) ;
- int pos = rand()%5;
- Creature *traveler;
- traveler = m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- }
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- if( HeroicMode )
- debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
-
- ShadowBoltVolley_Timer = 15000;
- DrawnShadows_Timer = 45000;
- sumportals_Timer = 10000;
- summonTraveler_Timer = 90000;
-
- InCombat = false;
- sumportals = false;
- destroyPortals();
-
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
-
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- destroyPortals();
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
- }
-
- void StartEvent()
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
-
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
-
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
-
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
- }
-
- void Aggro(Unit *who)
- {
- if(!InCombat)
- {
- InCombat = true;
- StartEvent();
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- Aggro(who);
- }
- }
- else if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) ) //not sure about right radius
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- Intro = true;
- }
-
- }
-
- void UpdateAI(const uint32 diff)
- {
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (!sumportals)
- if (sumportals_Timer < diff)
- {
- DoYell(SAY_HELP, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_HELP);
- summonPortals();
- sumportals_Timer = 1000000;
-
- }else sumportals_Timer -= diff;
-
- if (ShadowBoltVolley_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY);
- ShadowBoltVolley_Timer = 15000;
- }else ShadowBoltVolley_Timer -= diff;
-
- if ( DrawnShadows_Timer < diff)
- {
- Map *map = m_creature->GetMap();
- if(map->IsDungeon())
- {
- InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
- for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if((*i)->isAlive())
- {
- (*i)->TeleportTo(555,VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
- }
- }
- }
- m_creature->Relocate(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
- DoCast(m_creature,SPELL_DRAWN_SHADOWS,true);
-
- if(!HeroicMode) DoCast(m_creature,SPELL_RAIN_OF_FIRE);
- else DoCast(m_creature,H_SPELL_RAIN_OF_FIRE);
-
- ShadowBoltVolley_Timer = 6000;
- DrawnShadows_Timer = 45000;
- }else DrawnShadows_Timer -= diff;
-
- if ( summonTraveler_Timer < diff)
- {
- spawnVoidTraveler();
- summonTraveler_Timer = 10000;
- }else summonTraveler_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_grandmaster_vorpil(Creature *_Creature)
-{
- return new boss_grandmaster_vorpilAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
-{
- mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
- uint32 VorpilCheck_Timer;
- uint32 eventCheck_Timer;
- bool sacrifice;
- bool sacrificed;
- bool oneTarget;
- bool HeroicMode;
-
- uint32 target_timer;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- if( HeroicMode )
- debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
-
- VorpilCheck_Timer = 5000;
- eventCheck_Timer = 1000;
- target_timer = 2000;
- oneTarget = false;
- sacrificed = false;
- sacrifice = false;
- }
- void EnterEvadeMode(){}
- void Aggro(Unit *who) {}
- void AttackStart(Unit *who){}
- void MoveInLineOfSight(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if (eventCheck_Timer < diff)
- {
- if(pInstance)
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- {
- if (Vorpil->isDead())
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- if (Vorpil->getVictim())
- {
- if((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
- (*m_creature).GetMotionMaster()->MoveFollow(Vorpil,1,0);
- }
- }
- if(pInstance->GetData(DATA_GRANDMASTERVORPILEVENT) != IN_PROGRESS)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
- eventCheck_Timer = 5000;
- }else eventCheck_Timer -=diff;
-
- if (VorpilCheck_Timer < diff)
- {
- if (pInstance)
- {
- if (!sacrificed)
- {
- if (!sacrifice)
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- if (Vorpil->isAlive())
- {
- if (m_creature->IsWithinDistInMap(Vorpil, 2))
- {
- sacrifice = true;
- DoCast(m_creature,SPELL_SACRIFICE);
- VorpilCheck_Timer = 2000;
- }
- }
-
- if (!sacrifice)
- VorpilCheck_Timer = 3000;
- }
- else
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- if (Vorpil->isAlive())
- {
- if(!HeroicMode) Vorpil->CastSpell(Vorpil,SPELL_HEALVORPIL,true);
- else Vorpil->CastSpell(Vorpil,H_SPELL_HEALVORPIL,true);
- };
- DoCast(m_creature,SPELL_SHADOW_NOVA);
- sacrificed = true;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- VorpilCheck_Timer = 100000;
- }
- }
- }
- }else VorpilCheck_Timer -= diff;
- }
-};
-
-CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
-{
- return new mob_voidtravelerAI (_Creature);
-}
-
-void AddSC_boss_grandmaster_vorpil()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_grandmaster_vorpil";
- newscript->GetAI = GetAI_boss_grandmaster_vorpil;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_voidtraveler";
- newscript->GetAI = GetAI_mob_voidtraveler;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grandmaster_Vorpil
+SD%Complete: 100
+SDComment:
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SAY_INTRO "Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!"
+#define SAY_AGGRO1 "I'll make an offering of your blood!"
+#define SAY_AGGRO2 "You'll be a fine example, for the others."
+#define SAY_AGGRO3 "Good, a worthy sacrifice."
+#define SAY_HELP "Come to my aid, heed your master now!"
+#define SAY_SLAY1 "I serve with pride."
+#define SAY_SLAY2 "Your death is for the greater cause!"
+#define SAY_DEATH "I give my life... Gladly."
+
+#define SOUND_INTRO 10522
+#define SOUND_AGGRO1 10524
+#define SOUND_AGGRO2 10525
+#define SOUND_AGGRO3 10526
+#define SOUND_HELP 10523
+#define SOUND_SLAY1 10527
+#define SOUND_SLAY2 10528
+#define SOUND_DEATH 10529
+
+#define SPELL_RAIN_OF_FIRE 33617
+#define H_SPELL_RAIN_OF_FIRE 39363
+
+#define SPELL_DRAWN_SHADOWS 33563
+#define SPELL_SHADOWBOLT_VOLLEY 33841
+
+#define MOB_VOID_TRAVELER 19226
+#define SPELL_SACRIFICE 33587
+#define SPELL_SHADOW_NOVA 33846
+#define SPELL_HEALVORPIL 33783
+#define H_SPELL_HEALVORPIL 39364
+
+#define MOB_VOID_PORTAL 19224
+#define SPELL_VOID_PORTAL_VISUAL 33569
+
+float VorpilPosition[1][3] =
+{
+ {-252.8820,-264.3030,17.1}
+};
+
+float VoidPortalCoords[5][3] =
+{
+ {-283.5894, -239.5718, 12.7},
+ {-306.5853, -258.4539, 12.7},
+ {-295.8789, -269.0899, 12.7},
+ {-209.3401, -262.7564, 17.1},
+ {-261.4533, -297.3298, 17.1}
+};
+
+struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
+{
+ boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Intro = false;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool Intro;
+ bool sumportals;
+ bool HeroicMode;
+
+ uint32 ShadowBoltVolley_Timer;
+ uint32 DrawnShadows_Timer;
+ uint32 sumportals_Timer;
+ uint32 summonTraveler_Timer;
+ uint64 PortalsGuid[5];
+
+ void summonPortals()
+ {
+ for (int i = 0;i<5;i++)
+ {
+ Creature *Portal = NULL;
+ Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
+ PortalsGuid[i] = Portal->GetGUID();
+ Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
+ }
+ sumportals = true;
+ summonTraveler_Timer = 5000;
+ }
+
+ void destroyPortals()
+ {
+ for (int i = 0;i < 5; i ++)
+ {
+ Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
+ if (Portal)
+ if (Portal->isAlive())
+ Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ PortalsGuid[i] = 0;
+ }
+ }
+
+ void spawnVoidTraveler()
+ {
+ srand( (unsigned) time(NULL) ) ;
+ int pos = rand()%5;
+ Creature *traveler;
+ traveler = m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ }
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ if( HeroicMode )
+ debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
+
+ ShadowBoltVolley_Timer = 15000;
+ DrawnShadows_Timer = 45000;
+ sumportals_Timer = 10000;
+ summonTraveler_Timer = 90000;
+
+ InCombat = false;
+ sumportals = false;
+ destroyPortals();
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ destroyPortals();
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
+ }
+
+ void StartEvent()
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(!InCombat)
+ {
+ InCombat = true;
+ StartEvent();
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ Aggro(who);
+ }
+ }
+ else if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) ) //not sure about right radius
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ Intro = true;
+ }
+
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (!sumportals)
+ if (sumportals_Timer < diff)
+ {
+ DoYell(SAY_HELP, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_HELP);
+ summonPortals();
+ sumportals_Timer = 1000000;
+
+ }else sumportals_Timer -= diff;
+
+ if (ShadowBoltVolley_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY);
+ ShadowBoltVolley_Timer = 15000;
+ }else ShadowBoltVolley_Timer -= diff;
+
+ if ( DrawnShadows_Timer < diff)
+ {
+ Map *map = m_creature->GetMap();
+ if(map->IsDungeon())
+ {
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
+ for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if((*i)->isAlive())
+ {
+ (*i)->TeleportTo(555,VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
+ }
+ }
+ }
+ m_creature->Relocate(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
+ DoCast(m_creature,SPELL_DRAWN_SHADOWS,true);
+
+ if(!HeroicMode) DoCast(m_creature,SPELL_RAIN_OF_FIRE);
+ else DoCast(m_creature,H_SPELL_RAIN_OF_FIRE);
+
+ ShadowBoltVolley_Timer = 6000;
+ DrawnShadows_Timer = 45000;
+ }else DrawnShadows_Timer -= diff;
+
+ if ( summonTraveler_Timer < diff)
+ {
+ spawnVoidTraveler();
+ summonTraveler_Timer = 10000;
+ }else summonTraveler_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_grandmaster_vorpil(Creature *_Creature)
+{
+ return new boss_grandmaster_vorpilAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
+{
+ mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ uint32 VorpilCheck_Timer;
+ uint32 eventCheck_Timer;
+ bool sacrifice;
+ bool sacrificed;
+ bool oneTarget;
+ bool HeroicMode;
+
+ uint32 target_timer;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ if( HeroicMode )
+ debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
+
+ VorpilCheck_Timer = 5000;
+ eventCheck_Timer = 1000;
+ target_timer = 2000;
+ oneTarget = false;
+ sacrificed = false;
+ sacrifice = false;
+ }
+ void EnterEvadeMode(){}
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit *who){}
+ void MoveInLineOfSight(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (eventCheck_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ {
+ if (Vorpil->isDead())
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ if (Vorpil->getVictim())
+ {
+ if((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ (*m_creature).GetMotionMaster()->MoveFollow(Vorpil,1,0);
+ }
+ }
+ if(pInstance->GetData(DATA_GRANDMASTERVORPILEVENT) != IN_PROGRESS)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+ eventCheck_Timer = 5000;
+ }else eventCheck_Timer -=diff;
+
+ if (VorpilCheck_Timer < diff)
+ {
+ if (pInstance)
+ {
+ if (!sacrificed)
+ {
+ if (!sacrifice)
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ if (Vorpil->isAlive())
+ {
+ if (m_creature->IsWithinDistInMap(Vorpil, 2))
+ {
+ sacrifice = true;
+ DoCast(m_creature,SPELL_SACRIFICE);
+ VorpilCheck_Timer = 2000;
+ }
+ }
+
+ if (!sacrifice)
+ VorpilCheck_Timer = 3000;
+ }
+ else
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ if (Vorpil->isAlive())
+ {
+ if(!HeroicMode) Vorpil->CastSpell(Vorpil,SPELL_HEALVORPIL,true);
+ else Vorpil->CastSpell(Vorpil,H_SPELL_HEALVORPIL,true);
+ };
+ DoCast(m_creature,SPELL_SHADOW_NOVA);
+ sacrificed = true;
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ VorpilCheck_Timer = 100000;
+ }
+ }
+ }
+ }else VorpilCheck_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
+{
+ return new mob_voidtravelerAI (_Creature);
+}
+
+void AddSC_boss_grandmaster_vorpil()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_grandmaster_vorpil";
+ newscript->GetAI = GetAI_boss_grandmaster_vorpil;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_voidtraveler";
+ newscript->GetAI = GetAI_mob_voidtraveler;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
index c176b2056cd..55456c86286 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -1,192 +1,192 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Murmur
-SD%Complete: 75
-SDComment: Database should have `RegenHealth`=0 to prevent regen. Also, his shockwave triggered after magnetic pull may be incorrect. Murmur's Touch does not work properly.
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-
-#define EMOTE_SONIC_BOOM "draws energy from the air."
-
-#define SPELL_MAGNETIC_PULL 33689
-#define SPELL_SONIC_BOOM_PRE 33923
-#define SPELL_SONIC_BOOM_CAST 38795
-#define SPELL_MURMURS_TOUCH 33711
-#define SPELL_RESONANCE 33657
-#define SPELL_SHOCKWAVE 33686
-
-struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI
-{
- boss_murmurAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SonicBoom_Timer;
- uint32 MurmursTouch_Timer;
- uint32 Resonance_Timer;
- uint32 MagneticPull_Timer;
- bool CanSonicBoom;
- bool CanShockWave;
- uint64 pTarget;
-
- void Reset()
- {
- SonicBoom_Timer = 30000;
- MurmursTouch_Timer = 20000;
- Resonance_Timer = 10000;
- MagneticPull_Timer = 45000;
- CanSonicBoom = false;
- CanShockWave = false;
- pTarget = 0;
-
- //database should have `RegenHealth`=0 to prevent regen
- uint32 hp = m_creature->GetMaxHealth()*0.4;
- if( hp )
- m_creature->SetHealth(hp);
- }
-
- void Aggro(Unit *who) { }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- DoStartAttackNoMovement(who);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- DoStartAttackNoMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SonicBoom_Timer
- if(SonicBoom_Timer < diff)
- {
- if(CanSonicBoom)
- {
- DoCast(m_creature, SPELL_SONIC_BOOM_CAST,true);
- CanSonicBoom = false;
- SonicBoom_Timer = 30000;
- }
- else
- {
- DoTextEmote(EMOTE_SONIC_BOOM,NULL);
- DoCast(m_creature,SPELL_SONIC_BOOM_PRE);
- CanSonicBoom = true;
- SonicBoom_Timer = 5000;
- }
- }else SonicBoom_Timer -= diff;
-
- //MurmursTouch_Timer
- if(MurmursTouch_Timer < diff)
- {
- /*Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(target)
- DoCast(target, SPELL_MURMURS_TOUCH);*/
- DoCast(m_creature, SPELL_MURMURS_TOUCH);
- MurmursTouch_Timer = 30000;
- }else MurmursTouch_Timer -= diff;
-
- //Resonance_Timer
- if(Resonance_Timer < diff)
- {
- if( !m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
- DoCast(m_creature->getVictim(), SPELL_RESONANCE);
- Resonance_Timer = 5000;
- }else Resonance_Timer -= diff;
-
- //MagneticPull_Timer
- if(MagneticPull_Timer < diff)
- {
- if( !CanShockWave )
- {
- if( Unit* temp = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp, SPELL_MAGNETIC_PULL);
- pTarget = temp->GetGUID();
- CanShockWave = true;
- }
- MagneticPull_Timer = 2500;
- }
- }
- else
- {
- if( Unit* target = Unit::GetUnit(*m_creature,pTarget) )
- target->CastSpell(target,SPELL_SHOCKWAVE,true);
-
- MagneticPull_Timer = 35000;
- CanShockWave = false;
- pTarget = 0;
- }
- }else MagneticPull_Timer -= diff;
-
- //no meele if preparing for sonic boom
- if(!CanSonicBoom)
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_murmur(Creature *_Creature)
-{
- return new boss_murmurAI (_Creature);
-}
-
-void AddSC_boss_murmur()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_murmur";
- newscript->GetAI = GetAI_boss_murmur;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Murmur
+SD%Complete: 75
+SDComment: Database should have `RegenHealth`=0 to prevent regen. Also, his shockwave triggered after magnetic pull may be incorrect. Murmur's Touch does not work properly.
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+
+#define EMOTE_SONIC_BOOM "draws energy from the air."
+
+#define SPELL_MAGNETIC_PULL 33689
+#define SPELL_SONIC_BOOM_PRE 33923
+#define SPELL_SONIC_BOOM_CAST 38795
+#define SPELL_MURMURS_TOUCH 33711
+#define SPELL_RESONANCE 33657
+#define SPELL_SHOCKWAVE 33686
+
+struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI
+{
+ boss_murmurAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SonicBoom_Timer;
+ uint32 MurmursTouch_Timer;
+ uint32 Resonance_Timer;
+ uint32 MagneticPull_Timer;
+ bool CanSonicBoom;
+ bool CanShockWave;
+ uint64 pTarget;
+
+ void Reset()
+ {
+ SonicBoom_Timer = 30000;
+ MurmursTouch_Timer = 20000;
+ Resonance_Timer = 10000;
+ MagneticPull_Timer = 45000;
+ CanSonicBoom = false;
+ CanShockWave = false;
+ pTarget = 0;
+
+ //database should have `RegenHealth`=0 to prevent regen
+ uint32 hp = m_creature->GetMaxHealth()*0.4;
+ if( hp )
+ m_creature->SetHealth(hp);
+ }
+
+ void Aggro(Unit *who) { }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ DoStartAttackNoMovement(who);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ DoStartAttackNoMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SonicBoom_Timer
+ if(SonicBoom_Timer < diff)
+ {
+ if(CanSonicBoom)
+ {
+ DoCast(m_creature, SPELL_SONIC_BOOM_CAST,true);
+ CanSonicBoom = false;
+ SonicBoom_Timer = 30000;
+ }
+ else
+ {
+ DoTextEmote(EMOTE_SONIC_BOOM,NULL);
+ DoCast(m_creature,SPELL_SONIC_BOOM_PRE);
+ CanSonicBoom = true;
+ SonicBoom_Timer = 5000;
+ }
+ }else SonicBoom_Timer -= diff;
+
+ //MurmursTouch_Timer
+ if(MurmursTouch_Timer < diff)
+ {
+ /*Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(target)
+ DoCast(target, SPELL_MURMURS_TOUCH);*/
+ DoCast(m_creature, SPELL_MURMURS_TOUCH);
+ MurmursTouch_Timer = 30000;
+ }else MurmursTouch_Timer -= diff;
+
+ //Resonance_Timer
+ if(Resonance_Timer < diff)
+ {
+ if( !m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
+ DoCast(m_creature->getVictim(), SPELL_RESONANCE);
+ Resonance_Timer = 5000;
+ }else Resonance_Timer -= diff;
+
+ //MagneticPull_Timer
+ if(MagneticPull_Timer < diff)
+ {
+ if( !CanShockWave )
+ {
+ if( Unit* temp = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp, SPELL_MAGNETIC_PULL);
+ pTarget = temp->GetGUID();
+ CanShockWave = true;
+ }
+ MagneticPull_Timer = 2500;
+ }
+ }
+ else
+ {
+ if( Unit* target = Unit::GetUnit(*m_creature,pTarget) )
+ target->CastSpell(target,SPELL_SHOCKWAVE,true);
+
+ MagneticPull_Timer = 35000;
+ CanShockWave = false;
+ pTarget = 0;
+ }
+ }else MagneticPull_Timer -= diff;
+
+ //no meele if preparing for sonic boom
+ if(!CanSonicBoom)
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_murmur(Creature *_Creature)
+{
+ return new boss_murmurAI (_Creature);
+}
+
+void AddSC_boss_murmur()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_murmur";
+ newscript->GetAI = GetAI_boss_murmur;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
index 38b30fcd6fa..3331999c83a 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
@@ -1,14 +1,14 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SHADOW_LABYRINTH_H
-#define DEF_SHADOW_LABYRINTH_H
-
-#define TYPE_HELLMAW 1
-#define TYPE_OVERSEER 2
-#define DATA_BLACKHEARTTHEINCITEREVENT 3
-#define DATA_GRANDMASTERVORPILEVENT 4
-#define DATA_MURMUREVENT 5
-#define DATA_GRANDMASTERVORPIL 6
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SHADOW_LABYRINTH_H
+#define DEF_SHADOW_LABYRINTH_H
+
+#define TYPE_HELLMAW 1
+#define TYPE_OVERSEER 2
+#define DATA_BLACKHEARTTHEINCITEREVENT 3
+#define DATA_GRANDMASTERVORPILEVENT 4
+#define DATA_MURMUREVENT 5
+#define DATA_GRANDMASTERVORPIL 6
+#endif
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
index 643887d64fb..1d482754cbc 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
@@ -1,178 +1,178 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Shadow_Labyrinth
-SD%Complete: 85
-SDComment: Some cleanup left along with save
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define ENCOUNTERS 5
-
-#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies
-#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies
-
-/* Shadow Labyrinth encounters:
-1 - Ambassador Hellmaw event
-2 - Blackheart the Inciter event
-3 - Grandmaster Vorpil event
-4 - Murmur event
-*/
-
-struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
-{
- instance_shadow_labyrinth(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
-
- GameObject *RefectoryDoor;
- GameObject *ScreamingHallDoor;
- uint64 GrandmasterVorpil;
- uint32 FelOverseerCount;
-
- void Initialize()
- {
- RefectoryDoor = NULL;
- ScreamingHallDoor = NULL;
- GrandmasterVorpil = 0;
- FelOverseerCount = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounter[i]) return true;
-
- return false;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case REFECTORY_DOOR:
- RefectoryDoor = go;
- break;
- case SCREAMING_HALL_DOOR:
- ScreamingHallDoor = go;
- break;
- }
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 18732:
- GrandmasterVorpil = creature->GetGUID();
- break;
- case 18796:
- ++FelOverseerCount;
- debug_log("SD2: Shadow Labyrinth: counting %u Fel Overseers.",FelOverseerCount);
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_HELLMAW:
- Encounter[0] = data;
- break;
-
- case TYPE_OVERSEER:
- if( data != DONE )
- error_log("SD2: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
- if( FelOverseerCount )
- {
- --FelOverseerCount;
- debug_log("SD2: Shadow Labyrinth: %u Fel Overseers left to kill.",FelOverseerCount);
- }
- if( FelOverseerCount == 0 )
- {
- Encounter[1] = DONE;
- debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE");
- }
- break;
-
- case DATA_BLACKHEARTTHEINCITEREVENT:
- if( data == DONE )
- {
- if( RefectoryDoor )
- RefectoryDoor->UseDoorOrButton();
- }
- Encounter[2] = data;
- break;
-
- case DATA_GRANDMASTERVORPILEVENT:
- if( data == DONE )
- {
- if( ScreamingHallDoor )
- ScreamingHallDoor->UseDoorOrButton();
- }
- Encounter[3] = data;
- break;
-
- case DATA_MURMUREVENT:
- Encounter[4] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch( type )
- {
- case TYPE_HELLMAW:
- return Encounter[0];
- case TYPE_OVERSEER:
- return Encounter[1];
- case DATA_GRANDMASTERVORPILEVENT:
- return Encounter[3];
- }
- return false;
- }
-
- uint64 GetData64(uint32 identifier)
- {
- if(identifier == DATA_GRANDMASTERVORPIL)
- return GrandmasterVorpil;
-
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map)
-{
- return new instance_shadow_labyrinth(map);
-}
-
-void AddSC_instance_shadow_labyrinth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_shadow_labyrinth";
- newscript->GetInstanceData = GetInstanceData_instance_shadow_labyrinth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Shadow_Labyrinth
+SD%Complete: 85
+SDComment: Some cleanup left along with save
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define ENCOUNTERS 5
+
+#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies
+#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies
+
+/* Shadow Labyrinth encounters:
+1 - Ambassador Hellmaw event
+2 - Blackheart the Inciter event
+3 - Grandmaster Vorpil event
+4 - Murmur event
+*/
+
+struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
+{
+ instance_shadow_labyrinth(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+
+ GameObject *RefectoryDoor;
+ GameObject *ScreamingHallDoor;
+ uint64 GrandmasterVorpil;
+ uint32 FelOverseerCount;
+
+ void Initialize()
+ {
+ RefectoryDoor = NULL;
+ ScreamingHallDoor = NULL;
+ GrandmasterVorpil = 0;
+ FelOverseerCount = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounter[i]) return true;
+
+ return false;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case REFECTORY_DOOR:
+ RefectoryDoor = go;
+ break;
+ case SCREAMING_HALL_DOOR:
+ ScreamingHallDoor = go;
+ break;
+ }
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 18732:
+ GrandmasterVorpil = creature->GetGUID();
+ break;
+ case 18796:
+ ++FelOverseerCount;
+ debug_log("SD2: Shadow Labyrinth: counting %u Fel Overseers.",FelOverseerCount);
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_HELLMAW:
+ Encounter[0] = data;
+ break;
+
+ case TYPE_OVERSEER:
+ if( data != DONE )
+ error_log("SD2: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
+ if( FelOverseerCount )
+ {
+ --FelOverseerCount;
+ debug_log("SD2: Shadow Labyrinth: %u Fel Overseers left to kill.",FelOverseerCount);
+ }
+ if( FelOverseerCount == 0 )
+ {
+ Encounter[1] = DONE;
+ debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE");
+ }
+ break;
+
+ case DATA_BLACKHEARTTHEINCITEREVENT:
+ if( data == DONE )
+ {
+ if( RefectoryDoor )
+ RefectoryDoor->UseDoorOrButton();
+ }
+ Encounter[2] = data;
+ break;
+
+ case DATA_GRANDMASTERVORPILEVENT:
+ if( data == DONE )
+ {
+ if( ScreamingHallDoor )
+ ScreamingHallDoor->UseDoorOrButton();
+ }
+ Encounter[3] = data;
+ break;
+
+ case DATA_MURMUREVENT:
+ Encounter[4] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch( type )
+ {
+ case TYPE_HELLMAW:
+ return Encounter[0];
+ case TYPE_OVERSEER:
+ return Encounter[1];
+ case DATA_GRANDMASTERVORPILEVENT:
+ return Encounter[3];
+ }
+ return false;
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ if(identifier == DATA_GRANDMASTERVORPIL)
+ return GrandmasterVorpil;
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map)
+{
+ return new instance_shadow_labyrinth(map);
+}
+
+void AddSC_instance_shadow_labyrinth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_shadow_labyrinth";
+ newscript->GetInstanceData = GetInstanceData_instance_shadow_labyrinth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
index b9ec3538637..101345850d6 100644
--- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
@@ -1,164 +1,164 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Azshara
-SD%Complete: 90
-SDComment: Quest support: 2744, 3141, 9364
-SDCategory: Azshara
-EndScriptData */
-
-/* ContentData
-mobs_spitelashes
-npc_loramus_thalipedes
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mobs_spitelashes
-######*/
-
-struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI
-{
- mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 morphtimer;
- bool spellhit;
-
- void Reset()
- {
- morphtimer = 0;
- spellhit = false;
- }
-
- void Aggro(Unit *who) { }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if( !spellhit &&
- Hitter->GetTypeId() == TYPEID_PLAYER &&
- ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
- (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) )
- {
- spellhit=true;
- DoCast(m_creature,29124); //become a sheep
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- // we mustn't remove the creature in the same round in which we cast the summon spell, otherwise there will be no summons
- if( spellhit && morphtimer>=5000 )
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse(); //you don't see any corpse on off.
- EnterEvadeMode(); //spellhit will be set to false
- }
- // walk 5 seconds before summoning
- if( spellhit && morphtimer<5000 )
- {
- morphtimer+=diff;
- if( morphtimer>=5000 )
- {
- DoCast(m_creature,28406); //summon copies
- DoCast(m_creature,6924); //visual explosion
- }
- }
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //TODO: add abilities for the different creatures
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_spitelashes(Creature *_Creature)
-{
- return new mobs_spitelashesAI (_Creature);
-}
-
-/*######
-## npc_loramus_thalipedes
-######*/
-
-bool GossipHello_npc_loramus_thalipedes(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_loramus_thalipedes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2744);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(1813, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->ADD_GOSSIP_ITEM( 0, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(1814, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->ADD_GOSSIP_ITEM( 0, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
- player->SEND_GOSSIP_MENU(1815, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+23:
- player->ADD_GOSSIP_ITEM( 0, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
- player->SEND_GOSSIP_MENU(1816, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+24:
- player->ADD_GOSSIP_ITEM( 0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
- player->SEND_GOSSIP_MENU(1817, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+25:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3141);
- break;
- }
- return true;
-}
-
-void AddSC_azshara()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_spitelashes";
- newscript->GetAI = GetAI_mobs_spitelashes;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_loramus_thalipedes";
- newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes;
- newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Azshara
+SD%Complete: 90
+SDComment: Quest support: 2744, 3141, 9364
+SDCategory: Azshara
+EndScriptData */
+
+/* ContentData
+mobs_spitelashes
+npc_loramus_thalipedes
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mobs_spitelashes
+######*/
+
+struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI
+{
+ mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 morphtimer;
+ bool spellhit;
+
+ void Reset()
+ {
+ morphtimer = 0;
+ spellhit = false;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if( !spellhit &&
+ Hitter->GetTypeId() == TYPEID_PLAYER &&
+ ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
+ (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) )
+ {
+ spellhit=true;
+ DoCast(m_creature,29124); //become a sheep
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ // we mustn't remove the creature in the same round in which we cast the summon spell, otherwise there will be no summons
+ if( spellhit && morphtimer>=5000 )
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse(); //you don't see any corpse on off.
+ EnterEvadeMode(); //spellhit will be set to false
+ }
+ // walk 5 seconds before summoning
+ if( spellhit && morphtimer<5000 )
+ {
+ morphtimer+=diff;
+ if( morphtimer>=5000 )
+ {
+ DoCast(m_creature,28406); //summon copies
+ DoCast(m_creature,6924); //visual explosion
+ }
+ }
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //TODO: add abilities for the different creatures
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_spitelashes(Creature *_Creature)
+{
+ return new mobs_spitelashesAI (_Creature);
+}
+
+/*######
+## npc_loramus_thalipedes
+######*/
+
+bool GossipHello_npc_loramus_thalipedes(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_loramus_thalipedes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2744);
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ player->SEND_GOSSIP_MENU(1813, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ player->ADD_GOSSIP_ITEM( 0, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(1814, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->ADD_GOSSIP_ITEM( 0, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
+ player->SEND_GOSSIP_MENU(1815, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+23:
+ player->ADD_GOSSIP_ITEM( 0, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
+ player->SEND_GOSSIP_MENU(1816, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+24:
+ player->ADD_GOSSIP_ITEM( 0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
+ player->SEND_GOSSIP_MENU(1817, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+25:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(3141);
+ break;
+ }
+ return true;
+}
+
+void AddSC_azshara()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_spitelashes";
+ newscript->GetAI = GetAI_mobs_spitelashes;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_loramus_thalipedes";
+ newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes;
+ newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
index 5705c9a44fb..2908dc04285 100644
--- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
@@ -1,153 +1,153 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Azuregos
-SD%Complete: 90
-SDComment: Teleport not included, spell reflect not effecting dots (Core problem)
-SDCategory: Azshara
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MARKOFFROST 23182
-#define SPELL_MANASTORM 21097
-#define SPELL_CHILL 21098
-#define SPELL_FROSTBREATH 21099
-#define SPELL_REFLECT 22067 //Old one was 30969
-#define SPELL_CLEAVE 8255 //Perhaps not right ID
-#define SPELL_ENRAGE 23537
-
-struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI
-{
- boss_azuregosAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MarkOfFrost_Timer;
- uint32 ManaStorm_Timer;
- uint32 Chill_Timer;
- uint32 Breath_Timer;
- uint32 Teleport_Timer;
- uint32 Reflect_Timer;
- uint32 Cleave_Timer;
- uint32 Enrage_Timer;
- bool Enraged;
-
- void Reset()
- {
- MarkOfFrost_Timer = 35000;
- ManaStorm_Timer = 5000 + rand()%12000;
- Chill_Timer = 10000 + rand()%20000;
- Breath_Timer = 2000 + rand()%6000;
- Teleport_Timer = 30000;
- Reflect_Timer = 15000 + rand()%15000;
- Cleave_Timer = 7000;
- Enrage_Timer = 0;
- Enraged = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(Teleport_Timer < diff)
- {
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list<HostilReference*>::iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
- }
- }
-
- DoResetThreat();
- Teleport_Timer = 30000;
- }else Teleport_Timer -= diff;
-
- // //MarkOfFrost_Timer
- // if (MarkOfFrost_Timer < diff)
- // {
- // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST);
- // MarkOfFrost_Timer = 25000;
- // }else MarkOfFrost_Timer -= diff;
-
- //Chill_Timer
- if (Chill_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CHILL);
- Chill_Timer = 13000 + rand()%12000;
- }else Chill_Timer -= diff;
-
- //Breath_Timer
- if (Breath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
- Breath_Timer = 10000 + rand()%5000;
- }else Breath_Timer -= diff;
-
- //ManaStorm_Timer
- if (ManaStorm_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_MANASTORM);
- ManaStorm_Timer = 7500 + rand()%5000;
- }else ManaStorm_Timer -= diff;
-
- //Reflect_Timer
- if (Reflect_Timer < diff)
- {
- DoCast(m_creature,SPELL_REFLECT);
- Reflect_Timer = 20000 + rand()%15000;
- }else Reflect_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //Enrage_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_azuregos(Creature *_Creature)
-{
- return new boss_azuregosAI (_Creature);
-}
-
-void AddSC_boss_azuregos()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_azuregos";
- newscript->GetAI = GetAI_boss_azuregos;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Azuregos
+SD%Complete: 90
+SDComment: Teleport not included, spell reflect not effecting dots (Core problem)
+SDCategory: Azshara
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MARKOFFROST 23182
+#define SPELL_MANASTORM 21097
+#define SPELL_CHILL 21098
+#define SPELL_FROSTBREATH 21099
+#define SPELL_REFLECT 22067 //Old one was 30969
+#define SPELL_CLEAVE 8255 //Perhaps not right ID
+#define SPELL_ENRAGE 23537
+
+struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI
+{
+ boss_azuregosAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MarkOfFrost_Timer;
+ uint32 ManaStorm_Timer;
+ uint32 Chill_Timer;
+ uint32 Breath_Timer;
+ uint32 Teleport_Timer;
+ uint32 Reflect_Timer;
+ uint32 Cleave_Timer;
+ uint32 Enrage_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ MarkOfFrost_Timer = 35000;
+ ManaStorm_Timer = 5000 + rand()%12000;
+ Chill_Timer = 10000 + rand()%20000;
+ Breath_Timer = 2000 + rand()%6000;
+ Teleport_Timer = 30000;
+ Reflect_Timer = 15000 + rand()%15000;
+ Cleave_Timer = 7000;
+ Enrage_Timer = 0;
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(Teleport_Timer < diff)
+ {
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
+ }
+ }
+
+ DoResetThreat();
+ Teleport_Timer = 30000;
+ }else Teleport_Timer -= diff;
+
+ // //MarkOfFrost_Timer
+ // if (MarkOfFrost_Timer < diff)
+ // {
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST);
+ // MarkOfFrost_Timer = 25000;
+ // }else MarkOfFrost_Timer -= diff;
+
+ //Chill_Timer
+ if (Chill_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHILL);
+ Chill_Timer = 13000 + rand()%12000;
+ }else Chill_Timer -= diff;
+
+ //Breath_Timer
+ if (Breath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
+ Breath_Timer = 10000 + rand()%5000;
+ }else Breath_Timer -= diff;
+
+ //ManaStorm_Timer
+ if (ManaStorm_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_MANASTORM);
+ ManaStorm_Timer = 7500 + rand()%5000;
+ }else ManaStorm_Timer -= diff;
+
+ //Reflect_Timer
+ if (Reflect_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_REFLECT);
+ Reflect_Timer = 20000 + rand()%15000;
+ }else Reflect_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //Enrage_Timer
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_azuregos(Creature *_Creature)
+{
+ return new boss_azuregosAI (_Creature);
+}
+
+void AddSC_boss_azuregos()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_azuregos";
+ newscript->GetAI = GetAI_boss_azuregos;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
index 285d73fa574..43209b64ba8 100644
--- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
@@ -1,372 +1,372 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Azuremyst_Isle
-SD%Complete: 75
-SDComment: Quest support: 9283, 9537, 9554(special flight path, proper model for mount missing). Injured Draenei cosmetic only
-SDCategory: Azuremyst Isle
-EndScriptData */
-
-/* ContentData
-npc_draenei_survivor
-npc_engineer_spark_overgrind
-npc_injured_draenei
-npc_susurrus
-EndContentData */
-
-#include "precompiled.h"
-#include <cmath>
-
-/*######
-## npc_draenei_survivor
-######*/
-
-#define HEAL1 "The last thing I remember is the ship falling and us getting into the pods. I'll go see how I can help. Thank you!"
-#define HEAL2 "$C, Where am I? Who are you? Oh no! What happened to the ship?."
-#define HEAL3 "$C You saved me! I owe you a debt that I can never repay. I'll go see if I can help the others."
-#define HEAL4 "Ugh... what is this place? Is that all that's left of the ship over there?"
-
-#define HELP1 "Oh, the pain..."
-#define HELP2 "Everything hurts, Please make it stop..."
-#define HELP3 "Ughhh... I hurt. Can you help me?"
-#define HELP4 "I don't know if I can make it, please help me..."
-
-struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
-{
- npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 UnSpawnTimer;
- uint32 ResetlifeTimer;
- uint32 SayingTimer;
- uint32 HealSayTimer;
- bool UnSpawn;
- bool say;
- bool HealSay;
- bool isRun;
- bool isMove;
-
- void Reset()
- {
- UnSpawnTimer = 2500;
- ResetlifeTimer= 60000;
- SayingTimer = 5000;
- HealSayTimer = 6000;
- say = false;
- isRun = false;
- isMove = false;
- UnSpawn = false;
- HealSay = false;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //cast red shining
- m_creature->CastSpell(m_creature, 29152, false, NULL);
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
- {
- if (!who)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
- {
- switch (rand()%4) //Random switch between 4 texts
- {
- case 0:
- DoSay(HELP1, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 1:
- DoSay(HELP2, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 2:
- DoSay(HELP3, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 3:
- DoSay(HELP4, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- }
- }
- else
- {
- isRun = false;
- }
- }
-
- void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
- {
- if (m_creature->GetHealth() > 50)
- {
- if(ResetlifeTimer < diff)
- {
- ResetlifeTimer = 60000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- // ley down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
- }
- else ResetlifeTimer -= diff;
- }
-
- if(HealSay)
- {
- if (HealSayTimer < diff)
- {
- UnSpawn = true;
- isRun = true;
- isMove = true;
- }else HealSayTimer -= diff;
- }
-
- if(UnSpawn)
- {
- if(isMove)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
- isMove = false;
- }
-
- if (UnSpawnTimer < diff)
- {
- m_creature->StopMoving();
- EnterEvadeMode();
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
-
- }else UnSpawnTimer -= diff;
- }
-
- if(SayingTimer < diff)
- {
- say = true;
- }else SayingTimer -= diff;
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
- {
- if (Hitter && Spellkind->Id == 28880)
- {
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- m_creature->HandleEmoteCommand(ANIM_RISE);
- switch (rand()%4) //This switch doesn't work at all, creature say nothing!
- {
- case 0: DoSay(HEAL1, LANG_UNIVERSAL, Hitter); break;
- case 1: DoSay(HEAL2, LANG_UNIVERSAL, Hitter); break;
- case 2: DoSay(HEAL3, LANG_UNIVERSAL, Hitter); break;
- case 3: DoSay(HEAL4, LANG_UNIVERSAL, Hitter); break;
- }
- HealSay = true;
- }
- }
-};
-CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
-{
- return new npc_draenei_survivorAI (_Creature);
-}
-
-/*######
-## npc_engineer_spark_overgrind
-######*/
-
-#define SAY_TEXT "Yes Master, all goes along as planned."
-#define SAY_EMOTE "puts the shell to his ear."
-#define GOSSIP_FIGHT "Traitor! You will be brought to justice!"
-#define ATTACK_YELL "Now I cut you!"
-#define SPELL_DYNAMITE 7978
-
-struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI
-{
- npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Dynamite_Timer;
- uint32 Emote_Timer;
-
- void Reset()
- {
- Dynamite_Timer = 8000;
- Emote_Timer = 120000 + rand()%30000;
- m_creature->setFaction(875);
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( !InCombat )
- {
- if (Emote_Timer < diff)
- {
- DoSay(SAY_TEXT,LANG_UNIVERSAL,NULL);
- DoTextEmote(SAY_EMOTE,NULL);
- Emote_Timer = 120000 + rand()%30000;
- }else Emote_Timer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (Dynamite_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
- Dynamite_Timer = 8000;
- } else Dynamite_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature *_Creature)
-{
- return new npc_engineer_spark_overgrindAI (_Creature);
-}
-
-bool GossipHello_npc_engineer_spark_overgrind(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(9537) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(0, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_engineer_spark_overgrind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(14);
- _Creature->Yell(ATTACK_YELL, LANG_UNIVERSAL, player->GetGUID());
- ((npc_engineer_spark_overgrindAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-## npc_injured_draenei
-######*/
-
-struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
-{
- npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
- switch (rand()%2)
- {
- case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
- case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
- }
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- return; //ignore everyone around them (won't aggro anything)
- }
-
- void UpdateAI(const uint32 diff)
- {
- return;
- }
-
-};
-CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
-{
- return new npc_injured_draeneiAI (_Creature);
-}
-
-/*######
-## npc_susurrus
-######*/
-
-bool GossipHello_npc_susurrus(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->HasItemCount(23843,1,true))
- player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,32474,true); //apparently correct spell, possible not correct place to cast, or correct caster
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 92; //from susurrus
- nodes[1] = 91; //end at exodar
- player->ActivateTaxiPathTo(nodes,11686); //TaxiPath 506. Using invisible model, possible Trinity must allow 0(from dbc) for cases like this.
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_azuremyst_isle()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_draenei_survivor";
- newscript->GetAI = GetAI_npc_draenei_survivor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_engineer_spark_overgrind";
- newscript->GetAI = GetAI_npc_engineer_spark_overgrind;
- newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind;
- newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_injured_draenei";
- newscript->GetAI = GetAI_npc_injured_draenei;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_susurrus";
- newscript->pGossipHello = &GossipHello_npc_susurrus;
- newscript->pGossipSelect = &GossipSelect_npc_susurrus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Azuremyst_Isle
+SD%Complete: 75
+SDComment: Quest support: 9283, 9537, 9554(special flight path, proper model for mount missing). Injured Draenei cosmetic only
+SDCategory: Azuremyst Isle
+EndScriptData */
+
+/* ContentData
+npc_draenei_survivor
+npc_engineer_spark_overgrind
+npc_injured_draenei
+npc_susurrus
+EndContentData */
+
+#include "precompiled.h"
+#include <cmath>
+
+/*######
+## npc_draenei_survivor
+######*/
+
+#define HEAL1 "The last thing I remember is the ship falling and us getting into the pods. I'll go see how I can help. Thank you!"
+#define HEAL2 "$C, Where am I? Who are you? Oh no! What happened to the ship?."
+#define HEAL3 "$C You saved me! I owe you a debt that I can never repay. I'll go see if I can help the others."
+#define HEAL4 "Ugh... what is this place? Is that all that's left of the ship over there?"
+
+#define HELP1 "Oh, the pain..."
+#define HELP2 "Everything hurts, Please make it stop..."
+#define HELP3 "Ughhh... I hurt. Can you help me?"
+#define HELP4 "I don't know if I can make it, please help me..."
+
+struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
+{
+ npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 UnSpawnTimer;
+ uint32 ResetlifeTimer;
+ uint32 SayingTimer;
+ uint32 HealSayTimer;
+ bool UnSpawn;
+ bool say;
+ bool HealSay;
+ bool isRun;
+ bool isMove;
+
+ void Reset()
+ {
+ UnSpawnTimer = 2500;
+ ResetlifeTimer= 60000;
+ SayingTimer = 5000;
+ HealSayTimer = 6000;
+ say = false;
+ isRun = false;
+ isMove = false;
+ UnSpawn = false;
+ HealSay = false;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //cast red shining
+ m_creature->CastSpell(m_creature, 29152, false, NULL);
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
+ {
+ if (!who)
+ return;
+
+ if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
+ {
+ switch (rand()%4) //Random switch between 4 texts
+ {
+ case 0:
+ DoSay(HELP1, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 1:
+ DoSay(HELP2, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 2:
+ DoSay(HELP3, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 3:
+ DoSay(HELP4, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ }
+ }
+ else
+ {
+ isRun = false;
+ }
+ }
+
+ void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
+ {
+ if (m_creature->GetHealth() > 50)
+ {
+ if(ResetlifeTimer < diff)
+ {
+ ResetlifeTimer = 60000;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+ // ley down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
+ }
+ else ResetlifeTimer -= diff;
+ }
+
+ if(HealSay)
+ {
+ if (HealSayTimer < diff)
+ {
+ UnSpawn = true;
+ isRun = true;
+ isMove = true;
+ }else HealSayTimer -= diff;
+ }
+
+ if(UnSpawn)
+ {
+ if(isMove)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
+ isMove = false;
+ }
+
+ if (UnSpawnTimer < diff)
+ {
+ m_creature->StopMoving();
+ EnterEvadeMode();
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+
+ }else UnSpawnTimer -= diff;
+ }
+
+ if(SayingTimer < diff)
+ {
+ say = true;
+ }else SayingTimer -= diff;
+ }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
+ {
+ if (Hitter && Spellkind->Id == 28880)
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
+ m_creature->HandleEmoteCommand(ANIM_RISE);
+ switch (rand()%4) //This switch doesn't work at all, creature say nothing!
+ {
+ case 0: DoSay(HEAL1, LANG_UNIVERSAL, Hitter); break;
+ case 1: DoSay(HEAL2, LANG_UNIVERSAL, Hitter); break;
+ case 2: DoSay(HEAL3, LANG_UNIVERSAL, Hitter); break;
+ case 3: DoSay(HEAL4, LANG_UNIVERSAL, Hitter); break;
+ }
+ HealSay = true;
+ }
+ }
+};
+CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
+{
+ return new npc_draenei_survivorAI (_Creature);
+}
+
+/*######
+## npc_engineer_spark_overgrind
+######*/
+
+#define SAY_TEXT "Yes Master, all goes along as planned."
+#define SAY_EMOTE "puts the shell to his ear."
+#define GOSSIP_FIGHT "Traitor! You will be brought to justice!"
+#define ATTACK_YELL "Now I cut you!"
+#define SPELL_DYNAMITE 7978
+
+struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI
+{
+ npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Dynamite_Timer;
+ uint32 Emote_Timer;
+
+ void Reset()
+ {
+ Dynamite_Timer = 8000;
+ Emote_Timer = 120000 + rand()%30000;
+ m_creature->setFaction(875);
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !InCombat )
+ {
+ if (Emote_Timer < diff)
+ {
+ DoSay(SAY_TEXT,LANG_UNIVERSAL,NULL);
+ DoTextEmote(SAY_EMOTE,NULL);
+ Emote_Timer = 120000 + rand()%30000;
+ }else Emote_Timer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (Dynamite_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
+ Dynamite_Timer = 8000;
+ } else Dynamite_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature *_Creature)
+{
+ return new npc_engineer_spark_overgrindAI (_Creature);
+}
+
+bool GossipHello_npc_engineer_spark_overgrind(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(9537) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_engineer_spark_overgrind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(14);
+ _Creature->Yell(ATTACK_YELL, LANG_UNIVERSAL, player->GetGUID());
+ ((npc_engineer_spark_overgrindAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+## npc_injured_draenei
+######*/
+
+struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
+{
+ npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
+ switch (rand()%2)
+ {
+ case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
+ case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
+ }
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return; //ignore everyone around them (won't aggro anything)
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ return;
+ }
+
+};
+CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
+{
+ return new npc_injured_draeneiAI (_Creature);
+}
+
+/*######
+## npc_susurrus
+######*/
+
+bool GossipHello_npc_susurrus(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->HasItemCount(23843,1,true))
+ player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,32474,true); //apparently correct spell, possible not correct place to cast, or correct caster
+
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 92; //from susurrus
+ nodes[1] = 91; //end at exodar
+ player->ActivateTaxiPathTo(nodes,11686); //TaxiPath 506. Using invisible model, possible Trinity must allow 0(from dbc) for cases like this.
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_azuremyst_isle()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_draenei_survivor";
+ newscript->GetAI = GetAI_npc_draenei_survivor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_engineer_spark_overgrind";
+ newscript->GetAI = GetAI_npc_engineer_spark_overgrind;
+ newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind;
+ newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_injured_draenei";
+ newscript->GetAI = GetAI_npc_injured_draenei;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_susurrus";
+ newscript->pGossipHello = &GossipHello_npc_susurrus;
+ newscript->pGossipSelect = &GossipSelect_npc_susurrus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index 3f1ebd4803b..fda28d32999 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -1,386 +1,386 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: The_Barrens
-SD%Complete: 90
-SDComment: Quest support: 2458, 4921, 6981
-SDCategory: Barrens
-EndScriptData */
-
-/* ContentData
-npc_beaten_corpse
-npc_sputtervalve
-npc_taskmaster_fizzule remove hack when Trinity implement feature/detect spell kind to not aggro
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_beaten_corpse
-######*/
-
-bool GossipHello_npc_beaten_corpse(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(4921) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(4921) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(0,"Examine corpse in detail...",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(3557,_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF +1)
- {
- player->SEND_GOSSIP_MENU(3558,_Creature->GetGUID());
- player->KilledMonster( 10668,_Creature->GetGUID() );
- }
- return true;
-}
-
-/*######
-## npc_sputtervalve
-######*/
-
-bool GossipHello_npc_sputtervalve(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0,"Can you tell me about this shard?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF)
- {
- player->SEND_GOSSIP_MENU(2013,_Creature->GetGUID());
- player->AreaExploredOrEventHappens(6981);
- }
- return true;
-}
-
-/*######
-## npc_taskmaster_fizzule
-######*/
-
-//#define FACTION_HOSTILE_F 430
-#define FACTION_HOSTILE_F 16
-#define FACTION_FRIENDLY_F 35
-
-#define SPELL_FLARE 10113
-#define SPELL_FOLLY 10137
-
-struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
-{
- npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- bool IsFriend;
- uint32 Reset_Timer;
- uint32 FlareCount;
-
- void Reset()
- {
- IsFriend = false;
- Reset_Timer = 120000;
- FlareCount = 0;
- m_creature->setFaction(FACTION_HOSTILE_F);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- }
-
- //This is a hack. Spellcast will make creature aggro but that is not
- //supposed to happen (Trinity not implemented/not found way to detect this spell kind)
- void DoUglyHack()
- {
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY )
- {
- DoUglyHack();
- ++FlareCount;
- if( FlareCount >= 2 )
- {
- m_creature->setFaction(FACTION_FRIENDLY_F);
- IsFriend = true;
- }
- }
- }
-
- void Aggro(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( IsFriend )
- {
- if( Reset_Timer < diff )
- {
- EnterEvadeMode();
- } else Reset_Timer -= diff;
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature)
-{
- return new npc_taskmaster_fizzuleAI (_Creature);
-}
-
-bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE )
- {
- if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- }
- }
- return true;
-}
-/*#####
-## npc_twiggy_flathead
-#####*/
-
-#define BIG_WILL 6238
-#define AFFRAY_CHALLENGER 6240
-#define SAY_BIG_WILL_READY "Ready when you are, warrior"
-#define SAY_TWIGGY_FLATHEAD_BEGIN "The Affray has begun, get ready to fight!"
-#define SAY_TWIGGY_FLATHEAD_FRAY "You! Enter the fray!"
-#define SAY_TWIGGY_FLATHEAD_DOWN "Challenger is down!"
-#define SAY_TWIGGY_FLATHEAD_OVER "The Affray is over"
-
-float AffrayChallengerLoc[6][4]=
-{
- {-1683, -4326, 2.79, 0},
- {-1682, -4329, 2.79, 0},
- {-1683, -4330, 2.79, 0},
- {-1680, -4334, 2.79, 1.49},
- {-1674, -4326, 2.79, 3.49},
- {-1677, -4334, 2.79, 1.66}
-};
-
-struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
-{
- npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool EventInProgress;
- bool EventGrate;
- bool EventBigWill;
- bool Challenger_down[6];
- uint32 Wave;
- uint32 Wave_Timer;
- uint32 Challenger_checker;
- uint64 PlayerGUID;
- uint64 AffrayChallenger[6];
- uint64 BigWill;
-
- void Reset()
- {
- EventInProgress = false;
- EventGrate = false;
- EventBigWill = false;
- Wave_Timer = 600000;
- Challenger_checker = 0;
- Wave = 0;
- PlayerGUID = 0;
-
- for(uint8 i = 0; i < 6; i++) {
- AffrayChallenger[i] = 0;
- Challenger_down[i] = false;
- }
- BigWill = 0;
- }
-
- void Aggro(Unit *who) { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive())) return;
-
- if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
- {
- PlayerGUID = who->GetGUID();
- EventInProgress = true;
- }
- }
-
- void KilledUnit(Unit *victim) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (EventInProgress) {
- Player* pWarrior = NULL;
-
- if(PlayerGUID)
- pWarrior = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
-
- if(!pWarrior)
- return;
-
- if(!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
- EventInProgress = false;
- DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
- pWarrior->FailQuest(1719);
-
- for(uint8 i = 0; i < 6; i++) {
- if (AffrayChallenger[i]) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
- if(pCreature) {
- if(pCreature->isAlive()) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->setDeathState(JUST_DIED);
- }
- }
- }
- AffrayChallenger[i] = 0;
- Challenger_down[i] = false;
- }
-
- if (BigWill) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
- if(pCreature) {
- if(pCreature->isAlive()) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->setDeathState(JUST_DIED);
- }
- }
- }
- BigWill = 0;
- }
-
- if (!EventGrate && EventInProgress) {
- float x,y,z;
- pWarrior->GetPosition(x, y, z);
-
- if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
- pWarrior->AreaExploredOrEventHappens(1719);
- DoYell(SAY_TWIGGY_FLATHEAD_BEGIN,LANG_UNIVERSAL,NULL);
-
- for(uint8 i = 0; i < 6; i++) {
- Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
- pCreature->setFaction(35);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->HandleEmoteCommand(15);
- AffrayChallenger[i] = pCreature->GetGUID();
- }
- Wave_Timer = 5000;
- Challenger_checker = 1000;
- EventGrate = true;
- }
- }
- else if (EventInProgress) {
- if (Challenger_checker < diff) {
- for(uint8 i = 0; i < 6; i++) {
- if (AffrayChallenger[i]) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
- if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) {
- DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
- Challenger_down[i] = true;
- }
- }
- }
- Challenger_checker = 1000;
- } else Challenger_checker -= diff;
-
- if(Wave_Timer < diff) {
- if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) {
- DoYell(SAY_TWIGGY_FLATHEAD_FRAY,LANG_UNIVERSAL,NULL);
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
- if(pCreature || (pCreature->isAlive())) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->HandleEmoteCommand(15);
- pCreature->setFaction(14);
- ((CreatureAI*)pCreature->AI())->AttackStart(pWarrior);
- Wave++;
- Wave_Timer = 20000;
- }
- }
- else if (Wave >= 6 && !EventBigWill) {
- Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000);
- BigWill = pCreature->GetGUID();
- //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
- //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78);
- pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79);
- //pCreature->HandleEmoteCommand(15);
- pCreature->HandleEmoteCommand(27);
- EventBigWill = true;
- Wave_Timer = 1000;
- }
- else if (Wave >= 6 && EventBigWill && BigWill) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
- if (!pCreature->isAlive()) {
- DoYell(SAY_TWIGGY_FLATHEAD_OVER,LANG_UNIVERSAL,NULL);
- EventInProgress = false;
- EventBigWill = false;
- EventGrate = false;
- PlayerGUID = 0;
- Wave = 0;
- }
- }
- } else Wave_Timer -= diff;
- }
- }
- }
-};
-CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature)
-{
- return new npc_twiggy_flatheadAI (_Creature);
-}
-void AddSC_the_barrens()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_beaten_corpse";
- newscript->pGossipHello = &GossipHello_npc_beaten_corpse;
- newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_sputtervalve";
- newscript->pGossipHello = &GossipHello_npc_sputtervalve;
- newscript->pGossipSelect = &GossipSelect_npc_sputtervalve;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_taskmaster_fizzule";
- newscript->GetAI = GetAI_npc_taskmaster_fizzule;
- newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_twiggy_flathead";
- newscript->GetAI = GetAI_npc_twiggy_flathead;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: The_Barrens
+SD%Complete: 90
+SDComment: Quest support: 2458, 4921, 6981
+SDCategory: Barrens
+EndScriptData */
+
+/* ContentData
+npc_beaten_corpse
+npc_sputtervalve
+npc_taskmaster_fizzule remove hack when Trinity implement feature/detect spell kind to not aggro
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_beaten_corpse
+######*/
+
+bool GossipHello_npc_beaten_corpse(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(4921) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(4921) == QUEST_STATUS_COMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"Examine corpse in detail...",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(3557,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF +1)
+ {
+ player->SEND_GOSSIP_MENU(3558,_Creature->GetGUID());
+ player->KilledMonster( 10668,_Creature->GetGUID() );
+ }
+ return true;
+}
+
+/*######
+## npc_sputtervalve
+######*/
+
+bool GossipHello_npc_sputtervalve(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"Can you tell me about this shard?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF)
+ {
+ player->SEND_GOSSIP_MENU(2013,_Creature->GetGUID());
+ player->AreaExploredOrEventHappens(6981);
+ }
+ return true;
+}
+
+/*######
+## npc_taskmaster_fizzule
+######*/
+
+//#define FACTION_HOSTILE_F 430
+#define FACTION_HOSTILE_F 16
+#define FACTION_FRIENDLY_F 35
+
+#define SPELL_FLARE 10113
+#define SPELL_FOLLY 10137
+
+struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
+{
+ npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ bool IsFriend;
+ uint32 Reset_Timer;
+ uint32 FlareCount;
+
+ void Reset()
+ {
+ IsFriend = false;
+ Reset_Timer = 120000;
+ FlareCount = 0;
+ m_creature->setFaction(FACTION_HOSTILE_F);
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ }
+
+ //This is a hack. Spellcast will make creature aggro but that is not
+ //supposed to happen (Trinity not implemented/not found way to detect this spell kind)
+ void DoUglyHack()
+ {
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY )
+ {
+ DoUglyHack();
+ ++FlareCount;
+ if( FlareCount >= 2 )
+ {
+ m_creature->setFaction(FACTION_FRIENDLY_F);
+ IsFriend = true;
+ }
+ }
+ }
+
+ void Aggro(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( IsFriend )
+ {
+ if( Reset_Timer < diff )
+ {
+ EnterEvadeMode();
+ } else Reset_Timer -= diff;
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature)
+{
+ return new npc_taskmaster_fizzuleAI (_Creature);
+}
+
+bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( emote == TEXTEMOTE_SALUTE )
+ {
+ if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ }
+ }
+ return true;
+}
+/*#####
+## npc_twiggy_flathead
+#####*/
+
+#define BIG_WILL 6238
+#define AFFRAY_CHALLENGER 6240
+#define SAY_BIG_WILL_READY "Ready when you are, warrior"
+#define SAY_TWIGGY_FLATHEAD_BEGIN "The Affray has begun, get ready to fight!"
+#define SAY_TWIGGY_FLATHEAD_FRAY "You! Enter the fray!"
+#define SAY_TWIGGY_FLATHEAD_DOWN "Challenger is down!"
+#define SAY_TWIGGY_FLATHEAD_OVER "The Affray is over"
+
+float AffrayChallengerLoc[6][4]=
+{
+ {-1683, -4326, 2.79, 0},
+ {-1682, -4329, 2.79, 0},
+ {-1683, -4330, 2.79, 0},
+ {-1680, -4334, 2.79, 1.49},
+ {-1674, -4326, 2.79, 3.49},
+ {-1677, -4334, 2.79, 1.66}
+};
+
+struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
+{
+ npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool EventInProgress;
+ bool EventGrate;
+ bool EventBigWill;
+ bool Challenger_down[6];
+ uint32 Wave;
+ uint32 Wave_Timer;
+ uint32 Challenger_checker;
+ uint64 PlayerGUID;
+ uint64 AffrayChallenger[6];
+ uint64 BigWill;
+
+ void Reset()
+ {
+ EventInProgress = false;
+ EventGrate = false;
+ EventBigWill = false;
+ Wave_Timer = 600000;
+ Challenger_checker = 0;
+ Wave = 0;
+ PlayerGUID = 0;
+
+ for(uint8 i = 0; i < 6; i++) {
+ AffrayChallenger[i] = 0;
+ Challenger_down[i] = false;
+ }
+ BigWill = 0;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive())) return;
+
+ if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
+ {
+ PlayerGUID = who->GetGUID();
+ EventInProgress = true;
+ }
+ }
+
+ void KilledUnit(Unit *victim) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (EventInProgress) {
+ Player* pWarrior = NULL;
+
+ if(PlayerGUID)
+ pWarrior = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
+
+ if(!pWarrior)
+ return;
+
+ if(!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
+ EventInProgress = false;
+ DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
+ pWarrior->FailQuest(1719);
+
+ for(uint8 i = 0; i < 6; i++) {
+ if (AffrayChallenger[i]) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
+ if(pCreature) {
+ if(pCreature->isAlive()) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->setDeathState(JUST_DIED);
+ }
+ }
+ }
+ AffrayChallenger[i] = 0;
+ Challenger_down[i] = false;
+ }
+
+ if (BigWill) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
+ if(pCreature) {
+ if(pCreature->isAlive()) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->setDeathState(JUST_DIED);
+ }
+ }
+ }
+ BigWill = 0;
+ }
+
+ if (!EventGrate && EventInProgress) {
+ float x,y,z;
+ pWarrior->GetPosition(x, y, z);
+
+ if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
+ pWarrior->AreaExploredOrEventHappens(1719);
+ DoYell(SAY_TWIGGY_FLATHEAD_BEGIN,LANG_UNIVERSAL,NULL);
+
+ for(uint8 i = 0; i < 6; i++) {
+ Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ pCreature->setFaction(35);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->HandleEmoteCommand(15);
+ AffrayChallenger[i] = pCreature->GetGUID();
+ }
+ Wave_Timer = 5000;
+ Challenger_checker = 1000;
+ EventGrate = true;
+ }
+ }
+ else if (EventInProgress) {
+ if (Challenger_checker < diff) {
+ for(uint8 i = 0; i < 6; i++) {
+ if (AffrayChallenger[i]) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
+ if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) {
+ DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
+ Challenger_down[i] = true;
+ }
+ }
+ }
+ Challenger_checker = 1000;
+ } else Challenger_checker -= diff;
+
+ if(Wave_Timer < diff) {
+ if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) {
+ DoYell(SAY_TWIGGY_FLATHEAD_FRAY,LANG_UNIVERSAL,NULL);
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
+ if(pCreature || (pCreature->isAlive())) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->HandleEmoteCommand(15);
+ pCreature->setFaction(14);
+ ((CreatureAI*)pCreature->AI())->AttackStart(pWarrior);
+ Wave++;
+ Wave_Timer = 20000;
+ }
+ }
+ else if (Wave >= 6 && !EventBigWill) {
+ Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000);
+ BigWill = pCreature->GetGUID();
+ //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
+ //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78);
+ pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79);
+ //pCreature->HandleEmoteCommand(15);
+ pCreature->HandleEmoteCommand(27);
+ EventBigWill = true;
+ Wave_Timer = 1000;
+ }
+ else if (Wave >= 6 && EventBigWill && BigWill) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
+ if (!pCreature->isAlive()) {
+ DoYell(SAY_TWIGGY_FLATHEAD_OVER,LANG_UNIVERSAL,NULL);
+ EventInProgress = false;
+ EventBigWill = false;
+ EventGrate = false;
+ PlayerGUID = 0;
+ Wave = 0;
+ }
+ }
+ } else Wave_Timer -= diff;
+ }
+ }
+ }
+};
+CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature)
+{
+ return new npc_twiggy_flatheadAI (_Creature);
+}
+void AddSC_the_barrens()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_beaten_corpse";
+ newscript->pGossipHello = &GossipHello_npc_beaten_corpse;
+ newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_sputtervalve";
+ newscript->pGossipHello = &GossipHello_npc_sputtervalve;
+ newscript->pGossipSelect = &GossipSelect_npc_sputtervalve;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_taskmaster_fizzule";
+ newscript->GetAI = GetAI_npc_taskmaster_fizzule;
+ newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_twiggy_flathead";
+ newscript->GetAI = GetAI_npc_twiggy_flathead;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
index b4b3404a878..757f6acef06 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
@@ -1,68 +1,68 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Black_Temple
-SD%Complete: 95
-SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip.
-SDCategory: Black Temple
-EndScriptData */
-
-/* ContentData
-npc_spirit_of_olum
-EndContentData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-/*###
-# npc_spirit_of_olum
-####*/
-
-#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's
-#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn"
-
-bool GossipHello_npc_spirit_of_olum(Player* player, Creature* _Creature)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
-
- if(pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_spirit_of_olum(Player* player, Creature* _Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF + 1)
- player->CLOSE_GOSSIP_MENU();
-
- player->InterruptNonMeleeSpells(false);
- player->CastSpell(player, SPELL_TELEPORT, false);
- return true;
-}
-
-void AddSC_black_temple()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_spirit_of_olum";
- newscript->pGossipHello = GossipHello_npc_spirit_of_olum;
- newscript->pGossipSelect = GossipSelect_npc_spirit_of_olum;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Black_Temple
+SD%Complete: 95
+SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip.
+SDCategory: Black Temple
+EndScriptData */
+
+/* ContentData
+npc_spirit_of_olum
+EndContentData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+/*###
+# npc_spirit_of_olum
+####*/
+
+#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's
+#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn"
+
+bool GossipHello_npc_spirit_of_olum(Player* player, Creature* _Creature)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+
+ if(pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_spirit_of_olum(Player* player, Creature* _Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF + 1)
+ player->CLOSE_GOSSIP_MENU();
+
+ player->InterruptNonMeleeSpells(false);
+ player->CastSpell(player, SPELL_TELEPORT, false);
+ return true;
+}
+
+void AddSC_black_temple()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_spirit_of_olum";
+ newscript->pGossipHello = GossipHello_npc_spirit_of_olum;
+ newscript->pGossipSelect = GossipSelect_npc_spirit_of_olum;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
index 86d823bd3af..44bf36cad93 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
@@ -1,365 +1,365 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Bloodboil
-SD%Complete: 80
-SDComment: Bloodboil not working correctly, missing enrage
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_ACID_GEYSER 40630
-#define SPELL_ACIDIC_WOUND 40481
-#define SPELL_ARCING_SMASH 40599
-#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be
-#define SPELL_FEL_ACID 40508
-#define SPELL_FEL_RAGE_SELF 40594
-#define SPELL_FEL_RAGE_TARGET 40604
-#define SPELL_FEL_RAGE_2 40616
-#define SPELL_FEL_RAGE_3 41625
-#define SPELL_BEWILDERING_STRIKE 40491
-#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think)
-#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?)
-#define SPELL_TAUNT_GURTOGG 40603
-#define SPELL_INSIGNIFIGANCE 40618
-#define SPELL_BERSERK 45078
-
-//Speech'n'Sound
-#define SAY_AGGRO "Horde will crush you!"
-#define SOUND_AGGRO 11432
-
-#define SAY_SLAY1 "Time to feast!"
-#define SOUND_SLAY1 11433
-
-#define SAY_SLAY2 "More! I want more!"
-#define SOUND_SLAY2 11434
-
-#define SAY_SPECIAL1 "Drink your blood! Eat your flesh!"
-#define SOUND_SPECIAL1 11435
-
-#define SAY_SPECIAL2 "I hunger!"
-#define SOUND_SPECIAL2 11436
-
-#define SAY_ENRAGE "I'll rip the meat from your bones!"
-#define SOUND_ENRAGE 11437
-
-#define SOUND_DEATH 11439
-
-//This is used to sort the players by distance in preparation for the Bloodboil cast.
-struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator ">"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
-{
- boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 TargetGUID;
-
- float TargetThreat;
-
- uint32 BloodboilTimer;
- uint32 BloodboilCount;
- uint32 AcidGeyserTimer;
- uint32 AcidicWoundTimer;
- uint32 ArcingSmashTimer;
- uint32 EnrageTimer;
- uint32 FelAcidTimer;
- uint32 EjectTimer;
- uint32 BewilderingStrikeTimer;
- uint32 PhaseChangeTimer;
-
- bool Phase1;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
-
- TargetGUID = 0;
-
- TargetThreat = 0;
-
- BloodboilTimer = 10000;
- BloodboilCount = 0;
- AcidGeyserTimer = 1000;
- AcidicWoundTimer = 6000;
- ArcingSmashTimer = 19000;
- EnrageTimer = 600000;
- FelAcidTimer = 25000;
- EjectTimer = 10000;
- BewilderingStrikeTimer = 15000;
- PhaseChangeTimer = 60000;
-
- Phase1 = true;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
-
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- // 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<HostilReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
-
- if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
-
- std::list<Unit *> targets;
- std::list<HostilReference *>::iterator itr = m_threatlist.begin();
- for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //only on alive players
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
- targets.push_back( target);
- }
-
- //Sort the list of players
- targets.sort(TargetDistanceOrder(m_creature));
- //Resize so we only get top 5
- targets.resize(5);
-
- //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp
- /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry( SPELL_BLOODBOIL );
- if(spellInfo)
- {
- for(std::list<Unit *>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
- {
- Unit* target = *itr;
- if(!target) return;
- for(uint32 i = 0;i<3;i++)
- {
- uint8 eff = spellInfo->Effect[i];
- if (eff>=TOTAL_SPELL_EFFECTS)
- continue;
-
- Aura *Aur = new Aura(spellInfo, i, NULL, target);
- target->AddAura(Aur);
- }
- }
- }*/
- }
-
- void RevertThreatOnTarget(uint64 guid)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), guid);
- if(pUnit)
- {
- if(m_creature->getThreatManager().getThreat(pUnit))
- m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
- if(TargetThreat)
- m_creature->AddThreat(pUnit, TargetThreat);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(ArcingSmashTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
- ArcingSmashTimer = 10000;
- }else ArcingSmashTimer -= diff;
-
- if(FelAcidTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEL_ACID);
- FelAcidTimer = 25000;
- }else FelAcidTimer -= diff;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- if(Phase1)
- {
- if(BewilderingStrikeTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
- float mt_threat = m_creature->getThreatManager().getThreat(m_creature->getVictim());
- Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
- m_creature->AddThreat(target, mt_threat);
- BewilderingStrikeTimer = 20000;
- }else BewilderingStrikeTimer -= diff;
-
- if(EjectTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_EJECT1);
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -40);
- EjectTimer = 15000;
- }else EjectTimer -= diff;
-
- if(AcidicWoundTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND);
- AcidicWoundTimer = 10000;
- }else AcidicWoundTimer -= diff;
-
- if(BloodboilTimer < diff)
- {
- if(BloodboilCount < 5) // Only cast it five times.
- {
- //CastBloodboil(); // Causes issues on windows, so is commented out.
- DoCast(m_creature->getVictim(), SPELL_BLOODBOIL);
- ++BloodboilCount;
- BloodboilTimer = 10000*BloodboilCount;
- }
- }else BloodboilTimer -= diff;
- }
-
- if(!Phase1)
- {
- if(AcidGeyserTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER);
- AcidGeyserTimer = 30000;
- }else AcidGeyserTimer -= diff;
-
- if(EjectTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_EJECT2);
- EjectTimer = 15000;
- }else EjectTimer -= diff;
- }
-
- if(PhaseChangeTimer < diff)
- {
- if(Phase1)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- {
- Phase1 = false;
-
- TargetThreat = m_creature->getThreatManager().getThreat(target);
- TargetGUID = target->GetGUID();
- target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
- if(m_creature->getThreatManager().getThreat(target))
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
- m_creature->AddThreat(target, 50000000.0f);
- // If VMaps are disabled, this spell can call the whole instance
- DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
- DoCast(target, SPELL_FEL_RAGE_TARGET, true);
- DoCast(target,SPELL_FEL_RAGE_2, true);
- /* These spells do not work, comment them out for now.
- DoCast(target, SPELL_FEL_RAGE_2, true);
- DoCast(target, SPELL_FEL_RAGE_3, true);*/
-
- //Cast this without triggered so that it appears in combat logs and shows visual.
- DoCast(m_creature, SPELL_FEL_RAGE_SELF);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
-
- AcidGeyserTimer = 1000;
- PhaseChangeTimer = 30000;
- }
- }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage
- {
- if(TargetGUID)
- RevertThreatOnTarget(TargetGUID);
- TargetGUID = 0;
- Phase1 = true;
- BloodboilTimer = 10000;
- BloodboilCount = 0;
- AcidicWoundTimer += 2000;
- ArcingSmashTimer += 2000;
- FelAcidTimer += 2000;
- EjectTimer += 2000;
- PhaseChangeTimer = 60000;
- }
- }else PhaseChangeTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature *_Creature)
-{
- return new boss_gurtogg_bloodboilAI (_Creature);
-}
-
-void AddSC_boss_gurtogg_bloodboil()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gurtogg_bloodboil";
- newscript->GetAI = GetAI_boss_gurtogg_bloodboil;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Bloodboil
+SD%Complete: 80
+SDComment: Bloodboil not working correctly, missing enrage
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_ACID_GEYSER 40630
+#define SPELL_ACIDIC_WOUND 40481
+#define SPELL_ARCING_SMASH 40599
+#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be
+#define SPELL_FEL_ACID 40508
+#define SPELL_FEL_RAGE_SELF 40594
+#define SPELL_FEL_RAGE_TARGET 40604
+#define SPELL_FEL_RAGE_2 40616
+#define SPELL_FEL_RAGE_3 41625
+#define SPELL_BEWILDERING_STRIKE 40491
+#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think)
+#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?)
+#define SPELL_TAUNT_GURTOGG 40603
+#define SPELL_INSIGNIFIGANCE 40618
+#define SPELL_BERSERK 45078
+
+//Speech'n'Sound
+#define SAY_AGGRO "Horde will crush you!"
+#define SOUND_AGGRO 11432
+
+#define SAY_SLAY1 "Time to feast!"
+#define SOUND_SLAY1 11433
+
+#define SAY_SLAY2 "More! I want more!"
+#define SOUND_SLAY2 11434
+
+#define SAY_SPECIAL1 "Drink your blood! Eat your flesh!"
+#define SOUND_SPECIAL1 11435
+
+#define SAY_SPECIAL2 "I hunger!"
+#define SOUND_SPECIAL2 11436
+
+#define SAY_ENRAGE "I'll rip the meat from your bones!"
+#define SOUND_ENRAGE 11437
+
+#define SOUND_DEATH 11439
+
+//This is used to sort the players by distance in preparation for the Bloodboil cast.
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator ">"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
+{
+ boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 TargetGUID;
+
+ float TargetThreat;
+
+ uint32 BloodboilTimer;
+ uint32 BloodboilCount;
+ uint32 AcidGeyserTimer;
+ uint32 AcidicWoundTimer;
+ uint32 ArcingSmashTimer;
+ uint32 EnrageTimer;
+ uint32 FelAcidTimer;
+ uint32 EjectTimer;
+ uint32 BewilderingStrikeTimer;
+ uint32 PhaseChangeTimer;
+
+ bool Phase1;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
+
+ TargetGUID = 0;
+
+ TargetThreat = 0;
+
+ BloodboilTimer = 10000;
+ BloodboilCount = 0;
+ AcidGeyserTimer = 1000;
+ AcidicWoundTimer = 6000;
+ ArcingSmashTimer = 19000;
+ EnrageTimer = 600000;
+ FelAcidTimer = 25000;
+ EjectTimer = 10000;
+ BewilderingStrikeTimer = 15000;
+ PhaseChangeTimer = 60000;
+
+ Phase1 = true;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
+
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ // 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<HostilReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
+
+ std::list<Unit *> targets;
+ std::list<HostilReference *>::iterator itr = m_threatlist.begin();
+ for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //only on alive players
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
+ targets.push_back( target);
+ }
+
+ //Sort the list of players
+ targets.sort(TargetDistanceOrder(m_creature));
+ //Resize so we only get top 5
+ targets.resize(5);
+
+ //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp
+ /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry( SPELL_BLOODBOIL );
+ if(spellInfo)
+ {
+ for(std::list<Unit *>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
+ {
+ Unit* target = *itr;
+ if(!target) return;
+ for(uint32 i = 0;i<3;i++)
+ {
+ uint8 eff = spellInfo->Effect[i];
+ if (eff>=TOTAL_SPELL_EFFECTS)
+ continue;
+
+ Aura *Aur = new Aura(spellInfo, i, NULL, target);
+ target->AddAura(Aur);
+ }
+ }
+ }*/
+ }
+
+ void RevertThreatOnTarget(uint64 guid)
+ {
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), guid);
+ if(pUnit)
+ {
+ if(m_creature->getThreatManager().getThreat(pUnit))
+ m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
+ if(TargetThreat)
+ m_creature->AddThreat(pUnit, TargetThreat);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(ArcingSmashTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ ArcingSmashTimer = 10000;
+ }else ArcingSmashTimer -= diff;
+
+ if(FelAcidTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEL_ACID);
+ FelAcidTimer = 25000;
+ }else FelAcidTimer -= diff;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ if(Phase1)
+ {
+ if(BewilderingStrikeTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
+ float mt_threat = m_creature->getThreatManager().getThreat(m_creature->getVictim());
+ Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+ m_creature->AddThreat(target, mt_threat);
+ BewilderingStrikeTimer = 20000;
+ }else BewilderingStrikeTimer -= diff;
+
+ if(EjectTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EJECT1);
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -40);
+ EjectTimer = 15000;
+ }else EjectTimer -= diff;
+
+ if(AcidicWoundTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND);
+ AcidicWoundTimer = 10000;
+ }else AcidicWoundTimer -= diff;
+
+ if(BloodboilTimer < diff)
+ {
+ if(BloodboilCount < 5) // Only cast it five times.
+ {
+ //CastBloodboil(); // Causes issues on windows, so is commented out.
+ DoCast(m_creature->getVictim(), SPELL_BLOODBOIL);
+ ++BloodboilCount;
+ BloodboilTimer = 10000*BloodboilCount;
+ }
+ }else BloodboilTimer -= diff;
+ }
+
+ if(!Phase1)
+ {
+ if(AcidGeyserTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER);
+ AcidGeyserTimer = 30000;
+ }else AcidGeyserTimer -= diff;
+
+ if(EjectTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EJECT2);
+ EjectTimer = 15000;
+ }else EjectTimer -= diff;
+ }
+
+ if(PhaseChangeTimer < diff)
+ {
+ if(Phase1)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ {
+ Phase1 = false;
+
+ TargetThreat = m_creature->getThreatManager().getThreat(target);
+ TargetGUID = target->GetGUID();
+ target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
+ if(m_creature->getThreatManager().getThreat(target))
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+ m_creature->AddThreat(target, 50000000.0f);
+ // If VMaps are disabled, this spell can call the whole instance
+ DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
+ DoCast(target, SPELL_FEL_RAGE_TARGET, true);
+ DoCast(target,SPELL_FEL_RAGE_2, true);
+ /* These spells do not work, comment them out for now.
+ DoCast(target, SPELL_FEL_RAGE_2, true);
+ DoCast(target, SPELL_FEL_RAGE_3, true);*/
+
+ //Cast this without triggered so that it appears in combat logs and shows visual.
+ DoCast(m_creature, SPELL_FEL_RAGE_SELF);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+
+ AcidGeyserTimer = 1000;
+ PhaseChangeTimer = 30000;
+ }
+ }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage
+ {
+ if(TargetGUID)
+ RevertThreatOnTarget(TargetGUID);
+ TargetGUID = 0;
+ Phase1 = true;
+ BloodboilTimer = 10000;
+ BloodboilCount = 0;
+ AcidicWoundTimer += 2000;
+ ArcingSmashTimer += 2000;
+ FelAcidTimer += 2000;
+ EjectTimer += 2000;
+ PhaseChangeTimer = 60000;
+ }
+ }else PhaseChangeTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature *_Creature)
+{
+ return new boss_gurtogg_bloodboilAI (_Creature);
+}
+
+void AddSC_boss_gurtogg_bloodboil()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gurtogg_bloodboil";
+ newscript->GetAI = GetAI_boss_gurtogg_bloodboil;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
index 48e0bc86ab2..11b97c5913e 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
@@ -1,2500 +1,2500 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_illidan_stormrage
-SD%Complete: 90
-SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-#define GETGO(obj, guid) GameObject* obj = GameObject::GetGameObject(*m_creature, guid)
-#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
-#define GETCRE(cre, guid) Creature* cre = (Creature*)Unit::GetUnit(*m_creature, guid)
-#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
-
-/************* Quotes and Sounds ***********************/
-// Gossip for when a player clicks Akama
-#define GOSSIP_ITEM "We are ready to face Illidan"
-
-// Yells for/by Akama
-#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond."
-#define SOUND_AKAMA_BEWARE 11388
-#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!"
-#define SOUND_AKAMA_MINION 11465
-#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!"
-#define SOUND_AKAMA_LEAVE 11390
-
-// Self explanatory
-#define SAY_KILL1 "Who shall be next to taste my blades?!"
-#define SOUND_KILL1 11473
-#define SAY_KILL2 "This is too easy!"
-#define SOUND_KILL2 11472
-
-// I think I'll fly now and let my subordinates take you on
-#define SAY_TAKEOFF "I will not be touched by rabble such as you!"
-#define SOUND_TAKEOFF 11479
-#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!"
-#define SOUND_SUMMONFLAMES 11480
-
-// When casting Eye Blast. Demon Fire will be appear on places that he casts this
-#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!"
-#define SOUND_EYE_BLAST 11481
-
-// kk, I go big, dark and demon on you.
-#define SAY_MORPH "Behold the power... of the demon within!"
-#define SOUND_MORPH 11475
-
-// I KILL!
-#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!"
-#define SOUND_ENRAGE 11474
-
-/************** Spells *************/
-// Normal Form
-#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast
-#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
-#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
-#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
-#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
-#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
-#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
-// Flying (Phase 2)
-#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground
-#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell
-#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan
-#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time.
-#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second.
-// Demon Form
-#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground)
-#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel)
-#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar)
-#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him.
-#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target.
-#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect)
-#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround)
-// Other Illidan spells
-#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully).
-#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev.
-#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees.
-#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150%
-#define SPELL_DUAL_WIELD 42459
-//Phase Normal spells
-#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons
-#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends
-#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons.
-#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them
-#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target
-#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target
-//Phase Flight spells
-#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell.
-#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius
-#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation.
-#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds
-#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature
-#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it.
-#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage.
-#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan.
-#define SPELL_FLAME_ENRAGE 45078
-//Akama spells
-#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit
-#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit
-#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used...
-#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full.
-#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets
-//Maiev spells
-#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO.
-#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards
-#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working)
-#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him'
-#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev
-#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds
-#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger
-#define SPELL_FAN_BLADES 39954 // bugged visual
-
-// Other defines
-#define CENTER_X 676.740
-#define CENTER_Y 305.297
-#define CENTER_Z 353.192
-
-#define FLAME_ENRAGE_DISTANCE 30
-#define FLAME_CHARGE_DISTANCE 50
-
-/**** Creature Summon and Recognition IDs ****/
-enum CreatureEntry
-{
- EMPTY = 0,
- AKAMA = 22990,
- ILLIDAN_STORMRAGE = 22917,
- BLADE_OF_AZZINOTH = 22996,
- FLAME_OF_AZZINOTH = 22997,
- MAIEV_SHADOWSONG = 23197,
- SHADOW_DEMON = 23375,
- DEMON_FIRE = 23069,
- FLAME_CRASH = 23336,
- ILLIDAN_DOOR_TRIGGER = 23412,
- SPIRIT_OF_OLUM = 23411,
- SPIRIT_OF_UDALO = 23410,
- ILLIDARI_ELITE = 23226,
- PARASITIC_SHADOWFIEND = 23498,
- CAGE_TRAP_TRIGGER = 23292,
-};
-
-/*** Phase Names ***/
-enum PhaseIllidan
-{
- PHASE_NULL = 0,
- PHASE_NORMAL = 1,
- PHASE_FLIGHT = 2,
- PHASE_NORMAL_2 = 3,
- PHASE_DEMON = 4,
- PHASE_NORMAL_MAIEV = 5,
- PHASE_TALK_SEQUENCE = 6,
- PHASE_FLIGHT_SEQUENCE = 7,
- PHASE_TRANSFORM_SEQUENCE = 8,
-};//Maiev uses the same phase
-
-enum PhaseAkama
-{
- PHASE_AKAMA_NULL = 0,
- PHASE_CHANNEL = 1,
- PHASE_WALK = 2,
- PHASE_TALK = 3,
- PHASE_FIGHT_ILLIDAN = 4,
- PHASE_FIGHT_MINIONS = 5,
- PHASE_RETURN = 6,
-};
-
-enum EventIllidan
-{
- EVENT_NULL = 0,
- EVENT_BERSERK = 1,
- //normal phase
- EVENT_TAUNT = 2,
- EVENT_SHEAR = 3,
- EVENT_FLAME_CRASH = 4,
- EVENT_PARASITIC_SHADOWFIEND = 5,
- EVENT_PARASITE_CHECK = 6,
- EVENT_DRAW_SOUL = 7,
- EVENT_AGONIZING_FLAMES = 8,
- EVENT_TRANSFORM_NORMAL = 9,
- EVENT_ENRAGE = 10,
- //flight phase
- EVENT_FIREBALL = 2,
- EVENT_DARK_BARRAGE = 3,
- EVENT_EYE_BLAST = 4,
- EVENT_MOVE_POINT = 5,
- //demon phase
- EVENT_SHADOW_BLAST = 2,
- EVENT_FLAME_BURST = 3,
- EVENT_SHADOWDEMON = 4,
- EVENT_TRANSFORM_DEMON = 5,
- //sequence phase
- EVENT_TALK_SEQUENCE = 2,
- EVENT_FLIGHT_SEQUENCE = 2,
- EVENT_TRANSFORM_SEQUENCE = 2,
-};
-
-enum EventMaiev
-{
- EVENT_MAIEV_NULL = 0,
- EVENT_MAIEV_STEALTH = 1,
- EVENT_MAIEV_TAUNT = 2,
- EVENT_MAIEV_SHADOW_STRIKE = 3,
- EVENT_MAIEV_THROW_DAGGER = 4,
- EVENT_MAIEV_TRAP = 5,
-};
-
-static EventIllidan MaxTimer[]=
-{
- EVENT_NULL,
- EVENT_DRAW_SOUL,
- EVENT_MOVE_POINT,
- EVENT_TRANSFORM_NORMAL,
- EVENT_TRANSFORM_DEMON,
- EVENT_ENRAGE,
- EVENT_TALK_SEQUENCE,
- EVENT_FLIGHT_SEQUENCE,
- EVENT_TRANSFORM_SEQUENCE
-};
-
-struct Yells
-{
- uint32 sound;
- char* text;
- uint32 creature, timer, emote;
- bool Talk;
-};
-
-static Yells Conversation[]=
-{
- {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
- {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
- {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true},
- {0, NULL, AKAMA, 5000, 66, true},
- {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true},
- {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true},
- {0, NULL, AKAMA, 2000, 15, true},
- {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true},
- {0, NULL, EMPTY, 1000, 0, true},
- {0, NULL, EMPTY, 0, 0, false},//9
- {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true},
- {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true},
- {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true},
- {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true},
- {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14
- {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15
- {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later
- {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true},
- {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true},
- {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear
- {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true},
- {0, NULL, EMPTY, 1000, 0, false}//21
-};
-
-static Yells RandomTaunts[]=
-{
- {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false},
- {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false},
- {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false},
- {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false}
-};
-
-static Yells MaievTaunts[]=
-{
- {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false},
- {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false},
- {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false},
- {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false}
-};
-
-struct Locations
-{
- float x, y, z;
-};
-
-static Locations HoverPosition[]=
-{
- {657, 340, 355},
- {657, 275, 355},
- {705, 275, 355},
- {705, 340, 355}
-};
-
-static Locations GlaivePosition[]=
-{
- {695.105, 305.303, 354.256},
- {659.338, 305.303, 354.256},//the distance between two glaives is 36
- {700.105, 305.303, 354.256},
- {664.338, 305.303, 354.256}
-};
-
-static Locations EyeBlast[]=
-{
- {677, 350, 354},//start point, pass through glaive point
- {677, 260, 354}
-};
-
-static Locations AkamaWP[]=
-{
- {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors
- {780.66, 304.50, 319.74}, // Top of the first stairs
- {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance)
- {787.17, 347.38, 341.42}, // Top of the second stairs
- {781.34, 350.31, 341.44}, // Bottom of the third stairs
- {762.60, 361.06, 353.60}, // Top of the third stairs
- {756.35, 360.52, 353.27}, // Before the door-thingy
- {743.82, 342.21, 353.00}, // Somewhere further
- {732.69, 305.13, 353.00}, // In front of Illidan - (8)
- {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!)
- {792.18, 366.62, 341.42}, // Down the first flight of stairs
- {796.84, 304.89, 319.76}, // Down the second flight of stairs
- {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12)
-};
-// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned
-static Locations SpiritSpawns[]=
-{
- {755.5426, 309.9156, 312.2129},
- {755.5426, 298.7923, 312.0834}
-};
-
-struct Animation // For the demon transformation
-{
- uint32 aura, unaura, timer, size, displayid, phase;
- bool equip;
-};
-
-static Animation DemonTransformation[]=
-{
- {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true},
- {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true},
- {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form
- {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false},
- {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false},
- {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false},
- {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false},
- {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false},
- {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true},
- {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true}
-};
-
-
-
-/************************************** Illidan's AI ***************************************/
-struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
-{
- boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- PhaseIllidan Phase;
- EventIllidan Event;
- uint32 Timer[EVENT_ENRAGE + 1];
-
- uint32 TalkCount;
- uint32 TransformCount;
- uint32 FlightCount;
-
- uint32 HoverPoint;
-
- uint64 AkamaGUID;
- uint64 MaievGUID;
- uint64 FlameGUID[2];
- uint64 GlaiveGUID[2];
-
- std::list<uint64> ParasiteTargets; // for safety, do not use Unit*
-
- void Reset();
-
- void JustSummoned(Creature* summon)//, TempSummonType type)
- {
- if(summon->GetCreatureInfo()->Entry == FLAME_CRASH)
- {
- // type = TEMPSUMMON_TIMED_DESPAWN;
- }
- //error_log("justsummoned %d %d", summon->GetCreatureInfo()->Entry, summon->GetGUID());
- }
-
- void SummonedCreatureDespawn(Creature* summon)
- {
- if(summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
- {
- for(uint8 i = 0; i < 2; i++)
- if(summon->GetGUID() == FlameGUID[i])
- FlameGUID[i] = 0;
-
- if(!FlameGUID[0] && !FlameGUID[1])
- {
- m_creature->InterruptNonMeleeSpells(true);
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- }
- }
- }
-
- void MovementInform(uint32 MovementType, uint32 Data)
- {
- if(FlightCount == 7) //change hover point
- {
- if(m_creature->getVictim())
- {
- m_creature->SetInFront(m_creature->getVictim());
- m_creature->StopMoving();
- }
- EnterPhase(PHASE_FLIGHT);
- }
- else
- Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void AttackStart(Unit *who)
- {
- if(!who || Phase >= PHASE_TALK_SEQUENCE)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
- m_creature->Attack(who, false);
- else
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who) {}
-
- void JustDied(Unit *killer)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- if(!pInstance)
- return;
-
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed
-
- for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i)
- {
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i));
- if(Door)
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- if(victim == m_creature) return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL1, LANG_UNIVERSAL, victim);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- break;
- case 1:
- DoYell(SAY_KILL2, LANG_UNIVERSAL, victim);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- break;
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth() && done_by != m_creature)
- damage = 0;
- if(done_by->GetGUID() == MaievGUID)
- done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
- {
- if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY))
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479);
- else
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- }
- }
-
- void AddParasiteTarget(uint64 targetGUID)
- {
- for(std::list<uint64>::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end(); tIter++)
- {
- if(*tIter == targetGUID)
- return;
- }
- ParasiteTargets.push_back(targetGUID);
-
- if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV)
- Timer[EVENT_PARASITE_CHECK] += 1000;
- }
-
- void DeleteFromThreatList(uint64 TargetGUID)
- {
- for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- {
- if((*itr)->getUnitGuid() == TargetGUID)
- {
- (*itr)->removeReference();
- break;
- }
- }
- }
-
- void Talk(uint32 count)
- {
- Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
-
- Creature* creature = NULL;
- if(Conversation[count].creature == ILLIDAN_STORMRAGE)
- creature = m_creature;
- else if(Conversation[count].creature == AKAMA)
- creature = ((Creature*)Unit::GetUnit((*m_creature), AkamaGUID));
- else if(Conversation[count].creature == MAIEV_SHADOWSONG)
- creature = ((Creature*)Unit::GetUnit((*m_creature), MaievGUID));
-
- if(creature)
- {
- if(Conversation[count].emote)
- creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation!
- if(Conversation[count].text)
- creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
- if(Conversation[count].sound)
- DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
- }
- }
-
- void EnterPhase(PhaseIllidan NextPhase);
- void CastEyeBlast();
- void SummonFlamesOfAzzinoth();
- void SummonMaiev();
- void SummonShadowDemon()
- {
- Creature* ShadowDemon = NULL;
- Unit* target = NULL;
- for(uint8 i = 0; i < 4; i++)
- {
- ShadowDemon = DoSpawnCreature(SHADOW_DEMON, 0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000);
- if(ShadowDemon)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
- {
- ShadowDemon->AddThreat(target, 5000000.0f);
- ShadowDemon->AI()->AttackStart(target);
- }
- DoZoneInCombat(ShadowDemon);
- }
- }
- }
- void HandleTalkSequence();
- void HandleFlightSequence()
- {
- switch(FlightCount)
- {
- case 1://lift off
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
- m_creature->StopMoving();
- DoYell(SAY_TAKEOFF, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 2://move to center
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 3://throw one glaive
- {
- uint8 i=1;
- Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Glaive)
- {
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Glaive->setFaction(m_creature->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE2);
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 700;
- break;
- case 4://throw another
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- {
- uint8 i=0;
- Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Glaive)
- {
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Glaive->setFaction(m_creature->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE, true);
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
- break;
- case 5://summon flames
- SummonFlamesOfAzzinoth();
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 6://fly to hover point
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 7://return to center
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 8://glaive return
- for(uint8 i = 0; i < 2; i++)
- {
- if(GlaiveGUID[i])
- {
- Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]);
- if(Glaive)
- {
- Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // disappear but not die for now
- }
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 9://land
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
- m_creature->StopMoving();
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- for(uint8 i = 0; i < 2; i++)
- {
- if(GlaiveGUID[i])
- {
- if(GETUNIT(Glaive, GlaiveGUID[i]))
- {
- Glaive->SetVisibility(VISIBILITY_OFF);
- Glaive->setDeathState(JUST_DIED); // Despawn the Glaive
- }
- GlaiveGUID[i] = 0;
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 10://attack
- DoResetThreat();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->GetMotionMaster()->Clear();
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
- }
- FlightCount++;
- }
-
- void HandleTransformSequence()
- {
- if(DemonTransformation[TransformCount].unaura)
- m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
-
- if(DemonTransformation[TransformCount].aura)
- DoCast(m_creature, DemonTransformation[TransformCount].aura, true);
-
- if(DemonTransformation[TransformCount].displayid)
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, DemonTransformation[TransformCount].displayid); // It's morphin time!
-
- if(DemonTransformation[TransformCount].equip)
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- }
- else
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- }
-
- switch(TransformCount)
- {
- case 2:
- DoResetThreat();
- break;
- case 4:
- EnterPhase(PHASE_DEMON);
- break;
- case 7:
- DoResetThreat();
- break;
- case 9:
- if(MaievGUID)
- EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
- else
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
- }
- if(Phase == PHASE_TRANSFORM_SEQUENCE)
- Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
- TransformCount++;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && Phase < PHASE_TALK_SEQUENCE)
- return;
-
- Event = EVENT_NULL;
- for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
- if(Timer[i])
- if(Timer[i] <= diff)
- {
- if(!Event)
- Event = (EventIllidan)i;
- }
- else Timer[i] -= diff;
-
- switch(Phase)
- {
- case PHASE_NORMAL:
- if(HPPCT(m_creature) < 65)
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- break;
-
- case PHASE_NORMAL_2:
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
-
- case PHASE_NORMAL_MAIEV:
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 1)
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
-
- case PHASE_TALK_SEQUENCE:
- if(Event == EVENT_TALK_SEQUENCE)
- HandleTalkSequence();
- break;
-
- case PHASE_FLIGHT_SEQUENCE:
- if(Event == EVENT_FLIGHT_SEQUENCE)
- HandleFlightSequence();
- break;
-
- case PHASE_TRANSFORM_SEQUENCE:
- if(Event == EVENT_TRANSFORM_SEQUENCE)
- HandleTransformSequence();
- break;
- }
-
- if(m_creature->IsNonMeleeSpellCasted(false))
- return;
-
- if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
- {
- switch(Event)
- {
- //PHASE_NORMAL
- case EVENT_BERSERK:
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- DoCast(m_creature, SPELL_BERSERK, true);
- Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever.
- break;
-
- case EVENT_TAUNT:
- {
- uint32 random = rand()%4;
- char* yell = RandomTaunts[random].text;
- uint32 soundid = RandomTaunts[random].sound;
- if(yell)
- DoYell(yell, LANG_UNIVERSAL, NULL);
- if(soundid)
- DoPlaySoundToSet(m_creature, soundid);
- }
- Timer[EVENT_TAUNT] = 32000;
- break;
-
- case EVENT_SHEAR:
- DoCast(m_creature->getVictim(), SPELL_SHEAR);
- Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
- break;
-
- case EVENT_FLAME_CRASH:
- DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
- Timer[EVENT_FLAME_CRASH] = 35000;
- break;
-
- case EVENT_PARASITIC_SHADOWFIEND:
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- if(target->GetTypeId() == TYPEID_PLAYER && !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- target->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); // do not miss
- ParasiteTargets.push_back(target->GetGUID());
- Timer[EVENT_PARASITE_CHECK] += 1000; // do not check immediately
- }
- Timer[EVENT_PARASITIC_SHADOWFIEND] = 40000;
- }
- break;
-
- case EVENT_PARASITE_CHECK:
- for(std::list<uint64>::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end();)
- {
- Unit* target = Unit::GetUnit((*m_creature), *tIter);
- if(!target || !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- if(target && target->isAlive())
- target->CastSpell(target, SPELL_SUMMON_PARASITICS, true);
- std::list<uint64>::iterator tIter2 = tIter;
- ++tIter;
- ParasiteTargets.erase(tIter2);
- }
- else
- ++tIter;
- }
- if(ParasiteTargets.empty())
- Timer[EVENT_PARASITE_CHECK] = 0;
- else
- Timer[EVENT_PARASITE_CHECK] = 1000;
- break;
-
- case EVENT_DRAW_SOUL:
- DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
- Timer[EVENT_DRAW_SOUL] = 55000;
- break;
-
- //PHASE_NORMAL_2
- case EVENT_AGONIZING_FLAMES:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES);
- Timer[EVENT_AGONIZING_FLAMES] = 0;
- break;
-
- case EVENT_TRANSFORM_NORMAL:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
-
- //PHASE_NORMAL_MAIEV
- case EVENT_ENRAGE:
- DoCast(m_creature, SPELL_ENRAGE);
- Timer[EVENT_ENRAGE] = 0;
- break;
-
- default:
- break;
- }
- DoMeleeAttackIfReady();
- }
-
- if(Phase == PHASE_FLIGHT)
- {
- switch(Event)
- {
- case EVENT_FIREBALL:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
- Timer[EVENT_FIREBALL] = 3000;
- break;
-
- case EVENT_DARK_BARRAGE:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
- Timer[EVENT_DARK_BARRAGE] = 0;
- break;
-
- case EVENT_EYE_BLAST:
- CastEyeBlast();
- Timer[EVENT_EYE_BLAST] = 0;
- break;
-
- case EVENT_MOVE_POINT:
- Phase = PHASE_FLIGHT_SEQUENCE;
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point
- for (uint8 i = 0; i <= rand()%3; i++)
- {
- HoverPoint++;
- if(HoverPoint > 3)
- HoverPoint = 0;
- }
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- break;
-
- default:
- break;
- }
- }
-
- if(Phase == PHASE_DEMON)
- {
- switch(Event)
- {
- case EVENT_SHADOW_BLAST:
- m_creature->GetMotionMaster()->Clear(false);
- if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim()))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
- else
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST);
- Timer[EVENT_SHADOW_BLAST] = 4000;
- break;
- case EVENT_SHADOWDEMON:
- SummonShadowDemon();
- Timer[EVENT_SHADOWDEMON] = 0;
- Timer[EVENT_FLAME_BURST] += 10000;
- break;
- case EVENT_FLAME_BURST:
- DoCast(m_creature, SPELL_FLAME_BURST);
- Timer[EVENT_FLAME_BURST] = 15000;
- break;
- case EVENT_TRANSFORM_DEMON:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
- default:
- break;
- }
- }
- }
-};
-
-/********************************** End of Illidan AI ******************************************/
-
-//This is used to sort the players by distance in preparation for being charged by the flames.
-struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator ">"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
-{
- flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FlameBlastTimer;
- uint32 CheckTimer;
- uint64 GlaiveGUID;
-
- void Reset()
- {
- FlameBlastTimer = 15000;
- CheckTimer = 5000;
- GlaiveGUID = 0;
- }
-
- void Aggro(Unit *who) {}
-
- void ChargeCheck()
- {
- // Get the Threat List
- std::list<HostilReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
-
- if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
-
- std::list<Unit *> targets;
- std::list<HostilReference *>::iterator itr = m_threatlist.begin();
- for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER && target->GetPositionZ()>350) //only on alive players
- targets.push_back(target);
- }
-
- if (!targets.size())
- return;
-
- //Sort the list of players
- targets.sort(TargetDistanceOrder(m_creature));
- //Resize so we only get the furthest target
- targets.resize(1);
-
- Unit* target = (*targets.begin());
- if(target && (!m_creature->IsWithinDistInMap(target, FLAME_CHARGE_DISTANCE)))
- {
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear(false);
- float x, y, z; // is it possible to fix charge?
- target->GetContactPoint(m_creature, x, y, z);
- m_creature->Relocate(x,y,z);
- m_creature->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, 1);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- m_creature->StopMoving();
- //DoCast(target, SPELL_CHARGE);
- m_creature->AddThreat(target, 5000000.0f);
- DoTextEmote("sets its gaze on $N!", target);
- }
- }
-
- void EnrageCheck()
- {
- if(GETUNIT(Glaive, GlaiveGUID))
- {
- if(!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
- {
- Glaive->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_FLAME_ENRAGE, true);
- DoResetThreat();
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- {
- m_creature->AddThreat(m_creature->getVictim(), 5000000.0f);
- AttackStart(m_creature->getVictim());
- }
- }
- else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
- {
- Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
- m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
- }
- }
- }
-
- void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(FlameBlastTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
- DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST);
- FlameBlastTimer = 15000; //10000 is official-like?
- DoZoneInCombat(); //in case someone is revived
- }else FlameBlastTimer -= diff;
-
- if(CheckTimer < diff)
- {
- ChargeCheck();
- EnrageCheck();
- CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-
-
-/******* Functions and vars for Akama's AI ******/
-struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
-{
- npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- PhaseAkama Phase;
- bool Event;
- uint32 Timer;
-
- uint64 IllidanGUID;
- uint64 ChannelGUID;
- uint64 SpiritGUID[2];
- uint64 GateGUID;
- uint64 DoorGUID[2];
-
- uint32 ChannelCount;
- uint32 WalkCount;
- uint32 TalkCount;
-
- void Reset()
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
-
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE);
- DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
- DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
-
- if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 1);
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
- }
- else
- {
- IllidanGUID = 0;
- GateGUID = 0;
- DoorGUID[0] = 0;
- DoorGUID[1] = 0;
- }
-
- ChannelGUID = 0;
- SpiritGUID[0] = 0;
- SpiritGUID[1] = 0;
-
- Phase = PHASE_AKAMA_NULL;
- Timer = 0;
-
- ChannelCount = 0;
- WalkCount = 0;
- TalkCount = 0;
-
- KillAllElites();
-
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- // 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->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- InCombat = false;
- }
-
- void Aggro(Unit *who) {}
-
- void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;}
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID)
- damage = 0;
- }
-
- void KillAllElites()
- {
- std::list<HostilReference*>::iterator itr;
- for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_UNIT) && (pUnit->GetEntry() == ILLIDARI_ELITE))
- pUnit->setDeathState(JUST_DIED);
- }
- EnterEvadeMode();
- }
-
- void BeginTalk()
- {
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
-
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
-
- if(GETCRE(Illidan, IllidanGUID))
- {
- Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
- m_creature->SetInFront(Illidan);
- Illidan->SetInFront(m_creature);
- m_creature->StopMoving();
- Illidan->StopMoving();
- ((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID();
- ((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
- }
- }
-
- void BeginChannel()
- {
- float x, y, z;
- if(GETGO(Gate, GateGUID))
- Gate->GetPosition(x, y, z);
-
- if(Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- {
- ChannelGUID = Channel->GetGUID();
- Channel->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // Invisible but spell visuals can still be seen.
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
- }
-
- for(uint8 i = 0; i < 2; ++i)
- if(Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- {
- Spirit->SetVisibility(VISIBILITY_OFF);
- SpiritGUID[i] = Spirit->GetGUID();
- }
- }
-
- void BeginWalk()
- {
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetSpeed(MOVE_RUN, 1.0f);
- m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
- }
-
- void EnterPhase(PhaseAkama NextPhase)
- {
- if(!pInstance) return;
- switch(NextPhase)
- {
- case PHASE_CHANNEL:
- BeginChannel();
- Timer = 5000;
- ChannelCount = 0;
- break;
- case PHASE_WALK:
- if(Phase == PHASE_CHANNEL)
- WalkCount = 0;
- else if(Phase == PHASE_TALK)
- {
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
- EnterEvadeMode();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- WalkCount++;
- }
- BeginWalk();
- Timer = 0;
- break;
- case PHASE_TALK:
- if(Phase == PHASE_WALK)
- {
- BeginTalk();
- Timer = 0;
- }
- else if(Phase == PHASE_FIGHT_ILLIDAN)
- {
- Timer = 1;
- TalkCount = 0;
- }
- break;
- case PHASE_FIGHT_ILLIDAN:
- if(GETUNIT(Illidan, IllidanGUID))
- {
- m_creature->AddThreat(Illidan, 10000000.0f);
- m_creature->GetMotionMaster()->MoveChase(Illidan);
- }
- Timer = 30000; //chain lightning
- break;
- case PHASE_FIGHT_MINIONS:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Timer = 10000 + rand()%6000;//summon minion
- break;
- case PHASE_RETURN:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- KillAllElites();
- WalkCount = 0;
- BeginWalk();
- Timer = 1;
- break;
- default:
- break;
- }
- Phase = NextPhase;
- Event = false;
- }
-
- void HandleTalkSequence()
- {
- switch(TalkCount)
- {
- case 0:
- if(GETCRE(Illidan, IllidanGUID))
- {
- ((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
- Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
- }
- Timer = 8000;
- break;
- case 1:
- DoYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE);
- Timer = 3000;
- break;
- case 2:
- EnterPhase(PHASE_WALK);
- break;
- }
- TalkCount++;
- }
-
- void HandleChannelSequence()
- {
- Unit* Channel, *Spirit[2];
- if(ChannelCount <= 5)
- {
- Channel = Unit::GetUnit((*m_creature), ChannelGUID);
- Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]);
- Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]);
- if(!Channel || !Spirit[0] || !Spirit[1])
- return;
- }
-
- switch(ChannelCount)
- {
- case 0: // channel failed
- m_creature->InterruptNonMeleeSpells(true);
- Timer = 2000;
- break;
- case 1: // spirit appear
- Spirit[0]->SetVisibility(VISIBILITY_ON);
- Spirit[1]->SetVisibility(VISIBILITY_ON);
- Timer = 2000;
- break;
- case 2: // spirit help
- DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL);
- Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
- Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
- Timer = 5000;
- break;
- case 3: //open the gate
- m_creature->InterruptNonMeleeSpells(true);
- Spirit[0]->InterruptNonMeleeSpells(true);
- Spirit[1]->InterruptNonMeleeSpells(true);
- if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 0);
- Timer = 2000;
- break;
- case 4:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- Timer = 2000;
- break;
- case 5:
- DoYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE);
- Channel->setDeathState(JUST_DIED);
- Spirit[0]->setDeathState(JUST_DIED);
- Spirit[1]->setDeathState(JUST_DIED);
- Timer = 3000;
- break;
- case 6:
- EnterPhase(PHASE_WALK);
- break;
- default:
- break;
- }
- ChannelCount++;
- }
-
- void HandleWalkSequence()
- {
- switch(WalkCount)
- {
- case 6:
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0);
- break;
- case 8:
- if(Phase == PHASE_WALK)
- EnterPhase(PHASE_TALK);
- else
- EnterPhase(PHASE_FIGHT_ILLIDAN);
- break;
- case 12:
- EnterPhase(PHASE_FIGHT_MINIONS);
- break;
- }
-
- if(Phase == PHASE_WALK)
- {
- Timer = 0;
- WalkCount++;
- m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- Event = false;
- if(Timer)
- {
- if(Timer <= diff)
- Event = true;
- else Timer -= diff;
- }
-
- if(Event)
- {
- switch(Phase)
- {
- case PHASE_CHANNEL:
- HandleChannelSequence();
- break;
- case PHASE_TALK:
- HandleTalkSequence();
- break;
- case PHASE_WALK:
- case PHASE_RETURN:
- HandleWalkSequence();
- break;
- case PHASE_FIGHT_ILLIDAN:
- {
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && HPPCT(Illidan) < 90)
- EnterPhase(PHASE_TALK);
- else
- {
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
- Timer = 30000;
- }
- }break;
- case PHASE_FIGHT_MINIONS:
- {
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- if(Elite)
- {
- Elite->AI()->AttackStart(m_creature);
- Elite->AddThreat(m_creature, 1000000.0f);
- AttackStart(Elite);
- }
- Timer = 10000 + rand()%6000;
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && HPPCT(Illidan) < 10)
- EnterPhase(PHASE_RETURN);
- }
- break;
- default:
- break;
- }
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
- DoCast(m_creature, SPELL_HEALING_POTION);
-
- DoMeleeAttackIfReady();
- }
-};
-
-
-struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
-{
- boss_maievAI(Creature *c) : ScriptedAI(c) { Reset(); };
-
- uint64 IllidanGUID;
-
- PhaseIllidan Phase;
- EventMaiev Event;
- uint32 Timer[5];
- uint32 MaxTimer;
-
- void Reset()
- {
- MaxTimer = 0;
- Phase = PHASE_NORMAL_MAIEV;
- IllidanGUID = 0;
- Timer[EVENT_MAIEV_STEALTH] = 0;
- Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
- Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738);
- }
-
- void Aggro(Unit *who) {}
- void MoveInLineOfSight(Unit *who) {}
- void EnterEvadeMode() {}
- void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(done_by->GetGUID() != IllidanGUID )
- damage = 0;
- else
- {
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && Illidan->getVictim() == m_creature)
- damage = m_creature->GetMaxHealth()/10;
- if(damage >= m_creature->GetHealth())
- damage = 0;
- }
- }
-
- void AttackStart(Unit *who)
- {
- if(!who || Timer[EVENT_MAIEV_STEALTH])
- return;
-
- if (who->isTargetableForAttack())
- {
- if(Phase == PHASE_TALK_SEQUENCE)
- m_creature->Attack(who, false);
- else if(Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE )
- {
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && m_creature->IsWithinDistInMap(Illidan, 25))
- BlinkToPlayer();//Do not let dread aura hurt her.
- m_creature->Attack(who, false);
- }
- else
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
- {
- switch(NextPhase)
- {
- case PHASE_TALK_SEQUENCE:
- if(Timer[EVENT_MAIEV_STEALTH])
- {
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- Timer[EVENT_MAIEV_STEALTH] = 0;
- }
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
- MaxTimer = 0;
- break;
- case PHASE_TRANSFORM_SEQUENCE:
- MaxTimer = 4;
- Timer[EVENT_MAIEV_TAUNT] += 10000;
- Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
- break;
- case PHASE_DEMON:
- break;
- case PHASE_NORMAL_MAIEV:
- MaxTimer = 4;
- Timer[EVENT_MAIEV_TAUNT] += 10000;
- Timer[EVENT_MAIEV_TRAP] = 22000;
- break;
- default:
- break;
- }
- if(Timer[EVENT_MAIEV_STEALTH])
- MaxTimer = 1;
- Phase = NextPhase;
- }
-
- void BlinkTo(float x, float y, float z)
- {
- m_creature->AttackStop();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->Relocate(x, y, z);
- m_creature->SendMonsterMove(x, y, z, 0, 0, 0);
- DoCast(m_creature, SPELL_TELEPORT_VISUAL, true);
- }
-
- void BlinkToPlayer()
- {
- if(GETCRE(Illidan, IllidanGUID))
- {
- Unit* target = ((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20))
- {
- uint8 pos = rand()%4;
- BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
- }
- else
- {
- float x, y, z;
- target->GetPosition(x, y, z);
- BlinkTo(x, y, z);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && !Timer[1])
- return;
-
- Event = EVENT_MAIEV_NULL;
- for(uint8 i = 1; i <= MaxTimer; i++)
- if(Timer[i])
- {
- if(Timer[i] <= diff)
- Event = (EventMaiev)i;
- else Timer[i] -= diff;
- }
-
- switch(Event)
- {
- case EVENT_MAIEV_STEALTH:
- {
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Timer[EVENT_MAIEV_STEALTH] = 0;
- BlinkToPlayer();
- EnterPhase(Phase);
- }break;
- case EVENT_MAIEV_TAUNT:
- {
- uint32 random = rand()%4;
- char* text = MaievTaunts[random].text;
- uint32 sound = MaievTaunts[random].sound;
- DoYell(text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, sound);
- Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
- }break;
- case EVENT_MAIEV_SHADOW_STRIKE:
- DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE);
- Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
- break;
- case EVENT_MAIEV_TRAP:
- if(Phase == PHASE_NORMAL_MAIEV)
- {
- BlinkToPlayer();
- DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON);
- Timer[EVENT_MAIEV_TRAP] = 22000;
- }
- else
- {
- if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
- DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER);
- Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
- }
- break;
- default:
- break;
- }
-
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
- m_creature->AttackStop();
- Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
- MaxTimer = 1;
- }
-
- if(Phase == PHASE_NORMAL_MAIEV)
- DoMeleeAttackIfReady();
- }
-};
-
-
-bool GossipSelect_npc_akama_at_illidan(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_akama_illidanAI*)_Creature->AI())->EnterPhase(PHASE_CHANNEL);
- }
- return true;
-}
-
-bool GossipHello_npc_akama_at_illidan(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(10465, _Creature->GetGUID());
-
- return true;
-}
-
-struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
-{
- cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 IllidanGUID;
- uint32 DespawnTimer;
-
- bool Active;
- bool SummonedBeams;
-
- void Reset()
- {
- IllidanGUID = 0;
-
- Active = false;
- SummonedBeams = false;
-
- DespawnTimer = 0;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who){}
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!Active)
- return;
-
- if(who && (who->GetTypeId() != TYPEID_PLAYER))
- {
- if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
- {
- if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
- {
- IllidanGUID = who->GetGUID();
- who->CastSpell(who, SPELL_CAGED, true);
- DespawnTimer = 5000;
- if(who->HasAura(SPELL_ENRAGE, 0))
- who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
- //if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
- // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(DespawnTimer)
- if(DespawnTimer < diff)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- else DespawnTimer -= diff;
-
- //if(IllidanGUID && !SummonedBeams)
- //{
- // if(Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID)
- // {
- // //TODO: Find proper spells and properly apply 'caged' Illidan effect
- // }
- //}
- }
-};
-
-bool GOHello_cage_trap(Player* plr, GameObject* go)
-{
- float x, y, z;
- plr->GetPosition(x, y, z);
-
- Creature* trigger = NULL;
-
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- // Grid search for nearest live creature of entry 23304 within 10 yards
- Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(trigger, check);
-
- TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap()));
-
- ((cage_trap_triggerAI*)trigger->AI())->Active = true;
- go->SetUInt32Value(GAMEOBJECT_STATE, 0);
- return true;
-}
-
-struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
-{
- shadow_demonAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 TargetGUID;
-
- void Aggro(Unit *who) {}
-
- void Reset()
- {
- TargetGUID = 0;
- DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
- }
-
- void JustDied(Unit *killer)
- {
- Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
- if(target)
- target->RemoveAurasDueToSpell(SPELL_PARALYZE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return;
-
- if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
-
- if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
- {
- TargetGUID = m_creature->getVictim()->GetGUID();
- m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
- DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true);
- DoCast(m_creature->getVictim(), SPELL_PARALYZE, true);
- }
- // Kill our target if we're very close.
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 3))
- DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL);
- }
-};
-
-// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
-struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
-{
- mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 IllidanGUID;
- uint32 CheckTimer;
-
- void Reset()
- {
- if(pInstance)
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- else
- IllidanGUID = 0;
-
- CheckTimer = 5000;
- DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true);
- }
-
- void Aggro(Unit* who) {}
- void MoveInLineOfSight(Unit *who){}
-
- void DoMeleeAttackIfReady()
- {
- if( m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true); //do not stack
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->AddParasiteTarget(m_creature->getVictim()->GetGUID());
- }
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim())
- {
- if(GETCRE(Illidan, IllidanGUID))
- {
- if(Illidan->getVictim() && !Illidan->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- AttackStart(Illidan->getVictim());
- else
- AttackStart(((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 1));
- }
- }
- else
- DoMeleeAttackIfReady();
-
- if(CheckTimer < diff)
- {
- GETUNIT(Illidan, IllidanGUID);
- if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode())
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }else CheckTimer = 5000;
- }else CheckTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI
-{
- demonfireAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 IllidanGUID;
- bool IsTrigger;
- bool DemonFire;
- uint32 CheckTimer;
- uint32 DespawnTimer;
-
- void Reset()
- {
- if(pInstance)
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- else
- IllidanGUID = 0;
-
- IsTrigger = false;
- DemonFire = false;
-
- CheckTimer = 5000;
- DespawnTimer = 78000; //spell duration, core bug, cannot despawn self
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if(IsTrigger)
- return;
-
- if(!DemonFire)
- DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s
-
- if(CheckTimer < diff)
- {
- GETUNIT(Illidan, IllidanGUID);
- if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }else CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL blazeAI : public ScriptedAI
-{
- blazeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BlazeTimer;
- uint32 DespawnTimer;
-
- void Reset()
- {
- BlazeTimer = 3000;
- DespawnTimer = 60000; // Spell duration = 1 min
- //((TemporarySummon*)m_creature)->Summon(TEMPSUMMON_TIMED_DESPAWN, 0, false);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit *who){ }
-
- void UpdateAI(const uint32 diff)
- {
- if(BlazeTimer)
- if(BlazeTimer <= diff)
- {
- DoCast(m_creature, SPELL_BLAZE_EFFECT);//duration 60s
- BlazeTimer = 0;
- }else BlazeTimer -= diff;
-
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL flamecrashAI : public ScriptedAI
-{
- flamecrashAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 DespawnTimer;
-
- void Reset()
- {
- DoCast(m_creature, SPELL_FLAME_CRASH_EFFECT);//duration inf
- DespawnTimer = 120000; // summon spell duration
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit *who) { }
- void MoveInLineOfSight(Unit *who){ }
-
- void UpdateAI(const uint32 diff)
- {
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI
-{
- blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {}
- void Reset() {}
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit* who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21431);//appear when hit by Illidan's glaive
- }
-};
-
-void boss_illidan_stormrageAI::Reset()
-{
- if(pInstance)
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
-
- for(uint8 i = 0; i < 2; i++)
- {
- if(FlameGUID[i])
- {
- if(GETUNIT(Flame, FlameGUID[i]))
- Flame->setDeathState(JUST_DIED);
- FlameGUID[i] = 0;
- }
-
- if(GlaiveGUID[i])
- {
- if(GETUNIT(Glaive, GlaiveGUID[i]))
- Glaive->setDeathState(JUST_DIED);
- GlaiveGUID[i] = 0;
- }
- }
-
- if(AkamaGUID)
- {
- if(GETCRE(Akama, AkamaGUID))
- {
- if(!Akama->isAlive())
- Akama->Respawn();
- else
- {
- ((npc_akama_illidanAI*)Akama->AI())->EnterEvadeMode();
- Akama->GetMotionMaster()->MoveTargetedHome();
- ((npc_akama_illidanAI*)Akama->AI())->Reset();
- }
- }
- AkamaGUID = 0;
- }
-
- if(MaievGUID)
- {
- GETUNIT(Maiev, MaievGUID);
- if(Maiev && Maiev->isAlive())
- {
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
- Maiev->setDeathState(JUST_DIED);
- }
- MaievGUID = 0;
- }
-
- Phase = PHASE_NULL;
- Event = EVENT_NULL;
- Timer[EVENT_BERSERK] = 1500000;
-
- HoverPoint = 0;
- TalkCount = 0;
- FlightCount = 0;
- TransformCount = 0;
-
- ParasiteTargets.clear();
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
-
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
-}
-
-void boss_illidan_stormrageAI::HandleTalkSequence()
-{
- switch(TalkCount)
- {
- case 0:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- break;
- case 8:
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives!
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 9:
- if(GETCRE(Akama, AkamaGUID))
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->AddThreat(Akama, 100.0f);
- ((npc_akama_illidanAI*)Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
- EnterPhase(PHASE_NORMAL);
- }
- break;
- case 10:
- SummonMaiev();
- break;
- case 11:
- if(GETUNIT(Maiev, MaievGUID))
- {
- Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
- Maiev->SetInFront(m_creature); // Have her face us
- m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
- Maiev->StopMoving();
- m_creature->StopMoving();
- }break;
- case 14:
- if(GETCRE(Maiev, MaievGUID))
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
- Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us.
- EnterPhase(PHASE_NORMAL_MAIEV);
- }break;
- case 15:
- DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
- break;
- case 17:
- if(GETUNIT(Akama, AkamaGUID))
- {
- if(!m_creature->IsWithinDistInMap(Akama, 15))
- {
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- x += 10; y += 10;
- Akama->GetMotionMaster()->Clear(false);
- //Akama->GetMotionMaster()->MoveIdle();
- Akama->Relocate(x, y, z);
- Akama->SendMonsterMove(x, y, z, 0, 0, 0);//Illidan must not die until Akama arrives.
- Akama->GetMotionMaster()->MoveChase(m_creature);
- }
- }
- break;
- case 19: // Make Maiev leave
- if(GETUNIT(Maiev, MaievGUID))
- {
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
- Maiev->setDeathState(JUST_DIED);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
- }
- break;
- case 21: // Kill ourself.
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- break;
- default:
- break;
- }
- if(Phase == PHASE_TALK_SEQUENCE)
- Talk(TalkCount); // This function does most of the talking
- TalkCount++;
-}
-
-
-void boss_illidan_stormrageAI::CastEyeBlast()
-{
- m_creature->InterruptNonMeleeSpells(false);
-
- DoYell(SAY_EYE_BLAST, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST);
-
- float distx, disty, dist[2];
- for(uint8 i = 0; i < 2; ++i)
- {
- distx = EyeBlast[i].x - HoverPosition[HoverPoint].x;
- disty = EyeBlast[i].y - HoverPosition[HoverPoint].y;
- dist[i] = distx * distx + disty * disty;
- }
- Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1];
- for(uint8 i = 0; i < 2; ++i)
- {
- distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x;
- disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y;
- dist[i] = distx * distx + disty * disty;
- }
- Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1];
-
- final.x = 2 * final.x - initial.x;
- final.y = 2 * final.y - initial.y;
-
- for(uint8 i = 0; i < 2; ++i)//core bug, two buff do not coexist
- {
- Creature* Trigger = NULL;
- Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
- if(Trigger)
- {
- ((demonfireAI*)Trigger->AI())->IsTrigger = true;
- Trigger->SetSpeed(MOVE_WALK, 3);
- Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
- Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
-
- if(!i)
- Trigger->CastSpell(Trigger, SPELL_EYE_BLAST_TRIGGER, true);
- else
- {
- Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
- DoCast(Trigger, SPELL_EYE_BLAST);
- }
- }
- }
-}
-
-void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
-{
- DoYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES);
-
- for(uint8 i = 0; i < 2; ++i)
- {
- if(GETUNIT(Glaive, GlaiveGUID[i]))
- {
- Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
- if(Flame)
- {
- Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction
- Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
- Flame->AI()->AttackStart(m_creature->getVictim()); // Attack our target!
- FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
- ((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
- DoZoneInCombat(Flame);
- Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
- }
- }
- }
-}
-
-void boss_illidan_stormrageAI::SummonMaiev()
-{
- DoCast(m_creature, SPELL_SHADOW_PRISON, true);
- Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Maiev)
- {
- Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
- Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- MaievGUID = Maiev->GetGUID();
- ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID());
- ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
- }
- else // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
- {
- EnterEvadeMode();
- DoTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", NULL);
- error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
- }
-}
-
-
-void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
-{
- DoZoneInCombat();
- switch(NextPhase)
- {
- case PHASE_NORMAL:
- case PHASE_NORMAL_2:
- case PHASE_NORMAL_MAIEV:
- AttackStart(m_creature->getVictim());
- Timer[EVENT_TAUNT] = 32000;
- Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000;
- Timer[EVENT_FLAME_CRASH] = 20000;
- Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000;
- Timer[EVENT_PARASITE_CHECK] = 0;
- Timer[EVENT_DRAW_SOUL] = 30000;
- if(NextPhase == PHASE_NORMAL)
- break;
- Timer[EVENT_AGONIZING_FLAMES] = 35000;
- Timer[EVENT_TRANSFORM_NORMAL] = 60000;
- if(NextPhase == PHASE_NORMAL_2)
- break;
- Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000;
- break;
- case PHASE_FLIGHT:
- Timer[EVENT_FIREBALL] = 1000;
- if(!(rand()%4))
- Timer[EVENT_DARK_BARRAGE] = 10000;
- Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000;
- Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000;
- break;
- case PHASE_DEMON:
- Timer[EVENT_SHADOW_BLAST] = 1000;
- Timer[EVENT_FLAME_BURST] = 10000;
- Timer[EVENT_SHADOWDEMON] = 30000;
- Timer[EVENT_TRANSFORM_DEMON] = 60000;
- AttackStart(m_creature->getVictim());
- break;
- case PHASE_TALK_SEQUENCE:
- Timer[EVENT_TALK_SEQUENCE] = 100;
- m_creature->RemoveAllAuras();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- break;
- case PHASE_FLIGHT_SEQUENCE:
- if(Phase == PHASE_FLIGHT) //land
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- else //lift off
- {
- FlightCount = 1;
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- 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->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- }
- break;
- case PHASE_TRANSFORM_SEQUENCE:
- if(Phase == PHASE_DEMON)
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- else
- {
- TransformCount = 0;
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- DoYell(SAY_MORPH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_MORPH);
- }
- m_creature->GetMotionMaster()->Clear();
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- break;
- default:
- break;
- }
- if(MaievGUID)
- {
- GETCRE(Maiev, MaievGUID);
- if(Maiev && Maiev->isAlive())
- ((boss_maievAI*)Maiev->AI())->EnterPhase(NextPhase);
- }
- Phase = NextPhase;
- Event = EVENT_NULL;
-}
-
-CreatureAI* GetAI_boss_illidan_stormrage(Creature *_Creature)
-{
- return new boss_illidan_stormrageAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_akama_at_illidan(Creature *_Creature)
-{
- return new npc_akama_illidanAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_maiev(Creature *_Creature)
-{
- return new boss_maievAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_flame_of_azzinoth(Creature *_Creature)
-{
- return new flame_of_azzinothAI (_Creature);
-}
-
-CreatureAI* GetAI_cage_trap_trigger(Creature *_Creature)
-{
- return new cage_trap_triggerAI (_Creature);
-}
-
-CreatureAI* GetAI_shadow_demon(Creature *_Creature)
-{
- return new shadow_demonAI (_Creature);
-}
-
-CreatureAI* GetAI_flamecrash(Creature *_Creature)
-{
- return new flamecrashAI (_Creature);
-}
-
-CreatureAI* GetAI_demonfire(Creature *_Creature)
-{
- return new demonfireAI (_Creature);
-}
-
-CreatureAI* GetAI_blaze(Creature *_Creature)
-{
- return new blazeAI (_Creature);
-}
-
-CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature)
-{
- return new blade_of_azzinothAI (_Creature);
-}
-
-CreatureAI* GetAI_parasitic_shadowfiend(Creature *_Creature)
-{
- return new mob_parasitic_shadowfiendAI (_Creature);
-}
-
-void AddSC_boss_illidan()
-{
- Script* newscript;
-
- newscript = new Script;
- newscript->Name = "boss_illidan_stormrage";
- newscript->GetAI = GetAI_boss_illidan_stormrage;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_akama_illidan";
- newscript->GetAI = GetAI_npc_akama_at_illidan;
- newscript->pGossipHello = GossipHello_npc_akama_at_illidan;
- newscript->pGossipSelect = GossipSelect_npc_akama_at_illidan;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "boss_maiev_shadowsong";
- newscript->GetAI = GetAI_boss_maiev;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_flame_of_azzinoth";
- newscript->GetAI = GetAI_mob_flame_of_azzinoth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_blade_of_azzinoth";
- newscript->GetAI = GetAI_blade_of_azzinoth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "gameobject_cage_trap";
- newscript->pGOHello = GOHello_cage_trap;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_cage_trap_trigger";
- newscript->GetAI = GetAI_cage_trap_trigger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_shadow_demon";
- newscript->GetAI = GetAI_shadow_demon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_flame_crash";
- newscript->GetAI = GetAI_flamecrash;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_demon_fire";
- newscript->GetAI = GetAI_demonfire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_blaze";
- newscript->GetAI = GetAI_blaze;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_parasitic_shadowfiend";
- newscript->GetAI = GetAI_parasitic_shadowfiend;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_illidan_stormrage
+SD%Complete: 90
+SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+#define GETGO(obj, guid) GameObject* obj = GameObject::GetGameObject(*m_creature, guid)
+#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
+#define GETCRE(cre, guid) Creature* cre = (Creature*)Unit::GetUnit(*m_creature, guid)
+#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
+
+/************* Quotes and Sounds ***********************/
+// Gossip for when a player clicks Akama
+#define GOSSIP_ITEM "We are ready to face Illidan"
+
+// Yells for/by Akama
+#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond."
+#define SOUND_AKAMA_BEWARE 11388
+#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!"
+#define SOUND_AKAMA_MINION 11465
+#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!"
+#define SOUND_AKAMA_LEAVE 11390
+
+// Self explanatory
+#define SAY_KILL1 "Who shall be next to taste my blades?!"
+#define SOUND_KILL1 11473
+#define SAY_KILL2 "This is too easy!"
+#define SOUND_KILL2 11472
+
+// I think I'll fly now and let my subordinates take you on
+#define SAY_TAKEOFF "I will not be touched by rabble such as you!"
+#define SOUND_TAKEOFF 11479
+#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!"
+#define SOUND_SUMMONFLAMES 11480
+
+// When casting Eye Blast. Demon Fire will be appear on places that he casts this
+#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!"
+#define SOUND_EYE_BLAST 11481
+
+// kk, I go big, dark and demon on you.
+#define SAY_MORPH "Behold the power... of the demon within!"
+#define SOUND_MORPH 11475
+
+// I KILL!
+#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!"
+#define SOUND_ENRAGE 11474
+
+/************** Spells *************/
+// Normal Form
+#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast
+#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
+#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
+#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
+#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
+#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
+#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
+// Flying (Phase 2)
+#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground
+#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell
+#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan
+#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time.
+#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second.
+// Demon Form
+#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground)
+#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel)
+#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar)
+#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him.
+#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target.
+#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect)
+#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround)
+// Other Illidan spells
+#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully).
+#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev.
+#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees.
+#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150%
+#define SPELL_DUAL_WIELD 42459
+//Phase Normal spells
+#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons
+#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends
+#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons.
+#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them
+#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target
+#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target
+//Phase Flight spells
+#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell.
+#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius
+#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation.
+#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds
+#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature
+#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it.
+#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage.
+#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan.
+#define SPELL_FLAME_ENRAGE 45078
+//Akama spells
+#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit
+#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit
+#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used...
+#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full.
+#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets
+//Maiev spells
+#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO.
+#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards
+#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working)
+#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him'
+#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev
+#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds
+#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger
+#define SPELL_FAN_BLADES 39954 // bugged visual
+
+// Other defines
+#define CENTER_X 676.740
+#define CENTER_Y 305.297
+#define CENTER_Z 353.192
+
+#define FLAME_ENRAGE_DISTANCE 30
+#define FLAME_CHARGE_DISTANCE 50
+
+/**** Creature Summon and Recognition IDs ****/
+enum CreatureEntry
+{
+ EMPTY = 0,
+ AKAMA = 22990,
+ ILLIDAN_STORMRAGE = 22917,
+ BLADE_OF_AZZINOTH = 22996,
+ FLAME_OF_AZZINOTH = 22997,
+ MAIEV_SHADOWSONG = 23197,
+ SHADOW_DEMON = 23375,
+ DEMON_FIRE = 23069,
+ FLAME_CRASH = 23336,
+ ILLIDAN_DOOR_TRIGGER = 23412,
+ SPIRIT_OF_OLUM = 23411,
+ SPIRIT_OF_UDALO = 23410,
+ ILLIDARI_ELITE = 23226,
+ PARASITIC_SHADOWFIEND = 23498,
+ CAGE_TRAP_TRIGGER = 23292,
+};
+
+/*** Phase Names ***/
+enum PhaseIllidan
+{
+ PHASE_NULL = 0,
+ PHASE_NORMAL = 1,
+ PHASE_FLIGHT = 2,
+ PHASE_NORMAL_2 = 3,
+ PHASE_DEMON = 4,
+ PHASE_NORMAL_MAIEV = 5,
+ PHASE_TALK_SEQUENCE = 6,
+ PHASE_FLIGHT_SEQUENCE = 7,
+ PHASE_TRANSFORM_SEQUENCE = 8,
+};//Maiev uses the same phase
+
+enum PhaseAkama
+{
+ PHASE_AKAMA_NULL = 0,
+ PHASE_CHANNEL = 1,
+ PHASE_WALK = 2,
+ PHASE_TALK = 3,
+ PHASE_FIGHT_ILLIDAN = 4,
+ PHASE_FIGHT_MINIONS = 5,
+ PHASE_RETURN = 6,
+};
+
+enum EventIllidan
+{
+ EVENT_NULL = 0,
+ EVENT_BERSERK = 1,
+ //normal phase
+ EVENT_TAUNT = 2,
+ EVENT_SHEAR = 3,
+ EVENT_FLAME_CRASH = 4,
+ EVENT_PARASITIC_SHADOWFIEND = 5,
+ EVENT_PARASITE_CHECK = 6,
+ EVENT_DRAW_SOUL = 7,
+ EVENT_AGONIZING_FLAMES = 8,
+ EVENT_TRANSFORM_NORMAL = 9,
+ EVENT_ENRAGE = 10,
+ //flight phase
+ EVENT_FIREBALL = 2,
+ EVENT_DARK_BARRAGE = 3,
+ EVENT_EYE_BLAST = 4,
+ EVENT_MOVE_POINT = 5,
+ //demon phase
+ EVENT_SHADOW_BLAST = 2,
+ EVENT_FLAME_BURST = 3,
+ EVENT_SHADOWDEMON = 4,
+ EVENT_TRANSFORM_DEMON = 5,
+ //sequence phase
+ EVENT_TALK_SEQUENCE = 2,
+ EVENT_FLIGHT_SEQUENCE = 2,
+ EVENT_TRANSFORM_SEQUENCE = 2,
+};
+
+enum EventMaiev
+{
+ EVENT_MAIEV_NULL = 0,
+ EVENT_MAIEV_STEALTH = 1,
+ EVENT_MAIEV_TAUNT = 2,
+ EVENT_MAIEV_SHADOW_STRIKE = 3,
+ EVENT_MAIEV_THROW_DAGGER = 4,
+ EVENT_MAIEV_TRAP = 5,
+};
+
+static EventIllidan MaxTimer[]=
+{
+ EVENT_NULL,
+ EVENT_DRAW_SOUL,
+ EVENT_MOVE_POINT,
+ EVENT_TRANSFORM_NORMAL,
+ EVENT_TRANSFORM_DEMON,
+ EVENT_ENRAGE,
+ EVENT_TALK_SEQUENCE,
+ EVENT_FLIGHT_SEQUENCE,
+ EVENT_TRANSFORM_SEQUENCE
+};
+
+struct Yells
+{
+ uint32 sound;
+ char* text;
+ uint32 creature, timer, emote;
+ bool Talk;
+};
+
+static Yells Conversation[]=
+{
+ {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
+ {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
+ {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true},
+ {0, NULL, AKAMA, 5000, 66, true},
+ {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true},
+ {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true},
+ {0, NULL, AKAMA, 2000, 15, true},
+ {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true},
+ {0, NULL, EMPTY, 1000, 0, true},
+ {0, NULL, EMPTY, 0, 0, false},//9
+ {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true},
+ {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true},
+ {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true},
+ {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true},
+ {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14
+ {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15
+ {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later
+ {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true},
+ {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true},
+ {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear
+ {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true},
+ {0, NULL, EMPTY, 1000, 0, false}//21
+};
+
+static Yells RandomTaunts[]=
+{
+ {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false}
+};
+
+static Yells MaievTaunts[]=
+{
+ {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false},
+ {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false},
+ {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false},
+ {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false}
+};
+
+struct Locations
+{
+ float x, y, z;
+};
+
+static Locations HoverPosition[]=
+{
+ {657, 340, 355},
+ {657, 275, 355},
+ {705, 275, 355},
+ {705, 340, 355}
+};
+
+static Locations GlaivePosition[]=
+{
+ {695.105, 305.303, 354.256},
+ {659.338, 305.303, 354.256},//the distance between two glaives is 36
+ {700.105, 305.303, 354.256},
+ {664.338, 305.303, 354.256}
+};
+
+static Locations EyeBlast[]=
+{
+ {677, 350, 354},//start point, pass through glaive point
+ {677, 260, 354}
+};
+
+static Locations AkamaWP[]=
+{
+ {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors
+ {780.66, 304.50, 319.74}, // Top of the first stairs
+ {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance)
+ {787.17, 347.38, 341.42}, // Top of the second stairs
+ {781.34, 350.31, 341.44}, // Bottom of the third stairs
+ {762.60, 361.06, 353.60}, // Top of the third stairs
+ {756.35, 360.52, 353.27}, // Before the door-thingy
+ {743.82, 342.21, 353.00}, // Somewhere further
+ {732.69, 305.13, 353.00}, // In front of Illidan - (8)
+ {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!)
+ {792.18, 366.62, 341.42}, // Down the first flight of stairs
+ {796.84, 304.89, 319.76}, // Down the second flight of stairs
+ {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12)
+};
+// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned
+static Locations SpiritSpawns[]=
+{
+ {755.5426, 309.9156, 312.2129},
+ {755.5426, 298.7923, 312.0834}
+};
+
+struct Animation // For the demon transformation
+{
+ uint32 aura, unaura, timer, size, displayid, phase;
+ bool equip;
+};
+
+static Animation DemonTransformation[]=
+{
+ {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true},
+ {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true},
+ {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form
+ {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false},
+ {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false},
+ {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false},
+ {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false},
+ {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false},
+ {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true},
+ {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true}
+};
+
+
+
+/************************************** Illidan's AI ***************************************/
+struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
+{
+ boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ PhaseIllidan Phase;
+ EventIllidan Event;
+ uint32 Timer[EVENT_ENRAGE + 1];
+
+ uint32 TalkCount;
+ uint32 TransformCount;
+ uint32 FlightCount;
+
+ uint32 HoverPoint;
+
+ uint64 AkamaGUID;
+ uint64 MaievGUID;
+ uint64 FlameGUID[2];
+ uint64 GlaiveGUID[2];
+
+ std::list<uint64> ParasiteTargets; // for safety, do not use Unit*
+
+ void Reset();
+
+ void JustSummoned(Creature* summon)//, TempSummonType type)
+ {
+ if(summon->GetCreatureInfo()->Entry == FLAME_CRASH)
+ {
+ // type = TEMPSUMMON_TIMED_DESPAWN;
+ }
+ //error_log("justsummoned %d %d", summon->GetCreatureInfo()->Entry, summon->GetGUID());
+ }
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ if(summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
+ {
+ for(uint8 i = 0; i < 2; i++)
+ if(summon->GetGUID() == FlameGUID[i])
+ FlameGUID[i] = 0;
+
+ if(!FlameGUID[0] && !FlameGUID[1])
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ }
+ }
+ }
+
+ void MovementInform(uint32 MovementType, uint32 Data)
+ {
+ if(FlightCount == 7) //change hover point
+ {
+ if(m_creature->getVictim())
+ {
+ m_creature->SetInFront(m_creature->getVictim());
+ m_creature->StopMoving();
+ }
+ EnterPhase(PHASE_FLIGHT);
+ }
+ else
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!who || Phase >= PHASE_TALK_SEQUENCE)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
+ m_creature->Attack(who, false);
+ else
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who) {}
+
+ void JustDied(Unit *killer)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if(!pInstance)
+ return;
+
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed
+
+ for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i)
+ {
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i));
+ if(Door)
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature) return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL1, LANG_UNIVERSAL, victim);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(SAY_KILL2, LANG_UNIVERSAL, victim);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ break;
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth() && done_by != m_creature)
+ damage = 0;
+ if(done_by->GetGUID() == MaievGUID)
+ done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
+ {
+ if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY))
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479);
+ else
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ }
+ }
+
+ void AddParasiteTarget(uint64 targetGUID)
+ {
+ for(std::list<uint64>::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end(); tIter++)
+ {
+ if(*tIter == targetGUID)
+ return;
+ }
+ ParasiteTargets.push_back(targetGUID);
+
+ if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV)
+ Timer[EVENT_PARASITE_CHECK] += 1000;
+ }
+
+ void DeleteFromThreatList(uint64 TargetGUID)
+ {
+ for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ {
+ if((*itr)->getUnitGuid() == TargetGUID)
+ {
+ (*itr)->removeReference();
+ break;
+ }
+ }
+ }
+
+ void Talk(uint32 count)
+ {
+ Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
+
+ Creature* creature = NULL;
+ if(Conversation[count].creature == ILLIDAN_STORMRAGE)
+ creature = m_creature;
+ else if(Conversation[count].creature == AKAMA)
+ creature = ((Creature*)Unit::GetUnit((*m_creature), AkamaGUID));
+ else if(Conversation[count].creature == MAIEV_SHADOWSONG)
+ creature = ((Creature*)Unit::GetUnit((*m_creature), MaievGUID));
+
+ if(creature)
+ {
+ if(Conversation[count].emote)
+ creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation!
+ if(Conversation[count].text)
+ creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
+ if(Conversation[count].sound)
+ DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
+ }
+ }
+
+ void EnterPhase(PhaseIllidan NextPhase);
+ void CastEyeBlast();
+ void SummonFlamesOfAzzinoth();
+ void SummonMaiev();
+ void SummonShadowDemon()
+ {
+ Creature* ShadowDemon = NULL;
+ Unit* target = NULL;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ ShadowDemon = DoSpawnCreature(SHADOW_DEMON, 0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000);
+ if(ShadowDemon)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
+ {
+ ShadowDemon->AddThreat(target, 5000000.0f);
+ ShadowDemon->AI()->AttackStart(target);
+ }
+ DoZoneInCombat(ShadowDemon);
+ }
+ }
+ }
+ void HandleTalkSequence();
+ void HandleFlightSequence()
+ {
+ switch(FlightCount)
+ {
+ case 1://lift off
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ DoYell(SAY_TAKEOFF, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 2://move to center
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 3://throw one glaive
+ {
+ uint8 i=1;
+ Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Glaive->setFaction(m_creature->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE2);
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 700;
+ break;
+ case 4://throw another
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ {
+ uint8 i=0;
+ Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Glaive->setFaction(m_creature->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE, true);
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
+ break;
+ case 5://summon flames
+ SummonFlamesOfAzzinoth();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 6://fly to hover point
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 7://return to center
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 8://glaive return
+ for(uint8 i = 0; i < 2; i++)
+ {
+ if(GlaiveGUID[i])
+ {
+ Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]);
+ if(Glaive)
+ {
+ Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // disappear but not die for now
+ }
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 9://land
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ for(uint8 i = 0; i < 2; i++)
+ {
+ if(GlaiveGUID[i])
+ {
+ if(GETUNIT(Glaive, GlaiveGUID[i]))
+ {
+ Glaive->SetVisibility(VISIBILITY_OFF);
+ Glaive->setDeathState(JUST_DIED); // Despawn the Glaive
+ }
+ GlaiveGUID[i] = 0;
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 10://attack
+ DoResetThreat();
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->GetMotionMaster()->Clear();
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ EnterPhase(PHASE_NORMAL_2);
+ break;
+ default:
+ break;
+ }
+ FlightCount++;
+ }
+
+ void HandleTransformSequence()
+ {
+ if(DemonTransformation[TransformCount].unaura)
+ m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
+
+ if(DemonTransformation[TransformCount].aura)
+ DoCast(m_creature, DemonTransformation[TransformCount].aura, true);
+
+ if(DemonTransformation[TransformCount].displayid)
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, DemonTransformation[TransformCount].displayid); // It's morphin time!
+
+ if(DemonTransformation[TransformCount].equip)
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ }
+ else
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ }
+
+ switch(TransformCount)
+ {
+ case 2:
+ DoResetThreat();
+ break;
+ case 4:
+ EnterPhase(PHASE_DEMON);
+ break;
+ case 7:
+ DoResetThreat();
+ break;
+ case 9:
+ if(MaievGUID)
+ EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
+ else
+ EnterPhase(PHASE_NORMAL_2);
+ break;
+ default:
+ break;
+ }
+ if(Phase == PHASE_TRANSFORM_SEQUENCE)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
+ TransformCount++;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && Phase < PHASE_TALK_SEQUENCE)
+ return;
+
+ Event = EVENT_NULL;
+ for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
+ if(Timer[i])
+ if(Timer[i] <= diff)
+ {
+ if(!Event)
+ Event = (EventIllidan)i;
+ }
+ else Timer[i] -= diff;
+
+ switch(Phase)
+ {
+ case PHASE_NORMAL:
+ if(HPPCT(m_creature) < 65)
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ break;
+
+ case PHASE_NORMAL_2:
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
+
+ case PHASE_NORMAL_MAIEV:
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 1)
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
+
+ case PHASE_TALK_SEQUENCE:
+ if(Event == EVENT_TALK_SEQUENCE)
+ HandleTalkSequence();
+ break;
+
+ case PHASE_FLIGHT_SEQUENCE:
+ if(Event == EVENT_FLIGHT_SEQUENCE)
+ HandleFlightSequence();
+ break;
+
+ case PHASE_TRANSFORM_SEQUENCE:
+ if(Event == EVENT_TRANSFORM_SEQUENCE)
+ HandleTransformSequence();
+ break;
+ }
+
+ if(m_creature->IsNonMeleeSpellCasted(false))
+ return;
+
+ if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
+ {
+ switch(Event)
+ {
+ //PHASE_NORMAL
+ case EVENT_BERSERK:
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ DoCast(m_creature, SPELL_BERSERK, true);
+ Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever.
+ break;
+
+ case EVENT_TAUNT:
+ {
+ uint32 random = rand()%4;
+ char* yell = RandomTaunts[random].text;
+ uint32 soundid = RandomTaunts[random].sound;
+ if(yell)
+ DoYell(yell, LANG_UNIVERSAL, NULL);
+ if(soundid)
+ DoPlaySoundToSet(m_creature, soundid);
+ }
+ Timer[EVENT_TAUNT] = 32000;
+ break;
+
+ case EVENT_SHEAR:
+ DoCast(m_creature->getVictim(), SPELL_SHEAR);
+ Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
+ break;
+
+ case EVENT_FLAME_CRASH:
+ DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
+ Timer[EVENT_FLAME_CRASH] = 35000;
+ break;
+
+ case EVENT_PARASITIC_SHADOWFIEND:
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ if(target->GetTypeId() == TYPEID_PLAYER && !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ target->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); // do not miss
+ ParasiteTargets.push_back(target->GetGUID());
+ Timer[EVENT_PARASITE_CHECK] += 1000; // do not check immediately
+ }
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = 40000;
+ }
+ break;
+
+ case EVENT_PARASITE_CHECK:
+ for(std::list<uint64>::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end();)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), *tIter);
+ if(!target || !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ if(target && target->isAlive())
+ target->CastSpell(target, SPELL_SUMMON_PARASITICS, true);
+ std::list<uint64>::iterator tIter2 = tIter;
+ ++tIter;
+ ParasiteTargets.erase(tIter2);
+ }
+ else
+ ++tIter;
+ }
+ if(ParasiteTargets.empty())
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ else
+ Timer[EVENT_PARASITE_CHECK] = 1000;
+ break;
+
+ case EVENT_DRAW_SOUL:
+ DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
+ Timer[EVENT_DRAW_SOUL] = 55000;
+ break;
+
+ //PHASE_NORMAL_2
+ case EVENT_AGONIZING_FLAMES:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES);
+ Timer[EVENT_AGONIZING_FLAMES] = 0;
+ break;
+
+ case EVENT_TRANSFORM_NORMAL:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+
+ //PHASE_NORMAL_MAIEV
+ case EVENT_ENRAGE:
+ DoCast(m_creature, SPELL_ENRAGE);
+ Timer[EVENT_ENRAGE] = 0;
+ break;
+
+ default:
+ break;
+ }
+ DoMeleeAttackIfReady();
+ }
+
+ if(Phase == PHASE_FLIGHT)
+ {
+ switch(Event)
+ {
+ case EVENT_FIREBALL:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
+ Timer[EVENT_FIREBALL] = 3000;
+ break;
+
+ case EVENT_DARK_BARRAGE:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
+ Timer[EVENT_DARK_BARRAGE] = 0;
+ break;
+
+ case EVENT_EYE_BLAST:
+ CastEyeBlast();
+ Timer[EVENT_EYE_BLAST] = 0;
+ break;
+
+ case EVENT_MOVE_POINT:
+ Phase = PHASE_FLIGHT_SEQUENCE;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point
+ for (uint8 i = 0; i <= rand()%3; i++)
+ {
+ HoverPoint++;
+ if(HoverPoint > 3)
+ HoverPoint = 0;
+ }
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if(Phase == PHASE_DEMON)
+ {
+ switch(Event)
+ {
+ case EVENT_SHADOW_BLAST:
+ m_creature->GetMotionMaster()->Clear(false);
+ if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim()))
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
+ else
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST);
+ Timer[EVENT_SHADOW_BLAST] = 4000;
+ break;
+ case EVENT_SHADOWDEMON:
+ SummonShadowDemon();
+ Timer[EVENT_SHADOWDEMON] = 0;
+ Timer[EVENT_FLAME_BURST] += 10000;
+ break;
+ case EVENT_FLAME_BURST:
+ DoCast(m_creature, SPELL_FLAME_BURST);
+ Timer[EVENT_FLAME_BURST] = 15000;
+ break;
+ case EVENT_TRANSFORM_DEMON:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+};
+
+/********************************** End of Illidan AI ******************************************/
+
+//This is used to sort the players by distance in preparation for being charged by the flames.
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator ">"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
+{
+ flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FlameBlastTimer;
+ uint32 CheckTimer;
+ uint64 GlaiveGUID;
+
+ void Reset()
+ {
+ FlameBlastTimer = 15000;
+ CheckTimer = 5000;
+ GlaiveGUID = 0;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void ChargeCheck()
+ {
+ // Get the Threat List
+ std::list<HostilReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
+
+ std::list<Unit *> targets;
+ std::list<HostilReference *>::iterator itr = m_threatlist.begin();
+ for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER && target->GetPositionZ()>350) //only on alive players
+ targets.push_back(target);
+ }
+
+ if (!targets.size())
+ return;
+
+ //Sort the list of players
+ targets.sort(TargetDistanceOrder(m_creature));
+ //Resize so we only get the furthest target
+ targets.resize(1);
+
+ Unit* target = (*targets.begin());
+ if(target && (!m_creature->IsWithinDistInMap(target, FLAME_CHARGE_DISTANCE)))
+ {
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear(false);
+ float x, y, z; // is it possible to fix charge?
+ target->GetContactPoint(m_creature, x, y, z);
+ m_creature->Relocate(x,y,z);
+ m_creature->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, 1);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ //DoCast(target, SPELL_CHARGE);
+ m_creature->AddThreat(target, 5000000.0f);
+ DoTextEmote("sets its gaze on $N!", target);
+ }
+ }
+
+ void EnrageCheck()
+ {
+ if(GETUNIT(Glaive, GlaiveGUID))
+ {
+ if(!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
+ {
+ Glaive->InterruptNonMeleeSpells(true);
+ DoCast(m_creature, SPELL_FLAME_ENRAGE, true);
+ DoResetThreat();
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ {
+ m_creature->AddThreat(m_creature->getVictim(), 5000000.0f);
+ AttackStart(m_creature->getVictim());
+ }
+ }
+ else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
+ {
+ Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
+ m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
+ }
+ }
+ }
+
+ void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(FlameBlastTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
+ DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST);
+ FlameBlastTimer = 15000; //10000 is official-like?
+ DoZoneInCombat(); //in case someone is revived
+ }else FlameBlastTimer -= diff;
+
+ if(CheckTimer < diff)
+ {
+ ChargeCheck();
+ EnrageCheck();
+ CheckTimer = 5000;
+ }else CheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+
+/******* Functions and vars for Akama's AI ******/
+struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
+{
+ npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ PhaseAkama Phase;
+ bool Event;
+ uint32 Timer;
+
+ uint64 IllidanGUID;
+ uint64 ChannelGUID;
+ uint64 SpiritGUID[2];
+ uint64 GateGUID;
+ uint64 DoorGUID[2];
+
+ uint32 ChannelCount;
+ uint32 WalkCount;
+ uint32 TalkCount;
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
+
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE);
+ DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
+ DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
+
+ if(GETGO(Gate, GateGUID))
+ Gate->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ }
+ else
+ {
+ IllidanGUID = 0;
+ GateGUID = 0;
+ DoorGUID[0] = 0;
+ DoorGUID[1] = 0;
+ }
+
+ ChannelGUID = 0;
+ SpiritGUID[0] = 0;
+ SpiritGUID[1] = 0;
+
+ Phase = PHASE_AKAMA_NULL;
+ Timer = 0;
+
+ ChannelCount = 0;
+ WalkCount = 0;
+ TalkCount = 0;
+
+ KillAllElites();
+
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ // 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->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ InCombat = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;}
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID)
+ damage = 0;
+ }
+
+ void KillAllElites()
+ {
+ std::list<HostilReference*>::iterator itr;
+ for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_UNIT) && (pUnit->GetEntry() == ILLIDARI_ELITE))
+ pUnit->setDeathState(JUST_DIED);
+ }
+ EnterEvadeMode();
+ }
+
+ void BeginTalk()
+ {
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
+
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
+ m_creature->SetInFront(Illidan);
+ Illidan->SetInFront(m_creature);
+ m_creature->StopMoving();
+ Illidan->StopMoving();
+ ((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID();
+ ((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+ }
+ }
+
+ void BeginChannel()
+ {
+ float x, y, z;
+ if(GETGO(Gate, GateGUID))
+ Gate->GetPosition(x, y, z);
+
+ if(Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ {
+ ChannelGUID = Channel->GetGUID();
+ Channel->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // Invisible but spell visuals can still be seen.
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
+ }
+
+ for(uint8 i = 0; i < 2; ++i)
+ if(Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ {
+ Spirit->SetVisibility(VISIBILITY_OFF);
+ SpiritGUID[i] = Spirit->GetGUID();
+ }
+ }
+
+ void BeginWalk()
+ {
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->SetSpeed(MOVE_RUN, 1.0f);
+ m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ }
+
+ void EnterPhase(PhaseAkama NextPhase)
+ {
+ if(!pInstance) return;
+ switch(NextPhase)
+ {
+ case PHASE_CHANNEL:
+ BeginChannel();
+ Timer = 5000;
+ ChannelCount = 0;
+ break;
+ case PHASE_WALK:
+ if(Phase == PHASE_CHANNEL)
+ WalkCount = 0;
+ else if(Phase == PHASE_TALK)
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
+ EnterEvadeMode();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ WalkCount++;
+ }
+ BeginWalk();
+ Timer = 0;
+ break;
+ case PHASE_TALK:
+ if(Phase == PHASE_WALK)
+ {
+ BeginTalk();
+ Timer = 0;
+ }
+ else if(Phase == PHASE_FIGHT_ILLIDAN)
+ {
+ Timer = 1;
+ TalkCount = 0;
+ }
+ break;
+ case PHASE_FIGHT_ILLIDAN:
+ if(GETUNIT(Illidan, IllidanGUID))
+ {
+ m_creature->AddThreat(Illidan, 10000000.0f);
+ m_creature->GetMotionMaster()->MoveChase(Illidan);
+ }
+ Timer = 30000; //chain lightning
+ break;
+ case PHASE_FIGHT_MINIONS:
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Timer = 10000 + rand()%6000;//summon minion
+ break;
+ case PHASE_RETURN:
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ KillAllElites();
+ WalkCount = 0;
+ BeginWalk();
+ Timer = 1;
+ break;
+ default:
+ break;
+ }
+ Phase = NextPhase;
+ Event = false;
+ }
+
+ void HandleTalkSequence()
+ {
+ switch(TalkCount)
+ {
+ case 0:
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ ((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
+ Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
+ }
+ Timer = 8000;
+ break;
+ case 1:
+ DoYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE);
+ Timer = 3000;
+ break;
+ case 2:
+ EnterPhase(PHASE_WALK);
+ break;
+ }
+ TalkCount++;
+ }
+
+ void HandleChannelSequence()
+ {
+ Unit* Channel, *Spirit[2];
+ if(ChannelCount <= 5)
+ {
+ Channel = Unit::GetUnit((*m_creature), ChannelGUID);
+ Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]);
+ Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]);
+ if(!Channel || !Spirit[0] || !Spirit[1])
+ return;
+ }
+
+ switch(ChannelCount)
+ {
+ case 0: // channel failed
+ m_creature->InterruptNonMeleeSpells(true);
+ Timer = 2000;
+ break;
+ case 1: // spirit appear
+ Spirit[0]->SetVisibility(VISIBILITY_ON);
+ Spirit[1]->SetVisibility(VISIBILITY_ON);
+ Timer = 2000;
+ break;
+ case 2: // spirit help
+ DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL);
+ Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
+ Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
+ Timer = 5000;
+ break;
+ case 3: //open the gate
+ m_creature->InterruptNonMeleeSpells(true);
+ Spirit[0]->InterruptNonMeleeSpells(true);
+ Spirit[1]->InterruptNonMeleeSpells(true);
+ if(GETGO(Gate, GateGUID))
+ Gate->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ Timer = 2000;
+ break;
+ case 4:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ Timer = 2000;
+ break;
+ case 5:
+ DoYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE);
+ Channel->setDeathState(JUST_DIED);
+ Spirit[0]->setDeathState(JUST_DIED);
+ Spirit[1]->setDeathState(JUST_DIED);
+ Timer = 3000;
+ break;
+ case 6:
+ EnterPhase(PHASE_WALK);
+ break;
+ default:
+ break;
+ }
+ ChannelCount++;
+ }
+
+ void HandleWalkSequence()
+ {
+ switch(WalkCount)
+ {
+ case 6:
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ break;
+ case 8:
+ if(Phase == PHASE_WALK)
+ EnterPhase(PHASE_TALK);
+ else
+ EnterPhase(PHASE_FIGHT_ILLIDAN);
+ break;
+ case 12:
+ EnterPhase(PHASE_FIGHT_MINIONS);
+ break;
+ }
+
+ if(Phase == PHASE_WALK)
+ {
+ Timer = 0;
+ WalkCount++;
+ m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ Event = false;
+ if(Timer)
+ {
+ if(Timer <= diff)
+ Event = true;
+ else Timer -= diff;
+ }
+
+ if(Event)
+ {
+ switch(Phase)
+ {
+ case PHASE_CHANNEL:
+ HandleChannelSequence();
+ break;
+ case PHASE_TALK:
+ HandleTalkSequence();
+ break;
+ case PHASE_WALK:
+ case PHASE_RETURN:
+ HandleWalkSequence();
+ break;
+ case PHASE_FIGHT_ILLIDAN:
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && HPPCT(Illidan) < 90)
+ EnterPhase(PHASE_TALK);
+ else
+ {
+ DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ Timer = 30000;
+ }
+ }break;
+ case PHASE_FIGHT_MINIONS:
+ {
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ if(Elite)
+ {
+ Elite->AI()->AttackStart(m_creature);
+ Elite->AddThreat(m_creature, 1000000.0f);
+ AttackStart(Elite);
+ }
+ Timer = 10000 + rand()%6000;
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && HPPCT(Illidan) < 10)
+ EnterPhase(PHASE_RETURN);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
+ DoCast(m_creature, SPELL_HEALING_POTION);
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
+{
+ boss_maievAI(Creature *c) : ScriptedAI(c) { Reset(); };
+
+ uint64 IllidanGUID;
+
+ PhaseIllidan Phase;
+ EventMaiev Event;
+ uint32 Timer[5];
+ uint32 MaxTimer;
+
+ void Reset()
+ {
+ MaxTimer = 0;
+ Phase = PHASE_NORMAL_MAIEV;
+ IllidanGUID = 0;
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738);
+ }
+
+ void Aggro(Unit *who) {}
+ void MoveInLineOfSight(Unit *who) {}
+ void EnterEvadeMode() {}
+ void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() != IllidanGUID )
+ damage = 0;
+ else
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && Illidan->getVictim() == m_creature)
+ damage = m_creature->GetMaxHealth()/10;
+ if(damage >= m_creature->GetHealth())
+ damage = 0;
+ }
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!who || Timer[EVENT_MAIEV_STEALTH])
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(Phase == PHASE_TALK_SEQUENCE)
+ m_creature->Attack(who, false);
+ else if(Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE )
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && m_creature->IsWithinDistInMap(Illidan, 25))
+ BlinkToPlayer();//Do not let dread aura hurt her.
+ m_creature->Attack(who, false);
+ }
+ else
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
+ {
+ switch(NextPhase)
+ {
+ case PHASE_TALK_SEQUENCE:
+ if(Timer[EVENT_MAIEV_STEALTH])
+ {
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ }
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
+ MaxTimer = 0;
+ break;
+ case PHASE_TRANSFORM_SEQUENCE:
+ MaxTimer = 4;
+ Timer[EVENT_MAIEV_TAUNT] += 10000;
+ Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
+ break;
+ case PHASE_DEMON:
+ break;
+ case PHASE_NORMAL_MAIEV:
+ MaxTimer = 4;
+ Timer[EVENT_MAIEV_TAUNT] += 10000;
+ Timer[EVENT_MAIEV_TRAP] = 22000;
+ break;
+ default:
+ break;
+ }
+ if(Timer[EVENT_MAIEV_STEALTH])
+ MaxTimer = 1;
+ Phase = NextPhase;
+ }
+
+ void BlinkTo(float x, float y, float z)
+ {
+ m_creature->AttackStop();
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->Relocate(x, y, z);
+ m_creature->SendMonsterMove(x, y, z, 0, 0, 0);
+ DoCast(m_creature, SPELL_TELEPORT_VISUAL, true);
+ }
+
+ void BlinkToPlayer()
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ Unit* target = ((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20))
+ {
+ uint8 pos = rand()%4;
+ BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
+ }
+ else
+ {
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ BlinkTo(x, y, z);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && !Timer[1])
+ return;
+
+ Event = EVENT_MAIEV_NULL;
+ for(uint8 i = 1; i <= MaxTimer; i++)
+ if(Timer[i])
+ {
+ if(Timer[i] <= diff)
+ Event = (EventMaiev)i;
+ else Timer[i] -= diff;
+ }
+
+ switch(Event)
+ {
+ case EVENT_MAIEV_STEALTH:
+ {
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ BlinkToPlayer();
+ EnterPhase(Phase);
+ }break;
+ case EVENT_MAIEV_TAUNT:
+ {
+ uint32 random = rand()%4;
+ char* text = MaievTaunts[random].text;
+ uint32 sound = MaievTaunts[random].sound;
+ DoYell(text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, sound);
+ Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ }break;
+ case EVENT_MAIEV_SHADOW_STRIKE:
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE);
+ Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
+ break;
+ case EVENT_MAIEV_TRAP:
+ if(Phase == PHASE_NORMAL_MAIEV)
+ {
+ BlinkToPlayer();
+ DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON);
+ Timer[EVENT_MAIEV_TRAP] = 22000;
+ }
+ else
+ {
+ if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40))
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
+ DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER);
+ Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
+ m_creature->AttackStop();
+ Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
+ MaxTimer = 1;
+ }
+
+ if(Phase == PHASE_NORMAL_MAIEV)
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+bool GossipSelect_npc_akama_at_illidan(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_akama_illidanAI*)_Creature->AI())->EnterPhase(PHASE_CHANNEL);
+ }
+ return true;
+}
+
+bool GossipHello_npc_akama_at_illidan(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(10465, _Creature->GetGUID());
+
+ return true;
+}
+
+struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
+{
+ cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 IllidanGUID;
+ uint32 DespawnTimer;
+
+ bool Active;
+ bool SummonedBeams;
+
+ void Reset()
+ {
+ IllidanGUID = 0;
+
+ Active = false;
+ SummonedBeams = false;
+
+ DespawnTimer = 0;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who){}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!Active)
+ return;
+
+ if(who && (who->GetTypeId() != TYPEID_PLAYER))
+ {
+ if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
+ {
+ if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
+ {
+ IllidanGUID = who->GetGUID();
+ who->CastSpell(who, SPELL_CAGED, true);
+ DespawnTimer = 5000;
+ if(who->HasAura(SPELL_ENRAGE, 0))
+ who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
+ //if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
+ // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(DespawnTimer)
+ if(DespawnTimer < diff)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ else DespawnTimer -= diff;
+
+ //if(IllidanGUID && !SummonedBeams)
+ //{
+ // if(Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID)
+ // {
+ // //TODO: Find proper spells and properly apply 'caged' Illidan effect
+ // }
+ //}
+ }
+};
+
+bool GOHello_cage_trap(Player* plr, GameObject* go)
+{
+ float x, y, z;
+ plr->GetPosition(x, y, z);
+
+ Creature* trigger = NULL;
+
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ // Grid search for nearest live creature of entry 23304 within 10 yards
+ Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(trigger, check);
+
+ TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap()));
+
+ ((cage_trap_triggerAI*)trigger->AI())->Active = true;
+ go->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ return true;
+}
+
+struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
+{
+ shadow_demonAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 TargetGUID;
+
+ void Aggro(Unit *who) {}
+
+ void Reset()
+ {
+ TargetGUID = 0;
+ DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
+ }
+
+ void JustDied(Unit *killer)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
+ if(target)
+ target->RemoveAurasDueToSpell(SPELL_PARALYZE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return;
+
+ if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
+
+ if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
+ {
+ TargetGUID = m_creature->getVictim()->GetGUID();
+ m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
+ DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true);
+ DoCast(m_creature->getVictim(), SPELL_PARALYZE, true);
+ }
+ // Kill our target if we're very close.
+ if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 3))
+ DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL);
+ }
+};
+
+// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
+struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
+{
+ mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 IllidanGUID;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ if(pInstance)
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ else
+ IllidanGUID = 0;
+
+ CheckTimer = 5000;
+ DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true);
+ }
+
+ void Aggro(Unit* who) {}
+ void MoveInLineOfSight(Unit *who){}
+
+ void DoMeleeAttackIfReady()
+ {
+ if( m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true); //do not stack
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->AddParasiteTarget(m_creature->getVictim()->GetGUID());
+ }
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim())
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ if(Illidan->getVictim() && !Illidan->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ AttackStart(Illidan->getVictim());
+ else
+ AttackStart(((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 1));
+ }
+ }
+ else
+ DoMeleeAttackIfReady();
+
+ if(CheckTimer < diff)
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode())
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }else CheckTimer = 5000;
+ }else CheckTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI
+{
+ demonfireAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 IllidanGUID;
+ bool IsTrigger;
+ bool DemonFire;
+ uint32 CheckTimer;
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ if(pInstance)
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ else
+ IllidanGUID = 0;
+
+ IsTrigger = false;
+ DemonFire = false;
+
+ CheckTimer = 5000;
+ DespawnTimer = 78000; //spell duration, core bug, cannot despawn self
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(IsTrigger)
+ return;
+
+ if(!DemonFire)
+ DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s
+
+ if(CheckTimer < diff)
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }else CheckTimer = 5000;
+ }else CheckTimer -= diff;
+
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL blazeAI : public ScriptedAI
+{
+ blazeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BlazeTimer;
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ BlazeTimer = 3000;
+ DespawnTimer = 60000; // Spell duration = 1 min
+ //((TemporarySummon*)m_creature)->Summon(TEMPSUMMON_TIMED_DESPAWN, 0, false);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit *who){ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(BlazeTimer)
+ if(BlazeTimer <= diff)
+ {
+ DoCast(m_creature, SPELL_BLAZE_EFFECT);//duration 60s
+ BlazeTimer = 0;
+ }else BlazeTimer -= diff;
+
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL flamecrashAI : public ScriptedAI
+{
+ flamecrashAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ DoCast(m_creature, SPELL_FLAME_CRASH_EFFECT);//duration inf
+ DespawnTimer = 120000; // summon spell duration
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit *who) { }
+ void MoveInLineOfSight(Unit *who){ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI
+{
+ blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {}
+ void Reset() {}
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit* who) { }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21431);//appear when hit by Illidan's glaive
+ }
+};
+
+void boss_illidan_stormrageAI::Reset()
+{
+ if(pInstance)
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
+
+ for(uint8 i = 0; i < 2; i++)
+ {
+ if(FlameGUID[i])
+ {
+ if(GETUNIT(Flame, FlameGUID[i]))
+ Flame->setDeathState(JUST_DIED);
+ FlameGUID[i] = 0;
+ }
+
+ if(GlaiveGUID[i])
+ {
+ if(GETUNIT(Glaive, GlaiveGUID[i]))
+ Glaive->setDeathState(JUST_DIED);
+ GlaiveGUID[i] = 0;
+ }
+ }
+
+ if(AkamaGUID)
+ {
+ if(GETCRE(Akama, AkamaGUID))
+ {
+ if(!Akama->isAlive())
+ Akama->Respawn();
+ else
+ {
+ ((npc_akama_illidanAI*)Akama->AI())->EnterEvadeMode();
+ Akama->GetMotionMaster()->MoveTargetedHome();
+ ((npc_akama_illidanAI*)Akama->AI())->Reset();
+ }
+ }
+ AkamaGUID = 0;
+ }
+
+ if(MaievGUID)
+ {
+ GETUNIT(Maiev, MaievGUID);
+ if(Maiev && Maiev->isAlive())
+ {
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
+ Maiev->setDeathState(JUST_DIED);
+ }
+ MaievGUID = 0;
+ }
+
+ Phase = PHASE_NULL;
+ Event = EVENT_NULL;
+ Timer[EVENT_BERSERK] = 1500000;
+
+ HoverPoint = 0;
+ TalkCount = 0;
+ FlightCount = 0;
+ TransformCount = 0;
+
+ ParasiteTargets.clear();
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+
+ DoCast(m_creature, SPELL_DUAL_WIELD, true);
+}
+
+void boss_illidan_stormrageAI::HandleTalkSequence()
+{
+ switch(TalkCount)
+ {
+ case 0:
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ break;
+ case 8:
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives!
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 9:
+ if(GETCRE(Akama, AkamaGUID))
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->AddThreat(Akama, 100.0f);
+ ((npc_akama_illidanAI*)Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
+ EnterPhase(PHASE_NORMAL);
+ }
+ break;
+ case 10:
+ SummonMaiev();
+ break;
+ case 11:
+ if(GETUNIT(Maiev, MaievGUID))
+ {
+ Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
+ Maiev->SetInFront(m_creature); // Have her face us
+ m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
+ Maiev->StopMoving();
+ m_creature->StopMoving();
+ }break;
+ case 14:
+ if(GETCRE(Maiev, MaievGUID))
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
+ Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us.
+ EnterPhase(PHASE_NORMAL_MAIEV);
+ }break;
+ case 15:
+ DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
+ break;
+ case 17:
+ if(GETUNIT(Akama, AkamaGUID))
+ {
+ if(!m_creature->IsWithinDistInMap(Akama, 15))
+ {
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ x += 10; y += 10;
+ Akama->GetMotionMaster()->Clear(false);
+ //Akama->GetMotionMaster()->MoveIdle();
+ Akama->Relocate(x, y, z);
+ Akama->SendMonsterMove(x, y, z, 0, 0, 0);//Illidan must not die until Akama arrives.
+ Akama->GetMotionMaster()->MoveChase(m_creature);
+ }
+ }
+ break;
+ case 19: // Make Maiev leave
+ if(GETUNIT(Maiev, MaievGUID))
+ {
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
+ Maiev->setDeathState(JUST_DIED);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ }
+ break;
+ case 21: // Kill ourself.
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ break;
+ default:
+ break;
+ }
+ if(Phase == PHASE_TALK_SEQUENCE)
+ Talk(TalkCount); // This function does most of the talking
+ TalkCount++;
+}
+
+
+void boss_illidan_stormrageAI::CastEyeBlast()
+{
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoYell(SAY_EYE_BLAST, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST);
+
+ float distx, disty, dist[2];
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ distx = EyeBlast[i].x - HoverPosition[HoverPoint].x;
+ disty = EyeBlast[i].y - HoverPosition[HoverPoint].y;
+ dist[i] = distx * distx + disty * disty;
+ }
+ Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1];
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x;
+ disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y;
+ dist[i] = distx * distx + disty * disty;
+ }
+ Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1];
+
+ final.x = 2 * final.x - initial.x;
+ final.y = 2 * final.y - initial.y;
+
+ for(uint8 i = 0; i < 2; ++i)//core bug, two buff do not coexist
+ {
+ Creature* Trigger = NULL;
+ Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
+ if(Trigger)
+ {
+ ((demonfireAI*)Trigger->AI())->IsTrigger = true;
+ Trigger->SetSpeed(MOVE_WALK, 3);
+ Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
+
+ if(!i)
+ Trigger->CastSpell(Trigger, SPELL_EYE_BLAST_TRIGGER, true);
+ else
+ {
+ Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
+ DoCast(Trigger, SPELL_EYE_BLAST);
+ }
+ }
+ }
+}
+
+void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
+{
+ DoYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES);
+
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ if(GETUNIT(Glaive, GlaiveGUID[i]))
+ {
+ Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ if(Flame)
+ {
+ Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction
+ Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
+ Flame->AI()->AttackStart(m_creature->getVictim()); // Attack our target!
+ FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
+ ((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
+ DoZoneInCombat(Flame);
+ Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
+ }
+ }
+ }
+}
+
+void boss_illidan_stormrageAI::SummonMaiev()
+{
+ DoCast(m_creature, SPELL_SHADOW_PRISON, true);
+ Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Maiev)
+ {
+ Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
+ Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ MaievGUID = Maiev->GetGUID();
+ ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID());
+ ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+ }
+ else // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
+ {
+ EnterEvadeMode();
+ DoTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", NULL);
+ error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
+ }
+}
+
+
+void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
+{
+ DoZoneInCombat();
+ switch(NextPhase)
+ {
+ case PHASE_NORMAL:
+ case PHASE_NORMAL_2:
+ case PHASE_NORMAL_MAIEV:
+ AttackStart(m_creature->getVictim());
+ Timer[EVENT_TAUNT] = 32000;
+ Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000;
+ Timer[EVENT_FLAME_CRASH] = 20000;
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000;
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ Timer[EVENT_DRAW_SOUL] = 30000;
+ if(NextPhase == PHASE_NORMAL)
+ break;
+ Timer[EVENT_AGONIZING_FLAMES] = 35000;
+ Timer[EVENT_TRANSFORM_NORMAL] = 60000;
+ if(NextPhase == PHASE_NORMAL_2)
+ break;
+ Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000;
+ break;
+ case PHASE_FLIGHT:
+ Timer[EVENT_FIREBALL] = 1000;
+ if(!(rand()%4))
+ Timer[EVENT_DARK_BARRAGE] = 10000;
+ Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000;
+ Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000;
+ break;
+ case PHASE_DEMON:
+ Timer[EVENT_SHADOW_BLAST] = 1000;
+ Timer[EVENT_FLAME_BURST] = 10000;
+ Timer[EVENT_SHADOWDEMON] = 30000;
+ Timer[EVENT_TRANSFORM_DEMON] = 60000;
+ AttackStart(m_creature->getVictim());
+ break;
+ case PHASE_TALK_SEQUENCE:
+ Timer[EVENT_TALK_SEQUENCE] = 100;
+ m_creature->RemoveAllAuras();
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ break;
+ case PHASE_FLIGHT_SEQUENCE:
+ if(Phase == PHASE_FLIGHT) //land
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ else //lift off
+ {
+ FlightCount = 1;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ 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->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ }
+ break;
+ case PHASE_TRANSFORM_SEQUENCE:
+ if(Phase == PHASE_DEMON)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ else
+ {
+ TransformCount = 0;
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ DoYell(SAY_MORPH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MORPH);
+ }
+ m_creature->GetMotionMaster()->Clear();
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ break;
+ default:
+ break;
+ }
+ if(MaievGUID)
+ {
+ GETCRE(Maiev, MaievGUID);
+ if(Maiev && Maiev->isAlive())
+ ((boss_maievAI*)Maiev->AI())->EnterPhase(NextPhase);
+ }
+ Phase = NextPhase;
+ Event = EVENT_NULL;
+}
+
+CreatureAI* GetAI_boss_illidan_stormrage(Creature *_Creature)
+{
+ return new boss_illidan_stormrageAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_akama_at_illidan(Creature *_Creature)
+{
+ return new npc_akama_illidanAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_maiev(Creature *_Creature)
+{
+ return new boss_maievAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_flame_of_azzinoth(Creature *_Creature)
+{
+ return new flame_of_azzinothAI (_Creature);
+}
+
+CreatureAI* GetAI_cage_trap_trigger(Creature *_Creature)
+{
+ return new cage_trap_triggerAI (_Creature);
+}
+
+CreatureAI* GetAI_shadow_demon(Creature *_Creature)
+{
+ return new shadow_demonAI (_Creature);
+}
+
+CreatureAI* GetAI_flamecrash(Creature *_Creature)
+{
+ return new flamecrashAI (_Creature);
+}
+
+CreatureAI* GetAI_demonfire(Creature *_Creature)
+{
+ return new demonfireAI (_Creature);
+}
+
+CreatureAI* GetAI_blaze(Creature *_Creature)
+{
+ return new blazeAI (_Creature);
+}
+
+CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature)
+{
+ return new blade_of_azzinothAI (_Creature);
+}
+
+CreatureAI* GetAI_parasitic_shadowfiend(Creature *_Creature)
+{
+ return new mob_parasitic_shadowfiendAI (_Creature);
+}
+
+void AddSC_boss_illidan()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_illidan_stormrage";
+ newscript->GetAI = GetAI_boss_illidan_stormrage;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_akama_illidan";
+ newscript->GetAI = GetAI_npc_akama_at_illidan;
+ newscript->pGossipHello = GossipHello_npc_akama_at_illidan;
+ newscript->pGossipSelect = GossipSelect_npc_akama_at_illidan;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_maiev_shadowsong";
+ newscript->GetAI = GetAI_boss_maiev;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_flame_of_azzinoth";
+ newscript->GetAI = GetAI_mob_flame_of_azzinoth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_blade_of_azzinoth";
+ newscript->GetAI = GetAI_blade_of_azzinoth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "gameobject_cage_trap";
+ newscript->pGOHello = GOHello_cage_trap;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_cage_trap_trigger";
+ newscript->GetAI = GetAI_cage_trap_trigger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_shadow_demon";
+ newscript->GetAI = GetAI_shadow_demon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_flame_crash";
+ newscript->GetAI = GetAI_flamecrash;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_demon_fire";
+ newscript->GetAI = GetAI_demonfire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_blaze";
+ newscript->GetAI = GetAI_blaze;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_parasitic_shadowfiend";
+ newscript->GetAI = GetAI_parasitic_shadowfiend;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
index 3c7345fa477..0f5d2af3c22 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
@@ -1,361 +1,361 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mother_Shahraz
-SD%Complete: 80
-SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_BEAM_SINISTER 40859
-#define SPELL_BEAM_VILE 40860
-#define SPELL_BEAM_WICKED 40861
-#define SPELL_BEAM_SINFUL 40827
-#define SPELL_ATTRACTION 40871
-#define SPELL_SILENCING_SHRIEK 40823
-#define SPELL_ENRAGE 23537
-#define SPELL_SABER_LASH 40810//43267
-#define SPELL_SABER_LASH_IMM 43690
-#define SPELL_TELEPORT_VISUAL 40869
-#define SPELL_BERSERK 45078
-
-uint32 PrismaticAuras[]=
-{
- 40880, // Shadow
- 40882, // Fire
- 40883, // Nature
- 40891, // Arcane
- 40896, // Frost
- 40897, // Holy
-};
-
-//Speech'n'Sounds
-#define SAY_TAUNT1 "You play, you pay."
-#define SOUND_TAUNT1 11501
-
-#define SAY_TAUNT2 "I'm not impressed."
-#define SOUND_TAUNT2 11502
-
-#define SAY_TAUNT3 "Enjoying yourselves?"
-#define SOUND_TAUNT3 11503
-
-#define SAY_AGGRO "So, business... Or pleasure?"
-#define SOUND_AGGRO 11504
-
-#define SAY_SPELL1 "You seem a little tense."
-#define SOUND_SPELL1 11505
-
-#define SAY_SPELL2 "Don't be shy."
-#define SOUND_SPELL2 11506
-
-#define SAY_SPELL3 "I'm all... yours."
-#define SOUND_SPELL3 11507
-
-#define SAY_SLAY1 "Easy come, easy go."
-#define SOUND_SLAY1 11508
-
-#define SAY_SLAY2 "So much for a happy ending."
-#define SOUND_SLAY2 11509
-
-#define SAY_ENRAGE "Stop toying with my emotions!"
-#define SOUND_ENRAGE 11510
-
-#define SAY_DEATH "I wasn't... finished."
-#define SOUND_DEATH 11511
-
-struct Locations
-{
- float x,y,z;
-};
-
-static Locations TeleportPoint[]=
-{
- {959.996, 212.576, 193.843},
- {932.537, 231.813, 193.838},
- {958.675, 254.767, 193.822},
- {946.955, 201.316, 192.535},
- {944.294, 149.676, 197.551},
- {930.548, 284.888, 193.367},
- {965.997, 278.398, 195.777}
-};
-
-struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
-{
- boss_shahrazAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 TargetGUID[3];
- uint32 BeamTimer;
- uint32 BeamCount;
- uint32 CurrentBeam;
- uint32 PrismaticShieldTimer;
- uint32 FatalAttractionTimer;
- uint32 FatalAttractionExplodeTimer;
- uint32 ShriekTimer;
- uint32 SaberTimer;
- uint32 RandomYellTimer;
- uint32 EnrageTimer;
- uint32 ExplosionCount;
-
- bool Enraged;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED);
-
- for(uint8 i = 0; i<3; i++)
- TargetGUID[i] = 0;
-
- BeamTimer = 20000; // Timers may be incorrect
- BeamCount = 0;
- CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful
- PrismaticShieldTimer = 0;
- FatalAttractionTimer = 60000;
- FatalAttractionExplodeTimer = 70000;
- ShriekTimer = 30000;
- SaberTimer = 35000;
- RandomYellTimer = 70000 + rand()%41 * 1000;
- EnrageTimer = 600000;
- ExplosionCount = 0;
-
- Enraged = false;
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
-
- DoZoneInCombat();
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
-
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void TeleportPlayers()
- {
- uint32 random = rand()%7;
- float X = TeleportPoint[random].x;
- float Y = TeleportPoint[random].y;
- float Z = TeleportPoint[random].z;
- for(uint8 i = 0; i < 3; i++)
- {
- Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- TargetGUID[i] = pUnit->GetGUID();
- pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true);
- DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation());
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
- {
- Enraged = true;
- DoCast(m_creature, SPELL_ENRAGE, true);
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
-
- //Randomly cast one beam.
- if(BeamTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(!target || !target->isAlive())
- return;
-
- BeamTimer = 9000;
-
- switch(CurrentBeam)
- {
- case 0:
- DoCast(target, SPELL_BEAM_SINISTER);
- break;
- case 1:
- DoCast(target, SPELL_BEAM_VILE);
- break;
- case 2:
- DoCast(target, SPELL_BEAM_WICKED);
- break;
- case 3:
- DoCast(target, SPELL_BEAM_SINFUL);
- break;
- }
- BeamCount++;
- uint32 Beam = CurrentBeam;
- if(BeamCount > 3)
- while(CurrentBeam == Beam)
- CurrentBeam = rand()%3;
-
- }else BeamTimer -= diff;
-
- // Random Prismatic Shield every 15 seconds.
- if(PrismaticShieldTimer < diff)
- {
- uint32 random = rand()%6;
- if(PrismaticAuras[random])
- DoCast(m_creature, PrismaticAuras[random]);
- PrismaticShieldTimer = 15000;
- }else PrismaticShieldTimer -= diff;
-
- // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other.
- if(FatalAttractionTimer < diff)
- {
- ExplosionCount = 0;
-
- TeleportPlayers();
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL2);
- break;
- case 1:
- DoYell(SAY_SPELL3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL3);
- break;
- }
- FatalAttractionExplodeTimer = 2000;
- FatalAttractionTimer = 40000 + rand()%31 * 1000;
- }else FatalAttractionTimer -= diff;
-
- if(FatalAttractionExplodeTimer < diff)
- {
- // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
- if(ExplosionCount < 3)
- {
- for(uint8 i = 0; i < 4; i++)
- {
- Unit* pUnit = NULL;
- if(TargetGUID[i])
- {
- pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]);
- if(pUnit)
- pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true);
- TargetGUID[i] = 0;
- }
- }
-
- ExplosionCount++;
- FatalAttractionExplodeTimer = 1000;
- }
- else
- {
- FatalAttractionExplodeTimer = FatalAttractionTimer + 2000;
- ExplosionCount = 0;
- }
- }else FatalAttractionExplodeTimer -= diff;
-
- if(ShriekTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK);
- ShriekTimer = 25000+rand()%10 * 1000;
- }else ShriekTimer -= diff;
-
- if(SaberTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SABER_LASH);
- SaberTimer = 25000+rand()%10 * 1000;
- }else SaberTimer -= diff;
-
- //Enrage
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- //Random taunts
- if(RandomYellTimer < diff)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_TAUNT1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
- break;
- case 1:
- DoYell(SAY_TAUNT2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
- break;
- case 2:
- DoYell(SAY_TAUNT3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
- break;
- }
- RandomYellTimer = 60000 + rand()%91 * 1000;
- }else RandomYellTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_shahraz(Creature *_Creature)
-{
- return new boss_shahrazAI (_Creature);
-}
-
-void AddSC_boss_mother_shahraz()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_mother_shahraz";
- newscript->GetAI = GetAI_boss_shahraz;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mother_Shahraz
+SD%Complete: 80
+SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_BEAM_SINISTER 40859
+#define SPELL_BEAM_VILE 40860
+#define SPELL_BEAM_WICKED 40861
+#define SPELL_BEAM_SINFUL 40827
+#define SPELL_ATTRACTION 40871
+#define SPELL_SILENCING_SHRIEK 40823
+#define SPELL_ENRAGE 23537
+#define SPELL_SABER_LASH 40810//43267
+#define SPELL_SABER_LASH_IMM 43690
+#define SPELL_TELEPORT_VISUAL 40869
+#define SPELL_BERSERK 45078
+
+uint32 PrismaticAuras[]=
+{
+ 40880, // Shadow
+ 40882, // Fire
+ 40883, // Nature
+ 40891, // Arcane
+ 40896, // Frost
+ 40897, // Holy
+};
+
+//Speech'n'Sounds
+#define SAY_TAUNT1 "You play, you pay."
+#define SOUND_TAUNT1 11501
+
+#define SAY_TAUNT2 "I'm not impressed."
+#define SOUND_TAUNT2 11502
+
+#define SAY_TAUNT3 "Enjoying yourselves?"
+#define SOUND_TAUNT3 11503
+
+#define SAY_AGGRO "So, business... Or pleasure?"
+#define SOUND_AGGRO 11504
+
+#define SAY_SPELL1 "You seem a little tense."
+#define SOUND_SPELL1 11505
+
+#define SAY_SPELL2 "Don't be shy."
+#define SOUND_SPELL2 11506
+
+#define SAY_SPELL3 "I'm all... yours."
+#define SOUND_SPELL3 11507
+
+#define SAY_SLAY1 "Easy come, easy go."
+#define SOUND_SLAY1 11508
+
+#define SAY_SLAY2 "So much for a happy ending."
+#define SOUND_SLAY2 11509
+
+#define SAY_ENRAGE "Stop toying with my emotions!"
+#define SOUND_ENRAGE 11510
+
+#define SAY_DEATH "I wasn't... finished."
+#define SOUND_DEATH 11511
+
+struct Locations
+{
+ float x,y,z;
+};
+
+static Locations TeleportPoint[]=
+{
+ {959.996, 212.576, 193.843},
+ {932.537, 231.813, 193.838},
+ {958.675, 254.767, 193.822},
+ {946.955, 201.316, 192.535},
+ {944.294, 149.676, 197.551},
+ {930.548, 284.888, 193.367},
+ {965.997, 278.398, 195.777}
+};
+
+struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
+{
+ boss_shahrazAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 TargetGUID[3];
+ uint32 BeamTimer;
+ uint32 BeamCount;
+ uint32 CurrentBeam;
+ uint32 PrismaticShieldTimer;
+ uint32 FatalAttractionTimer;
+ uint32 FatalAttractionExplodeTimer;
+ uint32 ShriekTimer;
+ uint32 SaberTimer;
+ uint32 RandomYellTimer;
+ uint32 EnrageTimer;
+ uint32 ExplosionCount;
+
+ bool Enraged;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED);
+
+ for(uint8 i = 0; i<3; i++)
+ TargetGUID[i] = 0;
+
+ BeamTimer = 20000; // Timers may be incorrect
+ BeamCount = 0;
+ CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful
+ PrismaticShieldTimer = 0;
+ FatalAttractionTimer = 60000;
+ FatalAttractionExplodeTimer = 70000;
+ ShriekTimer = 30000;
+ SaberTimer = 35000;
+ RandomYellTimer = 70000 + rand()%41 * 1000;
+ EnrageTimer = 600000;
+ ExplosionCount = 0;
+
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
+
+ DoZoneInCombat();
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
+
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void TeleportPlayers()
+ {
+ uint32 random = rand()%7;
+ float X = TeleportPoint[random].x;
+ float Y = TeleportPoint[random].y;
+ float Z = TeleportPoint[random].z;
+ for(uint8 i = 0; i < 3; i++)
+ {
+ Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ TargetGUID[i] = pUnit->GetGUID();
+ pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true);
+ DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation());
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
+ {
+ Enraged = true;
+ DoCast(m_creature, SPELL_ENRAGE, true);
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+
+ //Randomly cast one beam.
+ if(BeamTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(!target || !target->isAlive())
+ return;
+
+ BeamTimer = 9000;
+
+ switch(CurrentBeam)
+ {
+ case 0:
+ DoCast(target, SPELL_BEAM_SINISTER);
+ break;
+ case 1:
+ DoCast(target, SPELL_BEAM_VILE);
+ break;
+ case 2:
+ DoCast(target, SPELL_BEAM_WICKED);
+ break;
+ case 3:
+ DoCast(target, SPELL_BEAM_SINFUL);
+ break;
+ }
+ BeamCount++;
+ uint32 Beam = CurrentBeam;
+ if(BeamCount > 3)
+ while(CurrentBeam == Beam)
+ CurrentBeam = rand()%3;
+
+ }else BeamTimer -= diff;
+
+ // Random Prismatic Shield every 15 seconds.
+ if(PrismaticShieldTimer < diff)
+ {
+ uint32 random = rand()%6;
+ if(PrismaticAuras[random])
+ DoCast(m_creature, PrismaticAuras[random]);
+ PrismaticShieldTimer = 15000;
+ }else PrismaticShieldTimer -= diff;
+
+ // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other.
+ if(FatalAttractionTimer < diff)
+ {
+ ExplosionCount = 0;
+
+ TeleportPlayers();
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL2);
+ break;
+ case 1:
+ DoYell(SAY_SPELL3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL3);
+ break;
+ }
+ FatalAttractionExplodeTimer = 2000;
+ FatalAttractionTimer = 40000 + rand()%31 * 1000;
+ }else FatalAttractionTimer -= diff;
+
+ if(FatalAttractionExplodeTimer < diff)
+ {
+ // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
+ if(ExplosionCount < 3)
+ {
+ for(uint8 i = 0; i < 4; i++)
+ {
+ Unit* pUnit = NULL;
+ if(TargetGUID[i])
+ {
+ pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]);
+ if(pUnit)
+ pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true);
+ TargetGUID[i] = 0;
+ }
+ }
+
+ ExplosionCount++;
+ FatalAttractionExplodeTimer = 1000;
+ }
+ else
+ {
+ FatalAttractionExplodeTimer = FatalAttractionTimer + 2000;
+ ExplosionCount = 0;
+ }
+ }else FatalAttractionExplodeTimer -= diff;
+
+ if(ShriekTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK);
+ ShriekTimer = 25000+rand()%10 * 1000;
+ }else ShriekTimer -= diff;
+
+ if(SaberTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SABER_LASH);
+ SaberTimer = 25000+rand()%10 * 1000;
+ }else SaberTimer -= diff;
+
+ //Enrage
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ //Random taunts
+ if(RandomYellTimer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_TAUNT1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
+ break;
+ case 1:
+ DoYell(SAY_TAUNT2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
+ break;
+ case 2:
+ DoYell(SAY_TAUNT3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
+ break;
+ }
+ RandomYellTimer = 60000 + rand()%91 * 1000;
+ }else RandomYellTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_shahraz(Creature *_Creature)
+{
+ return new boss_shahrazAI (_Creature);
+}
+
+void AddSC_boss_mother_shahraz()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_mother_shahraz";
+ newscript->GetAI = GetAI_boss_shahraz;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
index dc7539442f4..50a0a4de3ac 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
@@ -1,802 +1,802 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Reliquary_of_Souls
-SD%Complete: 90
-SDComment:
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-#include "Spell.h"
-
-//Sound'n'speech
-//Suffering
-#define SUFF_SAY_FREED "Pain and suffering are all that await you!"
-#define SUFF_SOUND_FREED 11415
-#define SUFF_SAY_AGGRO "Don't leave me alone!"
-#define SUFF_SOUND_AGGRO 11416
-#define SUFF_SAY_SLAY1 "Look at what you make me do!"
-#define SUFF_SOUND_SLAY1 11417
-#define SUFF_SAY_SLAY2 "I didn't ask for this!"
-#define SUFF_SOUND_SLAY2 11418
-#define SUFF_SAY_ENRAGE "The pain is only beginning!"
-#define SUFF_SOUND_ENRAGE 11419
-#define SUFF_SAY_RECAP "I don't want to go back!"
-#define SUFF_SOUND_RECAP 11420
-#define SUFF_SAY_AFTER "Now what do I do?"
-#define SUFF_SOUND_AFTER 11421
-
-//Desire
-#define DESI_SAY_FREED "You can have anything you desire... for a price."
-#define DESI_SOUND_FREED 11408
-#define DESI_SAY_SLAY1 "Fulfilment is at hand!"
-#define DESI_SOUND_SLAY1 11409
-#define DESI_SAY_SLAY2 "Yes... you'll stay with us now..."
-#define DESI_SOUND_SLAY2 11410
-#define DESI_SAY_SLAY3 "Your reach exceeds your grasp."
-#define DESI_SOUND_SLAY3 11412
-#define DESI_SAY_SPEC "Be careful what you wish for..."
-#define DESI_SOUND_SPEC 11411
-#define DESI_SAY_RECAP "I'll be waiting..."
-#define DESI_SOUND_RECAP 11413
-#define DESI_SAY_AFTER "I won't be far..."
-#define DESI_SOUND_AFTER 11414
-
-//Anger
-#define ANGER_SAY_FREED "Beware... I live."
-#define ANGER_SOUND_FREED 11399
-#define ANGER_SAY_SCREAM "So... foolish."
-#define ANGER_SOUND_SCREAM 11400
-#define ANGER_SOUND_SLAY1 11401
-#define ANGER_SAY_SLAY2 "Enough. No more."
-#define ANGER_SOUND_SLAY2 11402
-#define ANGER_SAY_SPEC "On your knees!"
-#define ANGER_SOUND_SPEC 11403
-#define ANGER_SAY_BEFORE "Beware, coward."
-#define ANGER_SOUND_BEFORE 11405
-#define ANGER_SAY_DEATH "I won't... be... ignored."
-#define ANGER_SOUND_DEATH 11404
-
-//Spells
-#define AURA_OF_SUFFERING 41292
-#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support
-#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294
-#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
-#define SPELL_FIXATE_TARGET 41294 // dummy, select target
-#define SPELL_FIXATE_TAUNT 41295 // force taunt
-#define SPELL_ENRAGE 41305
-#define SPELL_SOUL_DRAIN 41303
-
-#define AURA_OF_DESIRE 41350
-#define AURA_OF_DESIRE_DAMAGE 41352
-#define SPELL_RUNE_SHIELD 41431
-#define SPELL_DEADEN 41410
-#define SPELL_SOUL_SHOCK 41426
-
-#define AURA_OF_ANGER 41337
-#define SPELL_SELF_SEETHE 41364 // force cast 41520
-#define SPELL_ENEMY_SEETHE 41520
-#define SPELL_SOUL_SCREAM 41545
-#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec
-#define SPELL_SPITE_DAMAGE 41377
-
-#define ENSLAVED_SOUL_PASSIVE 41535
-#define SPELL_SOUL_RELEASE 41542
-
-#define CREATURE_ENSLAVED_SOUL 23469
-#define NUMBER_ENSLAVED_SOUL 8
-
-struct Position
-{
- float x,y;
-};
-
-static Position Coords[]=
-{
- {450.4, 212.3},
- {542.1, 212.3},
- {542.1, 168.3},
- {542.1, 137.4},
- {450.4, 137.4},
- {450.4, 168.3}
-};
-
-struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI
-{
- npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 ReliquaryGUID;
-
- void Reset() {ReliquaryGUID = 0;}
-
- void Aggro(Unit* who)
- {
- m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true);
- DoZoneInCombat();
- }
-
- void JustDied(Unit *killer);
-};
-
-struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
-{
- boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- EssenceGUID = 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 EssenceGUID;
-
- uint32 Phase;
- uint32 Counter;
- uint32 Timer;
-
- uint32 SoulCount;
- uint32 SoulDeathCount;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
-
- if(EssenceGUID)
- {
- if(Unit* Essence = Unit::GetUnit(*m_creature, EssenceGUID))
- {
- Essence->SetVisibility(VISIBILITY_OFF);
- Essence->setDeathState(DEAD);
- }
- EssenceGUID = 0;
- }
-
- Phase = 0;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
- }
-
- void Aggro(Unit* who)
- {
- m_creature->AddThreat(who, 10000.0f);
- DoZoneInCombat();
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
-
- Phase = 1;
- Counter = 0;
- Timer = 0;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
- }
-
- void AttackStart(Unit*) {}
-
- bool SummonSoul()
- {
- uint32 random = rand()%6;
- float x = Coords[random].x;
- float y = Coords[random].y;
- Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(!Soul) return false;
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- ((npc_enslaved_soulAI*)Soul->AI())->ReliquaryGUID = m_creature->GetGUID();
- Soul->AI()->AttackStart(target);
- }else EnterEvadeMode();
- return true;
- }
-
- void JustDied(Unit* killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
-
- InCombat = false;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!Phase)
- return;
-
- if(m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
- {
- EnterEvadeMode();
- return;
- }
-
- Creature* Essence;
- if(EssenceGUID)
- {
- Essence = (Creature*)Unit::GetUnit(*m_creature, EssenceGUID);
- if(!Essence)
- {
- EnterEvadeMode();
- return;
- }
- }
-
- if(Timer < diff)
- {
- switch(Counter)
- {
- case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,375); // I R ANNNGRRRY!
- Timer = 3000;
- break;
- case 1:
- Timer = 2800;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); // Release the cube
- 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,373); // Ribs: open
- Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
- EssenceGUID = Summon->GetGUID();
- }else EnterEvadeMode();
- break;
- case 3:
- Timer = 1000;
- if(Phase == 3)
- {
- if(!Essence->isAlive())
- m_creature->CastSpell(m_creature, 7, true);
- else return;
- }
- else
- {
- if(Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- {
- Essence->AI()->EnterEvadeMode();
- Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
- }else return;
- }
- break;
- case 4:
- Timer = 1500;
- if(Essence->IsWithinDistInMap(m_creature, 10))
- Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, 374); //rotate and disappear
- else
- return;
- break;
- case 5:
- if(Phase == 1)
- {
- Essence->Yell(SUFF_SAY_AFTER,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(Essence, SUFF_SOUND_AFTER);
- }
- else
- {
- Essence->Yell(DESI_SAY_AFTER,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(Essence, DESI_SOUND_AFTER);
- }
- Essence->SetVisibility(VISIBILITY_OFF);
- Essence->setDeathState(DEAD);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
- EssenceGUID = 0;
- SoulCount = 0;
- SoulDeathCount = 0;
- Timer = 3000;
- break;
- case 6:
- if(SoulCount < NUMBER_ENSLAVED_SOUL)
- {
- if(SummonSoul())
- SoulCount++;
- Timer = 500;
- return;
- }break;
- case 7:
- if(SoulDeathCount >= SoulCount)
- {
- Counter = 1;
- Phase++;
- Timer = 5000;
- }
- return;
- default:
- break;
- }
- Counter++;
- }else Timer -= diff;
- }
-};
-
-//This is used to sort the players by distance in preparation for the Fixate cast.
-struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
-{
- boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 StatAuraGUID;
-
- uint32 AggroYellTimer;
- uint32 FixateTimer;
- uint32 EnrageTimer;
- uint32 SoulDrainTimer;
- uint32 AuraTimer;
-
- void Reset()
- {
- StatAuraGUID = 0;
-
- AggroYellTimer = 5000;
- FixateTimer = 8000;
- EnrageTimer = 30000;
- SoulDrainTimer = 45000;
- AuraTimer = 5000;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth())
- {
- damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_RECAP);
- }
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(SUFF_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_FREED);
- DoZoneInCombat();
- m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support
- m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true);
- m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SUFF_SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY1);
- break;
- case 1:
- DoYell(SUFF_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY2);
- break;
- }
- }
-
- void CastFixate()
- {
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return; // No point continuing if empty threatlist.
- std::list<Unit*> targets;
- std::list<HostilReference*>::iterator itr = m_threatlist.begin();
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
- targets.push_back(pUnit);
- }
- if(targets.empty())
- return; // No targets added for some reason. No point continuing.
- targets.sort(TargetDistanceOrder(m_creature)); // Sort players by distance.
- targets.resize(1); // Only need closest target.
- Unit* target = targets.front(); // Get the first target.
- target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- //Supposed to be cast on nearest target
- if(FixateTimer < diff)
- {
- CastFixate();
- FixateTimer = 5000;
- if(!(rand()%16))
- {
- DoYell(SUFF_SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_AGGRO);
- }
- }else FixateTimer -= diff;
-
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- EnrageTimer = 60000;
- DoYell(SUFF_SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- if(SoulDrainTimer < diff)
- {
- DoCast(m_creature, SPELL_SOUL_DRAIN);
- SoulDrainTimer = 60000;
- }else SoulDrainTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
-{
- boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 RuneShieldTimer;
- uint32 DeadenTimer;
- uint32 SoulShockTimer;
-
- void Reset()
- {
- RuneShieldTimer = 60000;
- DeadenTimer = 30000;
- SoulShockTimer = 5000;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(done_by == m_creature)
- return;
-
- if(damage >= m_creature->GetHealth())
- {
- damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->Yell(DESI_SAY_RECAP,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(m_creature, DESI_SOUND_RECAP);
- }
- else
- {
- int32 bp0 = damage / 2;
- m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
- }
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL])
- for(uint8 i = 0; i < 3; ++i)
- if(spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
- if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
- || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN)
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(DESI_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, DESI_SOUND_FREED);
- DoZoneInCombat();
- DoCast(m_creature, AURA_OF_DESIRE, true);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(DESI_SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY1);
- break;
- case 1:
- DoYell(DESI_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY2);
- break;
- case 2:
- DoYell(DESI_SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY3);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(RuneShieldTimer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true);
- SoulShockTimer += 2000;
- DeadenTimer += 2000;
- RuneShieldTimer = 60000;
- }else RuneShieldTimer -= diff;
-
- if(SoulShockTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK);
- SoulShockTimer = 5000;
- }else SoulShockTimer -= diff;
-
- if(DeadenTimer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_DEADEN);
- DeadenTimer = 25000 + rand()%10000;
- if(!(rand()%2))
- {
- DoYell(DESI_SAY_SPEC,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SPEC);
- }
- }else DeadenTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
-{
- boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 AggroTargetGUID;
-
- uint32 CheckTankTimer;
- uint32 SoulScreamTimer;
- uint32 SpiteTimer;
-
- std::list<uint64> SpiteTargetGUID;
-
- bool CheckedAggro;
-
- void Reset()
- {
- AggroTargetGUID = 0;
-
- CheckTankTimer = 5000;
- SoulScreamTimer = 10000;
- SpiteTimer = 30000;
-
- SpiteTargetGUID.clear();
-
- CheckedAggro = false;
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(ANGER_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_FREED);
- DoZoneInCombat();
- DoCast(m_creature, AURA_OF_ANGER, true);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(ANGER_SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,ANGER_SOUND_DEATH);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY1);
- break;
- case 1:
- DoYell(ANGER_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY2);
- break;
- }
- }
-
- void SelectSpiteTarget(uint32 num, float max_range = 999)
- {
- if(!num) return;
-
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list<Unit *> tempUnitMap;
-
- {
- Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
- Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
-
- TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
- TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
- cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
- }
-
- std::list<Unit*>::iterator itr;
- while(tempUnitMap.size() && SpiteTargetGUID.size() < num)
- {
- itr = tempUnitMap.begin();
- advance(itr, rand()%tempUnitMap.size());
- SpiteTargetGUID.push_back((*itr)->GetGUID());
- tempUnitMap.erase(itr);
- }
-
- for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
- (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->CastSpell(m_creature, SPELL_SPITE_TARGET, true); // must true
- for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
- (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(!CheckedAggro)
- {
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
- CheckedAggro = true;
- }
-
- if(CheckTankTimer < diff)
- {
- if(m_creature->getVictim()->GetGUID() != AggroTargetGUID)
- {
- DoYell(ANGER_SAY_BEFORE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_BEFORE);
- DoCast(m_creature, SPELL_SELF_SEETHE, true);
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
- }
- CheckTankTimer = 2000;
- }else CheckTankTimer -= diff;
-
- if(SoulScreamTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM);
- SoulScreamTimer = 10000;
- if(!(rand()%3))
- {
- DoYell(ANGER_SAY_SCREAM,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SCREAM);
- }
- }else SoulScreamTimer -= diff;
-
- if(SpiteTimer < diff)
- {
- if(!SpiteTargetGUID.empty())
- {
- for (std::list<uint64>::iterator itr = SpiteTargetGUID.begin(); itr != SpiteTargetGUID.end(); ++itr)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, *itr))
- {
- target->RemoveAurasDueToSpell(SPELL_SPITE_TARGET);
- m_creature->CastSpell(target, SPELL_SPITE_DAMAGE, true);
- }
- }
- SpiteTargetGUID.clear();
- SpiteTimer = 24000;
- }
- else
- {
- SelectSpiteTarget(3);
- SpiteTimer = 6000;
- DoYell(ANGER_SAY_SPEC,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SPEC);
- }
- }else SpiteTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-void npc_enslaved_soulAI::JustDied(Unit *killer)
-{
- if(ReliquaryGUID)
- {
- Creature* Reliquary = ((Creature*)Unit::GetUnit((*m_creature), ReliquaryGUID));
- if(Reliquary)
- ((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++;
- }
- DoCast(m_creature, SPELL_SOUL_RELEASE, true);
-}
-
-CreatureAI* GetAI_boss_reliquary_of_souls(Creature *_Creature)
-{
- return new boss_reliquary_of_soulsAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_suffering(Creature *_Creature)
-{
- return new boss_essence_of_sufferingAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_desire(Creature *_Creature)
-{
- return new boss_essence_of_desireAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_anger(Creature *_Creature)
-{
- return new boss_essence_of_angerAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_enslaved_soul(Creature *_Creature)
-{
- return new npc_enslaved_soulAI (_Creature);
-}
-
-void AddSC_boss_reliquary_of_souls()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_reliquary_of_souls";
- newscript->GetAI = GetAI_boss_reliquary_of_souls;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_suffering";
- newscript->GetAI = GetAI_boss_essence_of_suffering;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_desire";
- newscript->GetAI = GetAI_boss_essence_of_desire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_anger";
- newscript->GetAI = GetAI_boss_essence_of_anger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_enslaved_soul";
- newscript->GetAI = GetAI_npc_enslaved_soul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Reliquary_of_Souls
+SD%Complete: 90
+SDComment:
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+#include "Spell.h"
+
+//Sound'n'speech
+//Suffering
+#define SUFF_SAY_FREED "Pain and suffering are all that await you!"
+#define SUFF_SOUND_FREED 11415
+#define SUFF_SAY_AGGRO "Don't leave me alone!"
+#define SUFF_SOUND_AGGRO 11416
+#define SUFF_SAY_SLAY1 "Look at what you make me do!"
+#define SUFF_SOUND_SLAY1 11417
+#define SUFF_SAY_SLAY2 "I didn't ask for this!"
+#define SUFF_SOUND_SLAY2 11418
+#define SUFF_SAY_ENRAGE "The pain is only beginning!"
+#define SUFF_SOUND_ENRAGE 11419
+#define SUFF_SAY_RECAP "I don't want to go back!"
+#define SUFF_SOUND_RECAP 11420
+#define SUFF_SAY_AFTER "Now what do I do?"
+#define SUFF_SOUND_AFTER 11421
+
+//Desire
+#define DESI_SAY_FREED "You can have anything you desire... for a price."
+#define DESI_SOUND_FREED 11408
+#define DESI_SAY_SLAY1 "Fulfilment is at hand!"
+#define DESI_SOUND_SLAY1 11409
+#define DESI_SAY_SLAY2 "Yes... you'll stay with us now..."
+#define DESI_SOUND_SLAY2 11410
+#define DESI_SAY_SLAY3 "Your reach exceeds your grasp."
+#define DESI_SOUND_SLAY3 11412
+#define DESI_SAY_SPEC "Be careful what you wish for..."
+#define DESI_SOUND_SPEC 11411
+#define DESI_SAY_RECAP "I'll be waiting..."
+#define DESI_SOUND_RECAP 11413
+#define DESI_SAY_AFTER "I won't be far..."
+#define DESI_SOUND_AFTER 11414
+
+//Anger
+#define ANGER_SAY_FREED "Beware... I live."
+#define ANGER_SOUND_FREED 11399
+#define ANGER_SAY_SCREAM "So... foolish."
+#define ANGER_SOUND_SCREAM 11400
+#define ANGER_SOUND_SLAY1 11401
+#define ANGER_SAY_SLAY2 "Enough. No more."
+#define ANGER_SOUND_SLAY2 11402
+#define ANGER_SAY_SPEC "On your knees!"
+#define ANGER_SOUND_SPEC 11403
+#define ANGER_SAY_BEFORE "Beware, coward."
+#define ANGER_SOUND_BEFORE 11405
+#define ANGER_SAY_DEATH "I won't... be... ignored."
+#define ANGER_SOUND_DEATH 11404
+
+//Spells
+#define AURA_OF_SUFFERING 41292
+#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support
+#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294
+#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
+#define SPELL_FIXATE_TARGET 41294 // dummy, select target
+#define SPELL_FIXATE_TAUNT 41295 // force taunt
+#define SPELL_ENRAGE 41305
+#define SPELL_SOUL_DRAIN 41303
+
+#define AURA_OF_DESIRE 41350
+#define AURA_OF_DESIRE_DAMAGE 41352
+#define SPELL_RUNE_SHIELD 41431
+#define SPELL_DEADEN 41410
+#define SPELL_SOUL_SHOCK 41426
+
+#define AURA_OF_ANGER 41337
+#define SPELL_SELF_SEETHE 41364 // force cast 41520
+#define SPELL_ENEMY_SEETHE 41520
+#define SPELL_SOUL_SCREAM 41545
+#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec
+#define SPELL_SPITE_DAMAGE 41377
+
+#define ENSLAVED_SOUL_PASSIVE 41535
+#define SPELL_SOUL_RELEASE 41542
+
+#define CREATURE_ENSLAVED_SOUL 23469
+#define NUMBER_ENSLAVED_SOUL 8
+
+struct Position
+{
+ float x,y;
+};
+
+static Position Coords[]=
+{
+ {450.4, 212.3},
+ {542.1, 212.3},
+ {542.1, 168.3},
+ {542.1, 137.4},
+ {450.4, 137.4},
+ {450.4, 168.3}
+};
+
+struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI
+{
+ npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 ReliquaryGUID;
+
+ void Reset() {ReliquaryGUID = 0;}
+
+ void Aggro(Unit* who)
+ {
+ m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true);
+ DoZoneInCombat();
+ }
+
+ void JustDied(Unit *killer);
+};
+
+struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
+{
+ boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ EssenceGUID = 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 EssenceGUID;
+
+ uint32 Phase;
+ uint32 Counter;
+ uint32 Timer;
+
+ uint32 SoulCount;
+ uint32 SoulDeathCount;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
+
+ if(EssenceGUID)
+ {
+ if(Unit* Essence = Unit::GetUnit(*m_creature, EssenceGUID))
+ {
+ Essence->SetVisibility(VISIBILITY_OFF);
+ Essence->setDeathState(DEAD);
+ }
+ EssenceGUID = 0;
+ }
+
+ Phase = 0;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
+ }
+
+ void Aggro(Unit* who)
+ {
+ m_creature->AddThreat(who, 10000.0f);
+ DoZoneInCombat();
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
+
+ Phase = 1;
+ Counter = 0;
+ Timer = 0;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+ }
+
+ void AttackStart(Unit*) {}
+
+ bool SummonSoul()
+ {
+ uint32 random = rand()%6;
+ float x = Coords[random].x;
+ float y = Coords[random].y;
+ Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(!Soul) return false;
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ ((npc_enslaved_soulAI*)Soul->AI())->ReliquaryGUID = m_creature->GetGUID();
+ Soul->AI()->AttackStart(target);
+ }else EnterEvadeMode();
+ return true;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
+
+ InCombat = false;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!Phase)
+ return;
+
+ if(m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ Creature* Essence;
+ if(EssenceGUID)
+ {
+ Essence = (Creature*)Unit::GetUnit(*m_creature, EssenceGUID);
+ if(!Essence)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ }
+
+ if(Timer < diff)
+ {
+ switch(Counter)
+ {
+ case 0:
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,375); // I R ANNNGRRRY!
+ Timer = 3000;
+ break;
+ case 1:
+ Timer = 2800;
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); // Release the cube
+ 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,373); // Ribs: open
+ Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
+ EssenceGUID = Summon->GetGUID();
+ }else EnterEvadeMode();
+ break;
+ case 3:
+ Timer = 1000;
+ if(Phase == 3)
+ {
+ if(!Essence->isAlive())
+ m_creature->CastSpell(m_creature, 7, true);
+ else return;
+ }
+ else
+ {
+ if(Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ {
+ Essence->AI()->EnterEvadeMode();
+ Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
+ }else return;
+ }
+ break;
+ case 4:
+ Timer = 1500;
+ if(Essence->IsWithinDistInMap(m_creature, 10))
+ Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, 374); //rotate and disappear
+ else
+ return;
+ break;
+ case 5:
+ if(Phase == 1)
+ {
+ Essence->Yell(SUFF_SAY_AFTER,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(Essence, SUFF_SOUND_AFTER);
+ }
+ else
+ {
+ Essence->Yell(DESI_SAY_AFTER,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(Essence, DESI_SOUND_AFTER);
+ }
+ Essence->SetVisibility(VISIBILITY_OFF);
+ Essence->setDeathState(DEAD);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
+ EssenceGUID = 0;
+ SoulCount = 0;
+ SoulDeathCount = 0;
+ Timer = 3000;
+ break;
+ case 6:
+ if(SoulCount < NUMBER_ENSLAVED_SOUL)
+ {
+ if(SummonSoul())
+ SoulCount++;
+ Timer = 500;
+ return;
+ }break;
+ case 7:
+ if(SoulDeathCount >= SoulCount)
+ {
+ Counter = 1;
+ Phase++;
+ Timer = 5000;
+ }
+ return;
+ default:
+ break;
+ }
+ Counter++;
+ }else Timer -= diff;
+ }
+};
+
+//This is used to sort the players by distance in preparation for the Fixate cast.
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
+{
+ boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 StatAuraGUID;
+
+ uint32 AggroYellTimer;
+ uint32 FixateTimer;
+ uint32 EnrageTimer;
+ uint32 SoulDrainTimer;
+ uint32 AuraTimer;
+
+ void Reset()
+ {
+ StatAuraGUID = 0;
+
+ AggroYellTimer = 5000;
+ FixateTimer = 8000;
+ EnrageTimer = 30000;
+ SoulDrainTimer = 45000;
+ AuraTimer = 5000;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth())
+ {
+ damage = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_RECAP);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(SUFF_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_FREED);
+ DoZoneInCombat();
+ m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support
+ m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true);
+ m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SUFF_SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SUFF_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void CastFixate()
+ {
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return; // No point continuing if empty threatlist.
+ std::list<Unit*> targets;
+ std::list<HostilReference*>::iterator itr = m_threatlist.begin();
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
+ targets.push_back(pUnit);
+ }
+ if(targets.empty())
+ return; // No targets added for some reason. No point continuing.
+ targets.sort(TargetDistanceOrder(m_creature)); // Sort players by distance.
+ targets.resize(1); // Only need closest target.
+ Unit* target = targets.front(); // Get the first target.
+ target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ //Supposed to be cast on nearest target
+ if(FixateTimer < diff)
+ {
+ CastFixate();
+ FixateTimer = 5000;
+ if(!(rand()%16))
+ {
+ DoYell(SUFF_SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_AGGRO);
+ }
+ }else FixateTimer -= diff;
+
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ EnrageTimer = 60000;
+ DoYell(SUFF_SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ if(SoulDrainTimer < diff)
+ {
+ DoCast(m_creature, SPELL_SOUL_DRAIN);
+ SoulDrainTimer = 60000;
+ }else SoulDrainTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
+{
+ boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 RuneShieldTimer;
+ uint32 DeadenTimer;
+ uint32 SoulShockTimer;
+
+ void Reset()
+ {
+ RuneShieldTimer = 60000;
+ DeadenTimer = 30000;
+ SoulShockTimer = 5000;
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by == m_creature)
+ return;
+
+ if(damage >= m_creature->GetHealth())
+ {
+ damage = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->Yell(DESI_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_RECAP);
+ }
+ else
+ {
+ int32 bp0 = damage / 2;
+ m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
+ }
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL])
+ for(uint8 i = 0; i < 3; ++i)
+ if(spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
+ if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
+ || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN)
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(DESI_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_FREED);
+ DoZoneInCombat();
+ DoCast(m_creature, AURA_OF_DESIRE, true);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(DESI_SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(DESI_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(DESI_SAY_SLAY3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(RuneShieldTimer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true);
+ SoulShockTimer += 2000;
+ DeadenTimer += 2000;
+ RuneShieldTimer = 60000;
+ }else RuneShieldTimer -= diff;
+
+ if(SoulShockTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK);
+ SoulShockTimer = 5000;
+ }else SoulShockTimer -= diff;
+
+ if(DeadenTimer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature->getVictim(), SPELL_DEADEN);
+ DeadenTimer = 25000 + rand()%10000;
+ if(!(rand()%2))
+ {
+ DoYell(DESI_SAY_SPEC,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SPEC);
+ }
+ }else DeadenTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
+{
+ boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 AggroTargetGUID;
+
+ uint32 CheckTankTimer;
+ uint32 SoulScreamTimer;
+ uint32 SpiteTimer;
+
+ std::list<uint64> SpiteTargetGUID;
+
+ bool CheckedAggro;
+
+ void Reset()
+ {
+ AggroTargetGUID = 0;
+
+ CheckTankTimer = 5000;
+ SoulScreamTimer = 10000;
+ SpiteTimer = 30000;
+
+ SpiteTargetGUID.clear();
+
+ CheckedAggro = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(ANGER_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_FREED);
+ DoZoneInCombat();
+ DoCast(m_creature, AURA_OF_ANGER, true);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(ANGER_SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,ANGER_SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(ANGER_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void SelectSpiteTarget(uint32 num, float max_range = 999)
+ {
+ if(!num) return;
+
+ CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list<Unit *> tempUnitMap;
+
+ {
+ Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
+ Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
+
+ TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+ TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
+ cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
+ }
+
+ std::list<Unit*>::iterator itr;
+ while(tempUnitMap.size() && SpiteTargetGUID.size() < num)
+ {
+ itr = tempUnitMap.begin();
+ advance(itr, rand()%tempUnitMap.size());
+ SpiteTargetGUID.push_back((*itr)->GetGUID());
+ tempUnitMap.erase(itr);
+ }
+
+ for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
+ (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->CastSpell(m_creature, SPELL_SPITE_TARGET, true); // must true
+ for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
+ (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(!CheckedAggro)
+ {
+ AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ CheckedAggro = true;
+ }
+
+ if(CheckTankTimer < diff)
+ {
+ if(m_creature->getVictim()->GetGUID() != AggroTargetGUID)
+ {
+ DoYell(ANGER_SAY_BEFORE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_BEFORE);
+ DoCast(m_creature, SPELL_SELF_SEETHE, true);
+ AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ }
+ CheckTankTimer = 2000;
+ }else CheckTankTimer -= diff;
+
+ if(SoulScreamTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM);
+ SoulScreamTimer = 10000;
+ if(!(rand()%3))
+ {
+ DoYell(ANGER_SAY_SCREAM,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SCREAM);
+ }
+ }else SoulScreamTimer -= diff;
+
+ if(SpiteTimer < diff)
+ {
+ if(!SpiteTargetGUID.empty())
+ {
+ for (std::list<uint64>::iterator itr = SpiteTargetGUID.begin(); itr != SpiteTargetGUID.end(); ++itr)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, *itr))
+ {
+ target->RemoveAurasDueToSpell(SPELL_SPITE_TARGET);
+ m_creature->CastSpell(target, SPELL_SPITE_DAMAGE, true);
+ }
+ }
+ SpiteTargetGUID.clear();
+ SpiteTimer = 24000;
+ }
+ else
+ {
+ SelectSpiteTarget(3);
+ SpiteTimer = 6000;
+ DoYell(ANGER_SAY_SPEC,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SPEC);
+ }
+ }else SpiteTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+void npc_enslaved_soulAI::JustDied(Unit *killer)
+{
+ if(ReliquaryGUID)
+ {
+ Creature* Reliquary = ((Creature*)Unit::GetUnit((*m_creature), ReliquaryGUID));
+ if(Reliquary)
+ ((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++;
+ }
+ DoCast(m_creature, SPELL_SOUL_RELEASE, true);
+}
+
+CreatureAI* GetAI_boss_reliquary_of_souls(Creature *_Creature)
+{
+ return new boss_reliquary_of_soulsAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_suffering(Creature *_Creature)
+{
+ return new boss_essence_of_sufferingAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_desire(Creature *_Creature)
+{
+ return new boss_essence_of_desireAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_anger(Creature *_Creature)
+{
+ return new boss_essence_of_angerAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_enslaved_soul(Creature *_Creature)
+{
+ return new npc_enslaved_soulAI (_Creature);
+}
+
+void AddSC_boss_reliquary_of_souls()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_reliquary_of_souls";
+ newscript->GetAI = GetAI_boss_reliquary_of_souls;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_suffering";
+ newscript->GetAI = GetAI_boss_essence_of_suffering;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_desire";
+ newscript->GetAI = GetAI_boss_essence_of_desire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_anger";
+ newscript->GetAI = GetAI_boss_essence_of_anger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_enslaved_soul";
+ newscript->GetAI = GetAI_npc_enslaved_soul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
index 599a8a1e09d..590f1f71216 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
@@ -1,812 +1,812 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shade_of_Akama
-SD%Complete: 99
-SDComment: Seems to be complete.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-struct Location
-{
- float x, y, o, z;
-};
-
-static Location ChannelerLocations[]=
-{
- {463.161285, 401.219757, 3.141592},
- {457.377625, 391.227661, 2.106461},
- {446.012421, 391.227661, 1.071904},
- {439.533783, 401.219757, 0.000000},
- {446.012421, 411.211853, 5.210546},
- {457.377625, 411.211853, 4.177494}
-};
-
-static Location SpawnLocations[]=
-{
- {498.652740, 461.728119, 0},
- {498.505003, 339.619324, 0}
-};
-
-static Location AkamaWP[]=
-{
- {482.352448, 401.162720, 0, 112.783928},
- {469.597443, 402.264404, 0, 118.537910}
-};
-
-static Location BrokenCoords[]=
-{
- {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels
- {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove
- {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove
- {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove
-};
-
-static Location BrokenWP[]=
-{
- {492.491638, 400.744690, 3.122336, 112.783737},
- {494.335724, 382.221771, 2.676230, 112.783737},
- {489.555939, 373.507202, 2.416263, 112.783737},
- {491.136353, 427.868774, 3.519748, 112.783737},
-};
-
-// Locations
-#define Z1 118.543144
-#define Z2 120.783768
-#define Z_SPAWN 113.537949
-#define AGGRO_X 482.793182
-#define AGGRO_Y 401.270172
-#define AGGRO_Z 112.783928
-#define AKAMA_X 514.583984
-#define AKAMA_Y 400.601013
-#define AKAMA_Z 112.783997
-
-// Texts
-#define SOUND_DEATH 11386
-#define SAY_DEATH "No! Not yet..."
-#define SOUND_LOW_HEALTH 11385
-#define SAY_LOW_HEALTH "I will not last much longer..."
-
-// Ending cinematic text
-#define SAY_FREE "Come out from the shadows! I've returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!"
-#define SAY_BROKEN_FREE_01 "Hail our leader! Hail Akama!"
-#define SAY_BROKEN_FREE_02 "Hail Akama!"
-
-// Gossips
-#define GOSSIP_ITEM "We are ready to fight alongside you, Akama"
-
-// Spells
-#define SPELL_VERTEX_SHADE_BLACK 39833
-#define SPELL_SHADE_SOUL_CHANNEL 40401
-#define SPELL_DESTRUCTIVE_POISON 40874
-#define SPELL_LIGHTNING_BOLT 42024
-#define SPELL_AKAMA_SOUL_CHANNEL 40447
-#define SPELL_AKAMA_SOUL_RETRIEVE 40902
-#define AKAMA_SOUL_EXPEL 40855
-#define SPELL_SHADE_SOUL_CHANNEL_2 40520
-
-// Channeler entry
-#define CREATURE_CHANNELER 23421
-#define CREATURE_SORCERER 23215
-#define CREATURE_DEFENDER 23216
-#define CREATURE_BROKEN 23319
-
-const uint32 spawnEntries[4]= { 23523, 23318, 23524 };
-
-struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI
-{
- mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint64 ShadeGUID;
-
- void Reset() { ShadeGUID = 0; }
- void JustDied(Unit* killer);
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-};
-
-struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
-{
- mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint64 ShadeGUID;
- uint32 CheckTimer;
- bool StartBanishing;
-
- void Reset()
- {
- StartBanishing = false;
- CheckTimer = 5000;
- ShadeGUID = 0;
- }
-
- void JustDied(Unit* killer);
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff)
- {
- if(StartBanishing)
- return;
-
- if(CheckTimer < diff)
- {
- Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
- if(Shade && Shade->isAlive() && m_creature->isAlive())
- {
- if(m_creature->GetDistance2d(Shade) < 20)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
-
- StartBanishing = true;
- }
- }
- CheckTimer = 2000;
- }else CheckTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
-{
- boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- std::list<uint64> Channelers;
- std::list<uint64> Sorcerers;
- uint64 AkamaGUID;
-
- uint32 SorcererCount;
- uint32 DeathCount;
-
- uint32 ReduceHealthTimer;
- uint32 SummonTimer;
- uint32 ResetTimer;
- uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon creature timer.
-
- bool IsBanished;
- bool HasKilledAkama;
-
- void Reset()
- {
- FindChannelers();
-
- if(!Channelers.empty())
- for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- {
- Creature* Channeler = NULL;
- Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
- if(Channeler)
- {
- if(Channeler->isDead())
- {
- Channeler->RemoveCorpse();
- Channeler->Respawn();
- }
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
- Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
-
- if(!Sorcerers.empty())
- for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
- if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- if(Sorcerer->isAlive())
- {
- Sorcerer->SetVisibility(VISIBILITY_OFF);
- Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- Sorcerers.clear();
-
- if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
- Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- SorcererCount = 0;
- DeathCount = 0;
-
- SummonTimer = 10000;
- ReduceHealthTimer = 0;
- ResetTimer = 60000;
- DefenderTimer = 15000;
-
- IsBanished = true;
- HasKilledAkama = false;
-
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
-
- if(pInstance && m_creature->isAlive())
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
- }
-
- void Aggro(Unit* who) { }
-
- void AttackStart(Unit* who)
- {
- if(!who || IsBanished) return;
-
- if(who->isTargetableForAttack() && who != m_creature)
- DoStartAttackAndMovement(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(IsBanished) return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
- {
- debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
- ++DeathCount;
- m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
- if(guid)
- {
- if(Sorcerers.empty())
- error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
- else Sorcerers.remove(guid);
- }
- }
-
- void SummonCreature()
- {
- uint32 random = rand()%2;
- float X = SpawnLocations[random].x;
- float Y = SpawnLocations[random].y;
- // max of 6 sorcerers can be summoned
- if((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7))
- {
- Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(Sorcerer)
- {
- ((mob_ashtongue_sorcererAI*)Sorcerer->AI())->ShadeGUID = m_creature->GetGUID();
- Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- Sorcerers.push_back(Sorcerer->GetGUID());
- --DeathCount;
- ++SorcererCount;
- }
- }
- else
- {
- for(uint8 i = 0; i < 3; ++i)
- {
- Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if(Spawn)
- {
- Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
- }
- }
- }
- }
-
- void FindChannelers()
- {
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list<Creature*> ChannelerList;
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(ChannelerList, check);
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
-
- if(!ChannelerList.empty())
- {
- Channelers.clear();
- for(std::list<Creature*>::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
- {
- ((mob_ashtongue_channelerAI*)(*itr)->AI())->ShadeGUID = m_creature->GetGUID();
- Channelers.push_back((*itr)->GetGUID());
- debug_log("SD2: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
- }
- }
- else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
- }
-
- void SetSelectableChannelers()
- {
- if(Channelers.empty())
- {
- error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
- return;
- }
-
- for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if(Creature* Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!InCombat)
- return;
-
- if(IsBanished)
- {
- // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
- if(m_creature->getThreatManager().getThreatList().size() < 2)
- EnterEvadeMode();
-
- if(DefenderTimer < diff)
- {
- uint32 ran = rand()%2;
- Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if(Defender)
- {
- Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- bool move = true;
- if(AkamaGUID)
- {
- if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
- {
- float x, y, z;
- Akama->GetPosition(x,y,z);
- // They move towards AKama
- Defender->GetMotionMaster()->MovePoint(0, x, y, z);
- }else move = false;
- }else move = false;
- if(!move)
- Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z);
- }
- DefenderTimer = 15000;
- }else DefenderTimer -= diff;
-
- if(SummonTimer < diff)
- {
- SummonCreature();
- SummonTimer = 35000;
- }else SummonTimer -= diff;
-
- if(DeathCount >= 6)
- {
- if(AkamaGUID)
- {
- Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
- if(Akama && Akama->isAlive())
- {
- IsBanished = false;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(Akama);
- Akama->GetMotionMaster()->Clear();
- // Shade should move to Akama, not the other way around
- Akama->GetMotionMaster()->MoveIdle();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Crazy amount of threat
- m_creature->AddThreat(Akama, 10000000.0f);
- Akama->AddThreat(m_creature, 10000000.0f);
- m_creature->Attack(Akama, true);
- Akama->Attack(m_creature, true);
- }
- }
- }
- }
- else // No longer banished, let's fight Akama now
- {
- if(ReduceHealthTimer < diff)
- {
- if(AkamaGUID)
- {
- Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
- if(Akama && Akama->isAlive())
- {
- //10 % less health every few seconds.
- m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- ReduceHealthTimer = 12000;
- }
- else
- {
- HasKilledAkama = true; // Akama is dead or missing, we stop fighting and disappear
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- }else ReduceHealthTimer -= diff;
-
- if(HasKilledAkama)
- {
- if(ResetTimer < diff)
- {
- InCombat = false;
- EnterEvadeMode(); // Reset a little while after killing Akama
- }
- else ResetTimer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-void mob_ashtongue_channelerAI::JustDied(Unit* killer)
-{
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount();
- else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
-}
-
-void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
-{
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
- else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
-}
-
-struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
-{
- npc_akamaAI(Creature* c) : ScriptedAI(c)
- {
- ShadeHasDied = false;
- StartCombat = false;
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 ShadeGUID;
-
- uint32 DestructivePoisonTimer;
- uint32 LightningBoltTimer;
- uint32 CheckTimer;
- uint32 CastSoulRetrieveTimer;
- uint32 SoulRetrieveTimer;
- uint32 SummonBrokenTimer;
- uint32 EndingTalkCount;
- uint32 WayPointId;
- uint32 BrokenSummonIndex;
-
- std::list<uint64> BrokenList;
-
- bool EventBegun;
- bool ShadeHasDied;
- bool StartCombat;
- bool HasYelledOnce;
-
- void Reset()
- {
- DestructivePoisonTimer = 15000;
- LightningBoltTimer = 10000;
- CheckTimer = 2000;
- CastSoulRetrieveTimer = 0;
- SoulRetrieveTimer = 0;
- SummonBrokenTimer = 0;
- EndingTalkCount = 0;
- WayPointId = 0;
- BrokenSummonIndex = 0;
-
- BrokenList.clear();
-
- EventBegun = false;
- HasYelledOnce = false;
-
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- void Aggro(Unit* who) {}
-
- void BeginEvent(Player* pl)
- {
- if(!pInstance)
- return;
-
- ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
- if(!ShadeGUID)
- return;
-
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade)
- {
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
- // Prevent players from trying to restart event
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- ((boss_shade_of_akamaAI*)Shade->AI())->SetAkamaGUID(m_creature->GetGUID());
- ((boss_shade_of_akamaAI*)Shade->AI())->SetSelectableChannelers();
- ((boss_shade_of_akamaAI*)Shade->AI())->InCombat = true;
- Shade->AddThreat(m_creature, 1000000.0f);
- Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- if(pl) Shade->AddThreat(pl, 1.0f);
- DoZoneInCombat(Shade);
- EventBegun = true;
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- switch(id)
- {
- case 0: ++WayPointId; break;
-
- case 1:
- if(Unit* Shade = Unit::GetUnit(*m_creature, ShadeGUID))
- {
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
- DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
- EndingTalkCount = 0;
- SoulRetrieveTimer = 16000;
- }
- break;
- }
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventBegun)
- return;
-
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce)
- {
- DoYell(SAY_LOW_HEALTH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LOW_HEALTH);
- HasYelledOnce = true;
- }
-
- if(ShadeGUID && !StartCombat)
- {
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- {
- if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished)
- {
- if(CastSoulRetrieveTimer < diff)
- {
- DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
- CastSoulRetrieveTimer = 500;
- }else CastSoulRetrieveTimer -= diff;
- }
- else
- {
- m_creature->InterruptNonMeleeSpells(false);
- StartCombat = true;
- }
- }
- }
-
- if(ShadeHasDied && (WayPointId == 1))
- {
- if(pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
- ++WayPointId;
- }
-
- if(!ShadeHasDied && StartCombat)
- {
- if(CheckTimer < diff)
- {
- if(ShadeGUID)
- {
- Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
- if(Shade && !Shade->isAlive())
- {
- ShadeHasDied = true;
- WayPointId = 0;
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
- }
- }
- CheckTimer = 5000;
- }else CheckTimer -= diff;
- }
-
- if(SummonBrokenTimer && BrokenSummonIndex < 4)
- if(SummonBrokenTimer <= diff)
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- float x = BrokenCoords[BrokenSummonIndex].x + (i*5);
- float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
- float z = BrokenCoords[BrokenSummonIndex].z;
- float o = BrokenCoords[BrokenSummonIndex].o;
- Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
- if(Broken)
- {
- float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
- float wy = BrokenWP[BrokenSummonIndex].y + (i*5);
- float wz = BrokenWP[BrokenSummonIndex].z;
- Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz);
- Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- BrokenList.push_back(Broken->GetGUID());
- }
- }
- ++BrokenSummonIndex;
- SummonBrokenTimer = 1000;
- }else SummonBrokenTimer -= diff;
-
- if(SoulRetrieveTimer)
- if(SoulRetrieveTimer <= diff)
- {
- switch(EndingTalkCount)
- {
- case 0:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- ++EndingTalkCount;
- SoulRetrieveTimer = 2000;
- SummonBrokenTimer = 1;
- case 1:
- DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
- ++EndingTalkCount;
- SoulRetrieveTimer = 25000;
- break;
- case 2:
- if(!BrokenList.empty())
- {
- bool Yelled = false;
- for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- {
- if(!Yelled)
- {
- pUnit->MonsterYell(SAY_BROKEN_FREE_01, LANG_UNIVERSAL, 0);
- Yelled = true;
- }
- pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
- }
- }
- ++EndingTalkCount;
- SoulRetrieveTimer = 1500;
- break;
- case 3:
- if(!BrokenList.empty())
- for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- // This is the incorrect spell, but can't seem to find the right one.
- pUnit->CastSpell(pUnit, 39656, true);
- ++EndingTalkCount;
- SoulRetrieveTimer = 5000;
- case 4:
- if(!BrokenList.empty())
- for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit((*m_creature), *itr))
- pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
- SoulRetrieveTimer = 0;
- break;
- }
- }else SoulRetrieveTimer -= diff;
-
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(DestructivePoisonTimer < diff)
- {
- // SPELL_DESTRUCTIVE_POISON is self-cast only for some reason so we make our target cast it on itself
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_DESTRUCTIVE_POISON, true);
- DestructivePoisonTimer = 15000;
- }else DestructivePoisonTimer -= diff;
-
- if(LightningBoltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
- LightningBoltTimer = 10000;
- }else LightningBoltTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_shade_of_akama(Creature *_Creature)
-{
- return new boss_shade_of_akamaAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_ashtongue_channeler(Creature *_Creature)
-{
- return new mob_ashtongue_channelerAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature *_Creature)
-{
- return new mob_ashtongue_sorcererAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_akama_shade(Creature *_Creature)
-{
- return new npc_akamaAI (_Creature);
-}
-
-bool GossipSelect_npc_akama(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_akamaAI*)_Creature->AI())->BeginEvent(player);
- }
-
- return true;
-}
-
-bool GossipHello_npc_akama(Player *player, Creature *_Creature)
-{
- if(player->isAlive())
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
- }
-
- return true;
-}
-
-void AddSC_boss_shade_of_akama()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_shade_of_akama";
- newscript->GetAI = GetAI_boss_shade_of_akama;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ashtongue_channeler";
- newscript->GetAI = GetAI_mob_ashtongue_channeler;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ashtongue_sorcerer";
- newscript->GetAI = GetAI_mob_ashtongue_sorcerer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_akama_shade";
- newscript->GetAI = GetAI_npc_akama_shade;
- newscript->pGossipHello = &GossipHello_npc_akama;
- newscript->pGossipSelect = &GossipSelect_npc_akama;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shade_of_Akama
+SD%Complete: 99
+SDComment: Seems to be complete.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+struct Location
+{
+ float x, y, o, z;
+};
+
+static Location ChannelerLocations[]=
+{
+ {463.161285, 401.219757, 3.141592},
+ {457.377625, 391.227661, 2.106461},
+ {446.012421, 391.227661, 1.071904},
+ {439.533783, 401.219757, 0.000000},
+ {446.012421, 411.211853, 5.210546},
+ {457.377625, 411.211853, 4.177494}
+};
+
+static Location SpawnLocations[]=
+{
+ {498.652740, 461.728119, 0},
+ {498.505003, 339.619324, 0}
+};
+
+static Location AkamaWP[]=
+{
+ {482.352448, 401.162720, 0, 112.783928},
+ {469.597443, 402.264404, 0, 118.537910}
+};
+
+static Location BrokenCoords[]=
+{
+ {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels
+ {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove
+ {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove
+ {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove
+};
+
+static Location BrokenWP[]=
+{
+ {492.491638, 400.744690, 3.122336, 112.783737},
+ {494.335724, 382.221771, 2.676230, 112.783737},
+ {489.555939, 373.507202, 2.416263, 112.783737},
+ {491.136353, 427.868774, 3.519748, 112.783737},
+};
+
+// Locations
+#define Z1 118.543144
+#define Z2 120.783768
+#define Z_SPAWN 113.537949
+#define AGGRO_X 482.793182
+#define AGGRO_Y 401.270172
+#define AGGRO_Z 112.783928
+#define AKAMA_X 514.583984
+#define AKAMA_Y 400.601013
+#define AKAMA_Z 112.783997
+
+// Texts
+#define SOUND_DEATH 11386
+#define SAY_DEATH "No! Not yet..."
+#define SOUND_LOW_HEALTH 11385
+#define SAY_LOW_HEALTH "I will not last much longer..."
+
+// Ending cinematic text
+#define SAY_FREE "Come out from the shadows! I've returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!"
+#define SAY_BROKEN_FREE_01 "Hail our leader! Hail Akama!"
+#define SAY_BROKEN_FREE_02 "Hail Akama!"
+
+// Gossips
+#define GOSSIP_ITEM "We are ready to fight alongside you, Akama"
+
+// Spells
+#define SPELL_VERTEX_SHADE_BLACK 39833
+#define SPELL_SHADE_SOUL_CHANNEL 40401
+#define SPELL_DESTRUCTIVE_POISON 40874
+#define SPELL_LIGHTNING_BOLT 42024
+#define SPELL_AKAMA_SOUL_CHANNEL 40447
+#define SPELL_AKAMA_SOUL_RETRIEVE 40902
+#define AKAMA_SOUL_EXPEL 40855
+#define SPELL_SHADE_SOUL_CHANNEL_2 40520
+
+// Channeler entry
+#define CREATURE_CHANNELER 23421
+#define CREATURE_SORCERER 23215
+#define CREATURE_DEFENDER 23216
+#define CREATURE_BROKEN 23319
+
+const uint32 spawnEntries[4]= { 23523, 23318, 23524 };
+
+struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI
+{
+ mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint64 ShadeGUID;
+
+ void Reset() { ShadeGUID = 0; }
+ void JustDied(Unit* killer);
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+};
+
+struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
+{
+ mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint64 ShadeGUID;
+ uint32 CheckTimer;
+ bool StartBanishing;
+
+ void Reset()
+ {
+ StartBanishing = false;
+ CheckTimer = 5000;
+ ShadeGUID = 0;
+ }
+
+ void JustDied(Unit* killer);
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if(StartBanishing)
+ return;
+
+ if(CheckTimer < diff)
+ {
+ Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
+ if(Shade && Shade->isAlive() && m_creature->isAlive())
+ {
+ if(m_creature->GetDistance2d(Shade) < 20)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
+
+ StartBanishing = true;
+ }
+ }
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
+{
+ boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::list<uint64> Channelers;
+ std::list<uint64> Sorcerers;
+ uint64 AkamaGUID;
+
+ uint32 SorcererCount;
+ uint32 DeathCount;
+
+ uint32 ReduceHealthTimer;
+ uint32 SummonTimer;
+ uint32 ResetTimer;
+ uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon creature timer.
+
+ bool IsBanished;
+ bool HasKilledAkama;
+
+ void Reset()
+ {
+ FindChannelers();
+
+ if(!Channelers.empty())
+ for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ {
+ Creature* Channeler = NULL;
+ Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
+ if(Channeler)
+ {
+ if(Channeler->isDead())
+ {
+ Channeler->RemoveCorpse();
+ Channeler->Respawn();
+ }
+ Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
+ Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
+ Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
+
+ if(!Sorcerers.empty())
+ for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
+ if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ if(Sorcerer->isAlive())
+ {
+ Sorcerer->SetVisibility(VISIBILITY_OFF);
+ Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ Sorcerers.clear();
+
+ if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
+ Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ SorcererCount = 0;
+ DeathCount = 0;
+
+ SummonTimer = 10000;
+ ReduceHealthTimer = 0;
+ ResetTimer = 60000;
+ DefenderTimer = 15000;
+
+ IsBanished = true;
+ HasKilledAkama = false;
+
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+
+ if(pInstance && m_creature->isAlive())
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit* who) { }
+
+ void AttackStart(Unit* who)
+ {
+ if(!who || IsBanished) return;
+
+ if(who->isTargetableForAttack() && who != m_creature)
+ DoStartAttackAndMovement(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(IsBanished) return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
+ {
+ debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
+ ++DeathCount;
+ m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
+ if(guid)
+ {
+ if(Sorcerers.empty())
+ error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
+ else Sorcerers.remove(guid);
+ }
+ }
+
+ void SummonCreature()
+ {
+ uint32 random = rand()%2;
+ float X = SpawnLocations[random].x;
+ float Y = SpawnLocations[random].y;
+ // max of 6 sorcerers can be summoned
+ if((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7))
+ {
+ Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ if(Sorcerer)
+ {
+ ((mob_ashtongue_sorcererAI*)Sorcerer->AI())->ShadeGUID = m_creature->GetGUID();
+ Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ Sorcerers.push_back(Sorcerer->GetGUID());
+ --DeathCount;
+ ++SorcererCount;
+ }
+ }
+ else
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if(Spawn)
+ {
+ Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
+ }
+ }
+ }
+ }
+
+ void FindChannelers()
+ {
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list<Creature*> ChannelerList;
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(ChannelerList, check);
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
+
+ if(!ChannelerList.empty())
+ {
+ Channelers.clear();
+ for(std::list<Creature*>::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
+ {
+ ((mob_ashtongue_channelerAI*)(*itr)->AI())->ShadeGUID = m_creature->GetGUID();
+ Channelers.push_back((*itr)->GetGUID());
+ debug_log("SD2: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
+ }
+ }
+ else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
+ }
+
+ void SetSelectableChannelers()
+ {
+ if(Channelers.empty())
+ {
+ error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
+ return;
+ }
+
+ for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ if(Creature* Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!InCombat)
+ return;
+
+ if(IsBanished)
+ {
+ // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
+ if(m_creature->getThreatManager().getThreatList().size() < 2)
+ EnterEvadeMode();
+
+ if(DefenderTimer < diff)
+ {
+ uint32 ran = rand()%2;
+ Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if(Defender)
+ {
+ Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ bool move = true;
+ if(AkamaGUID)
+ {
+ if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
+ {
+ float x, y, z;
+ Akama->GetPosition(x,y,z);
+ // They move towards AKama
+ Defender->GetMotionMaster()->MovePoint(0, x, y, z);
+ }else move = false;
+ }else move = false;
+ if(!move)
+ Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z);
+ }
+ DefenderTimer = 15000;
+ }else DefenderTimer -= diff;
+
+ if(SummonTimer < diff)
+ {
+ SummonCreature();
+ SummonTimer = 35000;
+ }else SummonTimer -= diff;
+
+ if(DeathCount >= 6)
+ {
+ if(AkamaGUID)
+ {
+ Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
+ if(Akama && Akama->isAlive())
+ {
+ IsBanished = false;
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(Akama);
+ Akama->GetMotionMaster()->Clear();
+ // Shade should move to Akama, not the other way around
+ Akama->GetMotionMaster()->MoveIdle();
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Crazy amount of threat
+ m_creature->AddThreat(Akama, 10000000.0f);
+ Akama->AddThreat(m_creature, 10000000.0f);
+ m_creature->Attack(Akama, true);
+ Akama->Attack(m_creature, true);
+ }
+ }
+ }
+ }
+ else // No longer banished, let's fight Akama now
+ {
+ if(ReduceHealthTimer < diff)
+ {
+ if(AkamaGUID)
+ {
+ Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
+ if(Akama && Akama->isAlive())
+ {
+ //10 % less health every few seconds.
+ m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ ReduceHealthTimer = 12000;
+ }
+ else
+ {
+ HasKilledAkama = true; // Akama is dead or missing, we stop fighting and disappear
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ }else ReduceHealthTimer -= diff;
+
+ if(HasKilledAkama)
+ {
+ if(ResetTimer < diff)
+ {
+ InCombat = false;
+ EnterEvadeMode(); // Reset a little while after killing Akama
+ }
+ else ResetTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+void mob_ashtongue_channelerAI::JustDied(Unit* killer)
+{
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount();
+ else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
+}
+
+void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
+{
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
+ else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
+}
+
+struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
+{
+ npc_akamaAI(Creature* c) : ScriptedAI(c)
+ {
+ ShadeHasDied = false;
+ StartCombat = false;
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 ShadeGUID;
+
+ uint32 DestructivePoisonTimer;
+ uint32 LightningBoltTimer;
+ uint32 CheckTimer;
+ uint32 CastSoulRetrieveTimer;
+ uint32 SoulRetrieveTimer;
+ uint32 SummonBrokenTimer;
+ uint32 EndingTalkCount;
+ uint32 WayPointId;
+ uint32 BrokenSummonIndex;
+
+ std::list<uint64> BrokenList;
+
+ bool EventBegun;
+ bool ShadeHasDied;
+ bool StartCombat;
+ bool HasYelledOnce;
+
+ void Reset()
+ {
+ DestructivePoisonTimer = 15000;
+ LightningBoltTimer = 10000;
+ CheckTimer = 2000;
+ CastSoulRetrieveTimer = 0;
+ SoulRetrieveTimer = 0;
+ SummonBrokenTimer = 0;
+ EndingTalkCount = 0;
+ WayPointId = 0;
+ BrokenSummonIndex = 0;
+
+ BrokenList.clear();
+
+ EventBegun = false;
+ HasYelledOnce = false;
+
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void BeginEvent(Player* pl)
+ {
+ if(!pInstance)
+ return;
+
+ ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
+ if(!ShadeGUID)
+ return;
+
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade)
+ {
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
+ // Prevent players from trying to restart event
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ ((boss_shade_of_akamaAI*)Shade->AI())->SetAkamaGUID(m_creature->GetGUID());
+ ((boss_shade_of_akamaAI*)Shade->AI())->SetSelectableChannelers();
+ ((boss_shade_of_akamaAI*)Shade->AI())->InCombat = true;
+ Shade->AddThreat(m_creature, 1000000.0f);
+ Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ if(pl) Shade->AddThreat(pl, 1.0f);
+ DoZoneInCombat(Shade);
+ EventBegun = true;
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ switch(id)
+ {
+ case 0: ++WayPointId; break;
+
+ case 1:
+ if(Unit* Shade = Unit::GetUnit(*m_creature, ShadeGUID))
+ {
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
+ DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
+ EndingTalkCount = 0;
+ SoulRetrieveTimer = 16000;
+ }
+ break;
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventBegun)
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce)
+ {
+ DoYell(SAY_LOW_HEALTH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LOW_HEALTH);
+ HasYelledOnce = true;
+ }
+
+ if(ShadeGUID && !StartCombat)
+ {
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ {
+ if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished)
+ {
+ if(CastSoulRetrieveTimer < diff)
+ {
+ DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
+ CastSoulRetrieveTimer = 500;
+ }else CastSoulRetrieveTimer -= diff;
+ }
+ else
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ StartCombat = true;
+ }
+ }
+ }
+
+ if(ShadeHasDied && (WayPointId == 1))
+ {
+ if(pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
+ m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
+ ++WayPointId;
+ }
+
+ if(!ShadeHasDied && StartCombat)
+ {
+ if(CheckTimer < diff)
+ {
+ if(ShadeGUID)
+ {
+ Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
+ if(Shade && !Shade->isAlive())
+ {
+ ShadeHasDied = true;
+ WayPointId = 0;
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
+ }
+ }
+ CheckTimer = 5000;
+ }else CheckTimer -= diff;
+ }
+
+ if(SummonBrokenTimer && BrokenSummonIndex < 4)
+ if(SummonBrokenTimer <= diff)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ float x = BrokenCoords[BrokenSummonIndex].x + (i*5);
+ float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
+ float z = BrokenCoords[BrokenSummonIndex].z;
+ float o = BrokenCoords[BrokenSummonIndex].o;
+ Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
+ if(Broken)
+ {
+ float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
+ float wy = BrokenWP[BrokenSummonIndex].y + (i*5);
+ float wz = BrokenWP[BrokenSummonIndex].z;
+ Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz);
+ Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ BrokenList.push_back(Broken->GetGUID());
+ }
+ }
+ ++BrokenSummonIndex;
+ SummonBrokenTimer = 1000;
+ }else SummonBrokenTimer -= diff;
+
+ if(SoulRetrieveTimer)
+ if(SoulRetrieveTimer <= diff)
+ {
+ switch(EndingTalkCount)
+ {
+ case 0:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 2000;
+ SummonBrokenTimer = 1;
+ case 1:
+ DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 25000;
+ break;
+ case 2:
+ if(!BrokenList.empty())
+ {
+ bool Yelled = false;
+ for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
+ {
+ if(!Yelled)
+ {
+ pUnit->MonsterYell(SAY_BROKEN_FREE_01, LANG_UNIVERSAL, 0);
+ Yelled = true;
+ }
+ pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
+ }
+ }
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 1500;
+ break;
+ case 3:
+ if(!BrokenList.empty())
+ for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
+ // This is the incorrect spell, but can't seem to find the right one.
+ pUnit->CastSpell(pUnit, 39656, true);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 5000;
+ case 4:
+ if(!BrokenList.empty())
+ for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit((*m_creature), *itr))
+ pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
+ SoulRetrieveTimer = 0;
+ break;
+ }
+ }else SoulRetrieveTimer -= diff;
+
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(DestructivePoisonTimer < diff)
+ {
+ // SPELL_DESTRUCTIVE_POISON is self-cast only for some reason so we make our target cast it on itself
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_DESTRUCTIVE_POISON, true);
+ DestructivePoisonTimer = 15000;
+ }else DestructivePoisonTimer -= diff;
+
+ if(LightningBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ LightningBoltTimer = 10000;
+ }else LightningBoltTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_shade_of_akama(Creature *_Creature)
+{
+ return new boss_shade_of_akamaAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_ashtongue_channeler(Creature *_Creature)
+{
+ return new mob_ashtongue_channelerAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature *_Creature)
+{
+ return new mob_ashtongue_sorcererAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_akama_shade(Creature *_Creature)
+{
+ return new npc_akamaAI (_Creature);
+}
+
+bool GossipSelect_npc_akama(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_akamaAI*)_Creature->AI())->BeginEvent(player);
+ }
+
+ return true;
+}
+
+bool GossipHello_npc_akama(Player *player, Creature *_Creature)
+{
+ if(player->isAlive())
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+ }
+
+ return true;
+}
+
+void AddSC_boss_shade_of_akama()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shade_of_akama";
+ newscript->GetAI = GetAI_boss_shade_of_akama;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ashtongue_channeler";
+ newscript->GetAI = GetAI_mob_ashtongue_channeler;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ashtongue_sorcerer";
+ newscript->GetAI = GetAI_mob_ashtongue_sorcerer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_akama_shade";
+ newscript->GetAI = GetAI_npc_akama_shade;
+ newscript->pGossipHello = &GossipHello_npc_akama;
+ newscript->pGossipSelect = &GossipSelect_npc_akama;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
index b3555c12816..243e4fed886 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
@@ -1,395 +1,395 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/ >
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Supremus
-SD%Complete: 95
-SDComment: Need to implement doors.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_HURTFUL_STRIKE 41926
-#define SPELL_DEMON_FIRE 40029
-#define SPELL_MOLTEN_FLAME 40253
-#define SPELL_VOLCANIC_ERUPTION 40276
-#define SPELL_VOLCANIC_FIREBALL 40118
-#define SPELL_VOLCANIC_GEYSER 42055
-#define SPELL_MOLTEN_PUNCH 40126
-#define SPELL_BERSERK 45078
-
-#define CREATURE_VOLCANO 23085
-#define CREATURE_STALKER 23095
-
-struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
-{
- molten_flameAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 SupremusGUID;
- bool TargetLocked;
- uint32 CheckTimer;
-
- void Reset()
- {
- SupremusGUID = 0;
- TargetLocked = false;
-
- CheckTimer = 1000;
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit *who)
- {
- if(TargetLocked)
- return; // stop it from aggroing players who move in LOS if we have a target.
- if(who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10)))
- StalkTarget(who);
- }
-
- void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; }
-
- void StalkTarget(Unit* target)
- {
- if(!target) return;
-
- m_creature->AddThreat(target, 50000000.0f);
- m_creature->GetMotionMaster()->MoveChase(target);
- DoCast(m_creature, SPELL_DEMON_FIRE, true);
- // DoCast(m_creature, SPELL_MOLTEN_FLAME, true); // This spell damages self, so disabled for now
- TargetLocked = true;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if(m_creature->getVictim() && m_creature->isAlive())
- {
- if(CheckTimer < diff)
- {
- if(SupremusGUID)
- {
- Unit* Supremus = NULL;
- Supremus = Unit::GetUnit((*m_creature), SupremusGUID);
- if(Supremus && (!Supremus->isAlive()))
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- CheckTimer = 2000;
- }else CheckTimer -= diff;
- }
- }
-};
-
-struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
-{
- npc_volcanoAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CheckTimer;
- uint64 SupremusGUID;
- uint32 FireballTimer;
- uint32 GeyserTimer;
-
- void Reset()
- {
- CheckTimer = 1000;
- SupremusGUID = 0;
- FireballTimer = 500;
- GeyserTimer = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(GeyserTimer < diff)
- {
- DoCast(m_creature, SPELL_VOLCANIC_GEYSER);
- GeyserTimer = 18000;
- }else GeyserTimer -= diff;
-
- if(FireballTimer < diff)
- {
- DoCast(m_creature, SPELL_VOLCANIC_FIREBALL, true);
- FireballTimer = 1000;
- }else FireballTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
-{
- boss_supremusAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 SummonFlameTimer;
- uint32 SwitchTargetTimer;
- uint32 PhaseSwitchTimer;
- uint32 SummonVolcanoTimer;
- uint32 HurtfulStrikeTimer;
- uint32 BerserkTimer;
-
- bool Phase1;
-
- void Reset()
- {
- if(pInstance)
- {
- if(m_creature->isAlive())
- {
- pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
- ToggleDoors(true);
- }
- else ToggleDoors(false);
- }
-
- HurtfulStrikeTimer = 5000;
- SummonFlameTimer = 20000;
- SwitchTargetTimer = 90000;
- PhaseSwitchTimer = 60000;
- SummonVolcanoTimer = 5000;
- BerserkTimer = 900000; // 15 minute enrage
-
- Phase1 = true;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
-
- if(pInstance)
- pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
- }
-
- void ToggleDoors(bool close)
- {
- if(GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS)))
- {
- if(close) Doors->SetGoState(1); // Closed
- else Doors->SetGoState(0); // Open
- }
- }
-
- void JustDied(Unit *killer)
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
- ToggleDoors(false);
- }
- }
-
- float CalculateRandomCoord(float initial)
- {
- float coord = 0;
-
- switch(rand()%2)
- {
- case 0: coord = initial + 20 + rand()%20; break;
- case 1: coord = initial - 20 - rand()%20; break;
- }
-
- return coord;
- }
-
- Creature* SummonCreature(uint32 entry, Unit* target)
- {
- if(target && entry)
- {
- Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
- if(Summon)
- {
- Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Summon->setFaction(m_creature->getFaction());
- return Summon;
- }
- }
- return NULL;
- }
-
- Unit* CalculateHurtfulStrikeTarget()
- {
- uint32 health = 0;
- Unit* target = NULL;
-
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list<HostilReference*>::iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
- {
- if(pUnit->GetHealth() > health)
- {
- health = pUnit->GetHealth();
- target = pUnit;
- }
- }
- }
-
- return target;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(BerserkTimer < diff)
- DoCast(m_creature, SPELL_BERSERK);
- else BerserkTimer -= diff;
-
- if(SummonFlameTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target) // someone is trying to solo, set target as current victim.
- target = m_creature->getVictim();
-
- if(target)
- {
- Creature* MoltenFlame = SummonCreature(CREATURE_STALKER, target);
- if(MoltenFlame)
- {
- // Invisible model
- MoltenFlame->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- ((molten_flameAI*)MoltenFlame->AI())->SetSupremusGUID(m_creature->GetGUID());
- ((molten_flameAI*)MoltenFlame->AI())->StalkTarget(target);
- SummonFlameTimer = 20000;
- }
- }
- }else SummonFlameTimer -= diff;
-
- if(Phase1)
- {
- if(HurtfulStrikeTimer < diff)
- {
- Unit* target = CalculateHurtfulStrikeTarget();
- if(target)
- {
- DoCast(target, SPELL_HURTFUL_STRIKE);
- HurtfulStrikeTimer = 5000;
- }
- }else HurtfulStrikeTimer -= diff;
- }
-
- if(!Phase1)
- {
- if(SwitchTargetTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoResetThreat();
- m_creature->AddThreat(target, 5000000.0f);
- DoTextEmote("acquires a new target!", NULL);
- SwitchTargetTimer = 10000;
- }
-
- }else SwitchTargetTimer -= diff;
-
- if(SummonVolcanoTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- {
- DoCast(target, SPELL_VOLCANIC_ERUPTION);
- DoTextEmote("roars and the ground begins to crack open!", NULL);
- SummonVolcanoTimer = 10000;
- }
- }else SummonVolcanoTimer -= diff;
- }
-
- if(PhaseSwitchTimer < diff)
- {
- if(!Phase1)
- {
- Phase1 = true;
- DoResetThreat();
- PhaseSwitchTimer = 60000;
- m_creature->SetSpeed(MOVE_RUN, 1.0f);
- DoZoneInCombat();
- }
- else
- {
- Phase1 = false;
- DoResetThreat();
- SwitchTargetTimer = 10000;
- SummonVolcanoTimer = 2000;
- PhaseSwitchTimer = 60000;
- m_creature->SetSpeed(MOVE_RUN, 0.9f);
- DoZoneInCombat();
- }
- }else PhaseSwitchTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_supremus(Creature *_Creature)
-{
- return new boss_supremusAI (_Creature);
-}
-
-CreatureAI* GetAI_molten_flame(Creature *_Creature)
-{
- return new molten_flameAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_volcano(Creature *_Creature)
-{
- return new npc_volcanoAI (_Creature);
-}
-
-void AddSC_boss_supremus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_supremus";
- newscript->GetAI = GetAI_boss_supremus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="molten_flame";
- newscript->GetAI = GetAI_molten_flame;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_volcano";
- newscript->GetAI = GetAI_npc_volcano;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/ >
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Supremus
+SD%Complete: 95
+SDComment: Need to implement doors.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_HURTFUL_STRIKE 41926
+#define SPELL_DEMON_FIRE 40029
+#define SPELL_MOLTEN_FLAME 40253
+#define SPELL_VOLCANIC_ERUPTION 40276
+#define SPELL_VOLCANIC_FIREBALL 40118
+#define SPELL_VOLCANIC_GEYSER 42055
+#define SPELL_MOLTEN_PUNCH 40126
+#define SPELL_BERSERK 45078
+
+#define CREATURE_VOLCANO 23085
+#define CREATURE_STALKER 23095
+
+struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
+{
+ molten_flameAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 SupremusGUID;
+ bool TargetLocked;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ SupremusGUID = 0;
+ TargetLocked = false;
+
+ CheckTimer = 1000;
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(TargetLocked)
+ return; // stop it from aggroing players who move in LOS if we have a target.
+ if(who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10)))
+ StalkTarget(who);
+ }
+
+ void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; }
+
+ void StalkTarget(Unit* target)
+ {
+ if(!target) return;
+
+ m_creature->AddThreat(target, 50000000.0f);
+ m_creature->GetMotionMaster()->MoveChase(target);
+ DoCast(m_creature, SPELL_DEMON_FIRE, true);
+ // DoCast(m_creature, SPELL_MOLTEN_FLAME, true); // This spell damages self, so disabled for now
+ TargetLocked = true;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if(m_creature->getVictim() && m_creature->isAlive())
+ {
+ if(CheckTimer < diff)
+ {
+ if(SupremusGUID)
+ {
+ Unit* Supremus = NULL;
+ Supremus = Unit::GetUnit((*m_creature), SupremusGUID);
+ if(Supremus && (!Supremus->isAlive()))
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
+{
+ npc_volcanoAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CheckTimer;
+ uint64 SupremusGUID;
+ uint32 FireballTimer;
+ uint32 GeyserTimer;
+
+ void Reset()
+ {
+ CheckTimer = 1000;
+ SupremusGUID = 0;
+ FireballTimer = 500;
+ GeyserTimer = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(GeyserTimer < diff)
+ {
+ DoCast(m_creature, SPELL_VOLCANIC_GEYSER);
+ GeyserTimer = 18000;
+ }else GeyserTimer -= diff;
+
+ if(FireballTimer < diff)
+ {
+ DoCast(m_creature, SPELL_VOLCANIC_FIREBALL, true);
+ FireballTimer = 1000;
+ }else FireballTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
+{
+ boss_supremusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 SummonFlameTimer;
+ uint32 SwitchTargetTimer;
+ uint32 PhaseSwitchTimer;
+ uint32 SummonVolcanoTimer;
+ uint32 HurtfulStrikeTimer;
+ uint32 BerserkTimer;
+
+ bool Phase1;
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ if(m_creature->isAlive())
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
+ ToggleDoors(true);
+ }
+ else ToggleDoors(false);
+ }
+
+ HurtfulStrikeTimer = 5000;
+ SummonFlameTimer = 20000;
+ SwitchTargetTimer = 90000;
+ PhaseSwitchTimer = 60000;
+ SummonVolcanoTimer = 5000;
+ BerserkTimer = 900000; // 15 minute enrage
+
+ Phase1 = true;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+
+ if(pInstance)
+ pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
+ }
+
+ void ToggleDoors(bool close)
+ {
+ if(GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS)))
+ {
+ if(close) Doors->SetGoState(1); // Closed
+ else Doors->SetGoState(0); // Open
+ }
+ }
+
+ void JustDied(Unit *killer)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
+ ToggleDoors(false);
+ }
+ }
+
+ float CalculateRandomCoord(float initial)
+ {
+ float coord = 0;
+
+ switch(rand()%2)
+ {
+ case 0: coord = initial + 20 + rand()%20; break;
+ case 1: coord = initial - 20 - rand()%20; break;
+ }
+
+ return coord;
+ }
+
+ Creature* SummonCreature(uint32 entry, Unit* target)
+ {
+ if(target && entry)
+ {
+ Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
+ if(Summon)
+ {
+ Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Summon->setFaction(m_creature->getFaction());
+ return Summon;
+ }
+ }
+ return NULL;
+ }
+
+ Unit* CalculateHurtfulStrikeTarget()
+ {
+ uint32 health = 0;
+ Unit* target = NULL;
+
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
+ {
+ if(pUnit->GetHealth() > health)
+ {
+ health = pUnit->GetHealth();
+ target = pUnit;
+ }
+ }
+ }
+
+ return target;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(BerserkTimer < diff)
+ DoCast(m_creature, SPELL_BERSERK);
+ else BerserkTimer -= diff;
+
+ if(SummonFlameTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target) // someone is trying to solo, set target as current victim.
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ Creature* MoltenFlame = SummonCreature(CREATURE_STALKER, target);
+ if(MoltenFlame)
+ {
+ // Invisible model
+ MoltenFlame->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ ((molten_flameAI*)MoltenFlame->AI())->SetSupremusGUID(m_creature->GetGUID());
+ ((molten_flameAI*)MoltenFlame->AI())->StalkTarget(target);
+ SummonFlameTimer = 20000;
+ }
+ }
+ }else SummonFlameTimer -= diff;
+
+ if(Phase1)
+ {
+ if(HurtfulStrikeTimer < diff)
+ {
+ Unit* target = CalculateHurtfulStrikeTarget();
+ if(target)
+ {
+ DoCast(target, SPELL_HURTFUL_STRIKE);
+ HurtfulStrikeTimer = 5000;
+ }
+ }else HurtfulStrikeTimer -= diff;
+ }
+
+ if(!Phase1)
+ {
+ if(SwitchTargetTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoResetThreat();
+ m_creature->AddThreat(target, 5000000.0f);
+ DoTextEmote("acquires a new target!", NULL);
+ SwitchTargetTimer = 10000;
+ }
+
+ }else SwitchTargetTimer -= diff;
+
+ if(SummonVolcanoTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ DoCast(target, SPELL_VOLCANIC_ERUPTION);
+ DoTextEmote("roars and the ground begins to crack open!", NULL);
+ SummonVolcanoTimer = 10000;
+ }
+ }else SummonVolcanoTimer -= diff;
+ }
+
+ if(PhaseSwitchTimer < diff)
+ {
+ if(!Phase1)
+ {
+ Phase1 = true;
+ DoResetThreat();
+ PhaseSwitchTimer = 60000;
+ m_creature->SetSpeed(MOVE_RUN, 1.0f);
+ DoZoneInCombat();
+ }
+ else
+ {
+ Phase1 = false;
+ DoResetThreat();
+ SwitchTargetTimer = 10000;
+ SummonVolcanoTimer = 2000;
+ PhaseSwitchTimer = 60000;
+ m_creature->SetSpeed(MOVE_RUN, 0.9f);
+ DoZoneInCombat();
+ }
+ }else PhaseSwitchTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_supremus(Creature *_Creature)
+{
+ return new boss_supremusAI (_Creature);
+}
+
+CreatureAI* GetAI_molten_flame(Creature *_Creature)
+{
+ return new molten_flameAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_volcano(Creature *_Creature)
+{
+ return new npc_volcanoAI (_Creature);
+}
+
+void AddSC_boss_supremus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_supremus";
+ newscript->GetAI = GetAI_boss_supremus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="molten_flame";
+ newscript->GetAI = GetAI_molten_flame;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_volcano";
+ newscript->GetAI = GetAI_npc_volcano;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
index af97adb4ca7..00b29611d78 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
@@ -1,589 +1,589 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Teron_Gorefiend
-SD%Complete: 60
-SDComment: Requires Mind Control support for Ghosts.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_INCINERATE 40239
-#define SPELL_CRUSHING_SHADOWS 40243
-#define SPELL_SHADOWBOLT 40185
-#define SPELL_PASSIVE_SHADOWFORM 40326
-#define SPELL_SHADOW_OF_DEATH 40251
-#define SPELL_BERSERK 45078
-
-#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player
-
-//Speech'n'sound
-#define SAY_INTRO "I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do..."
-#define SOUND_INTRO 11512
-
-#define SAY_AGGRO "Vengeance is mine!"
-#define SOUND_AGGRO 11513
-
-#define SAY_SLAY1 "I have use for you!"
-#define SOUND_SLAY1 11514
-
-#define SAY_SLAY2 "It gets worse..."
-#define SOUND_SLAY2 11515
-
-#define SAY_SPELL1 "What are you afraid of?"
-#define SOUND_SPELL1 11517
-
-#define SAY_SPELL2 "Death... really isn't so bad."
-#define SOUND_SPELL2 11516
-
-#define SAY_SPECIAL1 "Give in!"
-#define SOUND_SPECIAL1 11518
-
-#define SAY_SPECIAL2 "I have something for you..."
-#define SOUND_SPECIAL2 11519
-
-#define SAY_ENRAGE "YOU WILL SHOW THE PROPER RESPECT!"
-#define SOUND_ENRAGE 11520
-
-#define SAY_DEATH "The wheel...spins...again...."
-#define SOUND_DEATH 11521
-
-#define CREATURE_DOOM_BLOSSOM 23123
-#define CREATURE_SHADOWY_CONSTRUCT 23111
-
-struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
-{
- mob_doom_blossomAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 CheckTeronTimer;
- uint32 ShadowBoltTimer;
- uint64 TeronGUID;
-
- void Reset()
- {
- CheckTeronTimer = 5000;
- ShadowBoltTimer = 12000;
- TeronGUID = 0;
- }
-
- void Aggro(Unit *who) { }
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if(CheckTeronTimer < diff)
- {
- if(TeronGUID)
- {
- DoZoneInCombat();
-
- Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
- if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- CheckTeronTimer = 5000;
- }else CheckTeronTimer -= diff;
-
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(ShadowBoltTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
- ShadowBoltTimer = 10000;
- }else ShadowBoltTimer -= diff;
- }
-
- void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
-};
-
-//This is used to sort the players by distance for Constructs to see who to cast Atrophy on
-struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
-{
- mob_shadowy_constructAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 GhostGUID;
- uint64 TeronGUID;
-
- uint32 CheckPlayerTimer;
- uint32 CheckTeronTimer;
-
- void Reset()
- {
- GhostGUID = 0;
- TeronGUID = 0;
-
- CheckPlayerTimer = 2000;
- CheckTeronTimer = 5000;
- }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
- return;
-
- if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
-
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- m_creature->AddThreat(who, 1.0f);
- }
- }
- }
-
-/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(done_by->GetGUID() != GhostGUID)
- damage = 0; // Only the ghost can deal damage.
- }
- */
-
- void CheckPlayers()
- {
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return; // No threat list. Don't continue.
- std::list<HostilReference*>::iterator itr = m_threatlist.begin();
- std::list<Unit*> targets;
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- targets.push_back(pUnit);
- }
- targets.sort(TargetDistanceOrder(m_creature));
- Unit* target = targets.front();
- if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
- {
- DoCast(target, SPELL_ATROPHY);
- m_creature->AI()->AttackStart(target);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(CheckPlayerTimer < diff)
- {
- CheckPlayers();
- CheckPlayerTimer = 3000;
- }else CheckPlayerTimer -= diff;
-
- if(CheckTeronTimer < diff)
- {
- Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
- if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- CheckTeronTimer = 5000;
- }else CheckTeronTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
-{
- boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 IncinerateTimer;
- uint32 SummonDoomBlossomTimer;
- uint32 EnrageTimer;
- uint32 CrushingShadowsTimer;
- uint32 ShadowOfDeathTimer;
- uint32 SummonShadowsTimer;
- uint32 RandomYellTimer;
- uint32 AggroTimer;
-
- uint64 AggroTargetGUID;
- uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
-
- bool Intro;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
-
- IncinerateTimer = 20000 + rand()%11000;
- SummonDoomBlossomTimer = 12000;
- EnrageTimer = 600000;
- CrushingShadowsTimer = 22000;
- SummonShadowsTimer = 60000;
- RandomYellTimer = 50000;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Start off unattackable so that the intro is done properly
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- AggroTimer = 20000;
- AggroTargetGUID = 0;
- Intro = false;
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive())) return;
-
- if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
-
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- m_creature->AddThreat(who, 1.0f);
- }
-
- if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 200.0f) && (who->GetTypeId() == TYPEID_PLAYER))
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
-
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
- AggroTargetGUID = who->GetGUID();
- Intro = true;
- }
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
-
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- float CalculateRandomLocation(float Loc, uint32 radius)
- {
- float coord = Loc;
- switch(rand()%2)
- {
- case 0:
- coord += rand()%radius;
- break;
- case 1:
- coord -= rand()%radius;
- break;
- }
- return coord;
- }
-
- void SetThreatList(Creature* Blossom)
- {
- if(!Blossom) return;
-
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list<HostilReference*>::iterator i = m_threatlist.begin();
- for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- {
- float threat = m_creature->getThreatManager().getThreat(pUnit);
- Blossom->AddThreat(pUnit, threat);
- }
- }
- }
-
- void MindControlGhost()
- {
- /************************************************************************/
- /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/
- /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/
- /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/
- /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
- /************************************************************************/
-
- Unit* Ghost = NULL;
- if(GhostGUID)
- Ghost = Unit::GetUnit((*m_creature), GhostGUID);
- if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
- {
- /*float x,y,z;
- Ghost->GetPosition(x,y,z);
- Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
- if(control)
- {
- ((Player*)Ghost)->Possess(control);
- Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
- false);
- }*/
- for(uint8 i = 0; i < 4; ++i)
- {
- Creature* Construct = NULL;
- float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
- float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
- Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
- if(Construct)
- {
- Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
- SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
- ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID;
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) // someone's trying to solo.
- target = m_creature->getVictim();
-
- if(target)
- Construct->GetMotionMaster()->MoveChase(target);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(Intro)
- {
- if(AggroTimer < diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Intro = false;
- if(AggroTargetGUID)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
- if(pUnit)
- {
- m_creature->GetMotionMaster()->MoveChase(pUnit);
- AttackStart(pUnit);
- }
- DoZoneInCombat();
- }else EnterEvadeMode();
-
- }else AggroTimer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || Intro)
- return;
-
- if(SummonShadowsTimer < diff)
- {
- //MindControlGhost();
-
- for(uint8 i = 0; i < 2; ++i)
- {
- Creature* Shadow = NULL;
- float X = CalculateRandomLocation(m_creature->GetPositionX(), 10);
- Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
- if(Shadow)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- Shadow->AI()->AttackStart(target);
- }
- }
- SummonShadowsTimer = 60000;
- }else SummonShadowsTimer -= diff;
-
- if(SummonDoomBlossomTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- float X = CalculateRandomLocation(target->GetPositionX(), 20);
- float Y = CalculateRandomLocation(target->GetPositionY(), 20);
- Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
- if(DoomBlossom)
- {
- DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoomBlossom->setFaction(m_creature->getFaction());
- DoomBlossom->AddThreat(target, 1.0f);
- ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
- ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
- SetThreatList(DoomBlossom);
- SummonDoomBlossomTimer = 35000;
- }
- }
- }else SummonDoomBlossomTimer -= diff;
-
- if(IncinerateTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
- DoCast(target, SPELL_INCINERATE);
- IncinerateTimer = 20000 + rand()%31 * 1000;
- }
- }else IncinerateTimer -= diff;
-
- if(CrushingShadowsTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- DoCast(target, SPELL_CRUSHING_SHADOWS);
- CrushingShadowsTimer = 10000 + rand()%16 * 1000;
- }else CrushingShadowsTimer -= diff;
-
- /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
- /*if(ShadowOfDeathTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target)
- target = m_creature->getVictim();
-
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoCast(target, SPELL_SHADOW_OF_DEATH);
- GhostGUID = target->GetGUID();
- ShadowOfDeathTimer = 30000;
- SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
- }
- }else ShadowOfDeathTimer -= diff;*/
-
- if(RandomYellTimer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL1);
- break;
- case 1:
- DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL2);
- break;
- }
- RandomYellTimer = 50000 + rand()%51 * 1000;
- }else RandomYellTimer -= diff;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature)
-{
- return new mob_doom_blossomAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature)
-{
- return new mob_shadowy_constructAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature)
-{
- return new boss_teron_gorefiendAI (_Creature);
-}
-
-void AddSC_boss_teron_gorefiend()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "mob_doom_blossom";
- newscript->GetAI = GetAI_mob_doom_blossom;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_shadowy_construct";
- newscript->GetAI = GetAI_mob_shadowy_construct;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_teron_gorefiend";
- newscript->GetAI = GetAI_boss_teron_gorefiend;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Teron_Gorefiend
+SD%Complete: 60
+SDComment: Requires Mind Control support for Ghosts.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_INCINERATE 40239
+#define SPELL_CRUSHING_SHADOWS 40243
+#define SPELL_SHADOWBOLT 40185
+#define SPELL_PASSIVE_SHADOWFORM 40326
+#define SPELL_SHADOW_OF_DEATH 40251
+#define SPELL_BERSERK 45078
+
+#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player
+
+//Speech'n'sound
+#define SAY_INTRO "I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do..."
+#define SOUND_INTRO 11512
+
+#define SAY_AGGRO "Vengeance is mine!"
+#define SOUND_AGGRO 11513
+
+#define SAY_SLAY1 "I have use for you!"
+#define SOUND_SLAY1 11514
+
+#define SAY_SLAY2 "It gets worse..."
+#define SOUND_SLAY2 11515
+
+#define SAY_SPELL1 "What are you afraid of?"
+#define SOUND_SPELL1 11517
+
+#define SAY_SPELL2 "Death... really isn't so bad."
+#define SOUND_SPELL2 11516
+
+#define SAY_SPECIAL1 "Give in!"
+#define SOUND_SPECIAL1 11518
+
+#define SAY_SPECIAL2 "I have something for you..."
+#define SOUND_SPECIAL2 11519
+
+#define SAY_ENRAGE "YOU WILL SHOW THE PROPER RESPECT!"
+#define SOUND_ENRAGE 11520
+
+#define SAY_DEATH "The wheel...spins...again...."
+#define SOUND_DEATH 11521
+
+#define CREATURE_DOOM_BLOSSOM 23123
+#define CREATURE_SHADOWY_CONSTRUCT 23111
+
+struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
+{
+ mob_doom_blossomAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 CheckTeronTimer;
+ uint32 ShadowBoltTimer;
+ uint64 TeronGUID;
+
+ void Reset()
+ {
+ CheckTeronTimer = 5000;
+ ShadowBoltTimer = 12000;
+ TeronGUID = 0;
+ }
+
+ void Aggro(Unit *who) { }
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckTeronTimer < diff)
+ {
+ if(TeronGUID)
+ {
+ DoZoneInCombat();
+
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(ShadowBoltTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
+ ShadowBoltTimer = 10000;
+ }else ShadowBoltTimer -= diff;
+ }
+
+ void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
+};
+
+//This is used to sort the players by distance for Constructs to see who to cast Atrophy on
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
+{
+ mob_shadowy_constructAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 GhostGUID;
+ uint64 TeronGUID;
+
+ uint32 CheckPlayerTimer;
+ uint32 CheckTeronTimer;
+
+ void Reset()
+ {
+ GhostGUID = 0;
+ TeronGUID = 0;
+
+ CheckPlayerTimer = 2000;
+ CheckTeronTimer = 5000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
+ return;
+
+ if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+ }
+ }
+
+/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() != GhostGUID)
+ damage = 0; // Only the ghost can deal damage.
+ }
+ */
+
+ void CheckPlayers()
+ {
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return; // No threat list. Don't continue.
+ std::list<HostilReference*>::iterator itr = m_threatlist.begin();
+ std::list<Unit*> targets;
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+ targets.sort(TargetDistanceOrder(m_creature));
+ Unit* target = targets.front();
+ if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ {
+ DoCast(target, SPELL_ATROPHY);
+ m_creature->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckPlayerTimer < diff)
+ {
+ CheckPlayers();
+ CheckPlayerTimer = 3000;
+ }else CheckPlayerTimer -= diff;
+
+ if(CheckTeronTimer < diff)
+ {
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
+{
+ boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 IncinerateTimer;
+ uint32 SummonDoomBlossomTimer;
+ uint32 EnrageTimer;
+ uint32 CrushingShadowsTimer;
+ uint32 ShadowOfDeathTimer;
+ uint32 SummonShadowsTimer;
+ uint32 RandomYellTimer;
+ uint32 AggroTimer;
+
+ uint64 AggroTargetGUID;
+ uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
+
+ bool Intro;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
+
+ IncinerateTimer = 20000 + rand()%11000;
+ SummonDoomBlossomTimer = 12000;
+ EnrageTimer = 600000;
+ CrushingShadowsTimer = 22000;
+ SummonShadowsTimer = 60000;
+ RandomYellTimer = 50000;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Start off unattackable so that the intro is done properly
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ AggroTimer = 20000;
+ AggroTargetGUID = 0;
+ Intro = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive())) return;
+
+ if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+
+ if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 200.0f) && (who->GetTypeId() == TYPEID_PLAYER))
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
+
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ AggroTargetGUID = who->GetGUID();
+ Intro = true;
+ }
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
+
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ float CalculateRandomLocation(float Loc, uint32 radius)
+ {
+ float coord = Loc;
+ switch(rand()%2)
+ {
+ case 0:
+ coord += rand()%radius;
+ break;
+ case 1:
+ coord -= rand()%radius;
+ break;
+ }
+ return coord;
+ }
+
+ void SetThreatList(Creature* Blossom)
+ {
+ if(!Blossom) return;
+
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ {
+ float threat = m_creature->getThreatManager().getThreat(pUnit);
+ Blossom->AddThreat(pUnit, threat);
+ }
+ }
+ }
+
+ void MindControlGhost()
+ {
+ /************************************************************************/
+ /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/
+ /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/
+ /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/
+ /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
+ /************************************************************************/
+
+ Unit* Ghost = NULL;
+ if(GhostGUID)
+ Ghost = Unit::GetUnit((*m_creature), GhostGUID);
+ if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
+ {
+ /*float x,y,z;
+ Ghost->GetPosition(x,y,z);
+ Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
+ if(control)
+ {
+ ((Player*)Ghost)->Possess(control);
+ Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
+ false);
+ }*/
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Creature* Construct = NULL;
+ float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
+ float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
+ Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ if(Construct)
+ {
+ Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
+ SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
+ ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID;
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) // someone's trying to solo.
+ target = m_creature->getVictim();
+
+ if(target)
+ Construct->GetMotionMaster()->MoveChase(target);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(Intro)
+ {
+ if(AggroTimer < diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Intro = false;
+ if(AggroTargetGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
+ if(pUnit)
+ {
+ m_creature->GetMotionMaster()->MoveChase(pUnit);
+ AttackStart(pUnit);
+ }
+ DoZoneInCombat();
+ }else EnterEvadeMode();
+
+ }else AggroTimer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || Intro)
+ return;
+
+ if(SummonShadowsTimer < diff)
+ {
+ //MindControlGhost();
+
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ Creature* Shadow = NULL;
+ float X = CalculateRandomLocation(m_creature->GetPositionX(), 10);
+ Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
+ if(Shadow)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ Shadow->AI()->AttackStart(target);
+ }
+ }
+ SummonShadowsTimer = 60000;
+ }else SummonShadowsTimer -= diff;
+
+ if(SummonDoomBlossomTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ float X = CalculateRandomLocation(target->GetPositionX(), 20);
+ float Y = CalculateRandomLocation(target->GetPositionY(), 20);
+ Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
+ if(DoomBlossom)
+ {
+ DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoomBlossom->setFaction(m_creature->getFaction());
+ DoomBlossom->AddThreat(target, 1.0f);
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
+ SetThreatList(DoomBlossom);
+ SummonDoomBlossomTimer = 35000;
+ }
+ }
+ }else SummonDoomBlossomTimer -= diff;
+
+ if(IncinerateTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+ DoCast(target, SPELL_INCINERATE);
+ IncinerateTimer = 20000 + rand()%31 * 1000;
+ }
+ }else IncinerateTimer -= diff;
+
+ if(CrushingShadowsTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ DoCast(target, SPELL_CRUSHING_SHADOWS);
+ CrushingShadowsTimer = 10000 + rand()%16 * 1000;
+ }else CrushingShadowsTimer -= diff;
+
+ /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
+ /*if(ShadowOfDeathTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(target, SPELL_SHADOW_OF_DEATH);
+ GhostGUID = target->GetGUID();
+ ShadowOfDeathTimer = 30000;
+ SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
+ }
+ }else ShadowOfDeathTimer -= diff;*/
+
+ if(RandomYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL1);
+ break;
+ case 1:
+ DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL2);
+ break;
+ }
+ RandomYellTimer = 50000 + rand()%51 * 1000;
+ }else RandomYellTimer -= diff;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature)
+{
+ return new mob_doom_blossomAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature)
+{
+ return new mob_shadowy_constructAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature)
+{
+ return new boss_teron_gorefiendAI (_Creature);
+}
+
+void AddSC_boss_teron_gorefiend()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "mob_doom_blossom";
+ newscript->GetAI = GetAI_mob_doom_blossom;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_shadowy_construct";
+ newscript->GetAI = GetAI_mob_shadowy_construct;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_teron_gorefiend";
+ newscript->GetAI = GetAI_boss_teron_gorefiend;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
index 7ab12293b0f..685810151c6 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
@@ -1,269 +1,269 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warlord_Najentus
-SD%Complete: 95
-SDComment:
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Aggro
-#define SAY_AGGRO "You will die, in the name of Lady Vashj!"
-#define SOUND_AGGRO 11450
-
-//Needle (Random)
-#define SAY_NEEDLE1 "Stick around!"
-#define SOUND_NEEDLE1 11451
-
-#define SAY_NEEDLE2 "I'll deal with you later!"
-#define SOUND_NEEDLE2 11452
-
-//Slay
-#define SAY_SLAY1 "Your success was short lived!"
-#define SOUND_SLAY1 11455
-
-#define SAY_SLAY2 "Time for you to go!"
-#define SOUND_SLAY2 11456
-
-//Special
-#define SAY_SPECIAL1 "Bel'anen dal'lorei!"
-#define SOUND_SPECIAL1 11453
-
-#define SAY_SPECIAL2 "Blood will flow!"
-#define SOUND_SPECIAL2 11454
-
-//Enrage
-#define SAY_ENRAGE "My patience has ran out! Die, DIE!"
-#define SOUND_ENRAGE 11458
-
-//Death
-#define SAY_DEATH "Lord Illidan will... crush you."
-#define SOUND_DEATH 11459
-
-//Spells
-#define SPELL_NEEDLE_SPINE 39835
-#define SPELL_NEEDLE_AOE 39968
-#define SPELL_TIDAL_BURST 39878
-#define SPELL_TIDAL_SHIELD 39872
-#define SPELL_IMPALING_SPINE 39837
-#define SPELL_CREATE_NAJENTUS_SPINE 39956
-#define SPELL_HURL_SPINE 39948
-#define SPELL_BERSERK 45078
-
-#define GOBJECT_SPINE 185584
-
-struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
-{
- boss_najentusAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 NeedleSpineTimer;
- uint32 EnrageTimer;
- uint32 SpecialYellTimer;
- uint32 TidalShieldTimer;
- uint32 ImpalingSpineTimer;
-
- uint64 SpineTargetGUID;
-
- void Reset()
- {
- EnrageTimer = 480000;
- SpecialYellTimer = 45000 + (rand()%76)*1000;
-
- ResetTimer();
-
- SpineTargetGUID = 0;
-
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
-
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
- {
- m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
- m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
- ResetTimer();
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
-
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
- }
-
- bool RemoveImpalingSpine()
- {
- if(!SpineTargetGUID) return false;
- Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
- if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
- target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
- SpineTargetGUID=0;
- return true;
- }
-
- void ResetTimer(uint32 inc = 0)
- {
- NeedleSpineTimer = 10000 + inc;
- TidalShieldTimer = 60000 + inc;
- ImpalingSpineTimer = 20000 + inc;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(TidalShieldTimer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true);
- ResetTimer(45000);
- }else TidalShieldTimer -= diff;
-
- if(EnrageTimer < diff)
- {
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- EnrageTimer = 600000;
- }else EnrageTimer -= diff;
-
- // Needle
- if(NeedleSpineTimer < diff)
- {
- for(uint8 i = 0; i < 3; ++i)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->CastSpell(target, SPELL_NEEDLE_SPINE, true);
- }
- NeedleSpineTimer = 30000;
- }else NeedleSpineTimer -= diff;
-
- if(SpecialYellTimer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
- SpecialYellTimer = 25000 + (rand()%76)*1000;
- }else SpecialYellTimer -= diff;
-
- if(ImpalingSpineTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- if(target)
- {
- m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true);
- SpineTargetGUID = target->GetGUID();
- //must let target summon, otherwise you cannot click the spine
- target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_NEEDLE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NEEDLE1);
- break;
- case 1:
- DoYell(SAY_NEEDLE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NEEDLE2);
- break;
- }
- ImpalingSpineTimer = 21000;
- }
- }else ImpalingSpineTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
-{
- if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData())
- if(Creature* Najentus = (Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
- if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine())
- {
- player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
- _GO->SetLootState(GO_NOT_READY);
- _GO->SetRespawnTime(0);
- }
- return true;
-}
-
-CreatureAI* GetAI_boss_najentus(Creature *_Creature)
-{
- return new boss_najentusAI (_Creature);
-}
-
-void AddSC_boss_najentus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_najentus";
- newscript->GetAI = GetAI_boss_najentus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "go_najentus_spine";
- newscript->pGOHello = &GOHello_go_najentus_spine;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warlord_Najentus
+SD%Complete: 95
+SDComment:
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Aggro
+#define SAY_AGGRO "You will die, in the name of Lady Vashj!"
+#define SOUND_AGGRO 11450
+
+//Needle (Random)
+#define SAY_NEEDLE1 "Stick around!"
+#define SOUND_NEEDLE1 11451
+
+#define SAY_NEEDLE2 "I'll deal with you later!"
+#define SOUND_NEEDLE2 11452
+
+//Slay
+#define SAY_SLAY1 "Your success was short lived!"
+#define SOUND_SLAY1 11455
+
+#define SAY_SLAY2 "Time for you to go!"
+#define SOUND_SLAY2 11456
+
+//Special
+#define SAY_SPECIAL1 "Bel'anen dal'lorei!"
+#define SOUND_SPECIAL1 11453
+
+#define SAY_SPECIAL2 "Blood will flow!"
+#define SOUND_SPECIAL2 11454
+
+//Enrage
+#define SAY_ENRAGE "My patience has ran out! Die, DIE!"
+#define SOUND_ENRAGE 11458
+
+//Death
+#define SAY_DEATH "Lord Illidan will... crush you."
+#define SOUND_DEATH 11459
+
+//Spells
+#define SPELL_NEEDLE_SPINE 39835
+#define SPELL_NEEDLE_AOE 39968
+#define SPELL_TIDAL_BURST 39878
+#define SPELL_TIDAL_SHIELD 39872
+#define SPELL_IMPALING_SPINE 39837
+#define SPELL_CREATE_NAJENTUS_SPINE 39956
+#define SPELL_HURL_SPINE 39948
+#define SPELL_BERSERK 45078
+
+#define GOBJECT_SPINE 185584
+
+struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
+{
+ boss_najentusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 NeedleSpineTimer;
+ uint32 EnrageTimer;
+ uint32 SpecialYellTimer;
+ uint32 TidalShieldTimer;
+ uint32 ImpalingSpineTimer;
+
+ uint64 SpineTargetGUID;
+
+ void Reset()
+ {
+ EnrageTimer = 480000;
+ SpecialYellTimer = 45000 + (rand()%76)*1000;
+
+ ResetTimer();
+
+ SpineTargetGUID = 0;
+
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
+
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
+ {
+ m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
+ m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
+ ResetTimer();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
+
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+ }
+
+ bool RemoveImpalingSpine()
+ {
+ if(!SpineTargetGUID) return false;
+ Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
+ if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
+ target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
+ SpineTargetGUID=0;
+ return true;
+ }
+
+ void ResetTimer(uint32 inc = 0)
+ {
+ NeedleSpineTimer = 10000 + inc;
+ TidalShieldTimer = 60000 + inc;
+ ImpalingSpineTimer = 20000 + inc;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(TidalShieldTimer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true);
+ ResetTimer(45000);
+ }else TidalShieldTimer -= diff;
+
+ if(EnrageTimer < diff)
+ {
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ EnrageTimer = 600000;
+ }else EnrageTimer -= diff;
+
+ // Needle
+ if(NeedleSpineTimer < diff)
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ m_creature->CastSpell(target, SPELL_NEEDLE_SPINE, true);
+ }
+ NeedleSpineTimer = 30000;
+ }else NeedleSpineTimer -= diff;
+
+ if(SpecialYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+ SpecialYellTimer = 25000 + (rand()%76)*1000;
+ }else SpecialYellTimer -= diff;
+
+ if(ImpalingSpineTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ if(target)
+ {
+ m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true);
+ SpineTargetGUID = target->GetGUID();
+ //must let target summon, otherwise you cannot click the spine
+ target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_NEEDLE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NEEDLE1);
+ break;
+ case 1:
+ DoYell(SAY_NEEDLE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NEEDLE2);
+ break;
+ }
+ ImpalingSpineTimer = 21000;
+ }
+ }else ImpalingSpineTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
+{
+ if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData())
+ if(Creature* Najentus = (Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
+ if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine())
+ {
+ player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
+ _GO->SetLootState(GO_NOT_READY);
+ _GO->SetRespawnTime(0);
+ }
+ return true;
+}
+
+CreatureAI* GetAI_boss_najentus(Creature *_Creature)
+{
+ return new boss_najentusAI (_Creature);
+}
+
+void AddSC_boss_najentus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_najentus";
+ newscript->GetAI = GetAI_boss_najentus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "go_najentus_spine";
+ newscript->pGOHello = &GOHello_go_najentus_spine;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
index 3b48c6f7755..53e099f7835 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
+++ b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
@@ -1,34 +1,34 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_BLACK_TEMPLE_H
-#define DEF_BLACK_TEMPLE_H
-
-#define DATA_AKAMA 1
-#define DATA_AKAMA_SHADE 2
-#define DATA_GURTOGGBLOODBOILEVENT 3
-#define DATA_HIGHWARLORDNAJENTUS 4
-#define DATA_HIGHWARLORDNAJENTUSEVENT 5
-#define DATA_ILLIDANSTORMRAGE 6
-#define DATA_ILLIDANSTORMRAGEEVENT 7
-#define DATA_ILLIDARICOUNCILEVENT 8
-#define DATA_ILLIDARICOUNCIL 9
-#define DATA_LADYMALANDE 10
-#define DATA_HIGHNETHERMANCERZEREVOR 11
-#define DATA_GATHIOSTHESHATTERER 12
-#define DATA_VERASDARKSHADOW 13
-#define DATA_MOTHERSHAHRAZEVENT 14
-#define DATA_RELIQUARYOFSOULSEVENT 15
-#define DATA_SHADEOFAKAMA 16
-#define DATA_SHADEOFAKAMAEVENT 17
-#define DATA_SUPREMUS 18
-#define DATA_SUPREMUSEVENT 19
-#define DATA_TERONGOREFIENDEVENT 20
-#define DATA_GAMEOBJECT_NAJENTUS_GATE 21
-#define DATA_GAMEOBJECT_ILLIDAN_GATE 22
-#define DATA_GAMEOBJECT_ILLIDAN_DOOR_R 23
-#define DATA_GAMEOBJECT_ILLIDAN_DOOR_L 24
-#define DATA_GAMEOBJECT_SUPREMUS_DOORS 25
-#define DATA_BLOOD_ELF_COUNCIL_VOICE 26
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_BLACK_TEMPLE_H
+#define DEF_BLACK_TEMPLE_H
+
+#define DATA_AKAMA 1
+#define DATA_AKAMA_SHADE 2
+#define DATA_GURTOGGBLOODBOILEVENT 3
+#define DATA_HIGHWARLORDNAJENTUS 4
+#define DATA_HIGHWARLORDNAJENTUSEVENT 5
+#define DATA_ILLIDANSTORMRAGE 6
+#define DATA_ILLIDANSTORMRAGEEVENT 7
+#define DATA_ILLIDARICOUNCILEVENT 8
+#define DATA_ILLIDARICOUNCIL 9
+#define DATA_LADYMALANDE 10
+#define DATA_HIGHNETHERMANCERZEREVOR 11
+#define DATA_GATHIOSTHESHATTERER 12
+#define DATA_VERASDARKSHADOW 13
+#define DATA_MOTHERSHAHRAZEVENT 14
+#define DATA_RELIQUARYOFSOULSEVENT 15
+#define DATA_SHADEOFAKAMA 16
+#define DATA_SHADEOFAKAMAEVENT 17
+#define DATA_SUPREMUS 18
+#define DATA_SUPREMUSEVENT 19
+#define DATA_TERONGOREFIENDEVENT 20
+#define DATA_GAMEOBJECT_NAJENTUS_GATE 21
+#define DATA_GAMEOBJECT_ILLIDAN_GATE 22
+#define DATA_GAMEOBJECT_ILLIDAN_DOOR_R 23
+#define DATA_GAMEOBJECT_ILLIDAN_DOOR_L 24
+#define DATA_GAMEOBJECT_SUPREMUS_DOORS 25
+#define DATA_BLOOD_ELF_COUNCIL_VOICE 26
+#endif
diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
index 18f991148d5..13f30cf37da 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
@@ -1,885 +1,885 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Illidari_Council
-SD%Complete: 95
-SDComment: Circle of Healing not working properly.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-// High Nethermancer Zerevor's spells
-#define SPELL_FLAMESTRIKE 41481
-#define SPELL_BLIZZARD 41482
-#define SPELL_ARCANE_BOLT 41483
-#define SPELL_ARCANE_EXPLOSION 41524
-#define SPELL_DAMPEN_MAGIC 41478
-
-// Lady Malande's spells
-#define SPELL_EMPOWERED_SMITE 41471
-#define SPELL_CIRCLE_OF_HEALING 41455
-#define SPELL_REFLECTIVE_SHIELD 41475
-#define SPELL_DIVINE_WRATH 41472
-#define SPELL_HEAL_VISUAL 24171
-
-// Gathios the Shatterer's spells
-#define SPELL_BLESS_PROTECTION 41450
-#define SPELL_BLESS_SPELLWARD 41451
-#define SPELL_CONSECRATION 41541
-#define SPELL_HAMMER_OF_JUSTICE 41468
-#define SPELL_SEAL_OF_COMMAND 41469
-#define SPELL_SEAL_OF_BLOOD 41459
-#define SPELL_CHROMATIC_AURA 41453
-#define SPELL_DEVOTION_AURA 41452
-
-// Veras Darkshadow's spells
-#define SPELL_DEADLY_POISON 41485
-#define SPELL_ENVENOM 41487
-#define SPELL_VANISH 41479
-
-#define SPELL_BERSERK 45078
-
-//Speech'n'Sounds
-#define SAY_GATH_AGGRO "I have better things to do!"
-#define SOUND_GATH_AGGRO 11422
-#define SAY_GATH_SLAY "Selama am'oronor!"
-#define SOUND_GATH_SLAY 11423
-#define SAY_GATH_COMNT "Well done!"
-#define SOUND_GATH_COMNT 11424
-#define SAY_GATH_DEATH "Lord Illidan... I..."
-#define SOUND_GATH_DEATH 11425
-#define SAY_GATH_SPECIAL1 "Enjoy your final moments!"
-#define SOUND_GATH_SPECIAL1 11426
-#define SAY_GATH_SPECIAL2 "You are mine!"
-#define SOUND_GATH_SPECIAL2 11427
-
-#define SAY_MALA_AGGRO "Flee, or die!"
-#define SOUND_MALA_AGGRO 11482
-#define SAY_MALA_SLAY "My work is done."
-#define SOUND_MALA_SLAY 11483
-#define SAY_MALA_COMNT "As it should be!"
-#define SOUND_MALA_COMNT 11484
-#define SAY_MALA_DEATH "Destiny... awaits."
-#define SOUND_MALA_DEATH 11485
-#define SAY_MALA_SPECIAL1 "No second chances!"
-#define SOUND_MALA_SPECIAL1 11486
-#define SAY_MALA_SPECIAL2 "I'm full of surprises!"
-#define SOUND_MALA_SPECIAL2 11487
-
-#define SAY_ZERE_AGGRO "Common... such a crude language. Bandal!"
-#define SOUND_ZERE_AGGRO 11440
-#define SAY_ZERE_SLAY "Shorel'aran."
-#define SOUND_ZERE_SLAY 11441
-#define SAY_ZERE_COMNT "Belesa menoor!"
-#define SOUND_ZERE_COMNT 11442
-#define SAY_ZERE_DEATH "Diel ma'ahn... oreindel'o"
-#define SOUND_ZERE_DEATH 11443
-#define SAY_ZERE_SPECIAL1 "Diel fin'al"
-#define SOUND_ZERE_SPECIAL1 11444
-#define SAY_ZERE_SPECIAL2 "Sha'amoor ara mashal?"
-#define SOUND_ZERE_SPECIAL2 11445
-
-#define SAY_VERA_AGGRO "You wish to test me?"
-#define SOUND_VERA_AGGRO 11524
-#define SAY_VERA_SLAY "Valiant effort!"
-#define SOUND_VERA_SLAY 11525
-#define SAY_VERA_COMNT "A glorious kill!"
-#define SOUND_VERA_COMNT 11526
-#define SAY_VERA_DEATH "You got lucky!"
-#define SOUND_VERA_DEATH 11527
-#define SAY_VERA_SPECIAL1 "You're not caught up for this!"
-#define SOUND_VERA_SPECIAL1 11528
-#define SAY_VERA_SPECIAL2 "Anar'alah belore!"
-#define SOUND_VERA_SPECIAL2 11529
-
-#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
-
-struct CouncilYells
-{
- char* text;
- uint32 soundId, timer;
-};
-
-static CouncilYells CouncilAggro[]=
-{
- {"I have better things to do!", 11422, 5000}, // Gathios
- {"You wish to test me?", 11524, 5500}, // Veras
- {"Flee, or die!", 11482, 5000}, // Malande
- {"Common... such a crude language. Bandal!", 11440, 0}, // Zerevor
-};
-
-// Need to get proper timers for this later
-static CouncilYells CouncilEnrage[]=
-{
- {"Enough games!", 11428, 2000}, // Gathios
- {"You wish to kill me? Hahaha, you first!", 11530, 6000},//Veras
- {"For Quel'Thalas! For the Sunwell!", 11488, 5000}, // Malande
- {"Sha'amoor sine menoor!", 11446, 0}, // Zerevor
-};
-
-struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI
-{
- mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c)
- {
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
- Reset();
- }
-
- uint64 Council[4];
-
- uint32 EnrageTimer;
- uint32 AggroYellTimer;
-
- uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
-
- bool EventStarted;
-
- void Reset()
- {
- EnrageTimer = 900000; // 15 minutes
- AggroYellTimer = 500;
-
- YellCounter = 0;
-
- EventStarted = false;
- }
-
- // finds and stores the GUIDs for each Council member using instance data system.
- void LoadCouncilGUIDs()
- {
- if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
- {
- Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW);
- Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- }
- else error_log(ERROR_INST_DATA);
- }
-
- void Aggro(Unit* who) {}
-
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventStarted)
- return;
-
- if(YellCounter > 3)
- return;
-
- if(AggroYellTimer)
- if(AggroYellTimer <= diff)
- {
- if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
- {
- pMember->MonsterYell(CouncilAggro[YellCounter].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(pMember, CouncilAggro[YellCounter].soundId);
- AggroYellTimer = CouncilAggro[YellCounter].timer;
- }
- ++YellCounter;
- if(YellCounter > 3)
- YellCounter = 0; // Reuse for Enrage Yells
- }else AggroYellTimer -= diff;
-
- if(EnrageTimer)
- if(EnrageTimer <= diff)
- {
- if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
- {
- pMember->CastSpell(pMember, SPELL_BERSERK, true);
- pMember->MonsterYell(CouncilEnrage[YellCounter].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(pMember, CouncilEnrage[YellCounter].soundId);
- EnrageTimer = CouncilEnrage[YellCounter].timer;
- }
- ++YellCounter;
- }else EnrageTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
-{
- mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
-
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 Council[4];
-
- uint32 CheckTimer;
- uint32 EndEventTimer;
-
- uint8 DeathCount;
-
- bool EventBegun;
-
- void Reset()
- {
- CheckTimer = 2000;
- EndEventTimer = 0;
-
- DeathCount = 0;
-
- Creature* pMember = NULL;
- for(uint8 i = 0; i < 4; ++i)
- {
- if(pMember = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
- {
- if(!pMember->isAlive())
- {
- pMember->RemoveCorpse();
- pMember->Respawn();
- }
- pMember->AI()->EnterEvadeMode();
- }
- }
-
- if(pInstance)
- {
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
- if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- VoiceTrigger->AI()->EnterEvadeMode();
- }
-
- EventBegun = false;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void StartEvent(Unit *target)
- {
- if(!pInstance) return;
-
- if(target && target->isAlive())
- {
- Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
-
- // Start the event for the Voice Trigger
- if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- {
- ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs();
- ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true;
- }
-
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Member = NULL;
- if(Council[i])
- {
- Member = Unit::GetUnit((*m_creature), Council[i]);
- if(Member && Member->isAlive())
- Member->AddThreat(target, 1.0f);
- }
- }
-
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
-
- EventBegun = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventBegun) return;
-
- if(EndEventTimer)
- if(EndEventTimer <= diff)
- {
- if(DeathCount > 3)
- {
- if(pInstance)
- {
- if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
- }
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- return;
- }
-
- Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, Council[DeathCount]));
- if(pMember && pMember->isAlive())
- pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- ++DeathCount;
- EndEventTimer = 1500;
- }else EndEventTimer -= diff;
-
- if(CheckTimer)
- if(CheckTimer <= diff)
- {
- uint8 EvadeCheck = 0;
- for(uint8 i = 0; i < 4; ++i)
- {
- if(Council[i])
- {
- if(Creature* Member = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
- {
- // This is the evade/death check.
- if(Member->isAlive() && !Member->SelectHostilTarget())
- ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
- else if(!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
- {
- EndEventTimer = 1000;
- CheckTimer = 0;
- return;
- }
- }
- }
- }
-
- if(EvadeCheck > 3)
- Reset();
-
- CheckTimer = 2000;
- }else CheckTimer -= diff;
-
- }
-};
-
-struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
-{
- boss_illidari_councilAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
- LoadedGUIDs = false;
- }
-
- uint64 Council[4];
-
- ScriptedInstance* pInstance;
-
- bool LoadedGUIDs;
-
- void Aggro(Unit* who)
- {
- if(pInstance)
- {
- Creature* Controller = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
- if(Controller)
- ((mob_illidari_councilAI*)Controller->AI())->StartEvent(who);
- }
- else
- {
- error_log(ERROR_INST_DATA);
- EnterEvadeMode();
- }
- DoZoneInCombat();
- // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world-
- // this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are
- // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures
- // have been loaded and have their GUIDs set in the instance data system.
- if(!LoadedGUIDs)
- LoadGUIDs();
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(done_by == m_creature)
- return;
-
- damage /= 4;
- for(uint8 i = 0; i < 4; ++i)
- {
- if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
- if(pUnit != m_creature && damage < pUnit->GetHealth())
- pUnit->SetHealth(pUnit->GetHealth() - damage);
- }
- }
-
- void LoadGUIDs()
- {
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Council[0] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
-
- LoadedGUIDs = true;
- }
-};
-
-struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI
-{
- boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 ConsecrationTimer;
- uint32 HammerOfJusticeTimer;
- uint32 SealTimer;
- uint32 AuraTimer;
- uint32 BlessingTimer;
-
- void Reset()
- {
- ConsecrationTimer = 40000;
- HammerOfJusticeTimer = 10000;
- SealTimer = 40000;
- AuraTimer = 90000;
- BlessingTimer = 60000;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_GATH_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_GATH_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_GATH_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_GATH_DEATH);
- }
-
- Unit* SelectCouncilMember()
- {
- Unit* pUnit = m_creature;
- uint32 member = 0; // He chooses Lady Malande most often
-
- if(rand()%10 == 0) // But there is a chance he picks someone else.
- member = urand(1, 3);
-
- if(member != 2) // No need to create another pointer to us using Unit::GetUnit
- pUnit = Unit::GetUnit((*m_creature), Council[member]);
- return pUnit;
- }
-
- void CastAuraOnCouncil()
- {
- uint32 spellid = 0;
- switch(rand()%2)
- {
- case 0: spellid = SPELL_DEVOTION_AURA; break;
- case 1: spellid = SPELL_CHROMATIC_AURA; break;
- }
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]);
- if(pUnit)
- pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID());
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(BlessingTimer < diff)
- {
- if(Unit* pUnit = SelectCouncilMember())
- {
- switch(rand()%2)
- {
- case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
- case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
- }
- }
- BlessingTimer = 60000;
- }else BlessingTimer -= diff;
-
- if(ConsecrationTimer < diff)
- {
- DoCast(m_creature, SPELL_CONSECRATION);
- ConsecrationTimer = 40000;
- }else ConsecrationTimer -= diff;
-
- if(HammerOfJusticeTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- // is in ~10-40 yd range
- if(m_creature->GetDistance2d(target) > 10 && m_creature->GetDistance2d(target) < 40)
- {
- DoCast(target, SPELL_HAMMER_OF_JUSTICE);
- HammerOfJusticeTimer = 20000;
- }
- }
- }else HammerOfJusticeTimer -= diff;
-
- if(SealTimer < diff)
- {
- switch(rand()%2)
- {
- case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break;
- case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break;
- }
- SealTimer = 40000;
- }else SealTimer -= diff;
-
- if(AuraTimer < diff)
- {
- CastAuraOnCouncil();
- AuraTimer = 90000;
- }else AuraTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
-{
- boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 BlizzardTimer;
- uint32 FlamestrikeTimer;
- uint32 ArcaneBoltTimer;
- uint32 DampenMagicTimer;
- uint32 Cooldown;
- uint32 ArcaneExplosionTimer;
-
- void Reset()
- {
- BlizzardTimer = 30000 + rand()%61 * 1000;
- FlamestrikeTimer = 30000 + rand()%61 * 1000;
- ArcaneBoltTimer = 10000;
- DampenMagicTimer = 2000;
- ArcaneExplosionTimer = 14000;
- Cooldown = 0;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_ZERE_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ZERE_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_ZERE_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_ZERE_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(Cooldown)
- {
- if(Cooldown < diff) Cooldown = 0;
- else
- {
- Cooldown -= diff;
- return; // Don't cast any other spells if global cooldown is still ticking
- }
- }
-
- if(DampenMagicTimer < diff)
- {
- DoCast(m_creature, SPELL_DAMPEN_MAGIC);
- Cooldown = 1000;
- DampenMagicTimer = 110000; // almost 2 minutes
- ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
- }else DampenMagicTimer -= diff;
-
- if(ArcaneExplosionTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
- Cooldown = 1000;
- ArcaneExplosionTimer = 14000;
- }else ArcaneExplosionTimer -= diff;
-
- if(ArcaneBoltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
- ArcaneBoltTimer = 3000;
- Cooldown = 2000;
- }else ArcaneBoltTimer -= diff;
-
- if(BlizzardTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_BLIZZARD);
- BlizzardTimer = 45000 + rand()%46 * 1000;
- FlamestrikeTimer += 10000;
- Cooldown = 1000;
- }
- }else BlizzardTimer -= diff;
-
- if(FlamestrikeTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_FLAMESTRIKE);
- FlamestrikeTimer = 55000 + rand()%46 * 1000;
- BlizzardTimer += 10000;
- Cooldown = 2000;
- }
- }else FlamestrikeTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI
-{
- boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 EmpoweredSmiteTimer;
- uint32 CircleOfHealingTimer;
- uint32 DivineWrathTimer;
- uint32 ReflectiveShieldTimer;
-
- void Reset()
- {
- EmpoweredSmiteTimer = 38000;
- CircleOfHealingTimer = 20000;
- DivineWrathTimer = 40000;
- ReflectiveShieldTimer = 0;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_MALA_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_MALA_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_MALA_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MALA_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(EmpoweredSmiteTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_EMPOWERED_SMITE);
- EmpoweredSmiteTimer = 38000;
- }
- }else EmpoweredSmiteTimer -= diff;
-
- if(CircleOfHealingTimer < diff)
- {
- //Currently bugged and puts Malande on the threatlist of the other council members. It also heals players.
- //DoCast(m_creature, SPELL_CIRCLE_OF_HEALING);
- CircleOfHealingTimer = 60000;
- }else CircleOfHealingTimer -= diff;
-
- if(DivineWrathTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_DIVINE_WRATH);
- DivineWrathTimer = 40000 + rand()%41 * 1000;
- }
- }else DivineWrathTimer -= diff;
-
- if(ReflectiveShieldTimer < diff)
- {
- DoCast(m_creature, SPELL_REFLECTIVE_SHIELD);
- ReflectiveShieldTimer = 65000;
- }else ReflectiveShieldTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI
-{
- boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint64 EnvenomTargetGUID;
-
- uint32 DeadlyPoisonTimer;
- uint32 VanishTimer;
- uint32 AppearEnvenomTimer;
-
- bool HasVanished;
-
- void Reset()
- {
- EnvenomTargetGUID = 0;
-
- DeadlyPoisonTimer = 20000;
- VanishTimer = 60000 + rand()%61 * 1000;
- AppearEnvenomTimer = 150000;
-
- HasVanished = false;
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_VERA_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_VERA_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_VERA_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_VERA_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(!HasVanished)
- {
- if(DeadlyPoisonTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON);
- DeadlyPoisonTimer = 15000 + rand()%31 * 1000;
- }else DeadlyPoisonTimer -= diff;
-
- if(AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over
- {
- DoCast(m_creature->getVictim(), SPELL_ENVENOM);
- AppearEnvenomTimer = 90000;
- }else AppearEnvenomTimer -= diff;
-
- if(VanishTimer < diff) // Disappear and stop attacking, but follow a random unit
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- VanishTimer = 30000;
- AppearEnvenomTimer= 28000;
- HasVanished = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
- m_creature->AddThreat(target, 500000.0f);
- m_creature->GetMotionMaster()->MoveChase(target);
- }
- }else VanishTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
- else
- {
- if(VanishTimer < diff) // Become attackable and poison current target
- {
- Unit* target = m_creature->getVictim();
- DoCast(target, SPELL_DEADLY_POISON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
- DeadlyPoisonTimer += 6000;
- VanishTimer = 90000;
- AppearEnvenomTimer = 4000;
- HasVanished = false;
- }else VanishTimer -= diff;
-
- if(AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- m_creature->SetVisibility(VISIBILITY_ON);
- AppearEnvenomTimer = 6000;
- }else AppearEnvenomTimer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c)
-{
- return new mob_blood_elf_council_voice_triggerAI(c);
-}
-
-CreatureAI* GetAI_mob_illidari_council(Creature *_Creature)
-{
- return new mob_illidari_councilAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_gathios_the_shatterer(Creature *_Creature)
-{
- return new boss_gathios_the_shattererAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_lady_malande(Creature *_Creature)
-{
- return new boss_lady_malandeAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_veras_darkshadow(Creature *_Creature)
-{
- return new boss_veras_darkshadowAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature *_Creature)
-{
- return new boss_high_nethermancer_zerevorAI (_Creature);
-}
-
-void AddSC_boss_illidari_council()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_illidari_council";
- newscript->GetAI = GetAI_mob_illidari_council;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_blood_elf_council_voice_trigger";
- newscript->GetAI = GetAI_mob_blood_elf_council_voice_trigger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_gathios_the_shatterer";
- newscript->GetAI = GetAI_boss_gathios_the_shatterer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lady_malande";
- newscript->GetAI = GetAI_boss_lady_malande;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_veras_darkshadow";
- newscript->GetAI = GetAI_boss_veras_darkshadow;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_high_nethermancer_zerevor";
- newscript->GetAI = GetAI_boss_high_nethermancer_zerevor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Illidari_Council
+SD%Complete: 95
+SDComment: Circle of Healing not working properly.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+// High Nethermancer Zerevor's spells
+#define SPELL_FLAMESTRIKE 41481
+#define SPELL_BLIZZARD 41482
+#define SPELL_ARCANE_BOLT 41483
+#define SPELL_ARCANE_EXPLOSION 41524
+#define SPELL_DAMPEN_MAGIC 41478
+
+// Lady Malande's spells
+#define SPELL_EMPOWERED_SMITE 41471
+#define SPELL_CIRCLE_OF_HEALING 41455
+#define SPELL_REFLECTIVE_SHIELD 41475
+#define SPELL_DIVINE_WRATH 41472
+#define SPELL_HEAL_VISUAL 24171
+
+// Gathios the Shatterer's spells
+#define SPELL_BLESS_PROTECTION 41450
+#define SPELL_BLESS_SPELLWARD 41451
+#define SPELL_CONSECRATION 41541
+#define SPELL_HAMMER_OF_JUSTICE 41468
+#define SPELL_SEAL_OF_COMMAND 41469
+#define SPELL_SEAL_OF_BLOOD 41459
+#define SPELL_CHROMATIC_AURA 41453
+#define SPELL_DEVOTION_AURA 41452
+
+// Veras Darkshadow's spells
+#define SPELL_DEADLY_POISON 41485
+#define SPELL_ENVENOM 41487
+#define SPELL_VANISH 41479
+
+#define SPELL_BERSERK 45078
+
+//Speech'n'Sounds
+#define SAY_GATH_AGGRO "I have better things to do!"
+#define SOUND_GATH_AGGRO 11422
+#define SAY_GATH_SLAY "Selama am'oronor!"
+#define SOUND_GATH_SLAY 11423
+#define SAY_GATH_COMNT "Well done!"
+#define SOUND_GATH_COMNT 11424
+#define SAY_GATH_DEATH "Lord Illidan... I..."
+#define SOUND_GATH_DEATH 11425
+#define SAY_GATH_SPECIAL1 "Enjoy your final moments!"
+#define SOUND_GATH_SPECIAL1 11426
+#define SAY_GATH_SPECIAL2 "You are mine!"
+#define SOUND_GATH_SPECIAL2 11427
+
+#define SAY_MALA_AGGRO "Flee, or die!"
+#define SOUND_MALA_AGGRO 11482
+#define SAY_MALA_SLAY "My work is done."
+#define SOUND_MALA_SLAY 11483
+#define SAY_MALA_COMNT "As it should be!"
+#define SOUND_MALA_COMNT 11484
+#define SAY_MALA_DEATH "Destiny... awaits."
+#define SOUND_MALA_DEATH 11485
+#define SAY_MALA_SPECIAL1 "No second chances!"
+#define SOUND_MALA_SPECIAL1 11486
+#define SAY_MALA_SPECIAL2 "I'm full of surprises!"
+#define SOUND_MALA_SPECIAL2 11487
+
+#define SAY_ZERE_AGGRO "Common... such a crude language. Bandal!"
+#define SOUND_ZERE_AGGRO 11440
+#define SAY_ZERE_SLAY "Shorel'aran."
+#define SOUND_ZERE_SLAY 11441
+#define SAY_ZERE_COMNT "Belesa menoor!"
+#define SOUND_ZERE_COMNT 11442
+#define SAY_ZERE_DEATH "Diel ma'ahn... oreindel'o"
+#define SOUND_ZERE_DEATH 11443
+#define SAY_ZERE_SPECIAL1 "Diel fin'al"
+#define SOUND_ZERE_SPECIAL1 11444
+#define SAY_ZERE_SPECIAL2 "Sha'amoor ara mashal?"
+#define SOUND_ZERE_SPECIAL2 11445
+
+#define SAY_VERA_AGGRO "You wish to test me?"
+#define SOUND_VERA_AGGRO 11524
+#define SAY_VERA_SLAY "Valiant effort!"
+#define SOUND_VERA_SLAY 11525
+#define SAY_VERA_COMNT "A glorious kill!"
+#define SOUND_VERA_COMNT 11526
+#define SAY_VERA_DEATH "You got lucky!"
+#define SOUND_VERA_DEATH 11527
+#define SAY_VERA_SPECIAL1 "You're not caught up for this!"
+#define SOUND_VERA_SPECIAL1 11528
+#define SAY_VERA_SPECIAL2 "Anar'alah belore!"
+#define SOUND_VERA_SPECIAL2 11529
+
+#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
+
+struct CouncilYells
+{
+ char* text;
+ uint32 soundId, timer;
+};
+
+static CouncilYells CouncilAggro[]=
+{
+ {"I have better things to do!", 11422, 5000}, // Gathios
+ {"You wish to test me?", 11524, 5500}, // Veras
+ {"Flee, or die!", 11482, 5000}, // Malande
+ {"Common... such a crude language. Bandal!", 11440, 0}, // Zerevor
+};
+
+// Need to get proper timers for this later
+static CouncilYells CouncilEnrage[]=
+{
+ {"Enough games!", 11428, 2000}, // Gathios
+ {"You wish to kill me? Hahaha, you first!", 11530, 6000},//Veras
+ {"For Quel'Thalas! For the Sunwell!", 11488, 5000}, // Malande
+ {"Sha'amoor sine menoor!", 11446, 0}, // Zerevor
+};
+
+struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI
+{
+ mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ Reset();
+ }
+
+ uint64 Council[4];
+
+ uint32 EnrageTimer;
+ uint32 AggroYellTimer;
+
+ uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
+
+ bool EventStarted;
+
+ void Reset()
+ {
+ EnrageTimer = 900000; // 15 minutes
+ AggroYellTimer = 500;
+
+ YellCounter = 0;
+
+ EventStarted = false;
+ }
+
+ // finds and stores the GUIDs for each Council member using instance data system.
+ void LoadCouncilGUIDs()
+ {
+ if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
+ {
+ Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+ Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ }
+ else error_log(ERROR_INST_DATA);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventStarted)
+ return;
+
+ if(YellCounter > 3)
+ return;
+
+ if(AggroYellTimer)
+ if(AggroYellTimer <= diff)
+ {
+ if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ {
+ pMember->MonsterYell(CouncilAggro[YellCounter].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(pMember, CouncilAggro[YellCounter].soundId);
+ AggroYellTimer = CouncilAggro[YellCounter].timer;
+ }
+ ++YellCounter;
+ if(YellCounter > 3)
+ YellCounter = 0; // Reuse for Enrage Yells
+ }else AggroYellTimer -= diff;
+
+ if(EnrageTimer)
+ if(EnrageTimer <= diff)
+ {
+ if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ {
+ pMember->CastSpell(pMember, SPELL_BERSERK, true);
+ pMember->MonsterYell(CouncilEnrage[YellCounter].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(pMember, CouncilEnrage[YellCounter].soundId);
+ EnrageTimer = CouncilEnrage[YellCounter].timer;
+ }
+ ++YellCounter;
+ }else EnrageTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
+{
+ mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 Council[4];
+
+ uint32 CheckTimer;
+ uint32 EndEventTimer;
+
+ uint8 DeathCount;
+
+ bool EventBegun;
+
+ void Reset()
+ {
+ CheckTimer = 2000;
+ EndEventTimer = 0;
+
+ DeathCount = 0;
+
+ Creature* pMember = NULL;
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ if(pMember = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
+ {
+ if(!pMember->isAlive())
+ {
+ pMember->RemoveCorpse();
+ pMember->Respawn();
+ }
+ pMember->AI()->EnterEvadeMode();
+ }
+ }
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
+ if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ VoiceTrigger->AI()->EnterEvadeMode();
+ }
+
+ EventBegun = false;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void StartEvent(Unit *target)
+ {
+ if(!pInstance) return;
+
+ if(target && target->isAlive())
+ {
+ Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+
+ // Start the event for the Voice Trigger
+ if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ {
+ ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs();
+ ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true;
+ }
+
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Member = NULL;
+ if(Council[i])
+ {
+ Member = Unit::GetUnit((*m_creature), Council[i]);
+ if(Member && Member->isAlive())
+ Member->AddThreat(target, 1.0f);
+ }
+ }
+
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
+
+ EventBegun = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventBegun) return;
+
+ if(EndEventTimer)
+ if(EndEventTimer <= diff)
+ {
+ if(DeathCount > 3)
+ {
+ if(pInstance)
+ {
+ if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
+ }
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return;
+ }
+
+ Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, Council[DeathCount]));
+ if(pMember && pMember->isAlive())
+ pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ ++DeathCount;
+ EndEventTimer = 1500;
+ }else EndEventTimer -= diff;
+
+ if(CheckTimer)
+ if(CheckTimer <= diff)
+ {
+ uint8 EvadeCheck = 0;
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ if(Council[i])
+ {
+ if(Creature* Member = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
+ {
+ // This is the evade/death check.
+ if(Member->isAlive() && !Member->SelectHostilTarget())
+ ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
+ else if(!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
+ {
+ EndEventTimer = 1000;
+ CheckTimer = 0;
+ return;
+ }
+ }
+ }
+ }
+
+ if(EvadeCheck > 3)
+ Reset();
+
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+
+ }
+};
+
+struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
+{
+ boss_illidari_councilAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ LoadedGUIDs = false;
+ }
+
+ uint64 Council[4];
+
+ ScriptedInstance* pInstance;
+
+ bool LoadedGUIDs;
+
+ void Aggro(Unit* who)
+ {
+ if(pInstance)
+ {
+ Creature* Controller = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
+ if(Controller)
+ ((mob_illidari_councilAI*)Controller->AI())->StartEvent(who);
+ }
+ else
+ {
+ error_log(ERROR_INST_DATA);
+ EnterEvadeMode();
+ }
+ DoZoneInCombat();
+ // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world-
+ // this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are
+ // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures
+ // have been loaded and have their GUIDs set in the instance data system.
+ if(!LoadedGUIDs)
+ LoadGUIDs();
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(done_by == m_creature)
+ return;
+
+ damage /= 4;
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
+ if(pUnit != m_creature && damage < pUnit->GetHealth())
+ pUnit->SetHealth(pUnit->GetHealth() - damage);
+ }
+ }
+
+ void LoadGUIDs()
+ {
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Council[0] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+
+ LoadedGUIDs = true;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI
+{
+ boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 ConsecrationTimer;
+ uint32 HammerOfJusticeTimer;
+ uint32 SealTimer;
+ uint32 AuraTimer;
+ uint32 BlessingTimer;
+
+ void Reset()
+ {
+ ConsecrationTimer = 40000;
+ HammerOfJusticeTimer = 10000;
+ SealTimer = 40000;
+ AuraTimer = 90000;
+ BlessingTimer = 60000;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_GATH_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_GATH_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_GATH_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GATH_DEATH);
+ }
+
+ Unit* SelectCouncilMember()
+ {
+ Unit* pUnit = m_creature;
+ uint32 member = 0; // He chooses Lady Malande most often
+
+ if(rand()%10 == 0) // But there is a chance he picks someone else.
+ member = urand(1, 3);
+
+ if(member != 2) // No need to create another pointer to us using Unit::GetUnit
+ pUnit = Unit::GetUnit((*m_creature), Council[member]);
+ return pUnit;
+ }
+
+ void CastAuraOnCouncil()
+ {
+ uint32 spellid = 0;
+ switch(rand()%2)
+ {
+ case 0: spellid = SPELL_DEVOTION_AURA; break;
+ case 1: spellid = SPELL_CHROMATIC_AURA; break;
+ }
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]);
+ if(pUnit)
+ pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID());
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(BlessingTimer < diff)
+ {
+ if(Unit* pUnit = SelectCouncilMember())
+ {
+ switch(rand()%2)
+ {
+ case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
+ case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
+ }
+ }
+ BlessingTimer = 60000;
+ }else BlessingTimer -= diff;
+
+ if(ConsecrationTimer < diff)
+ {
+ DoCast(m_creature, SPELL_CONSECRATION);
+ ConsecrationTimer = 40000;
+ }else ConsecrationTimer -= diff;
+
+ if(HammerOfJusticeTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ // is in ~10-40 yd range
+ if(m_creature->GetDistance2d(target) > 10 && m_creature->GetDistance2d(target) < 40)
+ {
+ DoCast(target, SPELL_HAMMER_OF_JUSTICE);
+ HammerOfJusticeTimer = 20000;
+ }
+ }
+ }else HammerOfJusticeTimer -= diff;
+
+ if(SealTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break;
+ case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break;
+ }
+ SealTimer = 40000;
+ }else SealTimer -= diff;
+
+ if(AuraTimer < diff)
+ {
+ CastAuraOnCouncil();
+ AuraTimer = 90000;
+ }else AuraTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
+{
+ boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 BlizzardTimer;
+ uint32 FlamestrikeTimer;
+ uint32 ArcaneBoltTimer;
+ uint32 DampenMagicTimer;
+ uint32 Cooldown;
+ uint32 ArcaneExplosionTimer;
+
+ void Reset()
+ {
+ BlizzardTimer = 30000 + rand()%61 * 1000;
+ FlamestrikeTimer = 30000 + rand()%61 * 1000;
+ ArcaneBoltTimer = 10000;
+ DampenMagicTimer = 2000;
+ ArcaneExplosionTimer = 14000;
+ Cooldown = 0;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_ZERE_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ZERE_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_ZERE_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ZERE_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(Cooldown)
+ {
+ if(Cooldown < diff) Cooldown = 0;
+ else
+ {
+ Cooldown -= diff;
+ return; // Don't cast any other spells if global cooldown is still ticking
+ }
+ }
+
+ if(DampenMagicTimer < diff)
+ {
+ DoCast(m_creature, SPELL_DAMPEN_MAGIC);
+ Cooldown = 1000;
+ DampenMagicTimer = 110000; // almost 2 minutes
+ ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
+ }else DampenMagicTimer -= diff;
+
+ if(ArcaneExplosionTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ Cooldown = 1000;
+ ArcaneExplosionTimer = 14000;
+ }else ArcaneExplosionTimer -= diff;
+
+ if(ArcaneBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
+ ArcaneBoltTimer = 3000;
+ Cooldown = 2000;
+ }else ArcaneBoltTimer -= diff;
+
+ if(BlizzardTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_BLIZZARD);
+ BlizzardTimer = 45000 + rand()%46 * 1000;
+ FlamestrikeTimer += 10000;
+ Cooldown = 1000;
+ }
+ }else BlizzardTimer -= diff;
+
+ if(FlamestrikeTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_FLAMESTRIKE);
+ FlamestrikeTimer = 55000 + rand()%46 * 1000;
+ BlizzardTimer += 10000;
+ Cooldown = 2000;
+ }
+ }else FlamestrikeTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI
+{
+ boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 EmpoweredSmiteTimer;
+ uint32 CircleOfHealingTimer;
+ uint32 DivineWrathTimer;
+ uint32 ReflectiveShieldTimer;
+
+ void Reset()
+ {
+ EmpoweredSmiteTimer = 38000;
+ CircleOfHealingTimer = 20000;
+ DivineWrathTimer = 40000;
+ ReflectiveShieldTimer = 0;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_MALA_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MALA_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_MALA_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MALA_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(EmpoweredSmiteTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_EMPOWERED_SMITE);
+ EmpoweredSmiteTimer = 38000;
+ }
+ }else EmpoweredSmiteTimer -= diff;
+
+ if(CircleOfHealingTimer < diff)
+ {
+ //Currently bugged and puts Malande on the threatlist of the other council members. It also heals players.
+ //DoCast(m_creature, SPELL_CIRCLE_OF_HEALING);
+ CircleOfHealingTimer = 60000;
+ }else CircleOfHealingTimer -= diff;
+
+ if(DivineWrathTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_DIVINE_WRATH);
+ DivineWrathTimer = 40000 + rand()%41 * 1000;
+ }
+ }else DivineWrathTimer -= diff;
+
+ if(ReflectiveShieldTimer < diff)
+ {
+ DoCast(m_creature, SPELL_REFLECTIVE_SHIELD);
+ ReflectiveShieldTimer = 65000;
+ }else ReflectiveShieldTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI
+{
+ boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint64 EnvenomTargetGUID;
+
+ uint32 DeadlyPoisonTimer;
+ uint32 VanishTimer;
+ uint32 AppearEnvenomTimer;
+
+ bool HasVanished;
+
+ void Reset()
+ {
+ EnvenomTargetGUID = 0;
+
+ DeadlyPoisonTimer = 20000;
+ VanishTimer = 60000 + rand()%61 * 1000;
+ AppearEnvenomTimer = 150000;
+
+ HasVanished = false;
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_VERA_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_VERA_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_VERA_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_VERA_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(!HasVanished)
+ {
+ if(DeadlyPoisonTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON);
+ DeadlyPoisonTimer = 15000 + rand()%31 * 1000;
+ }else DeadlyPoisonTimer -= diff;
+
+ if(AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over
+ {
+ DoCast(m_creature->getVictim(), SPELL_ENVENOM);
+ AppearEnvenomTimer = 90000;
+ }else AppearEnvenomTimer -= diff;
+
+ if(VanishTimer < diff) // Disappear and stop attacking, but follow a random unit
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ VanishTimer = 30000;
+ AppearEnvenomTimer= 28000;
+ HasVanished = true;
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
+ m_creature->AddThreat(target, 500000.0f);
+ m_creature->GetMotionMaster()->MoveChase(target);
+ }
+ }else VanishTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else
+ {
+ if(VanishTimer < diff) // Become attackable and poison current target
+ {
+ Unit* target = m_creature->getVictim();
+ DoCast(target, SPELL_DEADLY_POISON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
+ DeadlyPoisonTimer += 6000;
+ VanishTimer = 90000;
+ AppearEnvenomTimer = 4000;
+ HasVanished = false;
+ }else VanishTimer -= diff;
+
+ if(AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ AppearEnvenomTimer = 6000;
+ }else AppearEnvenomTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c)
+{
+ return new mob_blood_elf_council_voice_triggerAI(c);
+}
+
+CreatureAI* GetAI_mob_illidari_council(Creature *_Creature)
+{
+ return new mob_illidari_councilAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_gathios_the_shatterer(Creature *_Creature)
+{
+ return new boss_gathios_the_shattererAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_lady_malande(Creature *_Creature)
+{
+ return new boss_lady_malandeAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_veras_darkshadow(Creature *_Creature)
+{
+ return new boss_veras_darkshadowAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature *_Creature)
+{
+ return new boss_high_nethermancer_zerevorAI (_Creature);
+}
+
+void AddSC_boss_illidari_council()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_illidari_council";
+ newscript->GetAI = GetAI_mob_illidari_council;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_blood_elf_council_voice_trigger";
+ newscript->GetAI = GetAI_mob_blood_elf_council_voice_trigger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_gathios_the_shatterer";
+ newscript->GetAI = GetAI_boss_gathios_the_shatterer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lady_malande";
+ newscript->GetAI = GetAI_boss_lady_malande;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_veras_darkshadow";
+ newscript->GetAI = GetAI_boss_veras_darkshadow;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_high_nethermancer_zerevor";
+ newscript->GetAI = GetAI_boss_high_nethermancer_zerevor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
index 551f62de6a2..a4bac36295d 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
@@ -1,343 +1,343 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Black_Temple
-SD%Complete: 100
-SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-#define ENCOUNTERS 9
-
-/* Black Temple encounters:
-0 - High Warlord Naj'entus event
-1 - Supremus Event
-2 - Shade of Akama Event
-3 - Teron Gorefiend Event
-4 - Gurtogg Bloodboil Event
-5 - Reliquary Of Souls Event
-6 - Mother Shahraz Event
-7 - Illidari Council Event
-8 - Illidan Stormrage Event
-*/
-
-struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
-{
- instance_black_temple(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 Najentus;
- uint64 Akama; // This is the Akama that starts the Illidan encounter.
- uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
- uint64 ShadeOfAkama;
- uint64 Supremus;
- uint64 LadyMalande;
- uint64 GathiosTheShatterer;
- uint64 HighNethermancerZerevor;
- uint64 VerasDarkshadow;
- uint64 IllidariCouncil;
- uint64 BloodElfCouncilVoice;
- uint64 IllidanStormrage;
-
- uint16 BossKilled;
-
- uint64 NajentusGate;
- uint64 MainTempleDoors;
- uint64 ShadeOfAkamaDoor;
- uint64 CommonDoor;//Teron
- uint64 TeronDoor;
- uint64 GuurtogDoor;
- uint64 MotherDoor;
- uint64 TempleDoor;//Befor mother
- uint64 CouncilDoor;
- uint64 SimpleDoor;//council
- uint64 IllidanGate;
- uint64 IllidanDoor[2];
-
-
- uint32 Encounters[ENCOUNTERS];
-
- void Initialize()
- {
- Najentus = 0;
- Akama = 0;
- Akama_Shade = 0;
- ShadeOfAkama = 0;
- Supremus = 0;
- LadyMalande = 0;
- GathiosTheShatterer = 0;
- HighNethermancerZerevor = 0;
- VerasDarkshadow = 0;
- IllidariCouncil = 0;
- BloodElfCouncilVoice = 0;
- IllidanStormrage = 0;
-
- BossKilled = 0;
-
- NajentusGate = 0;
- MainTempleDoors = 0;
- ShadeOfAkamaDoor= 0;
- CommonDoor = 0;//teron
- TeronDoor = 0;
- GuurtogDoor = 0;
- MotherDoor = 0;
- TempleDoor = 0;
- SimpleDoor = 0;//Bycouncil
- CouncilDoor = 0;
- IllidanGate = 0;
- IllidanDoor[0] = 0;
- IllidanDoor[1] = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = NOT_STARTED;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i] == IN_PROGRESS) return true;
-
- return false;
- }
-
- void OpenDoor(uint64 DoorGUID, bool open)
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
- }
-
- void CloseDoor(uint64 DoorGUID, bool close)
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0);
- }
-
-
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 22887: Najentus = creature->GetGUID(); break;
- case 23089: Akama = creature->GetGUID(); break;
- case 22990: Akama_Shade = creature->GetGUID(); break;
- case 22841: ShadeOfAkama = creature->GetGUID(); break;
- case 22898: Supremus = creature->GetGUID(); break;
- case 22917: IllidanStormrage = creature->GetGUID(); break;
- case 22949: GathiosTheShatterer = creature->GetGUID(); break;
- case 22950: HighNethermancerZerevor = creature->GetGUID(); break;
- case 22951: LadyMalande = creature->GetGUID(); break;
- case 22952: VerasDarkshadow = creature->GetGUID(); break;
- case 23426: IllidariCouncil = creature->GetGUID(); break;
- case 23499: BloodElfCouncilVoice = creature->GetGUID(); break;
- }
- }
-
- void OnObjectCreate(GameObject* go)
- {
- switch(go->GetEntry())
- {
- case 185483: // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
- NajentusGate = go->GetGUID();break;
- case 185882: // Main Temple Doors - right past Supermoose (Supremus)
- MainTempleDoors = go->GetGUID();break;
- case 185478:
- ShadeOfAkamaDoor = go->GetGUID();break;
- case 185480:
- CommonDoor = go->GetGUID();break;
- case 186153:
- TeronDoor = go->GetGUID();break;
- case 185892:
- GuurtogDoor = go->GetGUID();break;
- case 185479:
- TempleDoor = go->GetGUID();break;
- case 185482:
- MotherDoor = go->GetGUID();break;
- case 185481:
- CouncilDoor = go->GetGUID();break;
- case 186152://used by council
- SimpleDoor = go->GetGUID();break;
- case 185905: // Gate leading to Temple Summit
- IllidanGate = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- case 186261: // Right door at Temple Summit
- IllidanDoor[0] = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- case 186262: // Left door at Temple Summit
- IllidanDoor[1] = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_HIGHWARLORDNAJENTUS: return Najentus;
- case DATA_AKAMA: return Akama;
- case DATA_AKAMA_SHADE: return Akama_Shade;
- case DATA_SHADEOFAKAMA: return ShadeOfAkama;
- case DATA_SUPREMUS: return Supremus;
- case DATA_ILLIDANSTORMRAGE: return IllidanStormrage;
- case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer;
- case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor;
- case DATA_LADYMALANDE: return LadyMalande;
- case DATA_VERASDARKSHADOW: return VerasDarkshadow;
- case DATA_ILLIDARICOUNCIL: return IllidariCouncil;
- case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate;
- case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate;
- case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0];
- case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1];
- case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors;
- case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice;
- }
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break;
- case DATA_SUPREMUSEVENT: Encounters[1] = data; break;
- case DATA_SHADEOFAKAMAEVENT: Encounters[2] = data; break;
- case DATA_TERONGOREFIENDEVENT: Encounters[3] = data; break;
- case DATA_GURTOGGBLOODBOILEVENT: Encounters[4] = data; break;
- case DATA_RELIQUARYOFSOULSEVENT: Encounters[5] = data; break;
- case DATA_MOTHERSHAHRAZEVENT: Encounters[6] = data; break;
- case DATA_ILLIDARICOUNCILEVENT: Encounters[7] = data; break;
- case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break;
- }
-
- if(data == DONE)
- {
- SaveToDB();
- BossKilled++;
- }
- CheckInstanceStatus();
- }
-
- void CheckInstanceStatus()
- {
- if(BossKilled >= 6)
- OpenDoor(TempleDoor, true);
- if(Encounters[0] == DONE)
- OpenDoor(NajentusGate, true);
- if(Encounters[2] == IN_PROGRESS)
- CloseDoor(ShadeOfAkamaDoor, true);
- else OpenDoor(ShadeOfAkamaDoor, true);
- if(Encounters[3] == IN_PROGRESS)
- {
- CloseDoor(TeronDoor, true);
- CloseDoor(CommonDoor, true);
- }else{
- OpenDoor(TeronDoor, true);
- OpenDoor(CommonDoor, true);
- }
- if(Encounters[4] == DONE)
- OpenDoor(GuurtogDoor, true);
- if(Encounters[6] == DONE)
- OpenDoor(MotherDoor, true);
- if(Encounters[7] == IN_PROGRESS)
- {
- CloseDoor(CouncilDoor, true);
- CloseDoor(SimpleDoor, true);
- }else{
- OpenDoor(CouncilDoor, true);
- OpenDoor(SimpleDoor, true);
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0];
- case DATA_SUPREMUSEVENT: return Encounters[1];
- case DATA_SHADEOFAKAMAEVENT: return Encounters[2];
- case DATA_TERONGOREFIENDEVENT: return Encounters[3];
- case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4];
- case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5];
- case DATA_MOTHERSHAHRAZEVENT: return Encounters[6];
- case DATA_ILLIDARICOUNCILEVENT: return Encounters[7];
- case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8];
- }
-
- return 0;
- }
-
- const char* Save()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
- << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " "
- << Encounters[6] << " " << Encounters[7] << " " << Encounters[8];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if(out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
-
- return NULL;
- }
-
- void Load(const char* in)
- {
- if(!in)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
- >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
- >> Encounters[8];
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- Encounters[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
-};
-
-InstanceData* GetInstanceData_instance_black_temple(Map* map)
-{
- return new instance_black_temple(map);
-}
-
-void AddSC_instance_black_temple()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_black_temple";
- newscript->GetInstanceData = GetInstanceData_instance_black_temple;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Black_Temple
+SD%Complete: 100
+SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+#define ENCOUNTERS 9
+
+/* Black Temple encounters:
+0 - High Warlord Naj'entus event
+1 - Supremus Event
+2 - Shade of Akama Event
+3 - Teron Gorefiend Event
+4 - Gurtogg Bloodboil Event
+5 - Reliquary Of Souls Event
+6 - Mother Shahraz Event
+7 - Illidari Council Event
+8 - Illidan Stormrage Event
+*/
+
+struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
+{
+ instance_black_temple(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Najentus;
+ uint64 Akama; // This is the Akama that starts the Illidan encounter.
+ uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
+ uint64 ShadeOfAkama;
+ uint64 Supremus;
+ uint64 LadyMalande;
+ uint64 GathiosTheShatterer;
+ uint64 HighNethermancerZerevor;
+ uint64 VerasDarkshadow;
+ uint64 IllidariCouncil;
+ uint64 BloodElfCouncilVoice;
+ uint64 IllidanStormrage;
+
+ uint16 BossKilled;
+
+ uint64 NajentusGate;
+ uint64 MainTempleDoors;
+ uint64 ShadeOfAkamaDoor;
+ uint64 CommonDoor;//Teron
+ uint64 TeronDoor;
+ uint64 GuurtogDoor;
+ uint64 MotherDoor;
+ uint64 TempleDoor;//Befor mother
+ uint64 CouncilDoor;
+ uint64 SimpleDoor;//council
+ uint64 IllidanGate;
+ uint64 IllidanDoor[2];
+
+
+ uint32 Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ Najentus = 0;
+ Akama = 0;
+ Akama_Shade = 0;
+ ShadeOfAkama = 0;
+ Supremus = 0;
+ LadyMalande = 0;
+ GathiosTheShatterer = 0;
+ HighNethermancerZerevor = 0;
+ VerasDarkshadow = 0;
+ IllidariCouncil = 0;
+ BloodElfCouncilVoice = 0;
+ IllidanStormrage = 0;
+
+ BossKilled = 0;
+
+ NajentusGate = 0;
+ MainTempleDoors = 0;
+ ShadeOfAkamaDoor= 0;
+ CommonDoor = 0;//teron
+ TeronDoor = 0;
+ GuurtogDoor = 0;
+ MotherDoor = 0;
+ TempleDoor = 0;
+ SimpleDoor = 0;//Bycouncil
+ CouncilDoor = 0;
+ IllidanGate = 0;
+ IllidanDoor[0] = 0;
+ IllidanDoor[1] = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ void OpenDoor(uint64 DoorGUID, bool open)
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ }
+
+ void CloseDoor(uint64 DoorGUID, bool close)
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0);
+ }
+
+
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 22887: Najentus = creature->GetGUID(); break;
+ case 23089: Akama = creature->GetGUID(); break;
+ case 22990: Akama_Shade = creature->GetGUID(); break;
+ case 22841: ShadeOfAkama = creature->GetGUID(); break;
+ case 22898: Supremus = creature->GetGUID(); break;
+ case 22917: IllidanStormrage = creature->GetGUID(); break;
+ case 22949: GathiosTheShatterer = creature->GetGUID(); break;
+ case 22950: HighNethermancerZerevor = creature->GetGUID(); break;
+ case 22951: LadyMalande = creature->GetGUID(); break;
+ case 22952: VerasDarkshadow = creature->GetGUID(); break;
+ case 23426: IllidariCouncil = creature->GetGUID(); break;
+ case 23499: BloodElfCouncilVoice = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ switch(go->GetEntry())
+ {
+ case 185483: // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
+ NajentusGate = go->GetGUID();break;
+ case 185882: // Main Temple Doors - right past Supermoose (Supremus)
+ MainTempleDoors = go->GetGUID();break;
+ case 185478:
+ ShadeOfAkamaDoor = go->GetGUID();break;
+ case 185480:
+ CommonDoor = go->GetGUID();break;
+ case 186153:
+ TeronDoor = go->GetGUID();break;
+ case 185892:
+ GuurtogDoor = go->GetGUID();break;
+ case 185479:
+ TempleDoor = go->GetGUID();break;
+ case 185482:
+ MotherDoor = go->GetGUID();break;
+ case 185481:
+ CouncilDoor = go->GetGUID();break;
+ case 186152://used by council
+ SimpleDoor = go->GetGUID();break;
+ case 185905: // Gate leading to Temple Summit
+ IllidanGate = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ case 186261: // Right door at Temple Summit
+ IllidanDoor[0] = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ case 186262: // Left door at Temple Summit
+ IllidanDoor[1] = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_HIGHWARLORDNAJENTUS: return Najentus;
+ case DATA_AKAMA: return Akama;
+ case DATA_AKAMA_SHADE: return Akama_Shade;
+ case DATA_SHADEOFAKAMA: return ShadeOfAkama;
+ case DATA_SUPREMUS: return Supremus;
+ case DATA_ILLIDANSTORMRAGE: return IllidanStormrage;
+ case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer;
+ case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor;
+ case DATA_LADYMALANDE: return LadyMalande;
+ case DATA_VERASDARKSHADOW: return VerasDarkshadow;
+ case DATA_ILLIDARICOUNCIL: return IllidariCouncil;
+ case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate;
+ case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate;
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0];
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1];
+ case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors;
+ case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break;
+ case DATA_SUPREMUSEVENT: Encounters[1] = data; break;
+ case DATA_SHADEOFAKAMAEVENT: Encounters[2] = data; break;
+ case DATA_TERONGOREFIENDEVENT: Encounters[3] = data; break;
+ case DATA_GURTOGGBLOODBOILEVENT: Encounters[4] = data; break;
+ case DATA_RELIQUARYOFSOULSEVENT: Encounters[5] = data; break;
+ case DATA_MOTHERSHAHRAZEVENT: Encounters[6] = data; break;
+ case DATA_ILLIDARICOUNCILEVENT: Encounters[7] = data; break;
+ case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break;
+ }
+
+ if(data == DONE)
+ {
+ SaveToDB();
+ BossKilled++;
+ }
+ CheckInstanceStatus();
+ }
+
+ void CheckInstanceStatus()
+ {
+ if(BossKilled >= 6)
+ OpenDoor(TempleDoor, true);
+ if(Encounters[0] == DONE)
+ OpenDoor(NajentusGate, true);
+ if(Encounters[2] == IN_PROGRESS)
+ CloseDoor(ShadeOfAkamaDoor, true);
+ else OpenDoor(ShadeOfAkamaDoor, true);
+ if(Encounters[3] == IN_PROGRESS)
+ {
+ CloseDoor(TeronDoor, true);
+ CloseDoor(CommonDoor, true);
+ }else{
+ OpenDoor(TeronDoor, true);
+ OpenDoor(CommonDoor, true);
+ }
+ if(Encounters[4] == DONE)
+ OpenDoor(GuurtogDoor, true);
+ if(Encounters[6] == DONE)
+ OpenDoor(MotherDoor, true);
+ if(Encounters[7] == IN_PROGRESS)
+ {
+ CloseDoor(CouncilDoor, true);
+ CloseDoor(SimpleDoor, true);
+ }else{
+ OpenDoor(CouncilDoor, true);
+ OpenDoor(SimpleDoor, true);
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0];
+ case DATA_SUPREMUSEVENT: return Encounters[1];
+ case DATA_SHADEOFAKAMAEVENT: return Encounters[2];
+ case DATA_TERONGOREFIENDEVENT: return Encounters[3];
+ case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4];
+ case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5];
+ case DATA_MOTHERSHAHRAZEVENT: return Encounters[6];
+ case DATA_ILLIDARICOUNCILEVENT: return Encounters[7];
+ case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8];
+ }
+
+ return 0;
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
+ << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " "
+ << Encounters[6] << " " << Encounters[7] << " " << Encounters[8];
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if(out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+
+ return NULL;
+ }
+
+ void Load(const char* in)
+ {
+ if(!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
+ >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
+ >> Encounters[8];
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
+ Encounters[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_black_temple(Map* map)
+{
+ return new instance_black_temple(map);
+}
+
+void AddSC_instance_black_temple()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_black_temple";
+ newscript->GetInstanceData = GetInstanceData_instance_black_temple;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
index 4f3168602f5..95a920d39a3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
@@ -1,237 +1,237 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blackrock_Depths
-SD%Complete: 95
-SDComment: Quest support: 4001, 4342, 7604. Vendor Lokhtos Darkbargainer.
-SDCategory: Blackrock Depths
-EndScriptData */
-
-/* ContentData
-mob_phalanx
-npc_kharan_mighthammer
-npc_lokhtos_darkbargainer
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_phalanx
-######*/
-
-#define SPELL_THUNDERCLAP 8732
-#define SPELL_FIREBALLVOLLEY 22425
-#define SPELL_MIGHTYBLOW 14099
-
-struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
-{
- mob_phalanxAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ThunderClap_Timer;
- uint32 FireballVolley_Timer;
- uint32 MightyBlow_Timer;
-
- void Reset()
- {
- ThunderClap_Timer = 12000;
- FireballVolley_Timer =0;
- MightyBlow_Timer = 15000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ThunderClap_Timer
- if( ThunderClap_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- ThunderClap_Timer = 10000;
- }else ThunderClap_Timer -= diff;
-
- //FireballVolley_Timer
- if( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (FireballVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
- FireballVolley_Timer = 15000;
- }else FireballVolley_Timer -= diff;
- }
-
- //MightyBlow_Timer
- if( MightyBlow_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 10000;
- }else MightyBlow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mob_phalanx(Creature *_Creature)
-{
- return new mob_phalanxAI (_Creature);
-}
-
-/*######
-## npc_kharan_mighthammer
-######*/
-
-#define QUEST_4001 4001
-#define QUEST_4342 4342
-
-bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "I need to know where the princess are, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "All is not lost, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
-
- if( player->GetTeam() == HORDE ) player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID());
- if( player->GetTeam() == ALLIANCE ) player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "Gor'shak is my friend, you can trust me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(2475, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Not enough, you need to tell me more.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(2476, _Creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "So what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(2477, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(2478, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "So you suspect that someone on the inside was involved? That they were tipped off?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(2479, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(0, "Continue with your story please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(2480, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(0, "Indeed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- player->SEND_GOSSIP_MENU(2481, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(0, "The door is open, Kharan. You are a free man.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- player->SEND_GOSSIP_MENU(2482, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->CLOSE_GOSSIP_MENU();
- if( player->GetTeam() == HORDE ) player->AreaExploredOrEventHappens(QUEST_4001);
- if( player->GetTeam() == ALLIANCE ) player->AreaExploredOrEventHappens(QUEST_4342);
- break;
- }
- return true;
-}
-
-/*######
-## npc_lokhtos_darkbargainer
-######*/
-
-#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628
-#define ITEM_SULFURON_INGOT 17203
-#define QUEST_A_BINDING_CONTRACT 7604
-#define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059
-
-bool GossipHello_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (_Creature->isVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 1, "Show me what I have access to, Lothos.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
- !player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
- player->HasItemCount(ITEM_SULFURON_INGOT, 1))
- {
- player->ADD_GOSSIP_ITEM(0, "Get Thorium Brotherhood Contract", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- }
-
- if (player->GetReputationRank(59) < REP_FRIENDLY)
- player->SEND_GOSSIP_MENU(3673, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(3677, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
- }
- if (action == GOSSIP_ACTION_TRADE)
- {
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_blackrock_depths()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="phalanx";
- newscript->GetAI = GetAI_mob_phalanx;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_kharan_mighthammer";
- newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer;
- newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lokhtos_darkbargainer";
- newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
- newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blackrock_Depths
+SD%Complete: 95
+SDComment: Quest support: 4001, 4342, 7604. Vendor Lokhtos Darkbargainer.
+SDCategory: Blackrock Depths
+EndScriptData */
+
+/* ContentData
+mob_phalanx
+npc_kharan_mighthammer
+npc_lokhtos_darkbargainer
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_phalanx
+######*/
+
+#define SPELL_THUNDERCLAP 8732
+#define SPELL_FIREBALLVOLLEY 22425
+#define SPELL_MIGHTYBLOW 14099
+
+struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
+{
+ mob_phalanxAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ThunderClap_Timer;
+ uint32 FireballVolley_Timer;
+ uint32 MightyBlow_Timer;
+
+ void Reset()
+ {
+ ThunderClap_Timer = 12000;
+ FireballVolley_Timer =0;
+ MightyBlow_Timer = 15000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ThunderClap_Timer
+ if( ThunderClap_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 10000;
+ }else ThunderClap_Timer -= diff;
+
+ //FireballVolley_Timer
+ if( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (FireballVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
+ FireballVolley_Timer = 15000;
+ }else FireballVolley_Timer -= diff;
+ }
+
+ //MightyBlow_Timer
+ if( MightyBlow_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 10000;
+ }else MightyBlow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mob_phalanx(Creature *_Creature)
+{
+ return new mob_phalanxAI (_Creature);
+}
+
+/*######
+## npc_kharan_mighthammer
+######*/
+
+#define QUEST_4001 4001
+#define QUEST_4342 4342
+
+bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "I need to know where the princess are, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "All is not lost, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+
+ if( player->GetTeam() == HORDE ) player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID());
+ if( player->GetTeam() == ALLIANCE ) player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "Gor'shak is my friend, you can trust me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(2475, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Not enough, you need to tell me more.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(2476, _Creature->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "So what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(2477, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(2478, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "So you suspect that someone on the inside was involved? That they were tipped off?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(2479, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM(0, "Continue with your story please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ player->SEND_GOSSIP_MENU(2480, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->ADD_GOSSIP_ITEM(0, "Indeed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
+ player->SEND_GOSSIP_MENU(2481, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ player->ADD_GOSSIP_ITEM(0, "The door is open, Kharan. You are a free man.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
+ player->SEND_GOSSIP_MENU(2482, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ player->CLOSE_GOSSIP_MENU();
+ if( player->GetTeam() == HORDE ) player->AreaExploredOrEventHappens(QUEST_4001);
+ if( player->GetTeam() == ALLIANCE ) player->AreaExploredOrEventHappens(QUEST_4342);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_lokhtos_darkbargainer
+######*/
+
+#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628
+#define ITEM_SULFURON_INGOT 17203
+#define QUEST_A_BINDING_CONTRACT 7604
+#define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059
+
+bool GossipHello_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (_Creature->isVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 1, "Show me what I have access to, Lothos.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
+ !player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
+ player->HasItemCount(ITEM_SULFURON_INGOT, 1))
+ {
+ player->ADD_GOSSIP_ITEM(0, "Get Thorium Brotherhood Contract", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ }
+
+ if (player->GetReputationRank(59) < REP_FRIENDLY)
+ player->SEND_GOSSIP_MENU(3673, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(3677, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
+ }
+ if (action == GOSSIP_ACTION_TRADE)
+ {
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_blackrock_depths()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="phalanx";
+ newscript->GetAI = GetAI_mob_phalanx;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_kharan_mighthammer";
+ newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer;
+ newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lokhtos_darkbargainer";
+ newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
+ newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
index 0d049557e58..b63691a3b6e 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
@@ -1,106 +1,106 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ambassador_Flamelash
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIREBLAST 15573
-
-struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
-{
- boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireBlast_Timer;
- uint32 Spirit_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- FireBlast_Timer = 2000;
- Spirit_Timer = 24000;
- }
-
- void Aggro(Unit *who) {}
-
- void SummonSpirits(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX -= Rand; break;
- case 1: RandX += Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY -= Rand; break;
- case 1: RandY += Rand; break;
- }
- Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireBlast_Timer
- if (FireBlast_Timer < diff)
- {
- DoCast(m_creature->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());
-
- Spirit_Timer = 30000;
- }else Spirit_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ambassador_flamelash(Creature *_Creature)
-{
- return new boss_ambassador_flamelashAI (_Creature);
-}
-
-void AddSC_boss_ambassador_flamelash()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ambassador_flamelash";
- newscript->GetAI = GetAI_boss_ambassador_flamelash;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ambassador_Flamelash
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIREBLAST 15573
+
+struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
+{
+ boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireBlast_Timer;
+ uint32 Spirit_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ FireBlast_Timer = 2000;
+ Spirit_Timer = 24000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void SummonSpirits(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX -= Rand; break;
+ case 1: RandX += Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY -= Rand; break;
+ case 1: RandY += Rand; break;
+ }
+ Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireBlast_Timer
+ if (FireBlast_Timer < diff)
+ {
+ DoCast(m_creature->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());
+
+ Spirit_Timer = 30000;
+ }else Spirit_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ambassador_flamelash(Creature *_Creature)
+{
+ return new boss_ambassador_flamelashAI (_Creature);
+}
+
+void AddSC_boss_ambassador_flamelash()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ambassador_flamelash";
+ newscript->GetAI = GetAI_boss_ambassador_flamelash;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
index 944e5fb4b10..13b9f31e734 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Angerrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SUNDERARMOR 24317
-#define SPELL_SHIELDBLOCK 12169
-#define SPELL_STRIKE 15580
-
-struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI
-{
- boss_angerrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SunderArmor_Timer;
- uint32 ShieldBlock_Timer;
- uint32 Strike_Timer;
-
- void Reset()
- {
- SunderArmor_Timer = 8000;
- ShieldBlock_Timer = 15000;
- Strike_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SunderArmor_Timer
- if (SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
- SunderArmor_Timer = 28000;
- }else SunderArmor_Timer -= diff;
-
- //ShieldBlock_Timer
- if (ShieldBlock_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELDBLOCK);
- ShieldBlock_Timer = 25000;
- }else ShieldBlock_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_angerrel(Creature *_Creature)
-{
- return new boss_angerrelAI (_Creature);
-}
-
-void AddSC_boss_angerrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_angerrel";
- newscript->GetAI = GetAI_boss_angerrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Angerrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SUNDERARMOR 24317
+#define SPELL_SHIELDBLOCK 12169
+#define SPELL_STRIKE 15580
+
+struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI
+{
+ boss_angerrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SunderArmor_Timer;
+ uint32 ShieldBlock_Timer;
+ uint32 Strike_Timer;
+
+ void Reset()
+ {
+ SunderArmor_Timer = 8000;
+ ShieldBlock_Timer = 15000;
+ Strike_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SunderArmor_Timer
+ if (SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 28000;
+ }else SunderArmor_Timer -= diff;
+
+ //ShieldBlock_Timer
+ if (ShieldBlock_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELDBLOCK);
+ ShieldBlock_Timer = 25000;
+ }else ShieldBlock_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_angerrel(Creature *_Creature)
+{
+ return new boss_angerrelAI (_Creature);
+}
+
+void AddSC_boss_angerrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_angerrel";
+ newscript->GetAI = GetAI_boss_angerrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
index e9dcf4be094..50cf2af8169 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
@@ -1,115 +1,115 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Anubshiah
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLT 17228
-#define SPELL_CURSEOFTONGUES 15470
-#define SPELL_CURSEOFWEAKNESS 17227
-#define SPELL_DEMONARMOR 11735
-#define SPELL_ENVELOPINGWEB 15471
-
-struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
-{
- boss_anubshiahAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 CurseOfTongues_Timer;
- uint32 CurseOfWeakness_Timer;
- uint32 DemonArmor_Timer;
- uint32 EnvelopingWeb_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 7000;
- CurseOfTongues_Timer = 24000;
- CurseOfWeakness_Timer = 12000;
- DemonArmor_Timer = 3000;
- EnvelopingWeb_Timer = 16000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 7000;
- }else ShadowBolt_Timer -= diff;
-
- //CurseOfTongues_Timer
- if (CurseOfTongues_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_CURSEOFTONGUES);
- CurseOfTongues_Timer = 18000;
- }else CurseOfTongues_Timer -= diff;
-
- //CurseOfWeakness_Timer
- if (CurseOfWeakness_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
- CurseOfWeakness_Timer = 45000;
- }else CurseOfWeakness_Timer -= diff;
-
- //DemonArmor_Timer
- if (DemonArmor_Timer < diff)
- {
- DoCast(m_creature,SPELL_DEMONARMOR);
- DemonArmor_Timer = 300000;
- }else DemonArmor_Timer -= diff;
-
- //EnvelopingWeb_Timer
- if (EnvelopingWeb_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_ENVELOPINGWEB);
- EnvelopingWeb_Timer = 12000;
- }else EnvelopingWeb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_anubshiah(Creature *_Creature)
-{
- return new boss_anubshiahAI (_Creature);
-}
-
-void AddSC_boss_anubshiah()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_anubshiah";
- newscript->GetAI = GetAI_boss_anubshiah;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Anubshiah
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLT 17228
+#define SPELL_CURSEOFTONGUES 15470
+#define SPELL_CURSEOFWEAKNESS 17227
+#define SPELL_DEMONARMOR 11735
+#define SPELL_ENVELOPINGWEB 15471
+
+struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
+{
+ boss_anubshiahAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 CurseOfTongues_Timer;
+ uint32 CurseOfWeakness_Timer;
+ uint32 DemonArmor_Timer;
+ uint32 EnvelopingWeb_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 7000;
+ CurseOfTongues_Timer = 24000;
+ CurseOfWeakness_Timer = 12000;
+ DemonArmor_Timer = 3000;
+ EnvelopingWeb_Timer = 16000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 7000;
+ }else ShadowBolt_Timer -= diff;
+
+ //CurseOfTongues_Timer
+ if (CurseOfTongues_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_CURSEOFTONGUES);
+ CurseOfTongues_Timer = 18000;
+ }else CurseOfTongues_Timer -= diff;
+
+ //CurseOfWeakness_Timer
+ if (CurseOfWeakness_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
+ CurseOfWeakness_Timer = 45000;
+ }else CurseOfWeakness_Timer -= diff;
+
+ //DemonArmor_Timer
+ if (DemonArmor_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DEMONARMOR);
+ DemonArmor_Timer = 300000;
+ }else DemonArmor_Timer -= diff;
+
+ //EnvelopingWeb_Timer
+ if (EnvelopingWeb_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_ENVELOPINGWEB);
+ EnvelopingWeb_Timer = 12000;
+ }else EnvelopingWeb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_anubshiah(Creature *_Creature)
+{
+ return new boss_anubshiahAI (_Creature);
+}
+
+void AddSC_boss_anubshiah()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_anubshiah";
+ newscript->GetAI = GetAI_boss_anubshiah;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
index f5d4f8bd699..b58ebc7b97a 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
@@ -1,139 +1,139 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doomrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLTVOLLEY 17228
-#define SPELL_IMMOLATE 15505
-#define SPELL_CURSEOFWEAKNESS 17227
-#define SPELL_DEMONARMOR 11735
-
-struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
-{
- boss_doomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 Immolate_Timer;
- uint32 CurseOfWeakness_Timer;
- uint32 DemonArmor_Timer;
- bool Voidwalkers;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- Immolate_Timer = 18000;
- CurseOfWeakness_Timer = 5000;
- DemonArmor_Timer = 16000;
- Voidwalkers = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonVoidwalkers(Unit* victim)
- {
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
- ShadowVolley_Timer = 12000;
- }else ShadowVolley_Timer -= diff;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_IMMOLATE);
- Immolate_Timer = 25000;
- }else Immolate_Timer -= diff;
-
- //CurseOfWeakness_Timer
- if (CurseOfWeakness_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
- CurseOfWeakness_Timer = 45000;
- }else CurseOfWeakness_Timer -= diff;
-
- //DemonArmor_Timer
- if (DemonArmor_Timer < diff)
- {
- DoCast(m_creature,SPELL_DEMONARMOR);
- DemonArmor_Timer = 300000;
- }else DemonArmor_Timer -= diff;
-
- //Summon Voidwalkers
- if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- SummonVoidwalkers(m_creature->getVictim());
- SummonVoidwalkers(m_creature->getVictim());
- SummonVoidwalkers(m_creature->getVictim());
- Voidwalkers = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_doomrel(Creature *_Creature)
-{
- return new boss_doomrelAI (_Creature);
-}
-
-void AddSC_boss_doomrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doomrel";
- newscript->GetAI = GetAI_boss_doomrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doomrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLTVOLLEY 17228
+#define SPELL_IMMOLATE 15505
+#define SPELL_CURSEOFWEAKNESS 17227
+#define SPELL_DEMONARMOR 11735
+
+struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
+{
+ boss_doomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 Immolate_Timer;
+ uint32 CurseOfWeakness_Timer;
+ uint32 DemonArmor_Timer;
+ bool Voidwalkers;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 10000;
+ Immolate_Timer = 18000;
+ CurseOfWeakness_Timer = 5000;
+ DemonArmor_Timer = 16000;
+ Voidwalkers = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonVoidwalkers(Unit* victim)
+ {
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
+ ShadowVolley_Timer = 12000;
+ }else ShadowVolley_Timer -= diff;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_IMMOLATE);
+ Immolate_Timer = 25000;
+ }else Immolate_Timer -= diff;
+
+ //CurseOfWeakness_Timer
+ if (CurseOfWeakness_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
+ CurseOfWeakness_Timer = 45000;
+ }else CurseOfWeakness_Timer -= diff;
+
+ //DemonArmor_Timer
+ if (DemonArmor_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DEMONARMOR);
+ DemonArmor_Timer = 300000;
+ }else DemonArmor_Timer -= diff;
+
+ //Summon Voidwalkers
+ if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ SummonVoidwalkers(m_creature->getVictim());
+ SummonVoidwalkers(m_creature->getVictim());
+ SummonVoidwalkers(m_creature->getVictim());
+ Voidwalkers = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_doomrel(Creature *_Creature)
+{
+ return new boss_doomrelAI (_Creature);
+}
+
+void AddSC_boss_doomrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doomrel";
+ newscript->GetAI = GetAI_boss_doomrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
index ffa79896b55..f9da16dd2fd 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doperel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SINISTERSTRIKE 15581
-#define SPELL_BACKSTAB 15582
-#define SPELL_GOUGE 13579
-
-struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI
-{
- boss_doperelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SinisterStrike_Timer;
- uint32 BackStab_Timer;
- uint32 Gouge_Timer;
-
- void Reset()
- {
- SinisterStrike_Timer = 8000;
- BackStab_Timer = 12000;
- Gouge_Timer = 6000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SinisterStrike_Timer
- if (SinisterStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
- SinisterStrike_Timer = 7000;
- }else SinisterStrike_Timer -= diff;
-
- //BackStab_Timer
- if (BackStab_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BACKSTAB);
- BackStab_Timer = 6000;
- }else BackStab_Timer -= diff;
-
- //Gouge_Timer
- if (Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GOUGE);
- Gouge_Timer = 8000;
- }else Gouge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_doperel(Creature *_Creature)
-{
- return new boss_doperelAI (_Creature);
-}
-
-void AddSC_boss_doperel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doperel";
- newscript->GetAI = GetAI_boss_doperel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doperel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SINISTERSTRIKE 15581
+#define SPELL_BACKSTAB 15582
+#define SPELL_GOUGE 13579
+
+struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI
+{
+ boss_doperelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SinisterStrike_Timer;
+ uint32 BackStab_Timer;
+ uint32 Gouge_Timer;
+
+ void Reset()
+ {
+ SinisterStrike_Timer = 8000;
+ BackStab_Timer = 12000;
+ Gouge_Timer = 6000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SinisterStrike_Timer
+ if (SinisterStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
+ SinisterStrike_Timer = 7000;
+ }else SinisterStrike_Timer -= diff;
+
+ //BackStab_Timer
+ if (BackStab_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BACKSTAB);
+ BackStab_Timer = 6000;
+ }else BackStab_Timer -= diff;
+
+ //Gouge_Timer
+ if (Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GOUGE);
+ Gouge_Timer = 8000;
+ }else Gouge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_doperel(Creature *_Creature)
+{
+ return new boss_doperelAI (_Creature);
+}
+
+void AddSC_boss_doperel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doperel";
+ newscript->GetAI = GetAI_boss_doperel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
index 7594bec05df..e8b1fb791ee 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
@@ -1,104 +1,104 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Emperor_Dagran_Thaurissan
-SD%Complete: 99
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HANDOFTHAURISSAN 17492
-#define SPELL_AVATAROFFLAME 15636
-
-#define SAY_AGGRO "Come to aid the Throne!"
-#define SAY_SLAY "Hail to the king, baby!"
-
-struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
-{
- boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HandOfThaurissan_Timer;
- uint32 AvatarOfFlame_Timer;
- //uint32 Counter;
-
- void Reset()
- {
- HandOfThaurissan_Timer = 4000;
- AvatarOfFlame_Timer = 25000;
- //Counter= 0;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (HandOfThaurissan_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_HANDOFTHAURISSAN);
-
- //3 Hands of Thaurissan will be casted
- //if (Counter < 3)
- //{
- // HandOfThaurissan_Timer = 1000;
- // Counter++;
- //}
- //else
- //{
- HandOfThaurissan_Timer = 5000;
- //Counter=0;
- //}
- }else HandOfThaurissan_Timer -= diff;
-
- //AvatarOfFlame_Timer
- if (AvatarOfFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_AVATAROFFLAME);
- AvatarOfFlame_Timer = 18000;
- }else AvatarOfFlame_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature)
-{
- return new boss_draganthaurissanAI (_Creature);
-}
-
-void AddSC_boss_draganthaurissan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_emperor_dagran_thaurissan";
- newscript->GetAI = GetAI_boss_draganthaurissan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Emperor_Dagran_Thaurissan
+SD%Complete: 99
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HANDOFTHAURISSAN 17492
+#define SPELL_AVATAROFFLAME 15636
+
+#define SAY_AGGRO "Come to aid the Throne!"
+#define SAY_SLAY "Hail to the king, baby!"
+
+struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
+{
+ boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HandOfThaurissan_Timer;
+ uint32 AvatarOfFlame_Timer;
+ //uint32 Counter;
+
+ void Reset()
+ {
+ HandOfThaurissan_Timer = 4000;
+ AvatarOfFlame_Timer = 25000;
+ //Counter= 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (HandOfThaurissan_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_HANDOFTHAURISSAN);
+
+ //3 Hands of Thaurissan will be casted
+ //if (Counter < 3)
+ //{
+ // HandOfThaurissan_Timer = 1000;
+ // Counter++;
+ //}
+ //else
+ //{
+ HandOfThaurissan_Timer = 5000;
+ //Counter=0;
+ //}
+ }else HandOfThaurissan_Timer -= diff;
+
+ //AvatarOfFlame_Timer
+ if (AvatarOfFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_AVATAROFFLAME);
+ AvatarOfFlame_Timer = 18000;
+ }else AvatarOfFlame_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature)
+{
+ return new boss_draganthaurissanAI (_Creature);
+}
+
+void AddSC_boss_draganthaurissan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_emperor_dagran_thaurissan";
+ newscript->GetAI = GetAI_boss_draganthaurissan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
index 1198596754d..0760bc65733 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
@@ -1,167 +1,167 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_General_Angerforge
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MIGHTYBLOW 14099
-#define SPELL_HAMSTRING 9080
-#define SPELL_CLEAVE 20691
-
-struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
-{
- boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MightyBlow_Timer;
- uint32 HamString_Timer;
- uint32 Cleave_Timer;
- uint32 Adds_Timer;
- bool Medics;
- int Rand1;
- int Rand1X;
- int Rand1Y;
- int Rand2;
- int Rand2X;
- int Rand2Y;
- Creature* SummonedAdds;
- Creature* SummonedMedics;
-
- void Reset()
- {
- MightyBlow_Timer = 8000;
- HamString_Timer = 12000;
- Cleave_Timer = 16000;
- Adds_Timer = 0;
- Medics = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonAdds(Unit* victim)
- {
- Rand1 = rand()%15;
- switch (rand()%2)
- {
- case 0: Rand1X = 0 - Rand1; break;
- case 1: Rand1X = 0 + Rand1; break;
- }
- Rand1 = 0;
- Rand1 = rand()%15;
- switch (rand()%2)
- {
- case 0: Rand1Y = 0 - Rand1; break;
- case 1: Rand1Y = 0 + Rand1; break;
- }
- Rand1 = 0;
- SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(SummonedAdds)
- ((CreatureAI*)SummonedAdds->AI())->AttackStart(victim);
- }
-
- void SummonMedics(Unit* victim)
- {
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2X = 0 - Rand2; break;
- case 1: Rand2X = 0 + Rand2; break;
- }
- Rand2 = 0;
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2Y = 0 - Rand2; break;
- case 1: Rand2Y = 0 + Rand2; break;
- }
- Rand2 = 0;
- SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(SummonedMedics)
- ((CreatureAI*)SummonedMedics->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MightyBlow_Timer
- if (MightyBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 18000;
- }else MightyBlow_Timer -= diff;
-
- //HamString_Timer
- if (HamString_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamString_Timer = 15000;
- }else HamString_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 9000;
- }else Cleave_Timer -= diff;
-
- //Adds_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
- {
- if (Adds_Timer < diff)
- {
- // summon 3 Adds every 25s
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
-
- Adds_Timer = 25000;
- } else Adds_Timer -= diff;
- }
-
- //Summon Medics
- if ( !Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
- {
- SummonMedics(m_creature->getVictim());
- SummonMedics(m_creature->getVictim());
- Medics = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_general_angerforge(Creature *_Creature)
-{
- return new boss_general_angerforgeAI (_Creature);
-}
-
-void AddSC_boss_general_angerforge()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_general_angerforge";
- newscript->GetAI = GetAI_boss_general_angerforge;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_General_Angerforge
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MIGHTYBLOW 14099
+#define SPELL_HAMSTRING 9080
+#define SPELL_CLEAVE 20691
+
+struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
+{
+ boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MightyBlow_Timer;
+ uint32 HamString_Timer;
+ uint32 Cleave_Timer;
+ uint32 Adds_Timer;
+ bool Medics;
+ int Rand1;
+ int Rand1X;
+ int Rand1Y;
+ int Rand2;
+ int Rand2X;
+ int Rand2Y;
+ Creature* SummonedAdds;
+ Creature* SummonedMedics;
+
+ void Reset()
+ {
+ MightyBlow_Timer = 8000;
+ HamString_Timer = 12000;
+ Cleave_Timer = 16000;
+ Adds_Timer = 0;
+ Medics = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonAdds(Unit* victim)
+ {
+ Rand1 = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: Rand1X = 0 - Rand1; break;
+ case 1: Rand1X = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ Rand1 = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: Rand1Y = 0 - Rand1; break;
+ case 1: Rand1Y = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(SummonedAdds)
+ ((CreatureAI*)SummonedAdds->AI())->AttackStart(victim);
+ }
+
+ void SummonMedics(Unit* victim)
+ {
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2X = 0 - Rand2; break;
+ case 1: Rand2X = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2Y = 0 - Rand2; break;
+ case 1: Rand2Y = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(SummonedMedics)
+ ((CreatureAI*)SummonedMedics->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 18000;
+ }else MightyBlow_Timer -= diff;
+
+ //HamString_Timer
+ if (HamString_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamString_Timer = 15000;
+ }else HamString_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 9000;
+ }else Cleave_Timer -= diff;
+
+ //Adds_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
+ {
+ if (Adds_Timer < diff)
+ {
+ // summon 3 Adds every 25s
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+
+ Adds_Timer = 25000;
+ } else Adds_Timer -= diff;
+ }
+
+ //Summon Medics
+ if ( !Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
+ {
+ SummonMedics(m_creature->getVictim());
+ SummonMedics(m_creature->getVictim());
+ Medics = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_general_angerforge(Creature *_Creature)
+{
+ return new boss_general_angerforgeAI (_Creature);
+}
+
+void AddSC_boss_general_angerforge()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_general_angerforge";
+ newscript->GetAI = GetAI_boss_general_angerforge;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
index 79647ea55ed..30caa104b31 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
@@ -1,142 +1,142 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gloomrel
-SD%Complete: 80
-SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event and re-spawn GO Spectral Chalice
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HAMSTRING 9080
-#define SPELL_CLEAVE 15579
-#define SPELL_MORTALSTRIKE 15708
-
-struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI
-{
- boss_gloomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HamString_Timer;
- uint32 Cleave_Timer;
- uint32 MortalStrike_Timer;
-
- void Reset()
- {
- HamString_Timer = 19000;
- Cleave_Timer = 6000;
- MortalStrike_Timer = 10000;
-
- m_creature->setFaction(734);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //HamString_Timer
- if (HamString_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamString_Timer = 14000;
- }else HamString_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 12000;
- }else MortalStrike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gloomrel(Creature *_Creature)
-{
- return new boss_gloomrelAI (_Creature);
-}
-
-bool GossipHello_boss_gloomrel(Player *player, Creature *_Creature)
-{
- if (player->GetQuestRewardStatus(4083) == 1 && player->GetSkillValue(SKILL_MINING) >= 230 && !player->HasSpell(14891) )
- player->ADD_GOSSIP_ITEM(0, "Teach me the art of smelting dark iron", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestRewardStatus(4083) == 0 && player->GetSkillValue(SKILL_MINING) >= 230)
- player->ADD_GOSSIP_ITEM(0, "I want to pay tribute", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->ADD_GOSSIP_ITEM(0, "Challenge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2602, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_boss_gloomrel(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2606, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 14894, false);
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(2604, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->CLOSE_GOSSIP_MENU();
- //re-spawn object here
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33);
- player->SEND_GOSSIP_MENU(2605, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+33:
- player->CLOSE_GOSSIP_MENU();
- //start event here, below code just temporary
- _Creature->setFaction(754);
- break;
- }
- return true;
-}
-
-void AddSC_boss_gloomrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gloomrel";
- newscript->GetAI = GetAI_boss_gloomrel;
- newscript->pGossipHello = &GossipHello_boss_gloomrel;
- newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gloomrel
+SD%Complete: 80
+SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event and re-spawn GO Spectral Chalice
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HAMSTRING 9080
+#define SPELL_CLEAVE 15579
+#define SPELL_MORTALSTRIKE 15708
+
+struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI
+{
+ boss_gloomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HamString_Timer;
+ uint32 Cleave_Timer;
+ uint32 MortalStrike_Timer;
+
+ void Reset()
+ {
+ HamString_Timer = 19000;
+ Cleave_Timer = 6000;
+ MortalStrike_Timer = 10000;
+
+ m_creature->setFaction(734);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //HamString_Timer
+ if (HamString_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamString_Timer = 14000;
+ }else HamString_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 12000;
+ }else MortalStrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gloomrel(Creature *_Creature)
+{
+ return new boss_gloomrelAI (_Creature);
+}
+
+bool GossipHello_boss_gloomrel(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestRewardStatus(4083) == 1 && player->GetSkillValue(SKILL_MINING) >= 230 && !player->HasSpell(14891) )
+ player->ADD_GOSSIP_ITEM(0, "Teach me the art of smelting dark iron", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if (player->GetQuestRewardStatus(4083) == 0 && player->GetSkillValue(SKILL_MINING) >= 230)
+ player->ADD_GOSSIP_ITEM(0, "I want to pay tribute", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->ADD_GOSSIP_ITEM(0, "Challenge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2602, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_boss_gloomrel(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(2606, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 14894, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(2604, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->CLOSE_GOSSIP_MENU();
+ //re-spawn object here
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33);
+ player->SEND_GOSSIP_MENU(2605, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+33:
+ player->CLOSE_GOSSIP_MENU();
+ //start event here, below code just temporary
+ _Creature->setFaction(754);
+ break;
+ }
+ return true;
+}
+
+void AddSC_boss_gloomrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gloomrel";
+ newscript->GetAI = GetAI_boss_gloomrel;
+ newscript->pGossipHello = &GossipHello_boss_gloomrel;
+ newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
index 9d3e3172569..91770069779 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
@@ -1,81 +1,81 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gorosh_the_Dervish
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WHIRLWIND 15589
-#define SPELL_MORTALSTRIKE 24573
-
-struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI
-{
- boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 MortalStrike_Timer;
-
- void Reset()
- {
- WhirlWind_Timer = 12000;
- MortalStrike_Timer = 22000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WhirlWind_Timer
- if (WhirlWind_Timer < diff)
- {
- DoCast(m_creature,SPELL_WHIRLWIND);
- WhirlWind_Timer = 15000;
- }else WhirlWind_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 15000;
- }else MortalStrike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gorosh_the_dervish(Creature *_Creature)
-{
- return new boss_gorosh_the_dervishAI (_Creature);
-}
-
-void AddSC_boss_gorosh_the_dervish()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gorosh_the_dervish";
- newscript->GetAI = GetAI_boss_gorosh_the_dervish;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gorosh_the_Dervish
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WHIRLWIND 15589
+#define SPELL_MORTALSTRIKE 24573
+
+struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI
+{
+ boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 MortalStrike_Timer;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 12000;
+ MortalStrike_Timer = 22000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WhirlWind_Timer
+ if (WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_WHIRLWIND);
+ WhirlWind_Timer = 15000;
+ }else WhirlWind_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 15000;
+ }else MortalStrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gorosh_the_dervish(Creature *_Creature)
+{
+ return new boss_gorosh_the_dervishAI (_Creature);
+}
+
+void AddSC_boss_gorosh_the_dervish()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gorosh_the_dervish";
+ newscript->GetAI = GetAI_boss_gorosh_the_dervish;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
index db9a66a0ea3..7e489cca5a7 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
@@ -1,86 +1,86 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grizzle
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_GROUNDTREMOR 6524
-#define SPELL_FRENZY 28371
-
-struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
-{
- boss_grizzleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GroundTremor_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- GroundTremor_Timer = 12000;
- Frenzy_Timer =0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //GroundTremor_Timer
- if (GroundTremor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GROUNDTREMOR);
- GroundTremor_Timer = 8000;
- }else GroundTremor_Timer -= diff;
-
- //Frenzy_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
-
- Frenzy_Timer = 15000;
- }else Frenzy_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_grizzle(Creature *_Creature)
-{
- return new boss_grizzleAI (_Creature);
-}
-
-void AddSC_boss_grizzle()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_grizzle";
- newscript->GetAI = GetAI_boss_grizzle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grizzle
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_GROUNDTREMOR 6524
+#define SPELL_FRENZY 28371
+
+struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
+{
+ boss_grizzleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GroundTremor_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ GroundTremor_Timer = 12000;
+ Frenzy_Timer =0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //GroundTremor_Timer
+ if (GroundTremor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GROUNDTREMOR);
+ GroundTremor_Timer = 8000;
+ }else GroundTremor_Timer -= diff;
+
+ //Frenzy_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote("goes into a killing frenzy!",NULL);
+
+ Frenzy_Timer = 15000;
+ }else Frenzy_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_grizzle(Creature *_Creature)
+{
+ return new boss_grizzleAI (_Creature);
+}
+
+void AddSC_boss_grizzle()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_grizzle";
+ newscript->GetAI = GetAI_boss_grizzle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
index dc6c834bc8f..778c68f73d3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
@@ -1,105 +1,105 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Haterel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLT 17483 //Not sure if right ID
-#define SPELL_MANABURN 10876
-#define SPELL_SHADOWSHIELD 22417
-#define SPELL_STRIKE 15580
-
-struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI
-{
- boss_haterelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 ManaBurn_Timer;
- uint32 ShadowShield_Timer;
- uint32 Strike_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 15000;
- ManaBurn_Timer = 3000;
- ShadowShield_Timer = 8000;
- Strike_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 7000;
- }else ShadowBolt_Timer -= diff;
-
- //ManaBurn_Timer
- if (ManaBurn_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_MANABURN);
- ManaBurn_Timer = 13000;
- }else ManaBurn_Timer -= diff;
-
- //ShadowShield_Timer
- if (ShadowShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWSHIELD);
- ShadowShield_Timer = 25000;
- }else ShadowShield_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_haterel(Creature *_Creature)
-{
- return new boss_haterelAI (_Creature);
-}
-
-void AddSC_boss_haterel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_haterel";
- newscript->GetAI = GetAI_boss_haterel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Haterel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLT 17483 //Not sure if right ID
+#define SPELL_MANABURN 10876
+#define SPELL_SHADOWSHIELD 22417
+#define SPELL_STRIKE 15580
+
+struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI
+{
+ boss_haterelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 ShadowShield_Timer;
+ uint32 Strike_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 15000;
+ ManaBurn_Timer = 3000;
+ ShadowShield_Timer = 8000;
+ Strike_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 7000;
+ }else ShadowBolt_Timer -= diff;
+
+ //ManaBurn_Timer
+ if (ManaBurn_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_MANABURN);
+ ManaBurn_Timer = 13000;
+ }else ManaBurn_Timer -= diff;
+
+ //ShadowShield_Timer
+ if (ShadowShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWSHIELD);
+ ShadowShield_Timer = 25000;
+ }else ShadowShield_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_haterel(Creature *_Creature)
+{
+ return new boss_haterelAI (_Creature);
+}
+
+void AddSC_boss_haterel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_haterel";
+ newscript->GetAI = GetAI_boss_haterel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
index 6831ecf006e..8ee1a00c85b 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
@@ -1,105 +1,105 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_Interrogator_Gerstahn
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWWORDPAIN 10894
-#define SPELL_MANABURN 10876
-#define SPELL_PSYCHICSCREAM 8122
-#define SPELL_SHADOWSHIELD 22417
-
-struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
-{
- boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowWordPain_Timer;
- uint32 ManaBurn_Timer;
- uint32 PsychicScream_Timer;
- uint32 ShadowShield_Timer;
-
- void Reset()
- {
- ShadowWordPain_Timer = 4000;
- ManaBurn_Timer = 14000;
- PsychicScream_Timer = 32000;
- ShadowShield_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 7000;
- }else ShadowWordPain_Timer -= diff;
-
- //ManaBurn_Timer
- if (ManaBurn_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_MANABURN);
- ManaBurn_Timer = 10000;
- }else ManaBurn_Timer -= diff;
-
- //PsychicScream_Timer
- if (PsychicScream_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
- PsychicScream_Timer = 30000;
- }else PsychicScream_Timer -= diff;
-
- //ShadowShield_Timer
- if (ShadowShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWSHIELD);
- ShadowShield_Timer = 25000;
- }else ShadowShield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature *_Creature)
-{
- return new boss_high_interrogator_gerstahnAI (_Creature);
-}
-
-void AddSC_boss_high_interrogator_gerstahn()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_high_interrogator_gerstahn";
- newscript->GetAI = GetAI_boss_high_interrogator_gerstahn;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_Interrogator_Gerstahn
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWWORDPAIN 10894
+#define SPELL_MANABURN 10876
+#define SPELL_PSYCHICSCREAM 8122
+#define SPELL_SHADOWSHIELD 22417
+
+struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
+{
+ boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowWordPain_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 PsychicScream_Timer;
+ uint32 ShadowShield_Timer;
+
+ void Reset()
+ {
+ ShadowWordPain_Timer = 4000;
+ ManaBurn_Timer = 14000;
+ PsychicScream_Timer = 32000;
+ ShadowShield_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 7000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //ManaBurn_Timer
+ if (ManaBurn_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_MANABURN);
+ ManaBurn_Timer = 10000;
+ }else ManaBurn_Timer -= diff;
+
+ //PsychicScream_Timer
+ if (PsychicScream_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
+ PsychicScream_Timer = 30000;
+ }else PsychicScream_Timer -= diff;
+
+ //ShadowShield_Timer
+ if (ShadowShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWSHIELD);
+ ShadowShield_Timer = 25000;
+ }else ShadowShield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature *_Creature)
+{
+ return new boss_high_interrogator_gerstahnAI (_Creature);
+}
+
+void AddSC_boss_high_interrogator_gerstahn()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_high_interrogator_gerstahn";
+ newscript->GetAI = GetAI_boss_high_interrogator_gerstahn;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
index c617f36dc05..0d163d31775 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
@@ -1,84 +1,84 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Magmus
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIERYBURST 13900
-#define SPELL_WARSTOMP 24375
-
-struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
-{
- boss_magmusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FieryBurst_Timer;
- uint32 WarStomp_Timer;
-
- void Reset()
- {
- FieryBurst_Timer = 5000;
- WarStomp_Timer =0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FieryBurst_Timer
- if (FieryBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIERYBURST);
- FieryBurst_Timer = 6000;
- }else FieryBurst_Timer -= diff;
-
- //WarStomp_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 8000;
- }else WarStomp_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_magmus(Creature *_Creature)
-{
- return new boss_magmusAI (_Creature);
-}
-
-void AddSC_boss_magmus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_magmus";
- newscript->GetAI = GetAI_boss_magmus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Magmus
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIERYBURST 13900
+#define SPELL_WARSTOMP 24375
+
+struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
+{
+ boss_magmusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FieryBurst_Timer;
+ uint32 WarStomp_Timer;
+
+ void Reset()
+ {
+ FieryBurst_Timer = 5000;
+ WarStomp_Timer =0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FieryBurst_Timer
+ if (FieryBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIERYBURST);
+ FieryBurst_Timer = 6000;
+ }else FieryBurst_Timer -= diff;
+
+ //WarStomp_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 8000;
+ }else WarStomp_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_magmus(Creature *_Creature)
+{
+ return new boss_magmusAI (_Creature);
+}
+
+void AddSC_boss_magmus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_magmus";
+ newscript->GetAI = GetAI_boss_magmus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
index d3dd3ddeae0..208353e66f3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
@@ -1,99 +1,99 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Moira_Bronzbeard
-SD%Complete: 90
-SDComment: Healing of Emperor NYI
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HEAL 10917
-#define SPELL_RENEW 10929
-#define SPELL_SHIELD 10901
-#define SPELL_MINDBLAST 10947
-#define SPELL_SHADOWWORDPAIN 10894
-#define SPELL_SMITE 10934
-
-struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
-{
- boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Heal_Timer;
- uint32 MindBlast_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 Smite_Timer;
- Unit* PlayerHolder;
- Unit* Target;
- bool Heal;
-
- void Reset()
- {
- Target = NULL;
- Heal_Timer = 12000; //These times are probably wrong
- MindBlast_Timer = 16000;
- ShadowWordPain_Timer = 2000;
- Smite_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MindBlast_Timer
- if (MindBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- MindBlast_Timer = 14000;
- }else MindBlast_Timer -= diff;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 18000;
- }else ShadowWordPain_Timer -= diff;
-
- //Smite_Timer
- if (Smite_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SMITE);
- Smite_Timer = 10000;
- }else Smite_Timer -= diff;
-
- }
-};
-CreatureAI* GetAI_boss_moira_bronzebeard(Creature *_Creature)
-{
- return new boss_moira_bronzebeardAI (_Creature);
-}
-
-void AddSC_boss_moira_bronzebeard()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_moira_bronzebeard";
- newscript->GetAI = GetAI_boss_moira_bronzebeard;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Moira_Bronzbeard
+SD%Complete: 90
+SDComment: Healing of Emperor NYI
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HEAL 10917
+#define SPELL_RENEW 10929
+#define SPELL_SHIELD 10901
+#define SPELL_MINDBLAST 10947
+#define SPELL_SHADOWWORDPAIN 10894
+#define SPELL_SMITE 10934
+
+struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
+{
+ boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Heal_Timer;
+ uint32 MindBlast_Timer;
+ uint32 ShadowWordPain_Timer;
+ uint32 Smite_Timer;
+ Unit* PlayerHolder;
+ Unit* Target;
+ bool Heal;
+
+ void Reset()
+ {
+ Target = NULL;
+ Heal_Timer = 12000; //These times are probably wrong
+ MindBlast_Timer = 16000;
+ ShadowWordPain_Timer = 2000;
+ Smite_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MindBlast_Timer
+ if (MindBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ MindBlast_Timer = 14000;
+ }else MindBlast_Timer -= diff;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 18000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //Smite_Timer
+ if (Smite_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SMITE);
+ Smite_Timer = 10000;
+ }else Smite_Timer -= diff;
+
+ }
+};
+CreatureAI* GetAI_boss_moira_bronzebeard(Creature *_Creature)
+{
+ return new boss_moira_bronzebeardAI (_Creature);
+}
+
+void AddSC_boss_moira_bronzebeard()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_moira_bronzebeard";
+ newscript->GetAI = GetAI_boss_moira_bronzebeard;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
index bed39db9a04..93f3c124f29 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
@@ -1,115 +1,115 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Seethrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTBOLT 16799
-#define SPELL_FROSTARMOR 15784 //This is actually a buff he gives himself
-#define SPELL_BLIZZARD 19099
-#define SPELL_FROSTNOVA 15063
-#define SPELL_FROSTWARD 15004
-
-struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI
-{
- boss_seethrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FrostArmor_Timer;
- uint32 Frostbolt_Timer;
- uint32 Blizzard_Timer;
- uint32 FrostNova_Timer;
- uint32 FrostWard_Timer;
-
- void Reset()
- {
- FrostArmor_Timer = 2000;
- Frostbolt_Timer = 6000;
- Blizzard_Timer = 18000;
- FrostNova_Timer = 12000;
- FrostWard_Timer = 25000;
-
- m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FrostArmor_Timer
- if (FrostArmor_Timer < diff)
- {
- DoCast(m_creature, SPELL_FROSTARMOR);
- FrostArmor_Timer = 180000;
- }else FrostArmor_Timer -= diff;
-
- //Frostbolt_Timer
- if (Frostbolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- Frostbolt_Timer = 15000;
- }else Frostbolt_Timer -= diff;
-
- //Blizzard_Timer
- if (Blizzard_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_BLIZZARD);
- Blizzard_Timer = 22000;
- }else Blizzard_Timer -= diff;
-
- //FrostNova_Timer
- if (FrostNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
- FrostNova_Timer = 14000;
- }else FrostNova_Timer -= diff;
-
- //FrostWard_Timer
- if (FrostWard_Timer < diff)
- {
- DoCast(m_creature,SPELL_FROSTWARD);
- FrostWard_Timer = 68000;
- }else FrostWard_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_seethrel(Creature *_Creature)
-{
- return new boss_seethrelAI (_Creature);
-}
-
-void AddSC_boss_seethrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_seethrel";
- newscript->GetAI = GetAI_boss_seethrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Seethrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTBOLT 16799
+#define SPELL_FROSTARMOR 15784 //This is actually a buff he gives himself
+#define SPELL_BLIZZARD 19099
+#define SPELL_FROSTNOVA 15063
+#define SPELL_FROSTWARD 15004
+
+struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI
+{
+ boss_seethrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FrostArmor_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 Blizzard_Timer;
+ uint32 FrostNova_Timer;
+ uint32 FrostWard_Timer;
+
+ void Reset()
+ {
+ FrostArmor_Timer = 2000;
+ Frostbolt_Timer = 6000;
+ Blizzard_Timer = 18000;
+ FrostNova_Timer = 12000;
+ FrostWard_Timer = 25000;
+
+ m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FrostArmor_Timer
+ if (FrostArmor_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_FROSTARMOR);
+ FrostArmor_Timer = 180000;
+ }else FrostArmor_Timer -= diff;
+
+ //Frostbolt_Timer
+ if (Frostbolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ Frostbolt_Timer = 15000;
+ }else Frostbolt_Timer -= diff;
+
+ //Blizzard_Timer
+ if (Blizzard_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_BLIZZARD);
+ Blizzard_Timer = 22000;
+ }else Blizzard_Timer -= diff;
+
+ //FrostNova_Timer
+ if (FrostNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
+ FrostNova_Timer = 14000;
+ }else FrostNova_Timer -= diff;
+
+ //FrostWard_Timer
+ if (FrostWard_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FROSTWARD);
+ FrostWard_Timer = 68000;
+ }else FrostWard_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_seethrel(Creature *_Creature)
+{
+ return new boss_seethrelAI (_Creature);
+}
+
+void AddSC_boss_seethrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_seethrel";
+ newscript->GetAI = GetAI_boss_seethrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
index f9b8a68adc7..0ecf70148fe 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
@@ -1,101 +1,101 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vilerel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MINDBLAST 15587
-#define SPELL_HEAL 15586
-#define SPELL_PRAYEROFHEALING 15585
-#define SPELL_SHIELD 10901
-
-struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI
-{
- boss_vilerelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MindBlast_Timer;
- uint32 Heal_Timer;
- uint32 PrayerOfHealing_Timer;
- uint32 Shield_Timer;
-
- void Reset()
- {
- MindBlast_Timer = 10000;
- Heal_Timer = 35000;
- PrayerOfHealing_Timer = 25000;
- Shield_Timer = 3000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MindBlast_Timer
- if (MindBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- MindBlast_Timer = 7000;
- }else MindBlast_Timer -= diff;
-
- //Heal_Timer
- if (Heal_Timer < diff)
- {
- DoCast(m_creature,SPELL_HEAL);
- Heal_Timer = 20000;
- }else Heal_Timer -= diff;
-
- //PrayerOfHealing_Timer
- if (PrayerOfHealing_Timer < diff)
- {
- DoCast(m_creature,SPELL_PRAYEROFHEALING);
- PrayerOfHealing_Timer = 30000;
- }else PrayerOfHealing_Timer -= diff;
-
- //Shield_Timer
- if (Shield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELD);
- Shield_Timer = 30000;
- }else Shield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_vilerel(Creature *_Creature)
-{
- return new boss_vilerelAI (_Creature);
-}
-
-void AddSC_boss_vilerel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_vilerel";
- newscript->GetAI = GetAI_boss_vilerel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vilerel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MINDBLAST 15587
+#define SPELL_HEAL 15586
+#define SPELL_PRAYEROFHEALING 15585
+#define SPELL_SHIELD 10901
+
+struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI
+{
+ boss_vilerelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MindBlast_Timer;
+ uint32 Heal_Timer;
+ uint32 PrayerOfHealing_Timer;
+ uint32 Shield_Timer;
+
+ void Reset()
+ {
+ MindBlast_Timer = 10000;
+ Heal_Timer = 35000;
+ PrayerOfHealing_Timer = 25000;
+ Shield_Timer = 3000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MindBlast_Timer
+ if (MindBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ MindBlast_Timer = 7000;
+ }else MindBlast_Timer -= diff;
+
+ //Heal_Timer
+ if (Heal_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_HEAL);
+ Heal_Timer = 20000;
+ }else Heal_Timer -= diff;
+
+ //PrayerOfHealing_Timer
+ if (PrayerOfHealing_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_PRAYEROFHEALING);
+ PrayerOfHealing_Timer = 30000;
+ }else PrayerOfHealing_Timer -= diff;
+
+ //Shield_Timer
+ if (Shield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELD);
+ Shield_Timer = 30000;
+ }else Shield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_vilerel(Creature *_Creature)
+{
+ return new boss_vilerelAI (_Creature);
+}
+
+void AddSC_boss_vilerel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_vilerel";
+ newscript->GetAI = GetAI_boss_vilerel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
index d9231f50f21..c26ba2ed6b9 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
@@ -1,101 +1,101 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Drakkisath
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIRENOVA 23462
-#define SPELL_CLEAVE 20691
-#define SPELL_CONFLIGURATION 16805
-#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
-
-struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
-{
- boss_drakkisathAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireNova_Timer;
- uint32 Cleave_Timer;
- uint32 Confliguration_Timer;
- uint32 Thunderclap_Timer;
-
- void Reset()
- {
- FireNova_Timer = 6000;
- Cleave_Timer = 8000;
- Confliguration_Timer = 15000;
- Thunderclap_Timer = 17000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 10000;
- }else FireNova_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //Confliguration_Timer
- if (Confliguration_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION);
- Confliguration_Timer = 18000;
- }else Confliguration_Timer -= diff;
-
- //Thunderclap_Timer
- if (Thunderclap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- Thunderclap_Timer = 20000;
- }else Thunderclap_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_drakkisath(Creature *_Creature)
-{
- return new boss_drakkisathAI (_Creature);
-}
-
-void AddSC_boss_drakkisath()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_drakkisath";
- newscript->GetAI = GetAI_boss_drakkisath;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Drakkisath
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIRENOVA 23462
+#define SPELL_CLEAVE 20691
+#define SPELL_CONFLIGURATION 16805
+#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
+
+struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
+{
+ boss_drakkisathAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireNova_Timer;
+ uint32 Cleave_Timer;
+ uint32 Confliguration_Timer;
+ uint32 Thunderclap_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 6000;
+ Cleave_Timer = 8000;
+ Confliguration_Timer = 15000;
+ Thunderclap_Timer = 17000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 10000;
+ }else FireNova_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //Confliguration_Timer
+ if (Confliguration_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION);
+ Confliguration_Timer = 18000;
+ }else Confliguration_Timer -= diff;
+
+ //Thunderclap_Timer
+ if (Thunderclap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ Thunderclap_Timer = 20000;
+ }else Thunderclap_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_drakkisath(Creature *_Creature)
+{
+ return new boss_drakkisathAI (_Creature);
+}
+
+void AddSC_boss_drakkisath()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_drakkisath";
+ newscript->GetAI = GetAI_boss_drakkisath;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
index bc6100579a6..68107e820bf 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
@@ -1,205 +1,205 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gyth
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CORROSIVEACID 20667
-#define SPELL_FREEZE 18763
-#define SPELL_FLAMEBREATH 20712
-
-struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
-{
- boss_gythAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Aggro_Timer;
- uint32 Dragons_Timer;
- uint32 Orc_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 Freeze_Timer;
- uint32 Flamebreath_Timer;
- uint32 Line1Count;
- uint32 Line2Count;
-
- bool Event;
- bool SummonedDragons;
- bool SummonedOrcs;
- bool SummonedRend;
- bool bAggro;
- bool RootSelf;
- Creature *SummonedCreature;
-
- void Reset()
- {
- Dragons_Timer = 3000;
- Orc_Timer = 60000;
- Aggro_Timer = 60000;
- CorrosiveAcid_Timer = 8000;
- Freeze_Timer = 11000;
- Flamebreath_Timer = 4000;
- Event = false;
- SummonedDragons = false;
- SummonedOrcs= false;
- SummonedRend = false;
- bAggro = false;
- RootSelf = false;
-
- // how many times should the two lines of summoned creatures be spawned
- // min 2 x 2, max 7 lines of attack in total
- Line1Count = rand() % 4 + 2;
- if (Line1Count < 5)
- Line2Count = rand() % (5 - Line1Count) + 2;
- else
- Line2Count = 2;
-
- //Invisible for event start
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- 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);
- if (Summoned)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (target)
- Summoned->AddThreat(target, 1.0f);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //char buf[200];
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (!RootSelf)
- {
- //m_creature->m_canMove = true;
- DoCast(m_creature, 33356);
- RootSelf = true;
- }
-
- if (!bAggro && Line1Count == 0 && Line2Count == 0)
- {
- if (Aggro_Timer < diff)
- {
- bAggro = true;
- // Visible now!
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9723);
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- } else Aggro_Timer -= diff;
- }
-
- // Summon Dragon pack. 2 Dragons and 3 Whelps
- if (!bAggro && !SummonedRend && Line1Count > 0)
- {
- if (Dragons_Timer < diff)
- {
- SummonCreatureWithRandomTarget(10372);
- SummonCreatureWithRandomTarget(10372);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- Line1Count = Line1Count - 1;
- Dragons_Timer = 60000;
- } else Dragons_Timer -= diff;
- }
-
- //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
- if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
- {
- if (Orc_Timer < diff)
- {
- SummonCreatureWithRandomTarget(10447);
- SummonCreatureWithRandomTarget(10317);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- Line2Count = Line2Count - 1;
- Orc_Timer = 60000;
- } else Orc_Timer -= diff;
- }
-
- // we take part in the fight
- if (bAggro)
- {
- // CorrosiveAcid_Timer
- if (CorrosiveAcid_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
- CorrosiveAcid_Timer = 7000;
- } else CorrosiveAcid_Timer -= diff;
-
- // Freeze_Timer
- if (Freeze_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FREEZE);
- Freeze_Timer = 16000;
- } else Freeze_Timer -= diff;
-
- // Flamebreath_Timer
- if (Flamebreath_Timer < diff)
- {
- DoCast(m_creature->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 )
- {
- //summon Rend and Change model to normal Gyth
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- //Gyth model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9806);
- m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
- SummonedRend = true;
- }
-
- DoMeleeAttackIfReady();
- } // end if Aggro
- }
-};
-
-CreatureAI* GetAI_boss_gyth(Creature *_Creature)
-{
- return new boss_gythAI (_Creature);
-}
-
-void AddSC_boss_gyth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gyth";
- newscript->GetAI = GetAI_boss_gyth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gyth
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CORROSIVEACID 20667
+#define SPELL_FREEZE 18763
+#define SPELL_FLAMEBREATH 20712
+
+struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
+{
+ boss_gythAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Aggro_Timer;
+ uint32 Dragons_Timer;
+ uint32 Orc_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 Freeze_Timer;
+ uint32 Flamebreath_Timer;
+ uint32 Line1Count;
+ uint32 Line2Count;
+
+ bool Event;
+ bool SummonedDragons;
+ bool SummonedOrcs;
+ bool SummonedRend;
+ bool bAggro;
+ bool RootSelf;
+ Creature *SummonedCreature;
+
+ void Reset()
+ {
+ Dragons_Timer = 3000;
+ Orc_Timer = 60000;
+ Aggro_Timer = 60000;
+ CorrosiveAcid_Timer = 8000;
+ Freeze_Timer = 11000;
+ Flamebreath_Timer = 4000;
+ Event = false;
+ SummonedDragons = false;
+ SummonedOrcs= false;
+ SummonedRend = false;
+ bAggro = false;
+ RootSelf = false;
+
+ // how many times should the two lines of summoned creatures be spawned
+ // min 2 x 2, max 7 lines of attack in total
+ Line1Count = rand() % 4 + 2;
+ if (Line1Count < 5)
+ Line2Count = rand() % (5 - Line1Count) + 2;
+ else
+ Line2Count = 2;
+
+ //Invisible for event start
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ 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);
+ if (Summoned)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (target)
+ Summoned->AddThreat(target, 1.0f);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //char buf[200];
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (!RootSelf)
+ {
+ //m_creature->m_canMove = true;
+ DoCast(m_creature, 33356);
+ RootSelf = true;
+ }
+
+ if (!bAggro && Line1Count == 0 && Line2Count == 0)
+ {
+ if (Aggro_Timer < diff)
+ {
+ bAggro = true;
+ // Visible now!
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9723);
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ } else Aggro_Timer -= diff;
+ }
+
+ // Summon Dragon pack. 2 Dragons and 3 Whelps
+ if (!bAggro && !SummonedRend && Line1Count > 0)
+ {
+ if (Dragons_Timer < diff)
+ {
+ SummonCreatureWithRandomTarget(10372);
+ SummonCreatureWithRandomTarget(10372);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ Line1Count = Line1Count - 1;
+ Dragons_Timer = 60000;
+ } else Dragons_Timer -= diff;
+ }
+
+ //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
+ if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
+ {
+ if (Orc_Timer < diff)
+ {
+ SummonCreatureWithRandomTarget(10447);
+ SummonCreatureWithRandomTarget(10317);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ Line2Count = Line2Count - 1;
+ Orc_Timer = 60000;
+ } else Orc_Timer -= diff;
+ }
+
+ // we take part in the fight
+ if (bAggro)
+ {
+ // CorrosiveAcid_Timer
+ if (CorrosiveAcid_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
+ CorrosiveAcid_Timer = 7000;
+ } else CorrosiveAcid_Timer -= diff;
+
+ // Freeze_Timer
+ if (Freeze_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FREEZE);
+ Freeze_Timer = 16000;
+ } else Freeze_Timer -= diff;
+
+ // Flamebreath_Timer
+ if (Flamebreath_Timer < diff)
+ {
+ DoCast(m_creature->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 )
+ {
+ //summon Rend and Change model to normal Gyth
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ //Gyth model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9806);
+ m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
+ SummonedRend = true;
+ }
+
+ DoMeleeAttackIfReady();
+ } // end if Aggro
+ }
+};
+
+CreatureAI* GetAI_boss_gyth(Creature *_Creature)
+{
+ return new boss_gythAI (_Creature);
+}
+
+void AddSC_boss_gyth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gyth";
+ newscript->GetAI = GetAI_boss_gyth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
index 0cd834fa7c9..0b2c09acccf 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
@@ -1,95 +1,95 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Halycon
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CROWDPUMMEL 10887
-#define SPELL_MIGHTYBLOW 14099
-
-#define ADD_1X -169.839203
-#define ADD_1Y -324.961395
-#define ADD_1Z 64.401443
-#define ADD_1O 3.124724
-
-struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI
-{
- boss_halyconAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CrowdPummel_Timer;
- uint32 MightyBlow_Timer;
- bool Summoned;
-
- void Reset()
- {
- CrowdPummel_Timer = 8000;
- MightyBlow_Timer = 14000;
- Summoned = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //CrowdPummel_Timer
- if (CrowdPummel_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
- CrowdPummel_Timer = 14000;
- }else CrowdPummel_Timer -= diff;
-
- //MightyBlow_Timer
- if (MightyBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 10000;
- }else MightyBlow_Timer -= diff;
-
- //Summon Gizrul
- if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
- {
- m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
- Summoned = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_halycon(Creature *_Creature)
-{
- return new boss_halyconAI (_Creature);
-}
-
-void AddSC_boss_halycon()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_halycon";
- newscript->GetAI = GetAI_boss_halycon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Halycon
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CROWDPUMMEL 10887
+#define SPELL_MIGHTYBLOW 14099
+
+#define ADD_1X -169.839203
+#define ADD_1Y -324.961395
+#define ADD_1Z 64.401443
+#define ADD_1O 3.124724
+
+struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI
+{
+ boss_halyconAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CrowdPummel_Timer;
+ uint32 MightyBlow_Timer;
+ bool Summoned;
+
+ void Reset()
+ {
+ CrowdPummel_Timer = 8000;
+ MightyBlow_Timer = 14000;
+ Summoned = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //CrowdPummel_Timer
+ if (CrowdPummel_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
+ CrowdPummel_Timer = 14000;
+ }else CrowdPummel_Timer -= diff;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 10000;
+ }else MightyBlow_Timer -= diff;
+
+ //Summon Gizrul
+ if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
+ {
+ m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ Summoned = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_halycon(Creature *_Creature)
+{
+ return new boss_halyconAI (_Creature);
+}
+
+void AddSC_boss_halycon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_halycon";
+ newscript->GetAI = GetAI_boss_halycon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
index cf20cf422c6..afaedcc4ad8 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
@@ -1,131 +1,131 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Highlord_Omokk
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WARSTOMP 24375
-#define SPELL_CLEAVE 15579
-#define SPELL_STRIKE 18368
-#define SPELL_REND 18106
-#define SPELL_SUNDERARMOR 24317
-#define SPELL_KNOCKAWAY 20686
-#define SPELL_SLOW 22356
-
-struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
-{
- boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WarStomp_Timer;
- uint32 Cleave_Timer;
- uint32 Strike_Timer;
- uint32 Rend_Timer;
- uint32 SunderArmor_Timer;
- uint32 KnockAway_Timer;
- uint32 Slow_Timer;
-
- void Reset()
- {
- WarStomp_Timer = 15000;
- Cleave_Timer = 6000;
- Strike_Timer = 10000;
- Rend_Timer = 14000;
- SunderArmor_Timer = 2000;
- KnockAway_Timer = 18000;
- Slow_Timer = 24000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WarStomp_Timer
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 14000;
- }else WarStomp_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- //Rend_Timer
- if (Rend_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REND);
- Rend_Timer = 18000;
- }else Rend_Timer -= diff;
-
- //SunderArmor_Timer
- if (SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
- SunderArmor_Timer = 25000;
- }else SunderArmor_Timer -= diff;
-
- //KnockAway_Timer
- if (KnockAway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- KnockAway_Timer = 12000;
- }else KnockAway_Timer -= diff;
-
- //Slow_Timer
- if (Slow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLOW);
- Slow_Timer = 18000;
- }else Slow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_highlordomokk(Creature *_Creature)
-{
- return new boss_highlordomokkAI (_Creature);
-}
-
-void AddSC_boss_highlordomokk()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_highlord_omokk";
- newscript->GetAI = GetAI_boss_highlordomokk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Highlord_Omokk
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WARSTOMP 24375
+#define SPELL_CLEAVE 15579
+#define SPELL_STRIKE 18368
+#define SPELL_REND 18106
+#define SPELL_SUNDERARMOR 24317
+#define SPELL_KNOCKAWAY 20686
+#define SPELL_SLOW 22356
+
+struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
+{
+ boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WarStomp_Timer;
+ uint32 Cleave_Timer;
+ uint32 Strike_Timer;
+ uint32 Rend_Timer;
+ uint32 SunderArmor_Timer;
+ uint32 KnockAway_Timer;
+ uint32 Slow_Timer;
+
+ void Reset()
+ {
+ WarStomp_Timer = 15000;
+ Cleave_Timer = 6000;
+ Strike_Timer = 10000;
+ Rend_Timer = 14000;
+ SunderArmor_Timer = 2000;
+ KnockAway_Timer = 18000;
+ Slow_Timer = 24000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WarStomp_Timer
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 14000;
+ }else WarStomp_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ //Rend_Timer
+ if (Rend_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REND);
+ Rend_Timer = 18000;
+ }else Rend_Timer -= diff;
+
+ //SunderArmor_Timer
+ if (SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 25000;
+ }else SunderArmor_Timer -= diff;
+
+ //KnockAway_Timer
+ if (KnockAway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ KnockAway_Timer = 12000;
+ }else KnockAway_Timer -= diff;
+
+ //Slow_Timer
+ if (Slow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLOW);
+ Slow_Timer = 18000;
+ }else Slow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_highlordomokk(Creature *_Creature)
+{
+ return new boss_highlordomokkAI (_Creature);
+}
+
+void AddSC_boss_highlordomokk()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_highlord_omokk";
+ newscript->GetAI = GetAI_boss_highlordomokk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
index 0c77b2f4658..8c1d3096597 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
@@ -1,86 +1,86 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mother_Smolderweb
-SD%Complete: 100
-SDComment: Uncertain how often mother's milk is casted
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CRYSTALIZE 16104
-#define SPELL_MOTHERSMILK 16468
-#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
-
-struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI
-{
- boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Crystalize_Timer;
- uint32 MothersMilk_Timer;
-
- void Reset()
- {
- Crystalize_Timer = 20000;
- MothersMilk_Timer = 10000;
- }
-
- void Aggro(Unit *who) { }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( m_creature->GetHealth() <= damage )
- m_creature->CastSpell(m_creature,SPELL_SUMMON_SPIRE_SPIDERLING,true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Crystalize_Timer
- if( Crystalize_Timer < diff )
- {
- DoCast(m_creature,SPELL_CRYSTALIZE);
- Crystalize_Timer = 15000;
- }else Crystalize_Timer -= diff;
-
- //MothersMilk_Timer
- if( MothersMilk_Timer < diff )
- {
- DoCast(m_creature,SPELL_MOTHERSMILK);
- MothersMilk_Timer = 5000+rand()%7500;
- }else MothersMilk_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_mothersmolderweb(Creature *_Creature)
-{
- return new boss_mothersmolderwebAI (_Creature);
-}
-
-void AddSC_boss_mothersmolderweb()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_mother_smolderweb";
- newscript->GetAI = GetAI_boss_mothersmolderweb;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mother_Smolderweb
+SD%Complete: 100
+SDComment: Uncertain how often mother's milk is casted
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CRYSTALIZE 16104
+#define SPELL_MOTHERSMILK 16468
+#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
+
+struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI
+{
+ boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Crystalize_Timer;
+ uint32 MothersMilk_Timer;
+
+ void Reset()
+ {
+ Crystalize_Timer = 20000;
+ MothersMilk_Timer = 10000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( m_creature->GetHealth() <= damage )
+ m_creature->CastSpell(m_creature,SPELL_SUMMON_SPIRE_SPIDERLING,true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Crystalize_Timer
+ if( Crystalize_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_CRYSTALIZE);
+ Crystalize_Timer = 15000;
+ }else Crystalize_Timer -= diff;
+
+ //MothersMilk_Timer
+ if( MothersMilk_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_MOTHERSMILK);
+ MothersMilk_Timer = 5000+rand()%7500;
+ }else MothersMilk_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_mothersmolderweb(Creature *_Creature)
+{
+ return new boss_mothersmolderwebAI (_Creature);
+}
+
+void AddSC_boss_mothersmolderweb()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_mother_smolderweb";
+ newscript->GetAI = GetAI_boss_mothersmolderweb;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
index d805d3d13f5..5ab5847e38a 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
@@ -1,127 +1,127 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Overlord_Wyrmthalak
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_BLASTWAVE 11130
-#define SPELL_SHOUT 23511
-#define SPELL_CLEAVE 20691
-#define SPELL_KNOCKAWAY 20686
-
-#define ADD_1X -39.355381
-#define ADD_1Y -513.456482
-#define ADD_1Z 88.472046
-#define ADD_1O 4.679872
-
-#define ADD_2X -49.875881
-#define ADD_2Y -511.896942
-#define ADD_2Z 88.195160
-#define ADD_2O 4.613114
-
-struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
-{
- boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BlastWave_Timer;
- uint32 Shout_Timer;
- uint32 Cleave_Timer;
- uint32 Knockaway_Timer;
- bool Summoned;
- Creature *SummonedCreature;
-
- void Reset()
- {
- BlastWave_Timer = 20000;
- Shout_Timer = 2000;
- Cleave_Timer = 6000;
- Knockaway_Timer = 12000;
- Summoned = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //BlastWave_Timer
- if (BlastWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- BlastWave_Timer = 20000;
- }else BlastWave_Timer -= diff;
-
- //Shout_Timer
- if (Shout_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHOUT);
- Shout_Timer = 10000;
- }else Shout_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //Knockaway_Timer
- if (Knockaway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- Knockaway_Timer = 14000;
- }else Knockaway_Timer -= diff;
-
- //Summon two Beserks
- if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
- ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
- SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000);
- ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
- Summoned = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_overlordwyrmthalak(Creature *_Creature)
-{
- return new boss_overlordwyrmthalakAI (_Creature);
-}
-
-void AddSC_boss_overlordwyrmthalak()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_overlord_wyrmthalak";
- newscript->GetAI = GetAI_boss_overlordwyrmthalak;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Overlord_Wyrmthalak
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_BLASTWAVE 11130
+#define SPELL_SHOUT 23511
+#define SPELL_CLEAVE 20691
+#define SPELL_KNOCKAWAY 20686
+
+#define ADD_1X -39.355381
+#define ADD_1Y -513.456482
+#define ADD_1Z 88.472046
+#define ADD_1O 4.679872
+
+#define ADD_2X -49.875881
+#define ADD_2Y -511.896942
+#define ADD_2Z 88.195160
+#define ADD_2O 4.613114
+
+struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
+{
+ boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BlastWave_Timer;
+ uint32 Shout_Timer;
+ uint32 Cleave_Timer;
+ uint32 Knockaway_Timer;
+ bool Summoned;
+ Creature *SummonedCreature;
+
+ void Reset()
+ {
+ BlastWave_Timer = 20000;
+ Shout_Timer = 2000;
+ Cleave_Timer = 6000;
+ Knockaway_Timer = 12000;
+ Summoned = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //BlastWave_Timer
+ if (BlastWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ BlastWave_Timer = 20000;
+ }else BlastWave_Timer -= diff;
+
+ //Shout_Timer
+ if (Shout_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHOUT);
+ Shout_Timer = 10000;
+ }else Shout_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //Knockaway_Timer
+ if (Knockaway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ Knockaway_Timer = 14000;
+ }else Knockaway_Timer -= diff;
+
+ //Summon two Beserks
+ if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
+ SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
+ Summoned = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_overlordwyrmthalak(Creature *_Creature)
+{
+ return new boss_overlordwyrmthalakAI (_Creature);
+}
+
+void AddSC_boss_overlordwyrmthalak()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_overlord_wyrmthalak";
+ newscript->GetAI = GetAI_boss_overlordwyrmthalak;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
index 2c75dce3dd0..f7705c647af 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Pyroguard_Emberseer
-SD%Complete: 100
-SDComment: Event to activate Emberseer NYI
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIRENOVA 23462
-#define SPELL_FLAMEBUFFET 23341
-#define SPELL_PYROBLAST 17274
-
-struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
-{
- boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireNova_Timer;
- uint32 FlameBuffet_Timer;
- uint32 PyroBlast_Timer;
-
- void Reset()
- {
- FireNova_Timer = 6000;
- FlameBuffet_Timer = 3000;
- PyroBlast_Timer = 14000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 6000;
- }else FireNova_Timer -= diff;
-
- //FlameBuffet_Timer
- if (FlameBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
- FlameBuffet_Timer = 14000;
- }else FlameBuffet_Timer -= diff;
-
- //PyroBlast_Timer
- if (PyroBlast_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_PYROBLAST);
- PyroBlast_Timer = 15000;
- }else PyroBlast_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_pyroguard_emberseer(Creature *_Creature)
-{
- return new boss_pyroguard_emberseerAI (_Creature);
-}
-
-void AddSC_boss_pyroguard_emberseer()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_pyroguard_emberseer";
- newscript->GetAI = GetAI_boss_pyroguard_emberseer;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Pyroguard_Emberseer
+SD%Complete: 100
+SDComment: Event to activate Emberseer NYI
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIRENOVA 23462
+#define SPELL_FLAMEBUFFET 23341
+#define SPELL_PYROBLAST 17274
+
+struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
+{
+ boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireNova_Timer;
+ uint32 FlameBuffet_Timer;
+ uint32 PyroBlast_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 6000;
+ FlameBuffet_Timer = 3000;
+ PyroBlast_Timer = 14000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 6000;
+ }else FireNova_Timer -= diff;
+
+ //FlameBuffet_Timer
+ if (FlameBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
+ FlameBuffet_Timer = 14000;
+ }else FlameBuffet_Timer -= diff;
+
+ //PyroBlast_Timer
+ if (PyroBlast_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_PYROBLAST);
+ PyroBlast_Timer = 15000;
+ }else PyroBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_pyroguard_emberseer(Creature *_Creature)
+{
+ return new boss_pyroguard_emberseerAI (_Creature);
+}
+
+void AddSC_boss_pyroguard_emberseer()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_pyroguard_emberseer";
+ newscript->GetAI = GetAI_boss_pyroguard_emberseer;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
index 59076be8587..7c0901e1f40 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
@@ -1,85 +1,85 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Quartmaster_Zigris
-SD%Complete: 100
-SDComment: Needs revision
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHOOT 16496
-#define SPELL_STUNBOMB 16497
-#define SPELL_HEALING_POTION 15504
-#define SPELL_HOOKEDNET 15609
-
-struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI
-{
- boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Shoot_Timer;
- uint32 StunBomb_Timer;
- //uint32 HelingPotion_Timer;
-
- void Reset()
- {
- Shoot_Timer = 1000;
- StunBomb_Timer = 16000;
- //HelingPotion_Timer = 25000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shoot_Timer
- if (Shoot_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHOOT);
- Shoot_Timer = 500;
- }else Shoot_Timer -= diff;
-
- //StunBomb_Timer
- if (StunBomb_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STUNBOMB);
- StunBomb_Timer = 14000;
- }else StunBomb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_quatermasterzigris(Creature *_Creature)
-{
- return new boss_quatermasterzigrisAI (_Creature);
-}
-
-void AddSC_boss_quatermasterzigris()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="quartermaster_zigris";
- newscript->GetAI = GetAI_boss_quatermasterzigris;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Quartmaster_Zigris
+SD%Complete: 100
+SDComment: Needs revision
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHOOT 16496
+#define SPELL_STUNBOMB 16497
+#define SPELL_HEALING_POTION 15504
+#define SPELL_HOOKEDNET 15609
+
+struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI
+{
+ boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Shoot_Timer;
+ uint32 StunBomb_Timer;
+ //uint32 HelingPotion_Timer;
+
+ void Reset()
+ {
+ Shoot_Timer = 1000;
+ StunBomb_Timer = 16000;
+ //HelingPotion_Timer = 25000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shoot_Timer
+ if (Shoot_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHOOT);
+ Shoot_Timer = 500;
+ }else Shoot_Timer -= diff;
+
+ //StunBomb_Timer
+ if (StunBomb_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STUNBOMB);
+ StunBomb_Timer = 14000;
+ }else StunBomb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_quatermasterzigris(Creature *_Creature)
+{
+ return new boss_quatermasterzigrisAI (_Creature);
+}
+
+void AddSC_boss_quatermasterzigris()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="quartermaster_zigris";
+ newscript->GetAI = GetAI_boss_quatermasterzigris;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
index e36df935215..7ca84b3c429 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Rend_Blackhand
-SD%Complete: 100
-SDComment: Intro event NYI
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WHIRLWIND 26038
-#define SPELL_CLEAVE 20691
-#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
-
-struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI
-{
- boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 Cleave_Timer;
- uint32 Thunderclap_Timer;
-
- void Reset()
- {
- WhirlWind_Timer = 20000;
- Cleave_Timer = 5000;
- Thunderclap_Timer = 9000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WhirlWind_Timer
- if (WhirlWind_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
- WhirlWind_Timer = 18000;
- }else WhirlWind_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- //Thunderclap_Timer
- if (Thunderclap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- Thunderclap_Timer = 16000;
- }else Thunderclap_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_rend_blackhand(Creature *_Creature)
-{
- return new boss_rend_blackhandAI (_Creature);
-}
-
-void AddSC_boss_rend_blackhand()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_rend_blackhand";
- newscript->GetAI = GetAI_boss_rend_blackhand;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Rend_Blackhand
+SD%Complete: 100
+SDComment: Intro event NYI
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WHIRLWIND 26038
+#define SPELL_CLEAVE 20691
+#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
+
+struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI
+{
+ boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 Cleave_Timer;
+ uint32 Thunderclap_Timer;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 20000;
+ Cleave_Timer = 5000;
+ Thunderclap_Timer = 9000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WhirlWind_Timer
+ if (WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
+ WhirlWind_Timer = 18000;
+ }else WhirlWind_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ //Thunderclap_Timer
+ if (Thunderclap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ Thunderclap_Timer = 16000;
+ }else Thunderclap_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_rend_blackhand(Creature *_Creature)
+{
+ return new boss_rend_blackhandAI (_Creature);
+}
+
+void AddSC_boss_rend_blackhand()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_rend_blackhand";
+ newscript->GetAI = GetAI_boss_rend_blackhand;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
index 35c774b1e95..17c73e43c82 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
@@ -1,95 +1,95 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shadow_Hunter_Voshgajin
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CURSEOFBLOOD 24673
-#define SPELL_HEX 16708
-#define SPELL_CLEAVE 20691
-
-struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
-{
- boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CurseOfBlood_Timer;
- uint32 Hex_Timer;
- uint32 Cleave_Timer;
-
- void Reset()
- {
- CurseOfBlood_Timer = 2000;
- Hex_Timer = 8000;
- Cleave_Timer = 14000;
-
- //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //CurseOfBlood_Timer
- if (CurseOfBlood_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
- CurseOfBlood_Timer = 45000;
- }else CurseOfBlood_Timer -= diff;
-
- //Hex_Timer
- if (Hex_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_HEX);
- Hex_Timer = 15000;
- }else Hex_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_shadowvosh(Creature *_Creature)
-{
- return new boss_shadowvoshAI (_Creature);
-}
-
-void AddSC_boss_shadowvosh()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_shadow_hunter_voshgajin";
- newscript->GetAI = GetAI_boss_shadowvosh;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shadow_Hunter_Voshgajin
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CURSEOFBLOOD 24673
+#define SPELL_HEX 16708
+#define SPELL_CLEAVE 20691
+
+struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
+{
+ boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CurseOfBlood_Timer;
+ uint32 Hex_Timer;
+ uint32 Cleave_Timer;
+
+ void Reset()
+ {
+ CurseOfBlood_Timer = 2000;
+ Hex_Timer = 8000;
+ Cleave_Timer = 14000;
+
+ //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //CurseOfBlood_Timer
+ if (CurseOfBlood_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
+ CurseOfBlood_Timer = 45000;
+ }else CurseOfBlood_Timer -= diff;
+
+ //Hex_Timer
+ if (Hex_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_HEX);
+ Hex_Timer = 15000;
+ }else Hex_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_shadowvosh(Creature *_Creature)
+{
+ return new boss_shadowvoshAI (_Creature);
+}
+
+void AddSC_boss_shadowvosh()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shadow_hunter_voshgajin";
+ newscript->GetAI = GetAI_boss_shadowvosh;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
index 1d3edd0458b..d7e403d0e72 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_The_Best
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FLAMEBREAK 16785
-#define SPELL_IMMOLATE 20294
-#define SPELL_TERRIFYINGROAR 14100
-
-struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
-{
- boss_thebeastAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Flamebreak_Timer;
- uint32 Immolate_Timer;
- uint32 TerrifyingRoar_Timer;
-
- void Reset()
- {
- Flamebreak_Timer = 12000;
- Immolate_Timer = 3000;
- TerrifyingRoar_Timer = 23000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Flamebreak_Timer
- if (Flamebreak_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBREAK);
- Flamebreak_Timer = 10000;
- }else Flamebreak_Timer -= diff;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_IMMOLATE);
- Immolate_Timer = 8000;
- }else Immolate_Timer -= diff;
-
- //TerrifyingRoar_Timer
- if (TerrifyingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
- TerrifyingRoar_Timer = 20000;
- }else TerrifyingRoar_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_thebeast(Creature *_Creature)
-{
- return new boss_thebeastAI (_Creature);
-}
-
-void AddSC_boss_thebeast()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_the_beast";
- newscript->GetAI = GetAI_boss_thebeast;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_The_Best
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FLAMEBREAK 16785
+#define SPELL_IMMOLATE 20294
+#define SPELL_TERRIFYINGROAR 14100
+
+struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
+{
+ boss_thebeastAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Flamebreak_Timer;
+ uint32 Immolate_Timer;
+ uint32 TerrifyingRoar_Timer;
+
+ void Reset()
+ {
+ Flamebreak_Timer = 12000;
+ Immolate_Timer = 3000;
+ TerrifyingRoar_Timer = 23000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Flamebreak_Timer
+ if (Flamebreak_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBREAK);
+ Flamebreak_Timer = 10000;
+ }else Flamebreak_Timer -= diff;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_IMMOLATE);
+ Immolate_Timer = 8000;
+ }else Immolate_Timer -= diff;
+
+ //TerrifyingRoar_Timer
+ if (TerrifyingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
+ TerrifyingRoar_Timer = 20000;
+ }else TerrifyingRoar_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_thebeast(Creature *_Creature)
+{
+ return new boss_thebeastAI (_Creature);
+}
+
+void AddSC_boss_thebeast()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_the_beast";
+ newscript->GetAI = GetAI_boss_thebeast;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
index b349bd3ec25..7377b46526f 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
@@ -1,121 +1,121 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warmaster_Voone
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SNAPKICK 15618
-#define SPELL_CLEAVE 15579
-#define SPELL_UPPERCUT 10966
-#define SPELL_MORTALSTRIKE 16856
-#define SPELL_PUMMEL 15615
-#define SPELL_THROWAXE 16075
-
-struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
-{
- boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Snapkick_Timer;
- uint32 Cleave_Timer;
- uint32 Uppercut_Timer;
- uint32 MortalStrike_Timer;
- uint32 Pummel_Timer;
- uint32 ThrowAxe_Timer;
-
- void Reset()
- {
- Snapkick_Timer = 8000;
- Cleave_Timer = 14000;
- Uppercut_Timer = 20000;
- MortalStrike_Timer = 12000;
- Pummel_Timer = 32000;
- ThrowAxe_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Snapkick_Timer
- if (Snapkick_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SNAPKICK);
- Snapkick_Timer = 6000;
- }else Snapkick_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 12000;
- }else Cleave_Timer -= diff;
-
- //Uppercut_Timer
- if (Uppercut_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
- Uppercut_Timer = 14000;
- }else Uppercut_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 10000;
- }else MortalStrike_Timer -= diff;
-
- //Pummel_Timer
- if (Pummel_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_PUMMEL);
- Pummel_Timer = 16000;
- }else Pummel_Timer -= diff;
-
- //ThrowAxe_Timer
- if (ThrowAxe_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THROWAXE);
- ThrowAxe_Timer = 8000;
- }else ThrowAxe_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_warmastervoone(Creature *_Creature)
-{
- return new boss_warmastervooneAI (_Creature);
-}
-
-void AddSC_boss_warmastervoone()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_warmaster_voone";
- newscript->GetAI = GetAI_boss_warmastervoone;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warmaster_Voone
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SNAPKICK 15618
+#define SPELL_CLEAVE 15579
+#define SPELL_UPPERCUT 10966
+#define SPELL_MORTALSTRIKE 16856
+#define SPELL_PUMMEL 15615
+#define SPELL_THROWAXE 16075
+
+struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
+{
+ boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Snapkick_Timer;
+ uint32 Cleave_Timer;
+ uint32 Uppercut_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 Pummel_Timer;
+ uint32 ThrowAxe_Timer;
+
+ void Reset()
+ {
+ Snapkick_Timer = 8000;
+ Cleave_Timer = 14000;
+ Uppercut_Timer = 20000;
+ MortalStrike_Timer = 12000;
+ Pummel_Timer = 32000;
+ ThrowAxe_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Snapkick_Timer
+ if (Snapkick_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SNAPKICK);
+ Snapkick_Timer = 6000;
+ }else Snapkick_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 12000;
+ }else Cleave_Timer -= diff;
+
+ //Uppercut_Timer
+ if (Uppercut_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
+ Uppercut_Timer = 14000;
+ }else Uppercut_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 10000;
+ }else MortalStrike_Timer -= diff;
+
+ //Pummel_Timer
+ if (Pummel_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_PUMMEL);
+ Pummel_Timer = 16000;
+ }else Pummel_Timer -= diff;
+
+ //ThrowAxe_Timer
+ if (ThrowAxe_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THROWAXE);
+ ThrowAxe_Timer = 8000;
+ }else ThrowAxe_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_warmastervoone(Creature *_Creature)
+{
+ return new boss_warmastervooneAI (_Creature);
+}
+
+void AddSC_boss_warmastervoone()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_warmaster_voone";
+ newscript->GetAI = GetAI_boss_warmastervoone;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
index 5f9e73f835e..3e2feba5699 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
@@ -1,130 +1,130 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Broodlord_Lashlayer
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CLEAVE 26350
-#define SPELL_BLASTWAVE 23331
-#define SPELL_MORTALSTRIKE 24573
-#define SPELL_KNOCKBACK 25778
-
-#define SAY_AGGRO "None of your kind should be here! You've doomed only yourselves!"
-#define SAY_LEASH "Clever Mortals but I am not so easily lured away from my sanctum!"
-#define SOUND_AGGRO 8286
-#define SOUND_LEASH 8287
-
-struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
-{
- boss_broodlordAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cleave_Timer;
- uint32 BlastWave_Timer;
- uint32 MortalStrike_Timer;
- uint32 KnockBack_Timer;
- uint32 LeashCheck_Timer;
-
- void Reset()
- {
- Cleave_Timer = 8000; //These times are probably wrong
- BlastWave_Timer = 12000;
- MortalStrike_Timer = 20000;
- KnockBack_Timer = 30000;
- LeashCheck_Timer = 2000;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //LeashCheck_Timer
- if (LeashCheck_Timer < diff)
- {
- float rx,ry,rz;
- m_creature->GetRespawnCoord(rx, ry, rz);
- float spawndist = m_creature->GetDistance(rx,ry,rz);
- if ( spawndist > 250 )
- {
- EnterEvadeMode();
- return;
- }
- LeashCheck_Timer = 2000;
- }else LeashCheck_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- // BlastWave
- if (BlastWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- BlastWave_Timer = 8000 + rand()%8000;
- }else BlastWave_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 25000 + rand()%10000;
- }else MortalStrike_Timer -= diff;
-
- if (KnockBack_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
- //Drop 50% aggro
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
-
- KnockBack_Timer = 15000 + rand()%15000;
- }else KnockBack_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_broodlord(Creature *_Creature)
-{
- return new boss_broodlordAI (_Creature);
-}
-
-void AddSC_boss_broodlord()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_broodlord";
- newscript->GetAI = GetAI_boss_broodlord;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Broodlord_Lashlayer
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CLEAVE 26350
+#define SPELL_BLASTWAVE 23331
+#define SPELL_MORTALSTRIKE 24573
+#define SPELL_KNOCKBACK 25778
+
+#define SAY_AGGRO "None of your kind should be here! You've doomed only yourselves!"
+#define SAY_LEASH "Clever Mortals but I am not so easily lured away from my sanctum!"
+#define SOUND_AGGRO 8286
+#define SOUND_LEASH 8287
+
+struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
+{
+ boss_broodlordAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cleave_Timer;
+ uint32 BlastWave_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 KnockBack_Timer;
+ uint32 LeashCheck_Timer;
+
+ void Reset()
+ {
+ Cleave_Timer = 8000; //These times are probably wrong
+ BlastWave_Timer = 12000;
+ MortalStrike_Timer = 20000;
+ KnockBack_Timer = 30000;
+ LeashCheck_Timer = 2000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //LeashCheck_Timer
+ if (LeashCheck_Timer < diff)
+ {
+ float rx,ry,rz;
+ m_creature->GetRespawnCoord(rx, ry, rz);
+ float spawndist = m_creature->GetDistance(rx,ry,rz);
+ if ( spawndist > 250 )
+ {
+ EnterEvadeMode();
+ return;
+ }
+ LeashCheck_Timer = 2000;
+ }else LeashCheck_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ // BlastWave
+ if (BlastWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ BlastWave_Timer = 8000 + rand()%8000;
+ }else BlastWave_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 25000 + rand()%10000;
+ }else MortalStrike_Timer -= diff;
+
+ if (KnockBack_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
+ //Drop 50% aggro
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+
+ KnockBack_Timer = 15000 + rand()%15000;
+ }else KnockBack_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_broodlord(Creature *_Creature)
+{
+ return new boss_broodlordAI (_Creature);
+}
+
+void AddSC_boss_broodlord()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_broodlord";
+ newscript->GetAI = GetAI_boss_broodlord;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
index a34fbfd2180..33a91413ade 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
@@ -1,320 +1,320 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Chromaggus
-SD%Complete: 95
-SDComment: Chromatic Mutation disabled due to lack of core support
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-//These spells are actually called elemental shield
-//What they do is decrease all damage by 75% then they increase
-//One school of damage by 1100%
-#define SPELL_FIRE_VURNALBILTY 22277
-#define SPELL_FROST_VURNALBILTY 22278
-#define SPELL_SHADOW_VURNALBILTY 22279
-#define SPELL_NATURE_VURNALBILTY 22280
-#define SPELL_ARCANE_VURNALBILTY 22281
-
-#define EMOTE_FRENZY "goes into a killing frenzy!"
-#define EMOTE_SHIMMER "flinches as its skin shimmers"
-
-#define SPELL_INCINERATE 23308 //Incinerate 23308,23309
-#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01)
-#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314
-#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316
-#define SPELL_FROSTBURN 23187 //Frost burn 23187, 23189
-
-//Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them
-//Since Scripted spells arn't coded I'll just write a function that does the same thing
-
-#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153
-#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154
-#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death)
-#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170
-#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169
-
-#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs
-
-#define SPELL_FRENZY 28371 //The frenzy spell may be wrong
-#define SPELL_ENRAGE 28747
-
-#define TEMP_MUTATE_WHISPER "[SD2 Debug] You would be mind controlled here!"
-
-struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
-{
- boss_chromaggusAI(Creature *c) : ScriptedAI(c)
- {
- //Select the 2 breaths that we are going to use until despawned
- //5 possiblities for the first breath, 4 for the second, 20 total possiblites
- //This way we don't end up casting 2 of the same breath
- //TL TL would be stupid
- srand(time(NULL));
- switch (rand()%20)
- {
- //B1 - Incin
- case 0:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 1:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 2:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 3:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - TL
- case 4:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 5:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 6:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 7:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Acid
- case 8:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 9:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 10:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 11:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Ignite
- case 12:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 13:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 14:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 15:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Frost
- case 16:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 17:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 18:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 19:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- };
-
- EnterEvadeMode();
- }
-
- uint32 Breath1_Spell;
- uint32 Breath2_Spell;
- uint32 CurrentVurln_Spell;
-
- uint32 Shimmer_Timer;
- uint32 Breath1_Timer;
- uint32 Breath2_Timer;
- uint32 Affliction_Timer;
- uint32 Frenzy_Timer;
- bool Enraged;
-
- void Reset()
- {
- CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later
-
- Shimmer_Timer = 0; //Time till we change vurlnerabilites
- Breath1_Timer = 30000; //First breath is 30 seconds
- Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
- Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
- Frenzy_Timer = 15000;
-
- Enraged = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shimmer_Timer Timer
- if (Shimmer_Timer < diff)
- {
- //Remove old vurlnability spell
- if (CurrentVurln_Spell)
- m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
-
- //Cast new random vurlnabilty on self
- uint32 spell;
- switch (rand()%5)
- {
- case 0: spell = SPELL_FIRE_VURNALBILTY; break;
- case 1: spell = SPELL_FROST_VURNALBILTY; break;
- case 2: spell = SPELL_SHADOW_VURNALBILTY; break;
- case 3: spell = SPELL_NATURE_VURNALBILTY; break;
- case 4: spell = SPELL_ARCANE_VURNALBILTY; break;
- }
-
- DoCast(m_creature,spell);
- CurrentVurln_Spell = spell;
-
- DoTextEmote(EMOTE_SHIMMER, NULL);
- Shimmer_Timer = 45000;
- }else Shimmer_Timer -= diff;
-
- //Breath1_Timer
- if (Breath1_Timer < diff)
- {
- DoCast(m_creature->getVictim(),Breath1_Spell);
- Breath1_Timer = 60000;
- }else Breath1_Timer -= diff;
-
- //Breath2_Timer
- if (Breath2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),Breath2_Spell);
- Breath2_Timer = 60000;
- }else Breath2_Timer -= diff;
-
- //Affliction_Timer
- if (Affliction_Timer < diff)
- {
- uint32 SpellAfflict = 0;
-
- switch (rand()%5)
- {
- case 0: SpellAfflict = SPELL_BROODAF_BLUE; break;
- case 1: SpellAfflict = SPELL_BROODAF_BLACK; break;
- case 2: SpellAfflict = SPELL_BROODAF_RED; break;
- case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break;
- case 4: SpellAfflict = SPELL_BROODAF_GREEN; break;
- }
-
- std::list<HostilReference*>::iterator i;
-
- for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
-
- if(pUnit)
- {
- //Cast affliction
- DoCast(pUnit, SpellAfflict, true);
-
- //Chromatic mutation if target is effected by all afflictions
- if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
- && pUnit->HasAura(SPELL_BROODAF_BLACK,0)
- && pUnit->HasAura(SPELL_BROODAF_RED,0)
- && pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
- && pUnit->HasAura(SPELL_BROODAF_GREEN,0))
- {
- //target->RemoveAllAuras();
- //DoCast(target,SPELL_CHROMATIC_MUT_1);
-
- //Chromatic mutation is causing issues
- //Assuming it is caused by a lack of core support for Charm
- //So instead we instant kill our target
-
- //WORKAROUND
- if (pUnit->GetTypeId() == TYPEID_PLAYER)
- {
- DoWhisper(TEMP_MUTATE_WHISPER, pUnit);
- pUnit->CastSpell(pUnit, 5, false);
- }
- }
- }
- }
-
- Affliction_Timer = 10000;
- }else Affliction_Timer -= diff;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote(EMOTE_FRENZY,NULL);
- Frenzy_Timer = 10000 + (rand() % 5000);
- }else Frenzy_Timer -= diff;
-
- //Enrage if not already enraged and below 20%
- if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_chromaggus(Creature *_Creature)
-{
- return new boss_chromaggusAI (_Creature);
-}
-
-void AddSC_boss_chromaggus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_chromaggus";
- newscript->GetAI = GetAI_boss_chromaggus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Chromaggus
+SD%Complete: 95
+SDComment: Chromatic Mutation disabled due to lack of core support
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+//These spells are actually called elemental shield
+//What they do is decrease all damage by 75% then they increase
+//One school of damage by 1100%
+#define SPELL_FIRE_VURNALBILTY 22277
+#define SPELL_FROST_VURNALBILTY 22278
+#define SPELL_SHADOW_VURNALBILTY 22279
+#define SPELL_NATURE_VURNALBILTY 22280
+#define SPELL_ARCANE_VURNALBILTY 22281
+
+#define EMOTE_FRENZY "goes into a killing frenzy!"
+#define EMOTE_SHIMMER "flinches as its skin shimmers"
+
+#define SPELL_INCINERATE 23308 //Incinerate 23308,23309
+#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01)
+#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314
+#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316
+#define SPELL_FROSTBURN 23187 //Frost burn 23187, 23189
+
+//Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them
+//Since Scripted spells arn't coded I'll just write a function that does the same thing
+
+#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153
+#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154
+#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death)
+#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170
+#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169
+
+#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs
+
+#define SPELL_FRENZY 28371 //The frenzy spell may be wrong
+#define SPELL_ENRAGE 28747
+
+#define TEMP_MUTATE_WHISPER "[SD2 Debug] You would be mind controlled here!"
+
+struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
+{
+ boss_chromaggusAI(Creature *c) : ScriptedAI(c)
+ {
+ //Select the 2 breaths that we are going to use until despawned
+ //5 possiblities for the first breath, 4 for the second, 20 total possiblites
+ //This way we don't end up casting 2 of the same breath
+ //TL TL would be stupid
+ srand(time(NULL));
+ switch (rand()%20)
+ {
+ //B1 - Incin
+ case 0:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 1:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 2:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 3:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - TL
+ case 4:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 5:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 6:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 7:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Acid
+ case 8:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 9:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 10:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 11:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Ignite
+ case 12:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 13:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 14:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 15:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Frost
+ case 16:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 17:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 18:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 19:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ };
+
+ EnterEvadeMode();
+ }
+
+ uint32 Breath1_Spell;
+ uint32 Breath2_Spell;
+ uint32 CurrentVurln_Spell;
+
+ uint32 Shimmer_Timer;
+ uint32 Breath1_Timer;
+ uint32 Breath2_Timer;
+ uint32 Affliction_Timer;
+ uint32 Frenzy_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later
+
+ Shimmer_Timer = 0; //Time till we change vurlnerabilites
+ Breath1_Timer = 30000; //First breath is 30 seconds
+ Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
+ Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
+ Frenzy_Timer = 15000;
+
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shimmer_Timer Timer
+ if (Shimmer_Timer < diff)
+ {
+ //Remove old vurlnability spell
+ if (CurrentVurln_Spell)
+ m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
+
+ //Cast new random vurlnabilty on self
+ uint32 spell;
+ switch (rand()%5)
+ {
+ case 0: spell = SPELL_FIRE_VURNALBILTY; break;
+ case 1: spell = SPELL_FROST_VURNALBILTY; break;
+ case 2: spell = SPELL_SHADOW_VURNALBILTY; break;
+ case 3: spell = SPELL_NATURE_VURNALBILTY; break;
+ case 4: spell = SPELL_ARCANE_VURNALBILTY; break;
+ }
+
+ DoCast(m_creature,spell);
+ CurrentVurln_Spell = spell;
+
+ DoTextEmote(EMOTE_SHIMMER, NULL);
+ Shimmer_Timer = 45000;
+ }else Shimmer_Timer -= diff;
+
+ //Breath1_Timer
+ if (Breath1_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),Breath1_Spell);
+ Breath1_Timer = 60000;
+ }else Breath1_Timer -= diff;
+
+ //Breath2_Timer
+ if (Breath2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),Breath2_Spell);
+ Breath2_Timer = 60000;
+ }else Breath2_Timer -= diff;
+
+ //Affliction_Timer
+ if (Affliction_Timer < diff)
+ {
+ uint32 SpellAfflict = 0;
+
+ switch (rand()%5)
+ {
+ case 0: SpellAfflict = SPELL_BROODAF_BLUE; break;
+ case 1: SpellAfflict = SPELL_BROODAF_BLACK; break;
+ case 2: SpellAfflict = SPELL_BROODAF_RED; break;
+ case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break;
+ case 4: SpellAfflict = SPELL_BROODAF_GREEN; break;
+ }
+
+ std::list<HostilReference*>::iterator i;
+
+ for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+
+ if(pUnit)
+ {
+ //Cast affliction
+ DoCast(pUnit, SpellAfflict, true);
+
+ //Chromatic mutation if target is effected by all afflictions
+ if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
+ && pUnit->HasAura(SPELL_BROODAF_BLACK,0)
+ && pUnit->HasAura(SPELL_BROODAF_RED,0)
+ && pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
+ && pUnit->HasAura(SPELL_BROODAF_GREEN,0))
+ {
+ //target->RemoveAllAuras();
+ //DoCast(target,SPELL_CHROMATIC_MUT_1);
+
+ //Chromatic mutation is causing issues
+ //Assuming it is caused by a lack of core support for Charm
+ //So instead we instant kill our target
+
+ //WORKAROUND
+ if (pUnit->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoWhisper(TEMP_MUTATE_WHISPER, pUnit);
+ pUnit->CastSpell(pUnit, 5, false);
+ }
+ }
+ }
+ }
+
+ Affliction_Timer = 10000;
+ }else Affliction_Timer -= diff;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote(EMOTE_FRENZY,NULL);
+ Frenzy_Timer = 10000 + (rand() % 5000);
+ }else Frenzy_Timer -= diff;
+
+ //Enrage if not already enraged and below 20%
+ if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_chromaggus(Creature *_Creature)
+{
+ return new boss_chromaggusAI (_Creature);
+}
+
+void AddSC_boss_chromaggus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_chromaggus";
+ newscript->GetAI = GetAI_boss_chromaggus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
index 1e6cb6794fe..703dec09536 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
@@ -1,103 +1,103 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ebonroc
-SD%Complete: 50
-SDComment: Shadow of Ebonroc needs core support
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 18500
-#define SPELL_SHADOWOFEBONROC 23340
-#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
-
-struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
-{
- boss_ebonrocAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 ShadowOfEbonroc_Timer;
- uint32 Heal_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 15000; //These times are probably wrong
- WingBuffet_Timer = 30000;
- ShadowOfEbonroc_Timer = 45000;
- Heal_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shadowflame Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 12000 + rand()%3000;
- }else ShadowFlame_Timer -= diff;
-
- //Wing Buffet Timer
- if (WingBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //Shadow of Ebonroc Timer
- if (ShadowOfEbonroc_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC);
- ShadowOfEbonroc_Timer = 25000 + rand()%10000;
- }else ShadowOfEbonroc_Timer -= diff;
-
- if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
- {
- if (Heal_Timer < diff)
- {
- DoCast(m_creature, SPELL_HEAL);
- Heal_Timer = 1000 + rand()%2000;
- }else Heal_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ebonroc(Creature *_Creature)
-{
- return new boss_ebonrocAI (_Creature);
-}
-
-void AddSC_boss_ebonroc()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ebonroc";
- newscript->GetAI = GetAI_boss_ebonroc;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ebonroc
+SD%Complete: 50
+SDComment: Shadow of Ebonroc needs core support
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 18500
+#define SPELL_SHADOWOFEBONROC 23340
+#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
+
+struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
+{
+ boss_ebonrocAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 ShadowOfEbonroc_Timer;
+ uint32 Heal_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 15000; //These times are probably wrong
+ WingBuffet_Timer = 30000;
+ ShadowOfEbonroc_Timer = 45000;
+ Heal_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shadowflame Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 12000 + rand()%3000;
+ }else ShadowFlame_Timer -= diff;
+
+ //Wing Buffet Timer
+ if (WingBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //Shadow of Ebonroc Timer
+ if (ShadowOfEbonroc_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC);
+ ShadowOfEbonroc_Timer = 25000 + rand()%10000;
+ }else ShadowOfEbonroc_Timer -= diff;
+
+ if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
+ {
+ if (Heal_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HEAL);
+ Heal_Timer = 1000 + rand()%2000;
+ }else Heal_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ebonroc(Creature *_Creature)
+{
+ return new boss_ebonrocAI (_Creature);
+}
+
+void AddSC_boss_ebonroc()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ebonroc";
+ newscript->GetAI = GetAI_boss_ebonroc;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
index 54c0b4b40d7..05a3e36948b 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
@@ -1,94 +1,94 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Firemaw
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 23339
-#define SPELL_FLAMEBUFFET 23341
-
-struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI
-{
- boss_firemawAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 FlameBuffet_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 30000; //These times are probably wrong
- WingBuffet_Timer = 24000;
- FlameBuffet_Timer = 5000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 15000 + rand()%3000;
- }else ShadowFlame_Timer -= diff;
-
- //WingBuffet_Timer
- if (WingBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
-
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //FlameBuffet_Timer
- if (FlameBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
- FlameBuffet_Timer = 5000;
- }else FlameBuffet_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_firemaw(Creature *_Creature)
-{
- return new boss_firemawAI (_Creature);
-}
-
-void AddSC_boss_firemaw()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_firemaw";
- newscript->GetAI = GetAI_boss_firemaw;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Firemaw
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 23339
+#define SPELL_FLAMEBUFFET 23341
+
+struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI
+{
+ boss_firemawAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 FlameBuffet_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 30000; //These times are probably wrong
+ WingBuffet_Timer = 24000;
+ FlameBuffet_Timer = 5000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 15000 + rand()%3000;
+ }else ShadowFlame_Timer -= diff;
+
+ //WingBuffet_Timer
+ if (WingBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
+
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //FlameBuffet_Timer
+ if (FlameBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
+ FlameBuffet_Timer = 5000;
+ }else FlameBuffet_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_firemaw(Creature *_Creature)
+{
+ return new boss_firemawAI (_Creature);
+}
+
+void AddSC_boss_firemaw()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_firemaw";
+ newscript->GetAI = GetAI_boss_firemaw;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
index 320bf380b28..fa34406b1fe 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
@@ -1,94 +1,94 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Flamegor
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 23339
-#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
-
-struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
-{
- boss_flamegorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 21000; //These times are probably wrong
- WingBuffet_Timer = 35000;
- Frenzy_Timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->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(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
-
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- Frenzy_Timer = 8000 + (rand()%2000);
- }else Frenzy_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_flamegor(Creature *_Creature)
-{
- return new boss_flamegorAI (_Creature);
-}
-
-void AddSC_boss_flamegor()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_flamegor";
- newscript->GetAI = GetAI_boss_flamegor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Flamegor
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 23339
+#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
+
+struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
+{
+ boss_flamegorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 21000; //These times are probably wrong
+ WingBuffet_Timer = 35000;
+ Frenzy_Timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->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(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
+
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ Frenzy_Timer = 8000 + (rand()%2000);
+ }else Frenzy_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_flamegor(Creature *_Creature)
+{
+ return new boss_flamegorAI (_Creature);
+}
+
+void AddSC_boss_flamegor()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_flamegor";
+ newscript->GetAI = GetAI_boss_flamegor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
index 8ffe94f3f92..dffd01f171e 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
@@ -1,250 +1,250 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Nefarian
-SD%Complete: 100
-SDComment: Some issues with class calls effecting more than one class
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO "Well done, my minions. The mortals' courage begins to wane! Now, let's see how they contend with the true Lord of Blackrock Spire!"
-#define SAY_DEATH "This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!"
-#define SAY_RAISE_SKELETONS "Impossible! Rise my minions! Serve your master once more!"
-#define SAY_SHADOWFLAME "Burn, you wretches! Burn!"
-#define SAY_SLAY "Worthless $N! Your friends will join you soon enough!"
-#define SAY_XHEALTH "Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself."
-#define SAY_GAMESBEGIN "Let the games begin!"
-#define SAY_START "<unknown>"
-
-#define SOUND_AGGRO 8288
-#define SOUND_DEATH 8292
-#define SOUND_RAISE_SKELETONS 8291
-#define SOUND_SHADOWFLAME 8290
-#define SOUND_SLAY 8293
-#define SOUND_XHEALTH 8289
-#define SOUND_GAMESBEGIN 8279
-#define SOUND_START 8280
-
-#define SPELL_SHADOWFLAME_INITIAL 22972
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_BELLOWINGROAR 22686
-#define SPELL_VEILOFSHADOW 7068
-#define SPELL_CLEAVE 20691
-#define SPELL_TAILLASH 23364
-#define SPELL_BONECONTRUST 23363 //23362, 23361
-
-#define SPELL_MAGE 23410 //wild magic
-#define SPELL_WARRIOR 23397 //beserk
-#define SPELL_DRUID 23398 // cat form
-#define SPELL_PRIEST 23401 // corrupted healing
-#define SPELL_PALADIN 23418 //syphon blessing
-#define SPELL_SHAMAN 23425 //totems
-#define SPELL_WARLOCK 23427 //infernals
-#define SPELL_HUNTER 23436 //bow broke
-#define SPELL_ROGUE 23414 //Paralise
-
-#define SAY_MAGE "Mages too? You should be more careful when you play with magic..."
-#define SAY_WARRIOR "Warriors, I know you can hit harder than that! Let's see it!"
-#define SAY_DRUID "Druids and your silly shapeshifting. Let's see it in action!"
-#define SAY_PRIEST "Priests! If you're going to keep healing like that, we might as well make it a little more interesting!"
-#define SAY_PALADIN "Paladins, I've heard you have many lives. Show me."
-#define SAY_SHAMAN "Shamans, show me what your totems can do!"
-#define SAY_WARLOCK "Warlocks, you shouldn't be playing with magic you don't understand. See what happens?"
-#define SAY_HUNTER "Hunters and your annoying pea-shooters!"
-#define SAY_ROGUE "Rogues? Stop hiding and face me!"
-
-struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
-{
- boss_nefarianAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 BellowingRoar_Timer;
- uint32 VeilOfShadow_Timer;
- uint32 Cleave_Timer;
- uint32 TailLash_Timer;
- uint32 ClassCall_Timer;
- bool Phase3;
-
- void Reset()
- {
- ShadowFlame_Timer = 12000; //These times are probably wrong
- BellowingRoar_Timer = 30000;
- VeilOfShadow_Timer = 15000;
- Cleave_Timer = 7000;
- TailLash_Timer = 10000;
- ClassCall_Timer = 35000; //35-40 seconds
- Phase3 = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void KilledUnit(Unit* Victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_SLAY,LANG_UNIVERSAL,Victim);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_XHEALTH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_XHEALTH);
- break;
- case 1:
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- break;
- case 2:
- DoYell(SAY_SHADOWFLAME,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SHADOWFLAME);
- break;
- }
-
- DoCast(who,SPELL_SHADOWFLAME_INITIAL);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 12000;
- }else ShadowFlame_Timer -= diff;
-
- //BellowingRoar_Timer
- if (BellowingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
- BellowingRoar_Timer = 30000;
- }else BellowingRoar_Timer -= diff;
-
- //VeilOfShadow_Timer
- if (VeilOfShadow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
- VeilOfShadow_Timer = 15000;
- }else VeilOfShadow_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //TailLash_Timer
- if (TailLash_Timer < diff)
- {
- //Cast NYI since we need a better check for behind target
- //DoCast(m_creature->getVictim(),SPELL_TAILLASH);
-
- TailLash_Timer = 10000;
- }else TailLash_Timer -= diff;
-
- //ClassCall_Timer
- if (ClassCall_Timer < diff)
- {
- //Cast a random class call
- //On official it is based on what classes are currently on the hostil list
- //but we can't do that yet so just randomly call one
-
- switch (rand()%9)
- {
- case 0:
- DoYell(SAY_MAGE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_MAGE);
- break;
- case 1:
- DoYell(SAY_WARRIOR,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_WARRIOR);
- break;
- case 2:
- DoYell(SAY_DRUID,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_DRUID);
- break;
- case 3:
- DoYell(SAY_PRIEST,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_PRIEST);
- break;
- case 4:
- DoYell(SAY_PALADIN,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_PALADIN);
- break;
- case 5:
- DoYell(SAY_SHAMAN,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_SHAMAN);
- break;
- case 6:
- DoYell(SAY_WARLOCK,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_WARLOCK);
- break;
- case 7:
- DoYell(SAY_HUNTER,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_HUNTER);
- break;
- case 8:
- DoYell(SAY_ROGUE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ROGUE);
- break;
- }
-
- ClassCall_Timer = 35000 + (rand() % 5000);
- }else ClassCall_Timer -= diff;
-
- //Phase3 begins when we are below X health
- if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- Phase3 = true;
- DoYell(SAY_RAISE_SKELETONS,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RAISE_SKELETONS);
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_nefarian(Creature *_Creature)
-{
- return new boss_nefarianAI (_Creature);
-}
-
-void AddSC_boss_nefarian()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_nefarian";
- newscript->GetAI = GetAI_boss_nefarian;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Nefarian
+SD%Complete: 100
+SDComment: Some issues with class calls effecting more than one class
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO "Well done, my minions. The mortals' courage begins to wane! Now, let's see how they contend with the true Lord of Blackrock Spire!"
+#define SAY_DEATH "This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!"
+#define SAY_RAISE_SKELETONS "Impossible! Rise my minions! Serve your master once more!"
+#define SAY_SHADOWFLAME "Burn, you wretches! Burn!"
+#define SAY_SLAY "Worthless $N! Your friends will join you soon enough!"
+#define SAY_XHEALTH "Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself."
+#define SAY_GAMESBEGIN "Let the games begin!"
+#define SAY_START "<unknown>"
+
+#define SOUND_AGGRO 8288
+#define SOUND_DEATH 8292
+#define SOUND_RAISE_SKELETONS 8291
+#define SOUND_SHADOWFLAME 8290
+#define SOUND_SLAY 8293
+#define SOUND_XHEALTH 8289
+#define SOUND_GAMESBEGIN 8279
+#define SOUND_START 8280
+
+#define SPELL_SHADOWFLAME_INITIAL 22972
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_BELLOWINGROAR 22686
+#define SPELL_VEILOFSHADOW 7068
+#define SPELL_CLEAVE 20691
+#define SPELL_TAILLASH 23364
+#define SPELL_BONECONTRUST 23363 //23362, 23361
+
+#define SPELL_MAGE 23410 //wild magic
+#define SPELL_WARRIOR 23397 //beserk
+#define SPELL_DRUID 23398 // cat form
+#define SPELL_PRIEST 23401 // corrupted healing
+#define SPELL_PALADIN 23418 //syphon blessing
+#define SPELL_SHAMAN 23425 //totems
+#define SPELL_WARLOCK 23427 //infernals
+#define SPELL_HUNTER 23436 //bow broke
+#define SPELL_ROGUE 23414 //Paralise
+
+#define SAY_MAGE "Mages too? You should be more careful when you play with magic..."
+#define SAY_WARRIOR "Warriors, I know you can hit harder than that! Let's see it!"
+#define SAY_DRUID "Druids and your silly shapeshifting. Let's see it in action!"
+#define SAY_PRIEST "Priests! If you're going to keep healing like that, we might as well make it a little more interesting!"
+#define SAY_PALADIN "Paladins, I've heard you have many lives. Show me."
+#define SAY_SHAMAN "Shamans, show me what your totems can do!"
+#define SAY_WARLOCK "Warlocks, you shouldn't be playing with magic you don't understand. See what happens?"
+#define SAY_HUNTER "Hunters and your annoying pea-shooters!"
+#define SAY_ROGUE "Rogues? Stop hiding and face me!"
+
+struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
+{
+ boss_nefarianAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 BellowingRoar_Timer;
+ uint32 VeilOfShadow_Timer;
+ uint32 Cleave_Timer;
+ uint32 TailLash_Timer;
+ uint32 ClassCall_Timer;
+ bool Phase3;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 12000; //These times are probably wrong
+ BellowingRoar_Timer = 30000;
+ VeilOfShadow_Timer = 15000;
+ Cleave_Timer = 7000;
+ TailLash_Timer = 10000;
+ ClassCall_Timer = 35000; //35-40 seconds
+ Phase3 = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_SLAY,LANG_UNIVERSAL,Victim);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoYell(SAY_XHEALTH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_XHEALTH);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ break;
+ case 2:
+ DoYell(SAY_SHADOWFLAME,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SHADOWFLAME);
+ break;
+ }
+
+ DoCast(who,SPELL_SHADOWFLAME_INITIAL);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 12000;
+ }else ShadowFlame_Timer -= diff;
+
+ //BellowingRoar_Timer
+ if (BellowingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
+ BellowingRoar_Timer = 30000;
+ }else BellowingRoar_Timer -= diff;
+
+ //VeilOfShadow_Timer
+ if (VeilOfShadow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
+ VeilOfShadow_Timer = 15000;
+ }else VeilOfShadow_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //TailLash_Timer
+ if (TailLash_Timer < diff)
+ {
+ //Cast NYI since we need a better check for behind target
+ //DoCast(m_creature->getVictim(),SPELL_TAILLASH);
+
+ TailLash_Timer = 10000;
+ }else TailLash_Timer -= diff;
+
+ //ClassCall_Timer
+ if (ClassCall_Timer < diff)
+ {
+ //Cast a random class call
+ //On official it is based on what classes are currently on the hostil list
+ //but we can't do that yet so just randomly call one
+
+ switch (rand()%9)
+ {
+ case 0:
+ DoYell(SAY_MAGE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_MAGE);
+ break;
+ case 1:
+ DoYell(SAY_WARRIOR,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_WARRIOR);
+ break;
+ case 2:
+ DoYell(SAY_DRUID,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_DRUID);
+ break;
+ case 3:
+ DoYell(SAY_PRIEST,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_PRIEST);
+ break;
+ case 4:
+ DoYell(SAY_PALADIN,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_PALADIN);
+ break;
+ case 5:
+ DoYell(SAY_SHAMAN,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_SHAMAN);
+ break;
+ case 6:
+ DoYell(SAY_WARLOCK,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_WARLOCK);
+ break;
+ case 7:
+ DoYell(SAY_HUNTER,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_HUNTER);
+ break;
+ case 8:
+ DoYell(SAY_ROGUE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ROGUE);
+ break;
+ }
+
+ ClassCall_Timer = 35000 + (rand() % 5000);
+ }else ClassCall_Timer -= diff;
+
+ //Phase3 begins when we are below X health
+ if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ Phase3 = true;
+ DoYell(SAY_RAISE_SKELETONS,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RAISE_SKELETONS);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_nefarian(Creature *_Creature)
+{
+ return new boss_nefarianAI (_Creature);
+}
+
+void AddSC_boss_nefarian()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_nefarian";
+ newscript->GetAI = GetAI_boss_nefarian;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
index 2a44768ca50..305910aefa6 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
@@ -1,126 +1,126 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Razorgore
-SD%Complete: 50
-SDComment: Needs additional review. Phase 1 NYI
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-//Razorgore Phase 2 Script
-
-#define SAY_NPC_DEATH "If I fall into the abyss I'll take all of you mortals with me..."
-#define SOUND_NPC_DEATH 8278
-#define SAY_EGGS_BREAK3 "No! Not another one! I'll have your heads for this atrocity."
-#define SOUND_EGGS_BREAK3 8277
-
-#define SPELL_CLEAVE 22540
-#define SPELL_WARSTOMP 24375
-#define SPELL_FIREBALLVOLLEY 22425
-#define SPELL_CONFLAGRATION 23023
-
-struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
-{
- boss_razorgoreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cleave_Timer;
- uint32 WarStomp_Timer;
- uint32 FireballVolley_Timer;
- uint32 Conflagration_Timer;
-
- void Reset()
- {
- Cleave_Timer = 15000; //These times are probably wrong
- WarStomp_Timer = 35000;
- FireballVolley_Timer = 7000;
- Conflagration_Timer = 12000;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000 + rand()%3000;
- }else Cleave_Timer -= diff;
-
- //WarStomp_Timer
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 15000 + rand()%10000;
- }else WarStomp_Timer -= diff;
-
- //FireballVolley_Timer
- if (FireballVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
- FireballVolley_Timer = 12000 + rand()%3000;
- }else FireballVolley_Timer -= diff;
-
- //Conflagration_Timer
- if (Conflagration_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION);
- //We will remove this threat reduction and add an aura check.
-
- //if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- //m_creature->getThreatManager().modifyThreatPercent(m_creature->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()->HasAura(SPELL_CONFLAGRATION,0))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- m_creature->TauntApply(target);
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_razorgore(Creature *_Creature)
-{
- return new boss_razorgoreAI (_Creature);
-}
-
-void AddSC_boss_razorgore()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_razorgore";
- newscript->GetAI = GetAI_boss_razorgore;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Razorgore
+SD%Complete: 50
+SDComment: Needs additional review. Phase 1 NYI
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+//Razorgore Phase 2 Script
+
+#define SAY_NPC_DEATH "If I fall into the abyss I'll take all of you mortals with me..."
+#define SOUND_NPC_DEATH 8278
+#define SAY_EGGS_BREAK3 "No! Not another one! I'll have your heads for this atrocity."
+#define SOUND_EGGS_BREAK3 8277
+
+#define SPELL_CLEAVE 22540
+#define SPELL_WARSTOMP 24375
+#define SPELL_FIREBALLVOLLEY 22425
+#define SPELL_CONFLAGRATION 23023
+
+struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
+{
+ boss_razorgoreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cleave_Timer;
+ uint32 WarStomp_Timer;
+ uint32 FireballVolley_Timer;
+ uint32 Conflagration_Timer;
+
+ void Reset()
+ {
+ Cleave_Timer = 15000; //These times are probably wrong
+ WarStomp_Timer = 35000;
+ FireballVolley_Timer = 7000;
+ Conflagration_Timer = 12000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000 + rand()%3000;
+ }else Cleave_Timer -= diff;
+
+ //WarStomp_Timer
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 15000 + rand()%10000;
+ }else WarStomp_Timer -= diff;
+
+ //FireballVolley_Timer
+ if (FireballVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
+ FireballVolley_Timer = 12000 + rand()%3000;
+ }else FireballVolley_Timer -= diff;
+
+ //Conflagration_Timer
+ if (Conflagration_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION);
+ //We will remove this threat reduction and add an aura check.
+
+ //if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ //m_creature->getThreatManager().modifyThreatPercent(m_creature->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()->HasAura(SPELL_CONFLAGRATION,0))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->TauntApply(target);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_razorgore(Creature *_Creature)
+{
+ return new boss_razorgoreAI (_Creature);
+}
+
+void AddSC_boss_razorgore()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_razorgore";
+ newscript->GetAI = GetAI_boss_razorgore;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
index dffe68c5958..5bcf7fe995e 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
@@ -1,278 +1,278 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vaelastrasz
-SD%Complete: 75
-SDComment: Burning Adrenaline not correctly implemented in core
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ESSENCEOFTHERED 23513
-#define SPELL_FLAMEBREATH 23461
-#define SPELL_FIRENOVA 23462
-#define SPELL_TAILSWIPE 15847
-#define SPELL_BURNINGADRENALINE 23620
-#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
-
-#define SAY_LINE1 "Too late...friends. Nefarius' corruption has taken hold. I cannot...control myself. "
-#define SOUND_LINE1 8281
-
-#define SAY_LINE2 "I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!"
-#define SOUND_LINE2 8282
-
-#define SAY_LINE3 "FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!"
-#define SOUND_LINE3 8283
-
-#define SAY_HALFLIFE "Nefarius' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins! "
-#define SOUND_HALFLIFE 8285
-
-#define SAY_KILLTARGET "Forgive me $N, your death only adds to my failure."
-#define SOUND_KILLTARGET 8284
-
-#define GOSSIP_ITEM "Start Event <Needs Gossip Text>"
-
-struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
-{
- boss_vaelAI(Creature *c) : ScriptedAI(c)
- {
- c->SetUInt32Value(UNIT_NPC_FLAGS,1);
- c->setFaction(35);
- c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Reset();
- }
-
- uint64 PlayerGUID;
- uint32 SpeachTimer;
- uint32 SpeachNum;
- uint32 Cleave_Timer;
- uint32 FlameBreath_Timer;
- uint32 FireNova_Timer;
- uint32 BurningAdrenalineCaster_Timer;
- uint32 BurningAdrenalineTank_Timer;
- uint32 TailSwipe_Timer;
- bool HasYelled;
- bool DoingSpeach;
-
- void Reset()
- {
- PlayerGUID = 0;
- SpeachTimer = 0;
- SpeachNum = 0;
- Cleave_Timer = 8000; //These times are probably wrong
- FlameBreath_Timer = 11000;
- BurningAdrenalineCaster_Timer = 15000;
- BurningAdrenalineTank_Timer = 45000;
- FireNova_Timer = 5000;
- TailSwipe_Timer = 20000;
- HasYelled = false;
- DoingSpeach = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void BeginSpeach(Unit* target)
- {
- //Stand up and begin speach
- PlayerGUID = target->GetGUID();
-
- //10 seconds
- DoYell(SAY_LINE1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE1);
- SpeachTimer = 10000;
- SpeachNum = 0;
- DoingSpeach = true;
- }
-
- void KilledUnit(Unit *victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_KILLTARGET,LANG_UNIVERSAL,victim);
- DoPlaySoundToSet(m_creature,SOUND_KILLTARGET);
- }
-
- void Aggro(Unit *who)
- {
- DoCast(m_creature,SPELL_ESSENCEOFTHERED);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Speach
- if (DoingSpeach)
- if (SpeachTimer < diff)
- {
- switch (SpeachNum)
- {
- case 0:
- //16 seconds till next line
- DoYell(SAY_LINE2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE2);
- SpeachTimer = 16000;
- SpeachNum++;
- 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!"
- DoYell(SAY_LINE3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE3);
- SpeachTimer = 10000;
- SpeachNum++;
- break;
-
- case 2:
- default:
- m_creature->setFaction(103);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
- if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
- {
- DoStartAttackAndMovement(Unit::GetUnit((*m_creature),PlayerGUID));
- DoCast(m_creature,SPELL_ESSENCEOFTHERED);
- }
-
- SpeachTimer = 0;
- DoingSpeach = false;
- break;
- }
- }else SpeachTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- // Yell if hp lower than 15%
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
- {
- //Say our dialog
- DoYell(SAY_HALFLIFE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HALFLIFE);
- HasYelled = true;
- }
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 15000;
- }else Cleave_Timer -= diff;
-
- //FlameBreath_Timer
- if (FlameBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
- FlameBreath_Timer = 4000 + rand()%4000;
- }else FlameBreath_Timer -= diff;
-
- //BurningAdrenalineCaster_Timer
- if (BurningAdrenalineCaster_Timer < diff)
- {
- Unit* target = NULL;
-
- int i = 0 ;
- while (i < 3) // max 3 tries to get a random target with power_mana
- {
- ++i;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader
- if (target)
- if (target->getPowerType() == POWER_MANA)
- i=3;
- }
- if (target) // cast on self (see below)
- target->CastSpell(target,SPELL_BURNINGADRENALINE,1);
-
- BurningAdrenalineCaster_Timer = 15000;
- }else BurningAdrenalineCaster_Timer -= diff;
-
- //BurningAdrenalineTank_Timer
- if (BurningAdrenalineTank_Timer < diff)
- {
- // 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);
-
- BurningAdrenalineTank_Timer = 45000;
- }else BurningAdrenalineTank_Timer -= diff;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 5000;
- }else FireNova_Timer -= diff;
-
- //TailSwipe_Timer
- if (TailSwipe_Timer < diff)
- {
- //Only cast if we are behind
- /*if (!m_creature->HasInArc( M_PI, m_creature->getVictim()))
- {
- DoCast(m_creature->getVictim(),SPELL_TAILSWIPE);
- }*/
-
- TailSwipe_Timer = 20000;
- }else TailSwipe_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-void SendDefaultMenu_boss_vael(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- player->CLOSE_GOSSIP_MENU();
- ((boss_vaelAI*)_Creature->AI())->BeginSpeach((Unit*)player);
- }
-}
-
-bool GossipSelect_boss_vael(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (sender == GOSSIP_SENDER_MAIN)
- SendDefaultMenu_boss_vael(player, _Creature, action);
-
- return true;
-}
-
-bool GossipHello_boss_vael(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(907,_Creature->GetGUID());
-
- return true;
-}
-
-CreatureAI* GetAI_boss_vael(Creature *_Creature)
-{
- return new boss_vaelAI (_Creature);
-}
-
-void AddSC_boss_vael()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_vaelastrasz";
- newscript->GetAI = GetAI_boss_vael;
- newscript->pGossipHello = &GossipHello_boss_vael;
- newscript->pGossipSelect = &GossipSelect_boss_vael;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vaelastrasz
+SD%Complete: 75
+SDComment: Burning Adrenaline not correctly implemented in core
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ESSENCEOFTHERED 23513
+#define SPELL_FLAMEBREATH 23461
+#define SPELL_FIRENOVA 23462
+#define SPELL_TAILSWIPE 15847
+#define SPELL_BURNINGADRENALINE 23620
+#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
+
+#define SAY_LINE1 "Too late...friends. Nefarius' corruption has taken hold. I cannot...control myself. "
+#define SOUND_LINE1 8281
+
+#define SAY_LINE2 "I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!"
+#define SOUND_LINE2 8282
+
+#define SAY_LINE3 "FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!"
+#define SOUND_LINE3 8283
+
+#define SAY_HALFLIFE "Nefarius' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins! "
+#define SOUND_HALFLIFE 8285
+
+#define SAY_KILLTARGET "Forgive me $N, your death only adds to my failure."
+#define SOUND_KILLTARGET 8284
+
+#define GOSSIP_ITEM "Start Event <Needs Gossip Text>"
+
+struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
+{
+ boss_vaelAI(Creature *c) : ScriptedAI(c)
+ {
+ c->SetUInt32Value(UNIT_NPC_FLAGS,1);
+ c->setFaction(35);
+ c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Reset();
+ }
+
+ uint64 PlayerGUID;
+ uint32 SpeachTimer;
+ uint32 SpeachNum;
+ uint32 Cleave_Timer;
+ uint32 FlameBreath_Timer;
+ uint32 FireNova_Timer;
+ uint32 BurningAdrenalineCaster_Timer;
+ uint32 BurningAdrenalineTank_Timer;
+ uint32 TailSwipe_Timer;
+ bool HasYelled;
+ bool DoingSpeach;
+
+ void Reset()
+ {
+ PlayerGUID = 0;
+ SpeachTimer = 0;
+ SpeachNum = 0;
+ Cleave_Timer = 8000; //These times are probably wrong
+ FlameBreath_Timer = 11000;
+ BurningAdrenalineCaster_Timer = 15000;
+ BurningAdrenalineTank_Timer = 45000;
+ FireNova_Timer = 5000;
+ TailSwipe_Timer = 20000;
+ HasYelled = false;
+ DoingSpeach = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void BeginSpeach(Unit* target)
+ {
+ //Stand up and begin speach
+ PlayerGUID = target->GetGUID();
+
+ //10 seconds
+ DoYell(SAY_LINE1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE1);
+ SpeachTimer = 10000;
+ SpeachNum = 0;
+ DoingSpeach = true;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_KILLTARGET,LANG_UNIVERSAL,victim);
+ DoPlaySoundToSet(m_creature,SOUND_KILLTARGET);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoCast(m_creature,SPELL_ESSENCEOFTHERED);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Speach
+ if (DoingSpeach)
+ if (SpeachTimer < diff)
+ {
+ switch (SpeachNum)
+ {
+ case 0:
+ //16 seconds till next line
+ DoYell(SAY_LINE2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE2);
+ SpeachTimer = 16000;
+ SpeachNum++;
+ 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!"
+ DoYell(SAY_LINE3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE3);
+ SpeachTimer = 10000;
+ SpeachNum++;
+ break;
+
+ case 2:
+ default:
+ m_creature->setFaction(103);
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
+ if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
+ {
+ DoStartAttackAndMovement(Unit::GetUnit((*m_creature),PlayerGUID));
+ DoCast(m_creature,SPELL_ESSENCEOFTHERED);
+ }
+
+ SpeachTimer = 0;
+ DoingSpeach = false;
+ break;
+ }
+ }else SpeachTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ // Yell if hp lower than 15%
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
+ {
+ //Say our dialog
+ DoYell(SAY_HALFLIFE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HALFLIFE);
+ HasYelled = true;
+ }
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 15000;
+ }else Cleave_Timer -= diff;
+
+ //FlameBreath_Timer
+ if (FlameBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
+ FlameBreath_Timer = 4000 + rand()%4000;
+ }else FlameBreath_Timer -= diff;
+
+ //BurningAdrenalineCaster_Timer
+ if (BurningAdrenalineCaster_Timer < diff)
+ {
+ Unit* target = NULL;
+
+ int i = 0 ;
+ while (i < 3) // max 3 tries to get a random target with power_mana
+ {
+ ++i;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader
+ if (target)
+ if (target->getPowerType() == POWER_MANA)
+ i=3;
+ }
+ if (target) // cast on self (see below)
+ target->CastSpell(target,SPELL_BURNINGADRENALINE,1);
+
+ BurningAdrenalineCaster_Timer = 15000;
+ }else BurningAdrenalineCaster_Timer -= diff;
+
+ //BurningAdrenalineTank_Timer
+ if (BurningAdrenalineTank_Timer < diff)
+ {
+ // 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);
+
+ BurningAdrenalineTank_Timer = 45000;
+ }else BurningAdrenalineTank_Timer -= diff;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 5000;
+ }else FireNova_Timer -= diff;
+
+ //TailSwipe_Timer
+ if (TailSwipe_Timer < diff)
+ {
+ //Only cast if we are behind
+ /*if (!m_creature->HasInArc( M_PI, m_creature->getVictim()))
+ {
+ DoCast(m_creature->getVictim(),SPELL_TAILSWIPE);
+ }*/
+
+ TailSwipe_Timer = 20000;
+ }else TailSwipe_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+void SendDefaultMenu_boss_vael(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((boss_vaelAI*)_Creature->AI())->BeginSpeach((Unit*)player);
+ }
+}
+
+bool GossipSelect_boss_vael(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu_boss_vael(player, _Creature, action);
+
+ return true;
+}
+
+bool GossipHello_boss_vael(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(907,_Creature->GetGUID());
+
+ return true;
+}
+
+CreatureAI* GetAI_boss_vael(Creature *_Creature)
+{
+ return new boss_vaelAI (_Creature);
+}
+
+void AddSC_boss_vael()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_vaelastrasz";
+ newscript->GetAI = GetAI_boss_vael;
+ newscript->pGossipHello = &GossipHello_boss_vael;
+ newscript->pGossipSelect = &GossipSelect_boss_vael;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
index 3bf03bcbb81..0063f070e24 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
@@ -1,399 +1,399 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Victor_Nefarius
-SD%Complete: 75
-SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_GAMESBEGIN_1 "In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say..."
-#define SAY_GAMESBEGIN_2 "Let the games begin!"
-#define SAY_VAEL_INTRO "<unknown>"
-
-#define SOUND_GAMESBEGIN 8280
-#define SOUND_VAEL_INTRO 8279
-
-#define GOSSIP_ITEM_1 "I've made no mistakes."
-#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
-#define GOSSIP_ITEM_3 "Please do."
-
-#define CREATURE_BRONZE_DRAKANOID 14263
-#define CREATURE_BLUE_DRAKANOID 14261
-#define CREATURE_RED_DRAKANOID 14264
-#define CREATURE_GREEN_DRAKANOID 14262
-#define CREATURE_BLACK_DRAKANOID 14265
-
-#define CREATURE_CHROMATIC_DRAKANOID 14302
-
-#define CREATURE_NEFARIAN 11583
-
-#define ADD_X1 -7591.151855
-#define ADD_X2 -7514.598633
-#define ADD_Y1 -1204.051880
-#define ADD_Y2 -1150.448853
-#define ADD_Z1 476.800476
-#define ADD_Z2 476.796570
-
-#define NEF_X -7445
-#define NEF_Y -1332
-#define NEF_Z 536
-
-#define HIDE_X -7592
-#define HIDE_Y -1264
-#define HIDE_Z 481
-
-#define SPELL_SHADOWBOLT 21077
-#define SPELL_FEAR 26070
-
-//This script is complicated
-//Instead of morphing Victor Nefarius we will have him control phase 1
-//And then have him spawn "Nefarian" for phase 2
-//When phase 2 starts Victor Nefarius will go into hiding and stop attacking
-//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode
-//and allow players to start the event over
-//If nefarian dies then he will kill himself then he will kill himself in his hiding place
-//To prevent players from doing the event twice
-
-struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
-{
- boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
- {
- NefarianGUID = 0;
- Reset();
- srand(time(NULL));
- switch (rand()%20)
- {
- case 0:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 1:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 2:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 3:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 4:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 5:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 6:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 7:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 8:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 9:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 10:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 11:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 12:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 13:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 14:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 15:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 16:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 17:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 18:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 19:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- }
- }
-
- uint32 SpawnedAdds;
- uint32 AddSpawnTimer;
- uint32 ShadowBoltTimer;
- uint32 FearTimer;
- uint32 MindControlTimer;
- uint32 ResetTimer;
- uint32 DrakType1;
- uint32 DrakType2;
- uint64 NefarianGUID;
- uint32 NefCheckTime;
-
- void Reset()
- {
- SpawnedAdds = 0;
- AddSpawnTimer = 10000;
- ShadowBoltTimer = 5000;
- FearTimer = 8000;
- ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
- 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);
- }
-
- void BeginEvent(Player* target)
- {
- DoYell(SAY_GAMESBEGIN_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_GAMESBEGIN);
-
- //Trinity::Singleton<MapManager>::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
- /*
- list <Player*>::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->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)
- {
- AttackStart((*i));
- }
- */
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(103);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- AttackStart(target);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- //We simply use this function to find players until we can use Map->GetPlayers()
-
- if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
- {
- //Add them to our threat list
- m_creature->AddThreat(who,0.0f);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Only do this if we haven't spawned nef yet
- if (SpawnedAdds < 42)
- {
- //ShadowBoltTimer
- if (ShadowBoltTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_SHADOWBOLT);
-
- ShadowBoltTimer = 3000 + (rand()%7000);
- }else ShadowBoltTimer -= diff;
-
- //FearTimer
- if (FearTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_FEAR);
-
- FearTimer = 10000 + (rand()%10000);
- }else FearTimer -= diff;
-
- //Add spawning mechanism
- if (AddSpawnTimer < diff)
- {
- //Spawn 2 random types of creatures at the 2 locations
- uint32 CreatureID;
- Creature* Spawned = NULL;
- Unit* target = NULL;
-
- //1 in 3 chance it will be a chromatic
- if (rand()%3 == 0)
- CreatureID = CREATURE_CHROMATIC_DRAKANOID;
- else CreatureID = DrakType1;
-
- 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);
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Spawned)
- {
- Spawned->AI()->AttackStart(target);
- Spawned->setFaction(103);
- }
-
- //1 in 3 chance it will be a chromatic
- if (rand()%3 == 0)
- CreatureID = CREATURE_CHROMATIC_DRAKANOID;
- else CreatureID = DrakType2;
-
- SpawnedAdds++;
-
- target = NULL;
- Spawned = NULL;
- Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Spawned)
- {
- Spawned->AI()->AttackStart(target);
- Spawned->setFaction(103);
- }
-
- //Begin phase 2 by spawning Nefarian and what not
- 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);
-
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
-
- //Root self
- DoCast(m_creature,33356);
-
- //Make super invis
- DoCast(m_creature,8149);
-
- //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
- m_creature->Relocate(HIDE_X,HIDE_Y,HIDE_Z,0);
- m_creature->SendMonsterMove(HIDE_X,HIDE_Y,HIDE_Z,0,true,0);
- m_creature->addUnitState(UNIT_STAT_FLEEING);
-
- //Spawn nef and have him attack a random target
- Creature* Nefarian = NULL;
- Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
- target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Nefarian)
- {
- Nefarian->AI()->AttackStart(target);
- Nefarian->setFaction(103);
- NefarianGUID = Nefarian->GetGUID();
- }
- else DoYell("UNABLE TO SPAWN NEF PROPERLY",LANG_UNIVERSAL,NULL);
- }
-
- AddSpawnTimer = 4000;
- }else AddSpawnTimer -= diff;
- }
- else if (NefarianGUID)
- {
- if (NefCheckTime < diff)
- {
- Unit* Nefarian = NULL;
- Nefarian = Unit::GetUnit((*m_creature),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->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- NefCheckTime = 2000;
- }else NefCheckTime -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_boss_victor_nefarius(Creature *_Creature)
-{
- return new boss_victor_nefariusAI (_Creature);
-}
-
-bool GossipHello_boss_victor_nefarius(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(7134,_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_boss_victor_nefarius(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(7198, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(7199, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- _Creature->MonsterSay(SAY_GAMESBEGIN_1,LANG_UNIVERSAL,0);
- ((boss_victor_nefariusAI*)_Creature->AI())->BeginEvent(player);
- break;
- }
- return true;
-}
-
-void AddSC_boss_victor_nefarius()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_victor_nefarius";
- newscript->GetAI = GetAI_boss_victor_nefarius;
- newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
- newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Victor_Nefarius
+SD%Complete: 75
+SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_GAMESBEGIN_1 "In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say..."
+#define SAY_GAMESBEGIN_2 "Let the games begin!"
+#define SAY_VAEL_INTRO "<unknown>"
+
+#define SOUND_GAMESBEGIN 8280
+#define SOUND_VAEL_INTRO 8279
+
+#define GOSSIP_ITEM_1 "I've made no mistakes."
+#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
+#define GOSSIP_ITEM_3 "Please do."
+
+#define CREATURE_BRONZE_DRAKANOID 14263
+#define CREATURE_BLUE_DRAKANOID 14261
+#define CREATURE_RED_DRAKANOID 14264
+#define CREATURE_GREEN_DRAKANOID 14262
+#define CREATURE_BLACK_DRAKANOID 14265
+
+#define CREATURE_CHROMATIC_DRAKANOID 14302
+
+#define CREATURE_NEFARIAN 11583
+
+#define ADD_X1 -7591.151855
+#define ADD_X2 -7514.598633
+#define ADD_Y1 -1204.051880
+#define ADD_Y2 -1150.448853
+#define ADD_Z1 476.800476
+#define ADD_Z2 476.796570
+
+#define NEF_X -7445
+#define NEF_Y -1332
+#define NEF_Z 536
+
+#define HIDE_X -7592
+#define HIDE_Y -1264
+#define HIDE_Z 481
+
+#define SPELL_SHADOWBOLT 21077
+#define SPELL_FEAR 26070
+
+//This script is complicated
+//Instead of morphing Victor Nefarius we will have him control phase 1
+//And then have him spawn "Nefarian" for phase 2
+//When phase 2 starts Victor Nefarius will go into hiding and stop attacking
+//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode
+//and allow players to start the event over
+//If nefarian dies then he will kill himself then he will kill himself in his hiding place
+//To prevent players from doing the event twice
+
+struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
+{
+ boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
+ {
+ NefarianGUID = 0;
+ Reset();
+ srand(time(NULL));
+ switch (rand()%20)
+ {
+ case 0:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 1:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 2:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 3:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 4:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 5:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 6:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 7:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 8:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 9:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 10:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 11:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 12:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 13:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 14:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 15:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 16:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 17:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 18:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 19:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ }
+ }
+
+ uint32 SpawnedAdds;
+ uint32 AddSpawnTimer;
+ uint32 ShadowBoltTimer;
+ uint32 FearTimer;
+ uint32 MindControlTimer;
+ uint32 ResetTimer;
+ uint32 DrakType1;
+ uint32 DrakType2;
+ uint64 NefarianGUID;
+ uint32 NefCheckTime;
+
+ void Reset()
+ {
+ SpawnedAdds = 0;
+ AddSpawnTimer = 10000;
+ ShadowBoltTimer = 5000;
+ FearTimer = 8000;
+ ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
+ 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);
+ }
+
+ void BeginEvent(Player* target)
+ {
+ DoYell(SAY_GAMESBEGIN_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GAMESBEGIN);
+
+ //Trinity::Singleton<MapManager>::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
+ /*
+ list <Player*>::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->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)
+ {
+ AttackStart((*i));
+ }
+ */
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ m_creature->setFaction(103);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ AttackStart(target);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ //We simply use this function to find players until we can use Map->GetPlayers()
+
+ if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
+ {
+ //Add them to our threat list
+ m_creature->AddThreat(who,0.0f);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Only do this if we haven't spawned nef yet
+ if (SpawnedAdds < 42)
+ {
+ //ShadowBoltTimer
+ if (ShadowBoltTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_SHADOWBOLT);
+
+ ShadowBoltTimer = 3000 + (rand()%7000);
+ }else ShadowBoltTimer -= diff;
+
+ //FearTimer
+ if (FearTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_FEAR);
+
+ FearTimer = 10000 + (rand()%10000);
+ }else FearTimer -= diff;
+
+ //Add spawning mechanism
+ if (AddSpawnTimer < diff)
+ {
+ //Spawn 2 random types of creatures at the 2 locations
+ uint32 CreatureID;
+ Creature* Spawned = NULL;
+ Unit* target = NULL;
+
+ //1 in 3 chance it will be a chromatic
+ if (rand()%3 == 0)
+ CreatureID = CREATURE_CHROMATIC_DRAKANOID;
+ else CreatureID = DrakType1;
+
+ 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);
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Spawned)
+ {
+ Spawned->AI()->AttackStart(target);
+ Spawned->setFaction(103);
+ }
+
+ //1 in 3 chance it will be a chromatic
+ if (rand()%3 == 0)
+ CreatureID = CREATURE_CHROMATIC_DRAKANOID;
+ else CreatureID = DrakType2;
+
+ SpawnedAdds++;
+
+ target = NULL;
+ Spawned = NULL;
+ Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Spawned)
+ {
+ Spawned->AI()->AttackStart(target);
+ Spawned->setFaction(103);
+ }
+
+ //Begin phase 2 by spawning Nefarian and what not
+ 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);
+
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Root self
+ DoCast(m_creature,33356);
+
+ //Make super invis
+ DoCast(m_creature,8149);
+
+ //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
+ m_creature->Relocate(HIDE_X,HIDE_Y,HIDE_Z,0);
+ m_creature->SendMonsterMove(HIDE_X,HIDE_Y,HIDE_Z,0,true,0);
+ m_creature->addUnitState(UNIT_STAT_FLEEING);
+
+ //Spawn nef and have him attack a random target
+ Creature* Nefarian = NULL;
+ Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
+ target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Nefarian)
+ {
+ Nefarian->AI()->AttackStart(target);
+ Nefarian->setFaction(103);
+ NefarianGUID = Nefarian->GetGUID();
+ }
+ else DoYell("UNABLE TO SPAWN NEF PROPERLY",LANG_UNIVERSAL,NULL);
+ }
+
+ AddSpawnTimer = 4000;
+ }else AddSpawnTimer -= diff;
+ }
+ else if (NefarianGUID)
+ {
+ if (NefCheckTime < diff)
+ {
+ Unit* Nefarian = NULL;
+ Nefarian = Unit::GetUnit((*m_creature),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->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ NefCheckTime = 2000;
+ }else NefCheckTime -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_victor_nefarius(Creature *_Creature)
+{
+ return new boss_victor_nefariusAI (_Creature);
+}
+
+bool GossipHello_boss_victor_nefarius(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(7134,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_boss_victor_nefarius(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(7198, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(7199, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->MonsterSay(SAY_GAMESBEGIN_1,LANG_UNIVERSAL,0);
+ ((boss_victor_nefariusAI*)_Creature->AI())->BeginEvent(player);
+ break;
+ }
+ return true;
+}
+
+void AddSC_boss_victor_nefarius()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_victor_nefarius";
+ newscript->GetAI = GetAI_boss_victor_nefarius;
+ newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
+ newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
index e6c06bc739c..7bdd3250442 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
@@ -1,8 +1,8 @@
-/* ScriptData
-SDName: Instance_Blackwing_Lair
-SD%Complete: 0
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
+/* ScriptData
+SDName: Instance_Blackwing_Lair
+SD%Complete: 0
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
index 42e3121f350..a7c35624830 100644
--- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
@@ -1,441 +1,441 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blades_Edge_Mountains
-SD%Complete: 90
-SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
-SDCategory: Blade's Edge Mountains
-EndScriptData */
-
-/* ContentData
-mobs_bladespire_ogre
-mobs_nether_drake
-npc_daranelle
-npc_overseer_nuaar
-npc_saikkal_the_elder
-npc_skyguard_handler_irena
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mobs_bladespire_ogre
-######*/
-
-//TODO: add support for quest 10512 + creature abilities
-struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
-{
- mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
- }
-};
-CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
-{
- return new mobs_bladespire_ogreAI (_Creature);
-}
-
-/*######
-## mobs_nether_drake
-######*/
-
-#define SAY_NIHIL_1 "Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!"
-#define SAY_NIHIL_2 "All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!"
-#define SAY_NIHIL_3 "Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!"
-#define SAY_NIHIL_4 "No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again."
-#define SAY_NIHIL_INTERRUPT "NOOOOooooooo!"
-
-#define ENTRY_WHELP 20021
-#define ENTRY_PROTO 21821
-#define ENTRY_ADOLE 21817
-#define ENTRY_MATUR 21820
-#define ENTRY_NIHIL 21823
-
-#define SPELL_T_PHASE_MODULATOR 37573
-
-#define SPELL_ARCANE_BLAST 38881
-#define SPELL_MANA_BURN 38884
-#define SPELL_INTANGIBLE_PRESENCE 36513
-
-struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
-{
- mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool IsNihil;
- uint32 NihilSpeech_Timer;
- uint32 NihilSpeech_Phase;
-
- uint32 ArcaneBlast_Timer;
- uint32 ManaBurn_Timer;
- uint32 IntangiblePresence_Timer;
-
- void Reset()
- {
- NihilSpeech_Timer = 2000;
- IsNihil = false;
- if( m_creature->GetEntry() == ENTRY_NIHIL )
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- IsNihil = true;
- }
- NihilSpeech_Phase = 1;
-
- ArcaneBlast_Timer = 7500;
- ManaBurn_Timer = 10000;
- IntangiblePresence_Timer = 15000;
- }
-
- void Aggro(Unit* who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
- {
- uint32 cEntry = 0;
-
- switch( m_creature->GetEntry() )
- {
- case ENTRY_WHELP:
- switch(rand()%4)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- case 3: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_PROTO:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_ADOLE; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_ADOLE:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_MATUR:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_NIHIL:
- if( NihilSpeech_Phase )
- {
- DoYell(SAY_NIHIL_INTERRUPT,LANG_UNIVERSAL,NULL);
- IsNihil = false;
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- }
- }
- break;
- }
-
- if( cEntry )
- {
- m_creature->UpdateEntry(cEntry);
-
- if( cEntry == ENTRY_NIHIL )
- {
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- InCombat = false;
- Reset();
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( IsNihil )
- {
- if( NihilSpeech_Phase )
- {
- if(NihilSpeech_Timer <= diff)
- {
- switch( NihilSpeech_Phase )
- {
- case 1:
- DoSay(SAY_NIHIL_1,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 2:
- DoSay(SAY_NIHIL_2,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 3:
- DoSay(SAY_NIHIL_3,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 4:
- DoSay(SAY_NIHIL_4,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 5:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // + MOVEMENTFLAG_LEVITATING
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- //then take off to random location. creature is initially summoned, so don't bother do anything else.
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
- NihilSpeech_Phase = 0;
- break;
- }
- NihilSpeech_Timer = 5000;
- }else NihilSpeech_Timer -=diff;
- }
- return; //anything below here is not interesting for Nihil, so skip it
- }
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( IntangiblePresence_Timer <= diff )
- {
- DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
- IntangiblePresence_Timer = 15000+rand()%15000;
- }else IntangiblePresence_Timer -= diff;
-
- if( ManaBurn_Timer <= diff )
- {
- Unit* target = m_creature->getVictim();
- if( target && target->getPowerType() == POWER_MANA )
- DoCast(target,SPELL_MANA_BURN);
- ManaBurn_Timer = 8000+rand()%8000;
- }else ManaBurn_Timer -= diff;
-
- if( ArcaneBlast_Timer <= diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
- ArcaneBlast_Timer = 2500+rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
-{
- return new mobs_nether_drakeAI (_Creature);
-}
-
-/*######
-## npc_daranelle
-######*/
-
-struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
-{
- npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (who->GetTypeId() == TYPEID_PLAYER)
- {
- if(who->HasAura(36904,0))
- {
- DoSay("Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.",LANG_COMMON,who);
- //TODO: Move the below to updateAI and run if this statement == true
- ((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
- ((Player*)who)->RemoveAurasDueToSpell(36904);
- }
- }
-
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin melee attack if we are within range
- DoStartAttackAndMovement(who);
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
-{
- return new npc_daranelleAI (_Creature);
-}
-
-/*######
-## npc_overseer_nuaar
-######*/
-
-bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
- player->AreaExploredOrEventHappens(10682);
- }
- return true;
-}
-
-/*######
-## npc_saikkal_the_elder
-######*/
-
-bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
- break;
- }
- return true;
-}
-
-/*######
-## npc_skyguard_handler_irena
-######*/
-
-#define GOSSIP_SKYGUARD "Fly me to Skettis please"
-
-bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetReputationRank(1031) >= REP_HONORED)
- player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 172; //from ogri'la
- nodes[1] = 171; //end at skettis
- player->ActivateTaxiPathTo(nodes); //TaxiPath 706
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_blades_edge_mountains()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_bladespire_ogre";
- newscript->GetAI = GetAI_mobs_bladespire_ogre;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mobs_nether_drake";
- newscript->GetAI = GetAI_mobs_nether_drake;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_daranelle";
- newscript->GetAI = GetAI_npc_daranelle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_overseer_nuaar";
- newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
- newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_saikkal_the_elder";
- newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
- newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_skyguard_handler_irena";
- newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
- newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blades_Edge_Mountains
+SD%Complete: 90
+SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
+SDCategory: Blade's Edge Mountains
+EndScriptData */
+
+/* ContentData
+mobs_bladespire_ogre
+mobs_nether_drake
+npc_daranelle
+npc_overseer_nuaar
+npc_saikkal_the_elder
+npc_skyguard_handler_irena
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mobs_bladespire_ogre
+######*/
+
+//TODO: add support for quest 10512 + creature abilities
+struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
+{
+ mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
+ }
+};
+CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
+{
+ return new mobs_bladespire_ogreAI (_Creature);
+}
+
+/*######
+## mobs_nether_drake
+######*/
+
+#define SAY_NIHIL_1 "Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!"
+#define SAY_NIHIL_2 "All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!"
+#define SAY_NIHIL_3 "Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!"
+#define SAY_NIHIL_4 "No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again."
+#define SAY_NIHIL_INTERRUPT "NOOOOooooooo!"
+
+#define ENTRY_WHELP 20021
+#define ENTRY_PROTO 21821
+#define ENTRY_ADOLE 21817
+#define ENTRY_MATUR 21820
+#define ENTRY_NIHIL 21823
+
+#define SPELL_T_PHASE_MODULATOR 37573
+
+#define SPELL_ARCANE_BLAST 38881
+#define SPELL_MANA_BURN 38884
+#define SPELL_INTANGIBLE_PRESENCE 36513
+
+struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
+{
+ mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool IsNihil;
+ uint32 NihilSpeech_Timer;
+ uint32 NihilSpeech_Phase;
+
+ uint32 ArcaneBlast_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 IntangiblePresence_Timer;
+
+ void Reset()
+ {
+ NihilSpeech_Timer = 2000;
+ IsNihil = false;
+ if( m_creature->GetEntry() == ENTRY_NIHIL )
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = true;
+ }
+ NihilSpeech_Phase = 1;
+
+ ArcaneBlast_Timer = 7500;
+ ManaBurn_Timer = 10000;
+ IntangiblePresence_Timer = 15000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
+ {
+ uint32 cEntry = 0;
+
+ switch( m_creature->GetEntry() )
+ {
+ case ENTRY_WHELP:
+ switch(rand()%4)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_MATUR; break;
+ case 3: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_PROTO:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_ADOLE; break;
+ case 1: cEntry = ENTRY_MATUR; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_ADOLE:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_MATUR; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_MATUR:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_NIHIL:
+ if( NihilSpeech_Phase )
+ {
+ DoYell(SAY_NIHIL_INTERRUPT,LANG_UNIVERSAL,NULL);
+ IsNihil = false;
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_MATUR; break;
+ }
+ }
+ break;
+ }
+
+ if( cEntry )
+ {
+ m_creature->UpdateEntry(cEntry);
+
+ if( cEntry == ENTRY_NIHIL )
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ InCombat = false;
+ Reset();
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( IsNihil )
+ {
+ if( NihilSpeech_Phase )
+ {
+ if(NihilSpeech_Timer <= diff)
+ {
+ switch( NihilSpeech_Phase )
+ {
+ case 1:
+ DoSay(SAY_NIHIL_1,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 2:
+ DoSay(SAY_NIHIL_2,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 3:
+ DoSay(SAY_NIHIL_3,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 4:
+ DoSay(SAY_NIHIL_4,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 5:
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // + MOVEMENTFLAG_LEVITATING
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ //then take off to random location. creature is initially summoned, so don't bother do anything else.
+ m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
+ NihilSpeech_Phase = 0;
+ break;
+ }
+ NihilSpeech_Timer = 5000;
+ }else NihilSpeech_Timer -=diff;
+ }
+ return; //anything below here is not interesting for Nihil, so skip it
+ }
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( IntangiblePresence_Timer <= diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
+ IntangiblePresence_Timer = 15000+rand()%15000;
+ }else IntangiblePresence_Timer -= diff;
+
+ if( ManaBurn_Timer <= diff )
+ {
+ Unit* target = m_creature->getVictim();
+ if( target && target->getPowerType() == POWER_MANA )
+ DoCast(target,SPELL_MANA_BURN);
+ ManaBurn_Timer = 8000+rand()%8000;
+ }else ManaBurn_Timer -= diff;
+
+ if( ArcaneBlast_Timer <= diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
+ ArcaneBlast_Timer = 2500+rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
+{
+ return new mobs_nether_drakeAI (_Creature);
+}
+
+/*######
+## npc_daranelle
+######*/
+
+struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
+{
+ npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(who->HasAura(36904,0))
+ {
+ DoSay("Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.",LANG_COMMON,who);
+ //TODO: Move the below to updateAI and run if this statement == true
+ ((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
+ ((Player*)who)->RemoveAurasDueToSpell(36904);
+ }
+ }
+
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin melee attack if we are within range
+ DoStartAttackAndMovement(who);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
+{
+ return new npc_daranelleAI (_Creature);
+}
+
+/*######
+## npc_overseer_nuaar
+######*/
+
+bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
+ player->AreaExploredOrEventHappens(10682);
+ }
+ return true;
+}
+
+/*######
+## npc_saikkal_the_elder
+######*/
+
+bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_skyguard_handler_irena
+######*/
+
+#define GOSSIP_SKYGUARD "Fly me to Skettis please"
+
+bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetReputationRank(1031) >= REP_HONORED)
+ player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 172; //from ogri'la
+ nodes[1] = 171; //end at skettis
+ player->ActivateTaxiPathTo(nodes); //TaxiPath 706
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_blades_edge_mountains()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_bladespire_ogre";
+ newscript->GetAI = GetAI_mobs_bladespire_ogre;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_nether_drake";
+ newscript->GetAI = GetAI_mobs_nether_drake;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_daranelle";
+ newscript->GetAI = GetAI_npc_daranelle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_overseer_nuaar";
+ newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
+ newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_saikkal_the_elder";
+ newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
+ newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_skyguard_handler_irena";
+ newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
+ newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
index 3a20df853ef..9212f13946a 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
@@ -1,159 +1,159 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blasted_Lands
-SD%Complete: 90
-SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support.
-SDCategory: Blasted Lands
-EndScriptData */
-
-/* ContentData
-npc_deathly_usher
-npc_fallen_hero_of_horde
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_deathly_usher
-######*/
-
-#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
-
-#define SPELL_TELEPORT_SINGLE 12885
-#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142
-#define SPELL_TELEPORT_GROUP 27686
-
-bool GossipHello_npc_deathly_usher(Player *player, Creature *_Creature)
-{
- if(player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757, 1))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_deathly_usher(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action = GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
- }
-
- return true;
-}
-
-/*######
-## npc_fallen_hero_of_horde
-######*/
-
-#define GOSSIP_ITEM_FALLEN "Continue..."
-
-#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?"
-#define GOSSIP_ITEM_FALLEN2 "Subordinates?"
-#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?"
-#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero"
-#define GOSSIP_ITEM_FALLEN5 "I shall"
-
-bool GossipHello_npc_fallen_hero_of_horde(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == HORDE)
- player->ADD_GOSSIP_ITEM( 0, "Continue story...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == ALLIANCE)
- player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_fallen_hero_of_horde(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(1392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
- if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(2784);
- if (player->GetTeam() == ALLIANCE)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
- }
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(1451, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(1452, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
- player->SEND_GOSSIP_MENU(1453, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+23:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
- player->SEND_GOSSIP_MENU(1454, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+24:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
- player->SEND_GOSSIP_MENU(1455, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+25:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
- player->SEND_GOSSIP_MENU(1456, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+26:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2801);
- break;
- }
- return true;
-}
-
-void AddSC_blasted_lands()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_deathly_usher";
- newscript->pGossipHello = &GossipHello_npc_deathly_usher;
- newscript->pGossipSelect = &GossipSelect_npc_deathly_usher;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_fallen_hero_of_horde";
- newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde;
- newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blasted_Lands
+SD%Complete: 90
+SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support.
+SDCategory: Blasted Lands
+EndScriptData */
+
+/* ContentData
+npc_deathly_usher
+npc_fallen_hero_of_horde
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_deathly_usher
+######*/
+
+#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
+
+#define SPELL_TELEPORT_SINGLE 12885
+#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142
+#define SPELL_TELEPORT_GROUP 27686
+
+bool GossipHello_npc_deathly_usher(Player *player, Creature *_Creature)
+{
+ if(player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757, 1))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_deathly_usher(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action = GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
+ }
+
+ return true;
+}
+
+/*######
+## npc_fallen_hero_of_horde
+######*/
+
+#define GOSSIP_ITEM_FALLEN "Continue..."
+
+#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?"
+#define GOSSIP_ITEM_FALLEN2 "Subordinates?"
+#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?"
+#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero"
+#define GOSSIP_ITEM_FALLEN5 "I shall"
+
+bool GossipHello_npc_fallen_hero_of_horde(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == HORDE)
+ player->ADD_GOSSIP_ITEM( 0, "Continue story...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == ALLIANCE)
+ player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_fallen_hero_of_horde(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(1392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
+ if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(2784);
+ if (player->GetTeam() == ALLIANCE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
+ }
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ player->SEND_GOSSIP_MENU(1451, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(1452, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
+ player->SEND_GOSSIP_MENU(1453, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+23:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
+ player->SEND_GOSSIP_MENU(1454, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+24:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
+ player->SEND_GOSSIP_MENU(1455, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+25:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
+ player->SEND_GOSSIP_MENU(1456, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+26:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2801);
+ break;
+ }
+ return true;
+}
+
+void AddSC_blasted_lands()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_deathly_usher";
+ newscript->pGossipHello = &GossipHello_npc_deathly_usher;
+ newscript->pGossipSelect = &GossipSelect_npc_deathly_usher;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_fallen_hero_of_horde";
+ newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde;
+ newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
index 982ef1d1765..9de7b6d6085 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
@@ -1,182 +1,182 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kruul
-SD%Complete: 100
-SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWVOLLEY 21341
-#define SPELL_CLEAVE 20677
-#define SPELL_THUNDERCLAP 23931
-#define SPELL_TWISTEDREFLECTION 21063
-#define SPELL_VOIDBOLT 21066
-#define SPELL_RAGE 21340
-#define SPELL_CAPTURESOUL 21054
-
-struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
-{
- boss_kruulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 Cleave_Timer;
- uint32 ThunderClap_Timer;
- uint32 TwistedReflection_Timer;
- uint32 VoidBolt_Timer;
- uint32 Rage_Timer;
- uint32 Hound_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- Cleave_Timer = 14000;
- ThunderClap_Timer = 20000;
- TwistedReflection_Timer = 25000;
- VoidBolt_Timer = 30000;
- Rage_Timer = 60000; //Cast rage after 1 minute
- Hound_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void KilledUnit()
- {
- // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
- DoCast(m_creature,SPELL_CAPTURESOUL);
-
- }
-
- void SummonHounds(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- if (rand()%100 < 46)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY);
- }
-
- ShadowVolley_Timer = 5000;
- }else ShadowVolley_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- if (rand()%100 < 50)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- }
-
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- //ThunderClap_Timer
- if (ThunderClap_Timer < diff)
- {
- if (rand()%100 < 20)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- }
-
- ThunderClap_Timer = 12000;
- }else ThunderClap_Timer -= diff;
-
- //TwistedReflection_Timer
- if (TwistedReflection_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION);
- TwistedReflection_Timer = 30000;
- }else TwistedReflection_Timer -= diff;
-
- //VoidBolt_Timer
- if (VoidBolt_Timer < diff)
- {
- if (rand()%100 < 40)
- {
- DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
- }
-
- VoidBolt_Timer = 18000;
- }else VoidBolt_Timer -= diff;
-
- //Rage_Timer
- if (Rage_Timer < diff)
- {
- DoCast(m_creature,SPELL_RAGE);
- Rage_Timer = 70000;
- }else Rage_Timer -= diff;
-
- //Hound_Timer
- if (Hound_Timer < diff)
- {
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
-
- Hound_Timer = 45000;
- }else Hound_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_kruul(Creature *_Creature)
-{
- return new boss_kruulAI (_Creature);
-}
-
-void AddSC_boss_kruul()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kruul";
- newscript->GetAI = GetAI_boss_kruul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kruul
+SD%Complete: 100
+SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWVOLLEY 21341
+#define SPELL_CLEAVE 20677
+#define SPELL_THUNDERCLAP 23931
+#define SPELL_TWISTEDREFLECTION 21063
+#define SPELL_VOIDBOLT 21066
+#define SPELL_RAGE 21340
+#define SPELL_CAPTURESOUL 21054
+
+struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
+{
+ boss_kruulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 Cleave_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 TwistedReflection_Timer;
+ uint32 VoidBolt_Timer;
+ uint32 Rage_Timer;
+ uint32 Hound_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 10000;
+ Cleave_Timer = 14000;
+ ThunderClap_Timer = 20000;
+ TwistedReflection_Timer = 25000;
+ VoidBolt_Timer = 30000;
+ Rage_Timer = 60000; //Cast rage after 1 minute
+ Hound_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void KilledUnit()
+ {
+ // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
+ DoCast(m_creature,SPELL_CAPTURESOUL);
+
+ }
+
+ void SummonHounds(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ if (rand()%100 < 46)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY);
+ }
+
+ ShadowVolley_Timer = 5000;
+ }else ShadowVolley_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ if (rand()%100 < 50)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ }
+
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ //ThunderClap_Timer
+ if (ThunderClap_Timer < diff)
+ {
+ if (rand()%100 < 20)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ }
+
+ ThunderClap_Timer = 12000;
+ }else ThunderClap_Timer -= diff;
+
+ //TwistedReflection_Timer
+ if (TwistedReflection_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION);
+ TwistedReflection_Timer = 30000;
+ }else TwistedReflection_Timer -= diff;
+
+ //VoidBolt_Timer
+ if (VoidBolt_Timer < diff)
+ {
+ if (rand()%100 < 40)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
+ }
+
+ VoidBolt_Timer = 18000;
+ }else VoidBolt_Timer -= diff;
+
+ //Rage_Timer
+ if (Rage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_RAGE);
+ Rage_Timer = 70000;
+ }else Rage_Timer -= diff;
+
+ //Hound_Timer
+ if (Hound_Timer < diff)
+ {
+ SummonHounds(m_creature->getVictim());
+ SummonHounds(m_creature->getVictim());
+ SummonHounds(m_creature->getVictim());
+
+ Hound_Timer = 45000;
+ }else Hound_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_kruul(Creature *_Creature)
+{
+ return new boss_kruulAI (_Creature);
+}
+
+void AddSC_boss_kruul()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kruul";
+ newscript->GetAI = GetAI_boss_kruul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
index 001e2ed4e6c..e52386fc020 100644
--- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
@@ -1,141 +1,141 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Bloodmyst_Isle
-SD%Complete: 80
-SDComment: Quest support: 9670, 9756(gossip items text needed).
-SDCategory: Bloodmyst Isle
-EndScriptData */
-
-/* ContentData
-mob_webbed_creature
-npc_captured_sunhawk_agent
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_webbed_creature
-######*/
-
-//possible creatures to be spawned
-const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
-
-struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
-{
- mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- uint32 spawnCreatureID;
-
- switch(rand()%3)
- {
- case 0:
- spawnCreatureID = 17681;
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
- break;
- case 1:
- case 2:
- spawnCreatureID = possibleSpawns[rand()%31];
- break;
- }
-
- if(spawnCreatureID)
- DoSpawnCreature(spawnCreatureID,0,0,0,m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- }
-};
-CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
-{
- return new mob_webbed_creatureAI (_Creature);
-}
-
-/*######
-## npc_captured_sunhawk_agent
-######*/
-
-#define C_SUNHAWK_TRIGGER 17974
-
-bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
-{
- if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(9134, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_captured_sunhawk_agent(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(9137, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(9138, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(9139, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(9140, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(9141, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(C_SUNHAWK_TRIGGER, _Creature->GetGUID());
- break;
- }
- return true;
-}
-
-void AddSC_bloodmyst_isle()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_webbed_creature";
- newscript->GetAI = GetAI_mob_webbed_creature;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_captured_sunhawk_agent";
- newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent;
- newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Bloodmyst_Isle
+SD%Complete: 80
+SDComment: Quest support: 9670, 9756(gossip items text needed).
+SDCategory: Bloodmyst Isle
+EndScriptData */
+
+/* ContentData
+mob_webbed_creature
+npc_captured_sunhawk_agent
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_webbed_creature
+######*/
+
+//possible creatures to be spawned
+const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
+
+struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
+{
+ mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ uint32 spawnCreatureID;
+
+ switch(rand()%3)
+ {
+ case 0:
+ spawnCreatureID = 17681;
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
+ break;
+ case 1:
+ case 2:
+ spawnCreatureID = possibleSpawns[rand()%31];
+ break;
+ }
+
+ if(spawnCreatureID)
+ DoSpawnCreature(spawnCreatureID,0,0,0,m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ }
+};
+CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
+{
+ return new mob_webbed_creatureAI (_Creature);
+}
+
+/*######
+## npc_captured_sunhawk_agent
+######*/
+
+#define C_SUNHAWK_TRIGGER 17974
+
+bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
+{
+ if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(9134, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_captured_sunhawk_agent(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(9137, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(9138, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(9139, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(9140, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(9141, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->CLOSE_GOSSIP_MENU();
+ player->TalkedToCreature(C_SUNHAWK_TRIGGER, _Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+void AddSC_bloodmyst_isle()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_webbed_creature";
+ newscript->GetAI = GetAI_mob_webbed_creature;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_captured_sunhawk_agent";
+ newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent;
+ newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
index 4a86bcaf104..4b5e491c1c1 100644
--- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
+++ b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
@@ -1,157 +1,157 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Burning_Steppes
-SD%Complete: 100
-SDComment: Quest support: 4224, 4866
-SDCategory: Burning Steppes
-EndScriptData */
-
-/* ContentData
-npc_ragged_john
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_ragged_john
-######*/
-
-struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
-{
- npc_ragged_johnAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- void Reset() {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if( who->HasAura(16468,0) )
- {
- if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) )
- {
- DoCast(who,16472);
- ((Player*)who)->AreaExploredOrEventHappens(4866);
- }
- }
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who) {}
-};
-
-CreatureAI* GetAI_npc_ragged_john(Creature *_Creature)
-{
- return new npc_ragged_johnAI (_Creature);
-}
-
-bool GossipHello_npc_ragged_john(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2713, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_ragged_john(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "So what did you do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2714, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2715, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Ironfoe?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2716, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "Interesting... continue John.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2717, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "So that's how Windsor died...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(2718, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "So how did he die?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(2719, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM( 0, "Ok so where the hell is he? Wait a minute! Are you drunk?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(2720, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM( 0, "WHY is he in Blackrock Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2721, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM( 0, "300? So the Dark Irons killed him and dragged him into the Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(2722, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM( 0, "Ahh... Ironfoe", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->SEND_GOSSIP_MENU(2723, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM( 0, "Thanks, Ragged John. Your story was very uplifting and informative", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2725, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4224);
- break;
- }
- return true;
-}
-
-void AddSC_burning_steppes()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_ragged_john";
- newscript->GetAI = GetAI_npc_ragged_john;
- newscript->pGossipHello = &GossipHello_npc_ragged_john;
- newscript->pGossipSelect = &GossipSelect_npc_ragged_john;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Burning_Steppes
+SD%Complete: 100
+SDComment: Quest support: 4224, 4866
+SDCategory: Burning Steppes
+EndScriptData */
+
+/* ContentData
+npc_ragged_john
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_ragged_john
+######*/
+
+struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
+{
+ npc_ragged_johnAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( who->HasAura(16468,0) )
+ {
+ if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ DoCast(who,16472);
+ ((Player*)who)->AreaExploredOrEventHappens(4866);
+ }
+ }
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who) {}
+};
+
+CreatureAI* GetAI_npc_ragged_john(Creature *_Creature)
+{
+ return new npc_ragged_johnAI (_Creature);
+}
+
+bool GossipHello_npc_ragged_john(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(2713, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_ragged_john(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "So what did you do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(2714, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(2715, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Ironfoe?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2716, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "Interesting... continue John.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(2717, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "So that's how Windsor died...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(2718, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "So how did he die?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(2719, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM( 0, "Ok so where the hell is he? Wait a minute! Are you drunk?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(2720, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->ADD_GOSSIP_ITEM( 0, "WHY is he in Blackrock Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2721, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ player->ADD_GOSSIP_ITEM( 0, "300? So the Dark Irons killed him and dragged him into the Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(2722, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ player->ADD_GOSSIP_ITEM( 0, "Ahh... Ironfoe", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->SEND_GOSSIP_MENU(2723, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+10:
+ player->ADD_GOSSIP_ITEM( 0, "Thanks, Ragged John. Your story was very uplifting and informative", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(2725, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(4224);
+ break;
+ }
+ return true;
+}
+
+void AddSC_burning_steppes()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_ragged_john";
+ newscript->GetAI = GetAI_npc_ragged_john;
+ newscript->pGossipHello = &GossipHello_npc_ragged_john;
+ newscript->pGossipSelect = &GossipSelect_npc_ragged_john;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
index 7927730f4b2..91f05eadc3c 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
@@ -1,137 +1,137 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Aeonus
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAND_BREATH 31478
-#define TIME_STOP 31422
-#define FRENZY 19812
-
-#define SAY_ENTER "The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!"
-#define SAY_AGGRO "Let us see what fate lays in store..."
-#define SAY_BANISH "Your time is up, slave of the past!"
-#define SAY_SLAY1 "One less obstacle in our way!"
-#define SAY_SLAY2 "No one can stop us! No one!"
-#define SAY_DEATH "It is only a matter...of time."
-
-#define SOUND_ENTER 10400
-#define SOUND_AGGRO 10402
-#define SOUND_BANISH 10401
-#define SOUND_SLAY1 10403
-#define SOUND_SLAY2 10404
-#define SOUND_DEATH 10405
-
-struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
-{
- boss_aeonusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SandBreath_Timer;
- uint32 TimeStop_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- SandBreath_Timer = 30000;
- TimeStop_Timer = 40000;
- Frenzy_Timer = 120000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void JustDied(Unit *victim)
- {
- //Just Died
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void KilledUnit(Unit *victim)
- {
- //Killed Unit
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Sand Breath
- if (SandBreath_Timer < diff)
- {
- Unit* target = NULL;
- target = m_creature->getVictim();
- if (target)
- DoCast(target, SAND_BREATH);
- SandBreath_Timer = 30000;
- }else SandBreath_Timer -= diff;
-
- //Time Stop
- if (TimeStop_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
-
- DoCast(m_creature->getVictim(), TIME_STOP);
- TimeStop_Timer = 40000;
- }else TimeStop_Timer -= diff;
-
- //Frenzy
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature, FRENZY);
- Frenzy_Timer = 120000;
- }else Frenzy_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_aeonus(Creature *_Creature)
-{
- return new boss_aeonusAI (_Creature);
-}
-
-void AddSC_boss_aeonus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_aeonus";
- newscript->GetAI = GetAI_boss_aeonus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Aeonus
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAND_BREATH 31478
+#define TIME_STOP 31422
+#define FRENZY 19812
+
+#define SAY_ENTER "The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!"
+#define SAY_AGGRO "Let us see what fate lays in store..."
+#define SAY_BANISH "Your time is up, slave of the past!"
+#define SAY_SLAY1 "One less obstacle in our way!"
+#define SAY_SLAY2 "No one can stop us! No one!"
+#define SAY_DEATH "It is only a matter...of time."
+
+#define SOUND_ENTER 10400
+#define SOUND_AGGRO 10402
+#define SOUND_BANISH 10401
+#define SOUND_SLAY1 10403
+#define SOUND_SLAY2 10404
+#define SOUND_DEATH 10405
+
+struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
+{
+ boss_aeonusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SandBreath_Timer;
+ uint32 TimeStop_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ SandBreath_Timer = 30000;
+ TimeStop_Timer = 40000;
+ Frenzy_Timer = 120000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ //Just Died
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ //Killed Unit
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Sand Breath
+ if (SandBreath_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = m_creature->getVictim();
+ if (target)
+ DoCast(target, SAND_BREATH);
+ SandBreath_Timer = 30000;
+ }else SandBreath_Timer -= diff;
+
+ //Time Stop
+ if (TimeStop_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+
+ DoCast(m_creature->getVictim(), TIME_STOP);
+ TimeStop_Timer = 40000;
+ }else TimeStop_Timer -= diff;
+
+ //Frenzy
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature, FRENZY);
+ Frenzy_Timer = 120000;
+ }else Frenzy_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_aeonus(Creature *_Creature)
+{
+ return new boss_aeonusAI (_Creature);
+}
+
+void AddSC_boss_aeonus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_aeonus";
+ newscript->GetAI = GetAI_boss_aeonus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
index 9b63c8411d9..497f916c9c5 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
@@ -1,124 +1,124 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Chrono_Lord_Deja
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define ARCANE_BLAST 24857
-#define TIME_LAPSE 31467
-#define MAGNETIC_PULL 28337 //Not Implemented (Heroic mod)
-
-#define SAY_ENTER "Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ..."
-#define SAY_AGGRO "If you will not cease this foolish quest, then you will die!"
-#define SAY_BANISH "You have outstayed your welcome, Timekeeper. Begone!"
-#define SAY_SLAY1 "I told you it was a fool's quest!"
-#define SAY_SLAY2 "Leaving so soon?"
-#define SAY_DEATH "Time ... is on our side."
-
-#define SOUND_ENTER 10412
-#define SOUND_AGGRO 10414
-#define SOUND_BANISH 10413
-#define SOUND_SLAY1 10415
-#define SOUND_SLAY2 10416
-#define SOUND_DEATH 10417
-
-struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
-{
- boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ArcaneBlast_Timer;
- uint32 TimeLapse_Timer;
-
- void Reset()
- {
- ArcaneBlast_Timer = 20000;
- TimeLapse_Timer = 15000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Arcane Blast
- if (ArcaneBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), ARCANE_BLAST);
- ArcaneBlast_Timer = 20000+rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- //Time Lapse
- if (TimeLapse_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
- DoCast(m_creature, TIME_LAPSE);
- TimeLapse_Timer = 15000+rand()%10000;
- }else TimeLapse_Timer -= diff;
-
- DoMeleeAttackIfReady();
-
- }
-};
-
-CreatureAI* GetAI_boss_chrono_lord_deja(Creature *_Creature)
-{
- return new boss_chrono_lord_dejaAI (_Creature);
-}
-
-void AddSC_boss_chrono_lord_deja()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_chrono_lord_deja";
- newscript->GetAI = GetAI_boss_chrono_lord_deja;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Chrono_Lord_Deja
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define ARCANE_BLAST 24857
+#define TIME_LAPSE 31467
+#define MAGNETIC_PULL 28337 //Not Implemented (Heroic mod)
+
+#define SAY_ENTER "Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ..."
+#define SAY_AGGRO "If you will not cease this foolish quest, then you will die!"
+#define SAY_BANISH "You have outstayed your welcome, Timekeeper. Begone!"
+#define SAY_SLAY1 "I told you it was a fool's quest!"
+#define SAY_SLAY2 "Leaving so soon?"
+#define SAY_DEATH "Time ... is on our side."
+
+#define SOUND_ENTER 10412
+#define SOUND_AGGRO 10414
+#define SOUND_BANISH 10413
+#define SOUND_SLAY1 10415
+#define SOUND_SLAY2 10416
+#define SOUND_DEATH 10417
+
+struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
+{
+ boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ArcaneBlast_Timer;
+ uint32 TimeLapse_Timer;
+
+ void Reset()
+ {
+ ArcaneBlast_Timer = 20000;
+ TimeLapse_Timer = 15000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Arcane Blast
+ if (ArcaneBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), ARCANE_BLAST);
+ ArcaneBlast_Timer = 20000+rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ //Time Lapse
+ if (TimeLapse_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+ DoCast(m_creature, TIME_LAPSE);
+ TimeLapse_Timer = 15000+rand()%10000;
+ }else TimeLapse_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ }
+};
+
+CreatureAI* GetAI_boss_chrono_lord_deja(Creature *_Creature)
+{
+ return new boss_chrono_lord_dejaAI (_Creature);
+}
+
+void AddSC_boss_chrono_lord_deja()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_chrono_lord_deja";
+ newscript->GetAI = GetAI_boss_chrono_lord_deja;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
index 5d893e6c80e..55cbde02e3a 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
@@ -1,169 +1,169 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Temporus
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_TAUNT 355
-#define SPELL_HASTE 31458
-#define SPELL_MORTAL_WOUND 28467
-#define SPELL_REFLECT 23920 //Not Implemented (Heroic mod)
-
-#define SAY_ENTER "Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ..."
-#define SAY_AGGRO "So be it ... you have been warned."
-#define SAY_BANISH "Time... sands of time is run out for you."
-#define SAY_SLAY1 "You should have left when you had the chance."
-#define SAY_SLAY2 "Your days are done."
-#define SAY_DEATH "My death means ... little."
-
-#define SOUND_ENTER 10442
-#define SOUND_AGGRO 10444
-#define SOUND_BANISH 10443
-#define SOUND_SLAY1 10445
-#define SOUND_SLAY2 10446
-#define SOUND_DEATH 10447
-
-struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
-{
- boss_temporusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Haste_Timer;
- uint32 SpellReflection_Timer;
-
- void Reset()
- {
- Haste_Timer = 20000;
- SpellReflection_Timer = 40000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- //Despawn Time Keeper
- if (who->GetTypeId() == TYPEID_UNIT)
- {
- if(((Creature*)who)->GetEntry() == 17918 && m_creature->IsWithinDistInMap(who,20))
- {
- //This is the wrong yell & sound for despawning time keepers!
- DoYell(SAY_ENTER, LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENTER);
-
- m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- if (!InCombat)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Check if we have a current target
- if( m_creature->getVictim() && m_creature->isAlive())
- {
-
- //Attack Haste
- if (Haste_Timer < diff)
- {
- DoCast(m_creature, SPELL_HASTE);
- Haste_Timer = 20000+rand()%5000;
- }else Haste_Timer -= diff;
-
- //Spell Reflection
- if (SpellReflection_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
-
- DoCast(m_creature, SPELL_REFLECT);
- SpellReflection_Timer = 40000+rand()%10000;
- }else SpellReflection_Timer -= diff;
-
- DoMeleeAttackIfReady();
-
- }
- }
-};
-
-CreatureAI* GetAI_boss_temporus(Creature *_Creature)
-{
- return new boss_temporusAI (_Creature);
-}
-
-void AddSC_boss_temporus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_temporus";
- newscript->GetAI = GetAI_boss_temporus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Temporus
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_TAUNT 355
+#define SPELL_HASTE 31458
+#define SPELL_MORTAL_WOUND 28467
+#define SPELL_REFLECT 23920 //Not Implemented (Heroic mod)
+
+#define SAY_ENTER "Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ..."
+#define SAY_AGGRO "So be it ... you have been warned."
+#define SAY_BANISH "Time... sands of time is run out for you."
+#define SAY_SLAY1 "You should have left when you had the chance."
+#define SAY_SLAY2 "Your days are done."
+#define SAY_DEATH "My death means ... little."
+
+#define SOUND_ENTER 10442
+#define SOUND_AGGRO 10444
+#define SOUND_BANISH 10443
+#define SOUND_SLAY1 10445
+#define SOUND_SLAY2 10446
+#define SOUND_DEATH 10447
+
+struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
+{
+ boss_temporusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Haste_Timer;
+ uint32 SpellReflection_Timer;
+
+ void Reset()
+ {
+ Haste_Timer = 20000;
+ SpellReflection_Timer = 40000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ //Despawn Time Keeper
+ if (who->GetTypeId() == TYPEID_UNIT)
+ {
+ if(((Creature*)who)->GetEntry() == 17918 && m_creature->IsWithinDistInMap(who,20))
+ {
+ //This is the wrong yell & sound for despawning time keepers!
+ DoYell(SAY_ENTER, LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENTER);
+
+ m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ if (!InCombat)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Check if we have a current target
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+
+ //Attack Haste
+ if (Haste_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HASTE);
+ Haste_Timer = 20000+rand()%5000;
+ }else Haste_Timer -= diff;
+
+ //Spell Reflection
+ if (SpellReflection_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+
+ DoCast(m_creature, SPELL_REFLECT);
+ SpellReflection_Timer = 40000+rand()%10000;
+ }else SpellReflection_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_temporus(Creature *_Creature)
+{
+ return new boss_temporusAI (_Creature);
+}
+
+void AddSC_boss_temporus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_temporus";
+ newscript->GetAI = GetAI_boss_temporus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
index c2a9a349838..7e25c0c9b15 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
@@ -1,788 +1,788 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Archimonde
-SD%Complete: 95
-SDComment: Doomfires not completely offlike due to core limitations for random moving.
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_hyjal.h"
-#include "SpellAuras.h"
-
-#define SPELL_DENOUEMENT_WISP 32124
-#define SPELL_ANCIENT_SPARK 39349
-#define SPELL_PROTECTION_OF_ELUNE 38528
-
-#define SPELL_DRAIN_WORLD_TREE 39140
-#define SPELL_DRAIN_WORLD_TREE_2 39141
-
-#define SPELL_FINGER_OF_DEATH 31984
-#define SPELL_HAND_OF_DEATH 35354
-#define SPELL_AIR_BURST 32014
-#define SPELL_GRIP_OF_THE_LEGION 31972
-#define SPELL_DOOMFIRE_SPAWN 32074
-#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long
-#define SPELL_DOOMFIRE_DAMAGE 31944
-#define SPELL_SOUL_CHARGE_YELLOW 32045
-#define SPELL_SOUL_CHARGE_GREEN 32051
-#define SPELL_SOUL_CHARGE_RED 32052
-#define SPELL_UNLEASH_SOUL_YELLOW 32054
-#define SPELL_UNLEASH_SOUL_GREEN 32057
-#define SPELL_UNLEASH_SOUL_RED 32053
-#define SPELL_FEAR 31970
-
-#define SAY_AGGRO "Your resistance is insignificant!"
-#define SOUND_AGGRO 10987
-
-#define SAY_DOOMFIRE1 "This world will burn!"
-#define SOUND_DOOMFIRE1 10990
-
-#define SAY_DOOMFIRE2 "Manach sheek-thrish!"
-#define SOUND_DOOMFIRE2 11041
-
-#define SAY_AIR_BURST "A-kreesh!"
-#define SOUND_AIR_BURST 10989
-
-#define SAY_AIR_BURST2 "Away vermin!"
-#define SOUND_AIR_BURST2 11043
-
-#define SAY_SLAY1 "All creation will be devoured!"
-#define SOUND_SLAY1 11044
-
-#define SAY_SLAY2 "Your soul will languish for eternity."
-#define SOUND_SLAY2 10991
-
-#define SAY_SLAY3 "I am the coming of the end!"
-#define SOUND_SLAY3 11045
-
-#define SAY_UNK1 "You are mine now."
-#define SOUND_UNK1 10988
-
-#define SAY_UNK2 "Bow to my will."
-#define SOUND_UNK2 11042
-
-#define SAY_ENRAGE "At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!"
-#define SOUND_ENRAGE 10993
-
-#define SAY_DEATH "No, it cannot be! Nooo!"
-#define SOUND_DEATH 10992
-
-#define CREATURE_ARCHIMONDE 17968
-#define CREATURE_DOOMFIRE 18095
-#define CREATURE_DOOMFIRE_TARGETING 18104
-#define CREATURE_ANCIENT_WISP 17946
-#define CREATURE_CHANNEL_TARGET 22418
-
-#define NORDRASSIL_X 5503.713
-#define NORDRASSIL_Y -3523.436
-#define NORDRASSIL_Z 1608.781
-
-struct mob_ancient_wispAI : public ScriptedAI
-{
- mob_ancient_wispAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 ArchimondeGUID;
- uint32 CheckTimer;
-
- void Reset()
- {
- ArchimondeGUID = 0;
- CheckTimer = 1000;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void Aggro(Unit* who) {}
-
- void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!ArchimondeGUID)
- {
- if(pInstance)
- ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
- }
-
- if(CheckTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde)
- {
- if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
- DoCast(m_creature, SPELL_DENOUEMENT_WISP);
- else
- DoCast(Archimonde, SPELL_ANCIENT_SPARK);
- }
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-};
-
-/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players.
- Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that
- are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */
-struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI
-{
- mob_doomfireAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 CheckTimer;
- uint32 RefreshTimer;
-
- bool TargetSelected;
-
- uint64 ArchimondeGUID;
- uint64 TargetGUID;
-
- void Reset()
- {
- CheckTimer = 5000;
- RefreshTimer = 0;
-
- TargetSelected = false;
-
- ArchimondeGUID = 0;
- TargetGUID = 0;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit* who)
- {
- // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP ||
- who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE ||
- who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- if(m_creature->IsWithinDistInMap(who, 3))
- {
- TargetSelected = true;
- TargetGUID = who->GetGUID();
- RefreshTimer = 2000;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- bool suicide = true;
- if(ArchimondeGUID)
- {
- Creature* Archimonde = ((Creature*)Unit::GetUnit((*m_creature), ArchimondeGUID));
- if(Archimonde && Archimonde->isAlive())
- {
- suicide = false;
- Archimonde->AI()->KilledUnit(victim);
- }
- }
-
- if(suicide)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(RefreshTimer < diff)
- RefreshTimer = 0;
- else RefreshTimer -= diff;
-
- if(TargetSelected && TargetGUID)
- {
- Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
- if(target && target->isAlive())
- {
- target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true);
- TargetGUID = 0;
- TargetSelected = false;
- }
- }
-
- if(CheckTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(!Archimonde || !Archimonde->isAlive())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- CheckTimer = 5000;
- }
- else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else CheckTimer -= diff;
- }
-};
-
-/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */
-struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
-{
- mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 ChangeTargetTimer;
- uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde
-
- uint64 ArchimondeGUID;
-
- void Reset()
- {
- ChangeTargetTimer = 5000;
- SummonTimer = 1000;
-
- ArchimondeGUID = 0;
- }
-
- void Aggro(Unit* who) {}
-
- void MoveInLineOfSight(Unit* who)
- {
- // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE
- || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- m_creature->AddThreat(who, 1.0f);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(SummonTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde && Archimonde->isAlive())
- {
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
- {
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID;
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- SummonTimer = 500;
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else SummonTimer -= diff;
-
- if(ChangeTargetTimer < diff)
- {
- Unit* target = NULL;
- switch(rand()%2)
- {
- case 0: // stalk player
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && target->isAlive())
- {
- m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
- m_creature->GetMotionMaster()->MoveChase(target);
- }
- break;
-
- case 1: // random location
- float x = 0;
- float y = 0;
- float z = 0;
- m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- break;
- }
- ChangeTargetTimer = 5000;
- }else ChangeTargetTimer -= diff;
- }
-
-};
-
-/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
- The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the
- hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
- select a random target and cast the spell on them. However, if someone IS in melee range, and this
- is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
- For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second)
- Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */
-
-// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death
-struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
-{
- boss_archimondeAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 DrainNordrassilTimer;
- uint32 FearTimer;
- uint32 AirBurstTimer;
- uint32 GripOfTheLegionTimer;
- uint32 DoomfireTimer;
- uint32 SoulChargeTimer;
- uint32 SoulChargeCount;
- uint32 MeleeRangeCheckTimer;
- uint32 HandOfDeathTimer;
- uint32 SummonWispTimer;
- uint32 WispCount;
- uint32 EnrageTimer;
- uint32 CheckDistanceTimer;
-
- bool Enraged;
- bool BelowTenPercent;
- bool HasProtected;
- bool IsChanneling;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
-
- DrainNordrassilTimer = 0;
- FearTimer = 40000;
- AirBurstTimer = 30000;
- GripOfTheLegionTimer = 5000 + rand()%20000;
- DoomfireTimer = 20000;
- SoulChargeTimer = 2000 + rand()%27000;
- SoulChargeCount = 0;
- MeleeRangeCheckTimer = 15000;
- HandOfDeathTimer = 2000;
- WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
- EnrageTimer = 600000; // 10 minutes
- CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
-
- Enraged = false;
- BelowTenPercent = false;
- HasProtected = false;
- IsChanneling = false;
- }
-
- void Aggro(Unit *who)
- {
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
-
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
-
- if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
- GainSoulCharge(((Player*)victim));
- }
-
- void GainSoulCharge(Player* victim)
- {
- switch(victim->getClass())
- {
- case CLASS_PRIEST:
- case CLASS_PALADIN:
- case CLASS_WARLOCK:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
- break;
- case CLASS_MAGE:
- case CLASS_ROGUE:
- case CLASS_WARRIOR:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
- break;
- case CLASS_DRUID:
- case CLASS_SHAMAN:
- case CLASS_HUNTER:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
- break;
- }
-
- SoulChargeTimer = 2000 + rand()%28000;
- ++SoulChargeCount;
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
- }
-
- bool CanUseFingerOfDeath()
- {
- // First we check if our current victim is in melee range or not.
- Unit* victim = m_creature->getVictim();
- if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
- return false;
-
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return false;
-
- std::list<Unit*> targets;
- std::list<HostilReference*>::iterator itr = m_threatlist.begin();
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- targets.push_back(pUnit);
- }
-
- if(targets.empty())
- return false;
-
- targets.sort(TargetDistanceOrder(m_creature));
- Unit* target = targets.front();
- if(target)
- {
- if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
- return true; // Cast Finger of Death
- else // This target is closest, he is our new tank
- m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
- }
-
- return false;
- }
-
- void SummonDoomfire(Unit* target)
- {
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
- {
- ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID();
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Give Doomfire a taste of everyone in the threatlist = more targets to chase.
- std::list<HostilReference*>::iterator itr;
- for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f);
- Doomfire->setFaction(m_creature->getFaction());
- DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN);
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- if(target)
- Doomfire->AI()->AttackStart(target);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_DOOMFIRE1, LANG_UNIVERSAL, m_creature);
- DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE1);
- }else
- {
- DoYell(SAY_DOOMFIRE2, LANG_UNIVERSAL, m_creature);
- DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE2);
- }
- }
- }
-
- void UnleashSoulCharge()
- {
- m_creature->InterruptNonMeleeSpells(false);
- bool HasCast = false;
- uint32 chargeSpell = 0;
- uint32 unleashSpell = 0;
- switch(rand()%3)
- {
- case 0:
- chargeSpell = SPELL_SOUL_CHARGE_RED;
- unleashSpell = SPELL_UNLEASH_SOUL_RED;
- break;
- case 1:
- chargeSpell = SPELL_SOUL_CHARGE_YELLOW;
- unleashSpell = SPELL_UNLEASH_SOUL_YELLOW;
- break;
- case 2:
- chargeSpell = SPELL_SOUL_CHARGE_GREEN;
- unleashSpell = SPELL_UNLEASH_SOUL_GREEN;
- break;
- }
- if(m_creature->HasAura(chargeSpell, 0))
- {
- m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
- DoCast(m_creature->getVictim(), unleashSpell);
- HasCast = true;
- SoulChargeCount--;
- }
- if(HasCast)
- SoulChargeTimer = 2000 + rand()%28000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!InCombat)
- {
- if(pInstance)
- {
- // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
- if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setFaction(35);
- }
- else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
- {
- m_creature->setFaction(1720);
- m_creature->SetVisibility(VISIBILITY_ON);
- }
- }
-
- if(DrainNordrassilTimer < diff)
- {
- if(!IsChanneling)
- {
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
- if(Nordrassil)
- {
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE);
- IsChanneling = true;
- }
- }
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000);
- if(Nordrassil)
- {
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
- DrainNordrassilTimer = 1000;
- }
- }else DrainNordrassilTimer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
- BelowTenPercent = true;
-
- if(!Enraged)
- {
- if(EnrageTimer < diff)
- {
- if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- Enraged = true;
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
- }else EnrageTimer -= diff;
-
- if(CheckDistanceTimer < diff)
- { // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
- Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
- if(Check)
- {
- Check->SetVisibility(VISIBILITY_OFF);
- if(m_creature->IsWithinDistInMap(Check, 75))
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- Enraged = true;
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
- }
- CheckDistanceTimer = 5000;
- }else CheckDistanceTimer -= diff;
- }
-
- if(BelowTenPercent)
- {
- if(!HasProtected)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
- HasProtected = true;
- Enraged = true;
- }
-
- if(SummonWispTimer < diff)
- {
- Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(Wisp)
- {
- Wisp->AI()->AttackStart(m_creature);
- ((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
- }
- SummonWispTimer = 1500;
- ++WispCount;
- }else SummonWispTimer -= diff;
-
- if(WispCount >= 30)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- if(Enraged)
- {
- if(HandOfDeathTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
- HandOfDeathTimer = 2000;
- }else HandOfDeathTimer -= diff;
- return; // Don't do anything after this point.
- }
-
- if(SoulChargeCount)
- {
- if(SoulChargeTimer < diff)
- UnleashSoulCharge();
- else SoulChargeTimer -= diff;
- }
-
- if(GripOfTheLegionTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
- GripOfTheLegionTimer = 5000 + rand()%20000;
- }else GripOfTheLegionTimer -= diff;
-
- if(AirBurstTimer < diff)
- {
- if(rand()%2 == 0)
- {
- DoYell(SAY_AIR_BURST, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AIR_BURST);
- }else
- {
- DoYell(SAY_AIR_BURST2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AIR_BURST2);
- }
-
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST);
- AirBurstTimer = 25000 + rand()%15000;
- }else AirBurstTimer -= diff;
-
- if(FearTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEAR);
- FearTimer = 40000;
- }else FearTimer -= diff;
-
- if(DoomfireTimer < diff)
- {
- SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1));
- DoomfireTimer = 40000;
- }else DoomfireTimer -= diff;
-
- if(MeleeRangeCheckTimer < diff)
- {
- if(CanUseFingerOfDeath())
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH);
- MeleeRangeCheckTimer = 1000;
- }
-
- MeleeRangeCheckTimer = 5000;
- }else MeleeRangeCheckTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_archimonde(Creature *_Creature)
-{
- return new boss_archimondeAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_doomfire(Creature* _Creature)
-{
- return new mob_doomfireAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_doomfire_targetting(Creature* _Creature)
-{
- return new mob_doomfire_targettingAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_ancient_wisp(Creature* _Creature)
-{
- return new mob_ancient_wispAI(_Creature);
-}
-
-void AddSC_boss_archimonde()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_archimonde";
- newscript->GetAI = GetAI_boss_archimonde;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_doomfire";
- newscript->GetAI = GetAI_mob_doomfire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_doomfire_targetting";
- newscript->GetAI = GetAI_mob_doomfire_targetting;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_ancient_wisp";
- newscript->GetAI = GetAI_mob_ancient_wisp;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Archimonde
+SD%Complete: 95
+SDComment: Doomfires not completely offlike due to core limitations for random moving.
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_hyjal.h"
+#include "SpellAuras.h"
+
+#define SPELL_DENOUEMENT_WISP 32124
+#define SPELL_ANCIENT_SPARK 39349
+#define SPELL_PROTECTION_OF_ELUNE 38528
+
+#define SPELL_DRAIN_WORLD_TREE 39140
+#define SPELL_DRAIN_WORLD_TREE_2 39141
+
+#define SPELL_FINGER_OF_DEATH 31984
+#define SPELL_HAND_OF_DEATH 35354
+#define SPELL_AIR_BURST 32014
+#define SPELL_GRIP_OF_THE_LEGION 31972
+#define SPELL_DOOMFIRE_SPAWN 32074
+#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long
+#define SPELL_DOOMFIRE_DAMAGE 31944
+#define SPELL_SOUL_CHARGE_YELLOW 32045
+#define SPELL_SOUL_CHARGE_GREEN 32051
+#define SPELL_SOUL_CHARGE_RED 32052
+#define SPELL_UNLEASH_SOUL_YELLOW 32054
+#define SPELL_UNLEASH_SOUL_GREEN 32057
+#define SPELL_UNLEASH_SOUL_RED 32053
+#define SPELL_FEAR 31970
+
+#define SAY_AGGRO "Your resistance is insignificant!"
+#define SOUND_AGGRO 10987
+
+#define SAY_DOOMFIRE1 "This world will burn!"
+#define SOUND_DOOMFIRE1 10990
+
+#define SAY_DOOMFIRE2 "Manach sheek-thrish!"
+#define SOUND_DOOMFIRE2 11041
+
+#define SAY_AIR_BURST "A-kreesh!"
+#define SOUND_AIR_BURST 10989
+
+#define SAY_AIR_BURST2 "Away vermin!"
+#define SOUND_AIR_BURST2 11043
+
+#define SAY_SLAY1 "All creation will be devoured!"
+#define SOUND_SLAY1 11044
+
+#define SAY_SLAY2 "Your soul will languish for eternity."
+#define SOUND_SLAY2 10991
+
+#define SAY_SLAY3 "I am the coming of the end!"
+#define SOUND_SLAY3 11045
+
+#define SAY_UNK1 "You are mine now."
+#define SOUND_UNK1 10988
+
+#define SAY_UNK2 "Bow to my will."
+#define SOUND_UNK2 11042
+
+#define SAY_ENRAGE "At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!"
+#define SOUND_ENRAGE 10993
+
+#define SAY_DEATH "No, it cannot be! Nooo!"
+#define SOUND_DEATH 10992
+
+#define CREATURE_ARCHIMONDE 17968
+#define CREATURE_DOOMFIRE 18095
+#define CREATURE_DOOMFIRE_TARGETING 18104
+#define CREATURE_ANCIENT_WISP 17946
+#define CREATURE_CHANNEL_TARGET 22418
+
+#define NORDRASSIL_X 5503.713
+#define NORDRASSIL_Y -3523.436
+#define NORDRASSIL_Z 1608.781
+
+struct mob_ancient_wispAI : public ScriptedAI
+{
+ mob_ancient_wispAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 ArchimondeGUID;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ ArchimondeGUID = 0;
+ CheckTimer = 1000;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!ArchimondeGUID)
+ {
+ if(pInstance)
+ ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
+ }
+
+ if(CheckTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(Archimonde)
+ {
+ if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
+ DoCast(m_creature, SPELL_DENOUEMENT_WISP);
+ else
+ DoCast(Archimonde, SPELL_ANCIENT_SPARK);
+ }
+ }
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+ }
+};
+
+/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players.
+ Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that
+ are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */
+struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI
+{
+ mob_doomfireAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 CheckTimer;
+ uint32 RefreshTimer;
+
+ bool TargetSelected;
+
+ uint64 ArchimondeGUID;
+ uint64 TargetGUID;
+
+ void Reset()
+ {
+ CheckTimer = 5000;
+ RefreshTimer = 0;
+
+ TargetSelected = false;
+
+ ArchimondeGUID = 0;
+ TargetGUID = 0;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting
+ if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP ||
+ who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE ||
+ who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
+ return;
+
+ if(m_creature->IsWithinDistInMap(who, 3))
+ {
+ TargetSelected = true;
+ TargetGUID = who->GetGUID();
+ RefreshTimer = 2000;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ bool suicide = true;
+ if(ArchimondeGUID)
+ {
+ Creature* Archimonde = ((Creature*)Unit::GetUnit((*m_creature), ArchimondeGUID));
+ if(Archimonde && Archimonde->isAlive())
+ {
+ suicide = false;
+ Archimonde->AI()->KilledUnit(victim);
+ }
+ }
+
+ if(suicide)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(RefreshTimer < diff)
+ RefreshTimer = 0;
+ else RefreshTimer -= diff;
+
+ if(TargetSelected && TargetGUID)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
+ if(target && target->isAlive())
+ {
+ target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true);
+ TargetGUID = 0;
+ TargetSelected = false;
+ }
+ }
+
+ if(CheckTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(!Archimonde || !Archimonde->isAlive())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ CheckTimer = 5000;
+ }
+ else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else CheckTimer -= diff;
+ }
+};
+
+/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */
+struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
+{
+ mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 ChangeTargetTimer;
+ uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde
+
+ uint64 ArchimondeGUID;
+
+ void Reset()
+ {
+ ChangeTargetTimer = 5000;
+ SummonTimer = 1000;
+
+ ArchimondeGUID = 0;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting
+ if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE
+ || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
+ return;
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(SummonTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(Archimonde && Archimonde->isAlive())
+ {
+ Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(Doomfire)
+ {
+ Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
+ ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID;
+ Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ SummonTimer = 500;
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else SummonTimer -= diff;
+
+ if(ChangeTargetTimer < diff)
+ {
+ Unit* target = NULL;
+ switch(rand()%2)
+ {
+ case 0: // stalk player
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && target->isAlive())
+ {
+ m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
+ m_creature->GetMotionMaster()->MoveChase(target);
+ }
+ break;
+
+ case 1: // random location
+ float x = 0;
+ float y = 0;
+ float z = 0;
+ m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ break;
+ }
+ ChangeTargetTimer = 5000;
+ }else ChangeTargetTimer -= diff;
+ }
+
+};
+
+/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
+ The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the
+ hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
+ select a random target and cast the spell on them. However, if someone IS in melee range, and this
+ is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
+ For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second)
+ Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */
+
+// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
+{
+ boss_archimondeAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 DrainNordrassilTimer;
+ uint32 FearTimer;
+ uint32 AirBurstTimer;
+ uint32 GripOfTheLegionTimer;
+ uint32 DoomfireTimer;
+ uint32 SoulChargeTimer;
+ uint32 SoulChargeCount;
+ uint32 MeleeRangeCheckTimer;
+ uint32 HandOfDeathTimer;
+ uint32 SummonWispTimer;
+ uint32 WispCount;
+ uint32 EnrageTimer;
+ uint32 CheckDistanceTimer;
+
+ bool Enraged;
+ bool BelowTenPercent;
+ bool HasProtected;
+ bool IsChanneling;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
+
+ DrainNordrassilTimer = 0;
+ FearTimer = 40000;
+ AirBurstTimer = 30000;
+ GripOfTheLegionTimer = 5000 + rand()%20000;
+ DoomfireTimer = 20000;
+ SoulChargeTimer = 2000 + rand()%27000;
+ SoulChargeCount = 0;
+ MeleeRangeCheckTimer = 15000;
+ HandOfDeathTimer = 2000;
+ WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
+ EnrageTimer = 600000; // 10 minutes
+ CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
+
+ Enraged = false;
+ BelowTenPercent = false;
+ HasProtected = false;
+ IsChanneling = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+
+ if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
+ GainSoulCharge(((Player*)victim));
+ }
+
+ void GainSoulCharge(Player* victim)
+ {
+ switch(victim->getClass())
+ {
+ case CLASS_PRIEST:
+ case CLASS_PALADIN:
+ case CLASS_WARLOCK:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
+ break;
+ case CLASS_MAGE:
+ case CLASS_ROGUE:
+ case CLASS_WARRIOR:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
+ break;
+ case CLASS_DRUID:
+ case CLASS_SHAMAN:
+ case CLASS_HUNTER:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
+ break;
+ }
+
+ SoulChargeTimer = 2000 + rand()%28000;
+ ++SoulChargeCount;
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
+ }
+
+ bool CanUseFingerOfDeath()
+ {
+ // First we check if our current victim is in melee range or not.
+ Unit* victim = m_creature->getVictim();
+ if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
+ return false;
+
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return false;
+
+ std::list<Unit*> targets;
+ std::list<HostilReference*>::iterator itr = m_threatlist.begin();
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+
+ if(targets.empty())
+ return false;
+
+ targets.sort(TargetDistanceOrder(m_creature));
+ Unit* target = targets.front();
+ if(target)
+ {
+ if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ return true; // Cast Finger of Death
+ else // This target is closest, he is our new tank
+ m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
+ }
+
+ return false;
+ }
+
+ void SummonDoomfire(Unit* target)
+ {
+ Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(Doomfire)
+ {
+ ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID();
+ Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Give Doomfire a taste of everyone in the threatlist = more targets to chase.
+ std::list<HostilReference*>::iterator itr;
+ for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f);
+ Doomfire->setFaction(m_creature->getFaction());
+ DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN);
+ Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
+ if(target)
+ Doomfire->AI()->AttackStart(target);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_DOOMFIRE1, LANG_UNIVERSAL, m_creature);
+ DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE1);
+ }else
+ {
+ DoYell(SAY_DOOMFIRE2, LANG_UNIVERSAL, m_creature);
+ DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE2);
+ }
+ }
+ }
+
+ void UnleashSoulCharge()
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ bool HasCast = false;
+ uint32 chargeSpell = 0;
+ uint32 unleashSpell = 0;
+ switch(rand()%3)
+ {
+ case 0:
+ chargeSpell = SPELL_SOUL_CHARGE_RED;
+ unleashSpell = SPELL_UNLEASH_SOUL_RED;
+ break;
+ case 1:
+ chargeSpell = SPELL_SOUL_CHARGE_YELLOW;
+ unleashSpell = SPELL_UNLEASH_SOUL_YELLOW;
+ break;
+ case 2:
+ chargeSpell = SPELL_SOUL_CHARGE_GREEN;
+ unleashSpell = SPELL_UNLEASH_SOUL_GREEN;
+ break;
+ }
+ if(m_creature->HasAura(chargeSpell, 0))
+ {
+ m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
+ DoCast(m_creature->getVictim(), unleashSpell);
+ HasCast = true;
+ SoulChargeCount--;
+ }
+ if(HasCast)
+ SoulChargeTimer = 2000 + rand()%28000;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!InCombat)
+ {
+ if(pInstance)
+ {
+ // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
+ if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setFaction(35);
+ }
+ else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
+ {
+ m_creature->setFaction(1720);
+ m_creature->SetVisibility(VISIBILITY_ON);
+ }
+ }
+
+ if(DrainNordrassilTimer < diff)
+ {
+ if(!IsChanneling)
+ {
+ Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
+ if(Nordrassil)
+ {
+ Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE);
+ IsChanneling = true;
+ }
+ }
+ Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000);
+ if(Nordrassil)
+ {
+ Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
+ DrainNordrassilTimer = 1000;
+ }
+ }else DrainNordrassilTimer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
+ BelowTenPercent = true;
+
+ if(!Enraged)
+ {
+ if(EnrageTimer < diff)
+ {
+ if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ Enraged = true;
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+ }else EnrageTimer -= diff;
+
+ if(CheckDistanceTimer < diff)
+ { // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
+ Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
+ if(Check)
+ {
+ Check->SetVisibility(VISIBILITY_OFF);
+ if(m_creature->IsWithinDistInMap(Check, 75))
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ Enraged = true;
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+ }
+ CheckDistanceTimer = 5000;
+ }else CheckDistanceTimer -= diff;
+ }
+
+ if(BelowTenPercent)
+ {
+ if(!HasProtected)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
+ HasProtected = true;
+ Enraged = true;
+ }
+
+ if(SummonWispTimer < diff)
+ {
+ Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(Wisp)
+ {
+ Wisp->AI()->AttackStart(m_creature);
+ ((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
+ }
+ SummonWispTimer = 1500;
+ ++WispCount;
+ }else SummonWispTimer -= diff;
+
+ if(WispCount >= 30)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ if(Enraged)
+ {
+ if(HandOfDeathTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
+ HandOfDeathTimer = 2000;
+ }else HandOfDeathTimer -= diff;
+ return; // Don't do anything after this point.
+ }
+
+ if(SoulChargeCount)
+ {
+ if(SoulChargeTimer < diff)
+ UnleashSoulCharge();
+ else SoulChargeTimer -= diff;
+ }
+
+ if(GripOfTheLegionTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
+ GripOfTheLegionTimer = 5000 + rand()%20000;
+ }else GripOfTheLegionTimer -= diff;
+
+ if(AirBurstTimer < diff)
+ {
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_AIR_BURST, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AIR_BURST);
+ }else
+ {
+ DoYell(SAY_AIR_BURST2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AIR_BURST2);
+ }
+
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST);
+ AirBurstTimer = 25000 + rand()%15000;
+ }else AirBurstTimer -= diff;
+
+ if(FearTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEAR);
+ FearTimer = 40000;
+ }else FearTimer -= diff;
+
+ if(DoomfireTimer < diff)
+ {
+ SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1));
+ DoomfireTimer = 40000;
+ }else DoomfireTimer -= diff;
+
+ if(MeleeRangeCheckTimer < diff)
+ {
+ if(CanUseFingerOfDeath())
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH);
+ MeleeRangeCheckTimer = 1000;
+ }
+
+ MeleeRangeCheckTimer = 5000;
+ }else MeleeRangeCheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_archimonde(Creature *_Creature)
+{
+ return new boss_archimondeAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_doomfire(Creature* _Creature)
+{
+ return new mob_doomfireAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_doomfire_targetting(Creature* _Creature)
+{
+ return new mob_doomfire_targettingAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_ancient_wisp(Creature* _Creature)
+{
+ return new mob_ancient_wispAI(_Creature);
+}
+
+void AddSC_boss_archimonde()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_archimonde";
+ newscript->GetAI = GetAI_boss_archimonde;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_doomfire";
+ newscript->GetAI = GetAI_mob_doomfire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_doomfire_targetting";
+ newscript->GetAI = GetAI_mob_doomfire_targetting;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_ancient_wisp";
+ newscript->GetAI = GetAI_mob_ancient_wisp;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
index ff8e3dd3eed..1e28156857f 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
@@ -1,25 +1,25 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_HYJAL_H
-#define DEF_HYJAL_H
-
-#define DATA_ANETHERON 1
-#define DATA_ANETHERONEVENT 2
-#define DATA_ARCHIMONDE 3
-#define DATA_ARCHIMONDEEVENT 4
-#define DATA_AZGALOR 5
-#define DATA_AZGALOREVENT 6
-#define DATA_JAINAPROUDMOORE 7
-#define DATA_KAZROGAL 8
-#define DATA_KAZROGALEVENT 9
-#define DATA_RAGEWINTERCHILL 10
-#define DATA_RAGEWINTERCHILLEVENT 11
-#define DATA_THRALL 12
-#define DATA_TYRANDEWHISPERWIND 13
-#define DATA_TRASH 14
-#define DATA_RESET_TRASH_COUNT 15
-
-#define ERROR_INST_DATA "SD2: Instance data not set properly for Mount Hyjal. Encounters will be buggy"
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_HYJAL_H
+#define DEF_HYJAL_H
+
+#define DATA_ANETHERON 1
+#define DATA_ANETHERONEVENT 2
+#define DATA_ARCHIMONDE 3
+#define DATA_ARCHIMONDEEVENT 4
+#define DATA_AZGALOR 5
+#define DATA_AZGALOREVENT 6
+#define DATA_JAINAPROUDMOORE 7
+#define DATA_KAZROGAL 8
+#define DATA_KAZROGALEVENT 9
+#define DATA_RAGEWINTERCHILL 10
+#define DATA_RAGEWINTERCHILLEVENT 11
+#define DATA_THRALL 12
+#define DATA_TYRANDEWHISPERWIND 13
+#define DATA_TRASH 14
+#define DATA_RESET_TRASH_COUNT 15
+
+#define ERROR_INST_DATA "SD2: Instance data not set properly for Mount Hyjal. Encounters will be buggy"
+#endif
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
index a3484a4321a..837f1f09872 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
@@ -1,217 +1,217 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Hyjal
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-/* ContentData
-npc_jaina_proudmoore
-npc_thrall
-npc_tyrande_whisperwind
-EndContentData */
-
-#include "precompiled.h"
-#include "hyjalAI.h"
-
-#define GOSSIP_ITEM_BEGIN_ALLY "We are ready to defend the Alliance base."
-#define GOSSIP_ITEM_ANETHERON "The defenses are holding up; we can continue."
-#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!"
-
-#define GOSSIP_ITEM_BEGIN_HORDE "We're here to help! The Alliance are overrun."
-#define GOSSIP_ITEM_AZGALOR "We're okay so far. Let's do this!"
-
-CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature)
-{
- hyjalAI* ai = new hyjalAI(_Creature);
-
- ai->Reset();
- ai->EnterEvadeMode();
-
- ai->Spell[0].SpellId = SPELL_BLIZZARD;
- ai->Spell[0].Cooldown = 15000 + rand()%20000;
- ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
-
- ai->Spell[1].SpellId = SPELL_PYROBLAST;
- ai->Spell[1].Cooldown = 2000 + rand()%7000;
- ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
-
- ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
- ai->Spell[2].Cooldown = 15000 + rand()%30000;
- ai->Spell[2].TargetType = TARGETTYPE_SELF;
-
- return ai;
-}
-
-bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
-{
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- if(ai->EventBegun)
- return false;
-
- uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
- uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
- if(RageEncounter == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- else if(RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- else if(RageEncounter == DONE && AnetheronEncounter == DONE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- if(player->isGameMaster())
- player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
-
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- player->PlayerTalkClass->GetGossipMenu();
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- ai->FirstBossDead = true;
- ai->WaveCount = 9;
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- ai->Retreat();
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- ai->Debug = !ai->Debug;
- outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
- break;
- }
-
- return true;
-}
-
-CreatureAI* GetAI_npc_thrall(Creature *_Creature)
-{
- hyjalAI* ai = new hyjalAI(_Creature);
-
- ai->Reset();
- ai->EnterEvadeMode();
-
- ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
- ai->Spell[0].Cooldown = 2000 + rand()%5000;
- ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
-
- ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
- ai->Spell[1].Cooldown = 6000 + rand()%35000;
- ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
-
- return ai;
-}
-
-bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
-{
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
- if(AnetheronEvent >= DONE && !ai->EventBegun) // Only let them start the Horde phase if Anetheron is dead.
- {
- uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
- uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
- if(KazrogalEvent == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- else if(KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- else if(AzgalorEvent == DONE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- }
-
- if(player->isGameMaster())
- player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
-
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- player->PlayerTalkClass->GetGossipMenu();
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- ai->FirstBossDead = true;
- ai->WaveCount = 9;
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- ai->Retreat();
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- ai->Debug = !ai->Debug;
- outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
- break;
- }
-
- return true;
-}
-
-bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
-{
- player->ADD_GOSSIP_ITEM(1, "Aid us in defending Nordrassil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-void AddSC_hyjal()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_jaina_proudmoore";
- newscript->GetAI = GetAI_npc_jaina_proudmoore;
- newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore;
- newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_thrall";
- newscript->GetAI = GetAI_npc_thrall;
- newscript->pGossipHello = &GossipHello_npc_thrall;
- newscript->pGossipSelect = &GossipSelect_npc_thrall;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_tyrande_whisperwind";
- newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind;
- newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Hyjal
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+/* ContentData
+npc_jaina_proudmoore
+npc_thrall
+npc_tyrande_whisperwind
+EndContentData */
+
+#include "precompiled.h"
+#include "hyjalAI.h"
+
+#define GOSSIP_ITEM_BEGIN_ALLY "We are ready to defend the Alliance base."
+#define GOSSIP_ITEM_ANETHERON "The defenses are holding up; we can continue."
+#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!"
+
+#define GOSSIP_ITEM_BEGIN_HORDE "We're here to help! The Alliance are overrun."
+#define GOSSIP_ITEM_AZGALOR "We're okay so far. Let's do this!"
+
+CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature)
+{
+ hyjalAI* ai = new hyjalAI(_Creature);
+
+ ai->Reset();
+ ai->EnterEvadeMode();
+
+ ai->Spell[0].SpellId = SPELL_BLIZZARD;
+ ai->Spell[0].Cooldown = 15000 + rand()%20000;
+ ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
+
+ ai->Spell[1].SpellId = SPELL_PYROBLAST;
+ ai->Spell[1].Cooldown = 2000 + rand()%7000;
+ ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
+
+ ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
+ ai->Spell[2].Cooldown = 15000 + rand()%30000;
+ ai->Spell[2].TargetType = TARGETTYPE_SELF;
+
+ return ai;
+}
+
+bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
+{
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ if(ai->EventBegun)
+ return false;
+
+ uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
+ uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
+ if(RageEncounter == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ else if(RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ else if(RageEncounter == DONE && AnetheronEncounter == DONE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+
+ if(player->isGameMaster())
+ player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ player->PlayerTalkClass->GetGossipMenu();
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ ai->FirstBossDead = true;
+ ai->WaveCount = 9;
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ ai->Retreat();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ ai->Debug = !ai->Debug;
+ outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
+ break;
+ }
+
+ return true;
+}
+
+CreatureAI* GetAI_npc_thrall(Creature *_Creature)
+{
+ hyjalAI* ai = new hyjalAI(_Creature);
+
+ ai->Reset();
+ ai->EnterEvadeMode();
+
+ ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
+ ai->Spell[0].Cooldown = 2000 + rand()%5000;
+ ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
+
+ ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
+ ai->Spell[1].Cooldown = 6000 + rand()%35000;
+ ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
+
+ return ai;
+}
+
+bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
+{
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
+ if(AnetheronEvent >= DONE && !ai->EventBegun) // Only let them start the Horde phase if Anetheron is dead.
+ {
+ uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
+ uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
+ if(KazrogalEvent == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ else if(KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ else if(AzgalorEvent == DONE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ }
+
+ if(player->isGameMaster())
+ player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ player->PlayerTalkClass->GetGossipMenu();
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ ai->FirstBossDead = true;
+ ai->WaveCount = 9;
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ ai->Retreat();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ ai->Debug = !ai->Debug;
+ outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
+ break;
+ }
+
+ return true;
+}
+
+bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
+{
+ player->ADD_GOSSIP_ITEM(1, "Aid us in defending Nordrassil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+void AddSC_hyjal()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_jaina_proudmoore";
+ newscript->GetAI = GetAI_npc_jaina_proudmoore;
+ newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore;
+ newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_thrall";
+ newscript->GetAI = GetAI_npc_thrall;
+ newscript->pGossipHello = &GossipHello_npc_thrall;
+ newscript->pGossipSelect = &GossipSelect_npc_thrall;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_tyrande_whisperwind";
+ newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind;
+ newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
index c117b73e57f..3ccd790a648 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
@@ -1,458 +1,458 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: HyjalAI
-SD%Complete: 99
-SDComment: World Packet workaround for World States
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-#include "precompiled.h"
-#include "hyjalAI.h"
-#include "WorldPacket.h"
-
-float AllianceBase[4][3]= // Locations for summoning waves in Alliance base
-{
- {4979.010, -1709.134, 1339.674},
- {4969.123, -1705.904, 1341.363},
- {4970.260, -1698.546, 1341.200},
- {4975.262, -1698.239, 1341.427}
-};
-
-float HordeBase[4][3]= // Locations for summoning waves in Horde base
-{
- {5554.399, -2581.419, 1480.820},
- {5538.996, -2577.742, 1479.790},
- {5565.642, -2565.666, 1481.635},
- {5547.218, -2574.589, 1479.194}
-};
-
-float AttackArea[2][3]= // used to inform the wave where to move and attack to
-{
- { // Alliance
- 5042.9189, -1776.2562, 1323.0621
- },
- { // Horde
- 5510.4815, -2676.7112, 1480.4314
- }
-};
-
-hyjalAI::hyjalAI(Creature *c) : ScriptedAI(c)
-{
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
-}
-
-void hyjalAI::Reset()
-{
- /** GUIDs **/
- PlayerGUID = 0;
- BossGUID[0] = 0;
- BossGUID[1] = 0;
-
- /** Timers **/
- NextWaveTimer = 10000;
- CheckTimer = 0;
- RetreatTimer = 1000;
-
- /** Misc **/
- WaveCount = 0;
-
- /** Set faction properly based on creature entry**/
- switch(m_creature->GetEntry())
- {
- case 17772:
- Faction = 0;
- DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
- break;
-
- case 17852: Faction = 1; break;
- }
-
- /** Bools **/
- EventBegun = false;
- FirstBossDead = false;
- SecondBossDead = false;
- Summon = false;
- bRetreat = false;
-
- /** Flags **/
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- /** Initialize spells **/
- memset(Spell, 0, sizeof(Spell));
-
- /** Reset World States **/
- UpdateWorldState(WORLDSTATE_WAVES, 0);
- UpdateWorldState(WORLDSTATE_ENEMY, 0);
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
-
- /** Reset Instance Data for trash count **/
- if(pInstance)
- pInstance->SetData(DATA_RESET_TRASH_COUNT, 0);
- else error_log(ERROR_INST_DATA);
-
- /*** Visibility ***/
- m_creature->SetVisibility(VISIBILITY_ON);
-
- /** If Jaina evades, reset the visibility of all other creatures in the grid. **/
- if(CreatureList.empty())
- return;
-
- for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Creature* cr = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- cr->SetVisibility(VISIBILITY_ON);
-
- CreatureList.clear();
-}
-
-void hyjalAI::EnterEvadeMode()
-{
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->LoadCreaturesAddon();
-
- if(m_creature->isAlive())
- m_creature->GetMotionMaster()->MoveTargetedHome();
-
- InCombat = false;
-}
-
-void hyjalAI::Aggro(Unit *who)
-{
- for(uint8 i = 0; i < 2; ++i)
- if(Spell[i].Cooldown)
- SpellTimer[i] = Spell[i].Cooldown;
-
- Talk(ATTACKED);
-}
-
-void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
-{
- uint32 random = rand()%4;
- float SpawnLoc[3];
- float AttackLoc[3];
-
- for(uint8 i = 0; i < 3; ++i)
- {
- SpawnLoc[i] = Base[random][i];
- AttackLoc[i] = AttackArea[Faction][i];
- }
-
- Creature* pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- if(pCreature)
- {
- ++EnemyCount; // Increment Enemy Count to be used in World States and instance script
-
- pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]);
- pCreature->AddThreat(m_creature, 1.0f);
- DoZoneInCombat(pCreature);
-
- // Check if creature is a boss.
- if(pCreature->GetCreatureInfo()->rank == 3)
- {
- if(!FirstBossDead) BossGUID[0] = pCreature->GetGUID();
- else BossGUID[1] = pCreature->GetGUID();
- CheckTimer = 5000;
- }
- }
-}
-
-void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3])
-{
- if(rand()%4 == 0) // 1 in 4 chance we give a rally yell. Not sure if the chance is Blizzlike.
- Talk(RALLY);
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- EnemyCount = pInstance->GetData(DATA_TRASH);
- for(uint8 i = 0; i < 18; ++i)
- {
- if(wave[Count].Mob[i])
- SummonCreature(wave[Count].Mob[i], Base);
- }
-
- if(!wave[Count].IsBoss)
- {
- uint32 stateValue = Count+1;
- if(FirstBossDead)
- stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
- UpdateWorldState(WORLDSTATE_WAVES, stateValue); // Set world state to our current wave number
- UpdateWorldState(WORLDSTATE_ENEMY, 1);
- //UpdateWorldState(WORLDSTATE_ENEMYCOUNT, EnemyCount); // Let Instance Script handle this
- pInstance->SetData(DATA_TRASH, EnemyCount);
- if(!Debug)
- NextWaveTimer = wave[Count].WaveTimer;
- else
- {
- NextWaveTimer = 15000;
- DoTextEmote(": Debug Mode is enabled. Next Wave in 15 seconds", NULL);
- }
- }
- else
- {
- UpdateWorldState(WORLDSTATE_WAVES, 0); // Set world state for waves to 0 to disable it.
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 1); // Set World State for enemies invading to 1.
- Summon = false;
- }
- CheckTimer = 5000;
-}
-
-void hyjalAI::StartEvent(Player* player)
-{
- if(!player)
- return;
-
- Talk(BEGIN);
-
- EventBegun = true;
- Summon = true;
-
- NextWaveTimer = 15000;
- CheckTimer = 5000;
- PlayerGUID = player->GetGUID();
-
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- UpdateWorldState(WORLDSTATE_WAVES, 0);
- UpdateWorldState(WORLDSTATE_ENEMY, 0);
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
-}
-
-uint32 hyjalAI::GetInstanceData(uint32 Event)
-{
- if(pInstance)
- return pInstance->GetData(Event);
- else error_log(ERROR_INST_DATA);
-
- return 0;
-}
-
-void hyjalAI::Talk(uint32 id)
-{
- std::list<uint8> index;
- for(uint8 i = 0; i < 10; i++)
- {
- if(Faction == 0) // Alliance
- {
- if(JainaQuotes[i].id == id)
- index.push_back(i);
- }
- else if(Faction == 1) // Horde
- {
- if(ThrallQuotes[i].id == id)
- index.push_back(i);
- }
- }
-
- if(index.empty())
- return; // No quotes found, no use to continue
-
- uint8 ind = *(index.begin()) + rand()%index.size();
-
- char* Yell = NULL;
- uint32 Sound = 0;
- if(Faction == 0) // Alliance
- {
- Yell = JainaQuotes[ind].text;
- Sound = JainaQuotes[ind].sound;
- }
- else if(Faction == 1) // Horde
- {
- Yell = ThrallQuotes[ind].text;
- Sound = ThrallQuotes[ind].sound;
- }
-
- if(Yell)
- DoYell(Yell, LANG_UNIVERSAL, NULL);
- if(Sound)
- DoPlaySoundToSet(m_creature, Sound);
-}
-
-// Slight workaround for now
-void hyjalAI::UpdateWorldState(uint32 field, uint32 value)
-{
- Map * map = m_creature->GetMap();
- if(!map->IsDungeon()) return;
-
- WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
-
- data << field;
- data << value;
-
- ((InstanceMap*)map)->SendToPlayers(&data);
-
- // TODO: Uncomment and remove everything above this line only when the core patch for this is accepted
- //m_creature->GetMap()->UpdateWorldState(field, value);
-}
-
-void hyjalAI::Retreat()
-{
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- // First get all creatures.
- std::list<Creature*> creatures;
- Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
- TypeContainerVisitor
- <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
- GridTypeMapContainer> creature_visitor(creature_searcher);
-
- // Then get all Ancient Gem Veins. NOTE: Grid Search will only be able to find those in the grid.
- std::list<GameObject*> goList;
- Trinity::AllGameObjectsWithEntryInGrid go_check(185557);
- Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(goList, go_check);
- TypeContainerVisitor
- <Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- // Get Creatures
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
- // Get GOs
- cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap()));
-
- CreatureList.clear();
- if(!creatures.empty())
- {
- for(std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
- {
- (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
- CreatureList.push_back((*itr)->GetGUID());
- }
-
- DoCast(m_creature, SPELL_TELEPORT_VISUAL);
- bRetreat = true;
- RetreatTimer = 1000;
- }
-
- if(!goList.empty())
- {
- for(std::list<GameObject*>::iterator itr = goList.begin(); itr != goList.end(); ++itr)
- (*itr)->SetRespawnTime(5000);
- }
-}
-
-void hyjalAI::UpdateAI(const uint32 diff)
-{
- if(bRetreat)
- if(RetreatTimer < diff)
- {
- bRetreat = false;
- if(CreatureList.empty())
- return;
-
- for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- pUnit->SetVisibility(VISIBILITY_OFF);
-
- m_creature->SetVisibility(VISIBILITY_OFF);
- }else RetreatTimer -= diff;
-
- if(!EventBegun)
- return;
-
- if(Summon)
- {
- if(pInstance && EnemyCount)
- {
- EnemyCount = pInstance->GetData(DATA_TRASH);
- if(!EnemyCount)
- NextWaveTimer = 5000;
- }
-
- if(NextWaveTimer < diff)
- {
- if(Faction == 0)
- SummonNextWave(AllianceWaves, WaveCount, AllianceBase);
- else if(Faction == 1)
- SummonNextWave(HordeWaves, WaveCount, HordeBase);
- ++WaveCount;
- }else NextWaveTimer -= diff;
- }
-
- if(CheckTimer < diff)
- {
- for(uint8 i = 0; i < 2; ++i)
- {
- if(BossGUID[i])
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]);
- if(pUnit && (!pUnit->isAlive()))
- {
- if(BossGUID[i] == BossGUID[0])
- {
- Talk(INCOMING);
- FirstBossDead = true;
- }
- else if(BossGUID[i] == BossGUID[1])
- {
- Talk(SUCCESS);
- SecondBossDead = true;
- }
- EventBegun = false;
- CheckTimer = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- BossGUID[i] = 0;
- UpdateWorldState(WORLDSTATE_ENEMY, 0); // Reset world state for enemies to disable it
- }
- }
- }
- CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- for(uint8 i = 0; i < 3; ++i)
- {
- if(Spell[i].SpellId)
- {
- if(SpellTimer[i] < diff)
- {
- if(m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
-
- Unit* target = NULL;
-
- switch(Spell[i].TargetType)
- {
- case TARGETTYPE_SELF: target = m_creature; break;
- case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break;
- case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break;
- }
-
- if(target && target->isAlive())
- {
- DoCast(target, Spell[i].SpellId);
- SpellTimer[i] = Spell[i].Cooldown;
- }
- }else SpellTimer[i] -= diff;
- }
- }
-
- DoMeleeAttackIfReady();
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: HyjalAI
+SD%Complete: 99
+SDComment: World Packet workaround for World States
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+#include "precompiled.h"
+#include "hyjalAI.h"
+#include "WorldPacket.h"
+
+float AllianceBase[4][3]= // Locations for summoning waves in Alliance base
+{
+ {4979.010, -1709.134, 1339.674},
+ {4969.123, -1705.904, 1341.363},
+ {4970.260, -1698.546, 1341.200},
+ {4975.262, -1698.239, 1341.427}
+};
+
+float HordeBase[4][3]= // Locations for summoning waves in Horde base
+{
+ {5554.399, -2581.419, 1480.820},
+ {5538.996, -2577.742, 1479.790},
+ {5565.642, -2565.666, 1481.635},
+ {5547.218, -2574.589, 1479.194}
+};
+
+float AttackArea[2][3]= // used to inform the wave where to move and attack to
+{
+ { // Alliance
+ 5042.9189, -1776.2562, 1323.0621
+ },
+ { // Horde
+ 5510.4815, -2676.7112, 1480.4314
+ }
+};
+
+hyjalAI::hyjalAI(Creature *c) : ScriptedAI(c)
+{
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+}
+
+void hyjalAI::Reset()
+{
+ /** GUIDs **/
+ PlayerGUID = 0;
+ BossGUID[0] = 0;
+ BossGUID[1] = 0;
+
+ /** Timers **/
+ NextWaveTimer = 10000;
+ CheckTimer = 0;
+ RetreatTimer = 1000;
+
+ /** Misc **/
+ WaveCount = 0;
+
+ /** Set faction properly based on creature entry**/
+ switch(m_creature->GetEntry())
+ {
+ case 17772:
+ Faction = 0;
+ DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
+ break;
+
+ case 17852: Faction = 1; break;
+ }
+
+ /** Bools **/
+ EventBegun = false;
+ FirstBossDead = false;
+ SecondBossDead = false;
+ Summon = false;
+ bRetreat = false;
+
+ /** Flags **/
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ /** Initialize spells **/
+ memset(Spell, 0, sizeof(Spell));
+
+ /** Reset World States **/
+ UpdateWorldState(WORLDSTATE_WAVES, 0);
+ UpdateWorldState(WORLDSTATE_ENEMY, 0);
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
+
+ /** Reset Instance Data for trash count **/
+ if(pInstance)
+ pInstance->SetData(DATA_RESET_TRASH_COUNT, 0);
+ else error_log(ERROR_INST_DATA);
+
+ /*** Visibility ***/
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ /** If Jaina evades, reset the visibility of all other creatures in the grid. **/
+ if(CreatureList.empty())
+ return;
+
+ for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
+ if(Creature* cr = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ cr->SetVisibility(VISIBILITY_ON);
+
+ CreatureList.clear();
+}
+
+void hyjalAI::EnterEvadeMode()
+{
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->LoadCreaturesAddon();
+
+ if(m_creature->isAlive())
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+
+ InCombat = false;
+}
+
+void hyjalAI::Aggro(Unit *who)
+{
+ for(uint8 i = 0; i < 2; ++i)
+ if(Spell[i].Cooldown)
+ SpellTimer[i] = Spell[i].Cooldown;
+
+ Talk(ATTACKED);
+}
+
+void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
+{
+ uint32 random = rand()%4;
+ float SpawnLoc[3];
+ float AttackLoc[3];
+
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ SpawnLoc[i] = Base[random][i];
+ AttackLoc[i] = AttackArea[Faction][i];
+ }
+
+ Creature* pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ if(pCreature)
+ {
+ ++EnemyCount; // Increment Enemy Count to be used in World States and instance script
+
+ pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]);
+ pCreature->AddThreat(m_creature, 1.0f);
+ DoZoneInCombat(pCreature);
+
+ // Check if creature is a boss.
+ if(pCreature->GetCreatureInfo()->rank == 3)
+ {
+ if(!FirstBossDead) BossGUID[0] = pCreature->GetGUID();
+ else BossGUID[1] = pCreature->GetGUID();
+ CheckTimer = 5000;
+ }
+ }
+}
+
+void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3])
+{
+ if(rand()%4 == 0) // 1 in 4 chance we give a rally yell. Not sure if the chance is Blizzlike.
+ Talk(RALLY);
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ EnemyCount = pInstance->GetData(DATA_TRASH);
+ for(uint8 i = 0; i < 18; ++i)
+ {
+ if(wave[Count].Mob[i])
+ SummonCreature(wave[Count].Mob[i], Base);
+ }
+
+ if(!wave[Count].IsBoss)
+ {
+ uint32 stateValue = Count+1;
+ if(FirstBossDead)
+ stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
+ UpdateWorldState(WORLDSTATE_WAVES, stateValue); // Set world state to our current wave number
+ UpdateWorldState(WORLDSTATE_ENEMY, 1);
+ //UpdateWorldState(WORLDSTATE_ENEMYCOUNT, EnemyCount); // Let Instance Script handle this
+ pInstance->SetData(DATA_TRASH, EnemyCount);
+ if(!Debug)
+ NextWaveTimer = wave[Count].WaveTimer;
+ else
+ {
+ NextWaveTimer = 15000;
+ DoTextEmote(": Debug Mode is enabled. Next Wave in 15 seconds", NULL);
+ }
+ }
+ else
+ {
+ UpdateWorldState(WORLDSTATE_WAVES, 0); // Set world state for waves to 0 to disable it.
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 1); // Set World State for enemies invading to 1.
+ Summon = false;
+ }
+ CheckTimer = 5000;
+}
+
+void hyjalAI::StartEvent(Player* player)
+{
+ if(!player)
+ return;
+
+ Talk(BEGIN);
+
+ EventBegun = true;
+ Summon = true;
+
+ NextWaveTimer = 15000;
+ CheckTimer = 5000;
+ PlayerGUID = player->GetGUID();
+
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ UpdateWorldState(WORLDSTATE_WAVES, 0);
+ UpdateWorldState(WORLDSTATE_ENEMY, 0);
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
+}
+
+uint32 hyjalAI::GetInstanceData(uint32 Event)
+{
+ if(pInstance)
+ return pInstance->GetData(Event);
+ else error_log(ERROR_INST_DATA);
+
+ return 0;
+}
+
+void hyjalAI::Talk(uint32 id)
+{
+ std::list<uint8> index;
+ for(uint8 i = 0; i < 10; i++)
+ {
+ if(Faction == 0) // Alliance
+ {
+ if(JainaQuotes[i].id == id)
+ index.push_back(i);
+ }
+ else if(Faction == 1) // Horde
+ {
+ if(ThrallQuotes[i].id == id)
+ index.push_back(i);
+ }
+ }
+
+ if(index.empty())
+ return; // No quotes found, no use to continue
+
+ uint8 ind = *(index.begin()) + rand()%index.size();
+
+ char* Yell = NULL;
+ uint32 Sound = 0;
+ if(Faction == 0) // Alliance
+ {
+ Yell = JainaQuotes[ind].text;
+ Sound = JainaQuotes[ind].sound;
+ }
+ else if(Faction == 1) // Horde
+ {
+ Yell = ThrallQuotes[ind].text;
+ Sound = ThrallQuotes[ind].sound;
+ }
+
+ if(Yell)
+ DoYell(Yell, LANG_UNIVERSAL, NULL);
+ if(Sound)
+ DoPlaySoundToSet(m_creature, Sound);
+}
+
+// Slight workaround for now
+void hyjalAI::UpdateWorldState(uint32 field, uint32 value)
+{
+ Map * map = m_creature->GetMap();
+ if(!map->IsDungeon()) return;
+
+ WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
+
+ data << field;
+ data << value;
+
+ ((InstanceMap*)map)->SendToPlayers(&data);
+
+ // TODO: Uncomment and remove everything above this line only when the core patch for this is accepted
+ //m_creature->GetMap()->UpdateWorldState(field, value);
+}
+
+void hyjalAI::Retreat()
+{
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ // First get all creatures.
+ std::list<Creature*> creatures;
+ Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
+ TypeContainerVisitor
+ <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
+ GridTypeMapContainer> creature_visitor(creature_searcher);
+
+ // Then get all Ancient Gem Veins. NOTE: Grid Search will only be able to find those in the grid.
+ std::list<GameObject*> goList;
+ Trinity::AllGameObjectsWithEntryInGrid go_check(185557);
+ Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(goList, go_check);
+ TypeContainerVisitor
+ <Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ // Get Creatures
+ cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
+ // Get GOs
+ cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap()));
+
+ CreatureList.clear();
+ if(!creatures.empty())
+ {
+ for(std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
+ {
+ (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
+ CreatureList.push_back((*itr)->GetGUID());
+ }
+
+ DoCast(m_creature, SPELL_TELEPORT_VISUAL);
+ bRetreat = true;
+ RetreatTimer = 1000;
+ }
+
+ if(!goList.empty())
+ {
+ for(std::list<GameObject*>::iterator itr = goList.begin(); itr != goList.end(); ++itr)
+ (*itr)->SetRespawnTime(5000);
+ }
+}
+
+void hyjalAI::UpdateAI(const uint32 diff)
+{
+ if(bRetreat)
+ if(RetreatTimer < diff)
+ {
+ bRetreat = false;
+ if(CreatureList.empty())
+ return;
+
+ for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
+ pUnit->SetVisibility(VISIBILITY_OFF);
+
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ }else RetreatTimer -= diff;
+
+ if(!EventBegun)
+ return;
+
+ if(Summon)
+ {
+ if(pInstance && EnemyCount)
+ {
+ EnemyCount = pInstance->GetData(DATA_TRASH);
+ if(!EnemyCount)
+ NextWaveTimer = 5000;
+ }
+
+ if(NextWaveTimer < diff)
+ {
+ if(Faction == 0)
+ SummonNextWave(AllianceWaves, WaveCount, AllianceBase);
+ else if(Faction == 1)
+ SummonNextWave(HordeWaves, WaveCount, HordeBase);
+ ++WaveCount;
+ }else NextWaveTimer -= diff;
+ }
+
+ if(CheckTimer < diff)
+ {
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ if(BossGUID[i])
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]);
+ if(pUnit && (!pUnit->isAlive()))
+ {
+ if(BossGUID[i] == BossGUID[0])
+ {
+ Talk(INCOMING);
+ FirstBossDead = true;
+ }
+ else if(BossGUID[i] == BossGUID[1])
+ {
+ Talk(SUCCESS);
+ SecondBossDead = true;
+ }
+ EventBegun = false;
+ CheckTimer = 0;
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ BossGUID[i] = 0;
+ UpdateWorldState(WORLDSTATE_ENEMY, 0); // Reset world state for enemies to disable it
+ }
+ }
+ }
+ CheckTimer = 5000;
+ }else CheckTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ if(Spell[i].SpellId)
+ {
+ if(SpellTimer[i] < diff)
+ {
+ if(m_creature->IsNonMeleeSpellCasted(false))
+ m_creature->InterruptNonMeleeSpells(false);
+
+ Unit* target = NULL;
+
+ switch(Spell[i].TargetType)
+ {
+ case TARGETTYPE_SELF: target = m_creature; break;
+ case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break;
+ case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break;
+ }
+
+ if(target && target->isAlive())
+ {
+ DoCast(target, Spell[i].SpellId);
+ SpellTimer[i] = Spell[i].Cooldown;
+ }
+ }else SpellTimer[i] -= diff;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
index ebdad9170f2..3765e26d602 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
@@ -1,286 +1,286 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_HYJALAI_H
-#define SC_HYJALAI_H
-
-#include "def_hyjal.h"
-
-// Trash Mobs summoned in waves
-#define NECROMANCER 17899
-#define ABOMINATION 17898
-#define GHOUL 17895
-#define BANSHEE 17905
-#define CRYPT_FIEND 17897
-#define GARGOYLE 17906
-#define FROST_WYRM 17907
-#define GIANT_INFERNAL 17908
-#define FEL_STALKER 17916
-
-// Bosses summoned after every 8 waves
-#define RAGE_WINTERCHILL 17767
-#define ANETHERON 17808
-#define KAZROGAL 17888
-#define AZGALOR 17842
-#define ARCHIMONDE 17968
-
-#define SPELL_TELEPORT_VISUAL 41232
-
-#define WORLDSTATE_WAVES 2842
-#define WORLDSTATE_ENEMY 2453
-#define WORLDSTATE_ENEMYCOUNT 2454
-
-/*** Spells for Jaina ***/
-#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon
-#define SPELL_BLIZZARD 31266
-#define SPELL_PYROBLAST 31263
-#define SPELL_SUMMON_ELEMENTALS 31264
-
-/** Thrall spells **/
-#define SPELL_CHAIN_LIGHTNING 31330
-#define SPELL_SUMMON_DIRE_WOLF 31331
-
-struct Wave
-{
- uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves
- uint32 WaveTimer; // The timer before the next wave is summoned
- bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
-};
-
-static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
-{
- { // Wave 1
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 2
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 3
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 4
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 5
- GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 6
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 7
- GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 8
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false
- },
- { // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
- RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
- },
- { // Wave 1
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 2
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 3
- GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 4
- GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 5
- CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 6
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 7
- CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 8
- GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false
- },
- { // All 8 Waves are summoned, summon Anatheron
- ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
- }
-};
-
-static Wave HordeWaves[]= // Waves that are summoned in the Horde base
-{
- { // Wave 1
- GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 2
- GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false
- },
- { // Wave 3
- GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 120000, false
- },
- { // Wave 4
- CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER , 0, 0, 0, 0, 120000, false
- },
- { // Wave 5
- GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 6
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, FROST_WYRM, 0, 0, 120000, false
- },
- { // Wave 7
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, FROST_WYRM, 0, 0, 120000, false
- },
- { // Wave 8
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, 180000, false
- },
- { // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor
- KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
- },
- { // Wave 1
- ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 2
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false
- },
- { // Wave 3
- GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 120000, false
- },
- { // Wave 4
- GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 120000, false
- },
- { // Wave 5
- FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 120000, false
- },
- { // Wave 6
- NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 120000, false
- },
- { // Wave 7
- GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 0, 0, 120000, false
- },
- { // Wave 8
- CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 180000, false
- },
- { // All 8 Waves are summoned, summon Azgalor
- AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
- }
-};
-
-enum TargetType // Used in the spell cast system for the AI
-{
- TARGETTYPE_SELF = 0,
- TARGETTYPE_RANDOM = 1,
- TARGETTYPE_VICTIM = 2,
-};
-
-struct Yells
-{
- uint32 id; // Used to determine the type of yell (attack, rally, etc)
- char* text; // The text to be yelled
- uint32 sound; // Sound that corresponds to the text
-};
-
-enum YellId
-{
- ATTACKED = 0, // Used when attacked and set in combat
- BEGIN = 1, // Used when the event is begun
- INCOMING = 2, // Used to warn the raid that another wave phase is coming
- RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned
- FAILURE = 4, // Used when raid has failed (unsure where to place)
- SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase
- DEATH = 6, // Used on death
-};
-
-static Yells JainaQuotes[]=
-{
- {ATTACKED, "I'm in jeopardy, help me if you can!", 11007},
- {ATTACKED, "They've broken through!", 11049},
- {INCOMING, "Stay alert! Another wave approaches.", 11008},
- {BEGIN, "Hold them back as long as possible", 11050},
- {RALLY, "Don't give up! We must prevail!", 11006},
- {RALLY, "We must hold strong!", 11051},
- {FAILURE, "We are lost. Fall back!", 11009},
- {SUCCESS, "We have won valuable time. Now we must pull back!", 11011},
- {DEATH, "I did... my best.", 11010},
-};
-
-static Yells ThrallQuotes[]=
-{
- {ATTACKED, "I will lie down for no one!", 11031},
- {ATTACKED, "Bring the fight to me and pay with your lives!", 11061},
- {INCOMING, "Make ready for another wave! LOK-TAR OGAR!", 11032},
- {BEGIN, "Do not give an inch of ground!", 11060},
- {RALLY, "Hold them back! Do not falter!", 11030},
- {RALLY, "Victory or death!", 11059},
- {RALLY, "Do not give an inch of ground!", 11060},
- {FAILURE, "It is over. Withdraw! We have failed.", 11033},
- {SUCCESS, "We have played our part and done well. It is up to the others now.", 11035},
- {DEATH, "Uraaa...", 11034},
-};
-
-struct TRINITY_DLL_DECL hyjalAI : public ScriptedAI
-{
- hyjalAI(Creature *c);
-
- void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
-
- void EnterEvadeMode(); // Send creature back to spawn location and evade.
-
- void Aggro(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack
-
- void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells.
-
- void JustDied(Unit* killer) // Called on death, informs the raid that they have failed.
- {
- Talk(DEATH);
- }
-
- void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
- {
- Faction = _faction;
- }
-
- void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base.
-
- void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
-
- // Summons the next wave, calls SummonCreature
- void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]);
-
- void StartEvent(Player* player); // Begins the event by gossip click
-
- uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase
-
- void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things
-
- void UpdateWorldState(uint32 field, uint32 value); // NYI: Requires core support. Updates the world state counter at the top of the UI.
- public:
- ScriptedInstance* pInstance;
-
- uint64 PlayerGUID;
- uint64 BossGUID[2];
-
- uint32 NextWaveTimer;
- uint32 WaveCount;
- uint32 CheckTimer;
- uint32 Faction;
- uint32 EnemyCount;
- uint32 RetreatTimer;
-
- bool EventBegun;
- bool FirstBossDead;
- bool SecondBossDead;
- bool Summon;
- bool bRetreat;
- bool Debug;
-
- struct Spell
- {
- uint32 SpellId;
- uint32 Cooldown;
- uint32 TargetType;
- }Spell[3];
-
- private:
- uint32 SpellTimer[3];
- std::list<uint64> CreatureList;
-};
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_HYJALAI_H
+#define SC_HYJALAI_H
+
+#include "def_hyjal.h"
+
+// Trash Mobs summoned in waves
+#define NECROMANCER 17899
+#define ABOMINATION 17898
+#define GHOUL 17895
+#define BANSHEE 17905
+#define CRYPT_FIEND 17897
+#define GARGOYLE 17906
+#define FROST_WYRM 17907
+#define GIANT_INFERNAL 17908
+#define FEL_STALKER 17916
+
+// Bosses summoned after every 8 waves
+#define RAGE_WINTERCHILL 17767
+#define ANETHERON 17808
+#define KAZROGAL 17888
+#define AZGALOR 17842
+#define ARCHIMONDE 17968
+
+#define SPELL_TELEPORT_VISUAL 41232
+
+#define WORLDSTATE_WAVES 2842
+#define WORLDSTATE_ENEMY 2453
+#define WORLDSTATE_ENEMYCOUNT 2454
+
+/*** Spells for Jaina ***/
+#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon
+#define SPELL_BLIZZARD 31266
+#define SPELL_PYROBLAST 31263
+#define SPELL_SUMMON_ELEMENTALS 31264
+
+/** Thrall spells **/
+#define SPELL_CHAIN_LIGHTNING 31330
+#define SPELL_SUMMON_DIRE_WOLF 31331
+
+struct Wave
+{
+ uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves
+ uint32 WaveTimer; // The timer before the next wave is summoned
+ bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
+};
+
+static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
+{
+ { // Wave 1
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 2
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 3
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 4
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 5
+ GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 6
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 7
+ GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 8
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false
+ },
+ { // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
+ RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
+ },
+ { // Wave 1
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 2
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 3
+ GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 4
+ GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 5
+ CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 6
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 7
+ CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 8
+ GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false
+ },
+ { // All 8 Waves are summoned, summon Anatheron
+ ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
+ }
+};
+
+static Wave HordeWaves[]= // Waves that are summoned in the Horde base
+{
+ { // Wave 1
+ GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 2
+ GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 3
+ GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 4
+ CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER , 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 5
+ GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 6
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, FROST_WYRM, 0, 0, 120000, false
+ },
+ { // Wave 7
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, FROST_WYRM, 0, 0, 120000, false
+ },
+ { // Wave 8
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, 180000, false
+ },
+ { // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor
+ KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
+ },
+ { // Wave 1
+ ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 2
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 3
+ GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 4
+ GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 5
+ FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 6
+ NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 7
+ GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 0, 0, 120000, false
+ },
+ { // Wave 8
+ CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 180000, false
+ },
+ { // All 8 Waves are summoned, summon Azgalor
+ AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true
+ }
+};
+
+enum TargetType // Used in the spell cast system for the AI
+{
+ TARGETTYPE_SELF = 0,
+ TARGETTYPE_RANDOM = 1,
+ TARGETTYPE_VICTIM = 2,
+};
+
+struct Yells
+{
+ uint32 id; // Used to determine the type of yell (attack, rally, etc)
+ char* text; // The text to be yelled
+ uint32 sound; // Sound that corresponds to the text
+};
+
+enum YellId
+{
+ ATTACKED = 0, // Used when attacked and set in combat
+ BEGIN = 1, // Used when the event is begun
+ INCOMING = 2, // Used to warn the raid that another wave phase is coming
+ RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned
+ FAILURE = 4, // Used when raid has failed (unsure where to place)
+ SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase
+ DEATH = 6, // Used on death
+};
+
+static Yells JainaQuotes[]=
+{
+ {ATTACKED, "I'm in jeopardy, help me if you can!", 11007},
+ {ATTACKED, "They've broken through!", 11049},
+ {INCOMING, "Stay alert! Another wave approaches.", 11008},
+ {BEGIN, "Hold them back as long as possible", 11050},
+ {RALLY, "Don't give up! We must prevail!", 11006},
+ {RALLY, "We must hold strong!", 11051},
+ {FAILURE, "We are lost. Fall back!", 11009},
+ {SUCCESS, "We have won valuable time. Now we must pull back!", 11011},
+ {DEATH, "I did... my best.", 11010},
+};
+
+static Yells ThrallQuotes[]=
+{
+ {ATTACKED, "I will lie down for no one!", 11031},
+ {ATTACKED, "Bring the fight to me and pay with your lives!", 11061},
+ {INCOMING, "Make ready for another wave! LOK-TAR OGAR!", 11032},
+ {BEGIN, "Do not give an inch of ground!", 11060},
+ {RALLY, "Hold them back! Do not falter!", 11030},
+ {RALLY, "Victory or death!", 11059},
+ {RALLY, "Do not give an inch of ground!", 11060},
+ {FAILURE, "It is over. Withdraw! We have failed.", 11033},
+ {SUCCESS, "We have played our part and done well. It is up to the others now.", 11035},
+ {DEATH, "Uraaa...", 11034},
+};
+
+struct TRINITY_DLL_DECL hyjalAI : public ScriptedAI
+{
+ hyjalAI(Creature *c);
+
+ void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
+
+ void EnterEvadeMode(); // Send creature back to spawn location and evade.
+
+ void Aggro(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack
+
+ void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells.
+
+ void JustDied(Unit* killer) // Called on death, informs the raid that they have failed.
+ {
+ Talk(DEATH);
+ }
+
+ void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
+ {
+ Faction = _faction;
+ }
+
+ void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base.
+
+ void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
+
+ // Summons the next wave, calls SummonCreature
+ void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]);
+
+ void StartEvent(Player* player); // Begins the event by gossip click
+
+ uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase
+
+ void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things
+
+ void UpdateWorldState(uint32 field, uint32 value); // NYI: Requires core support. Updates the world state counter at the top of the UI.
+ public:
+ ScriptedInstance* pInstance;
+
+ uint64 PlayerGUID;
+ uint64 BossGUID[2];
+
+ uint32 NextWaveTimer;
+ uint32 WaveCount;
+ uint32 CheckTimer;
+ uint32 Faction;
+ uint32 EnemyCount;
+ uint32 RetreatTimer;
+
+ bool EventBegun;
+ bool FirstBossDead;
+ bool SecondBossDead;
+ bool Summon;
+ bool bRetreat;
+ bool Debug;
+
+ struct Spell
+ {
+ uint32 SpellId;
+ uint32 Cooldown;
+ uint32 TargetType;
+ }Spell[3];
+
+ private:
+ uint32 SpellTimer[3];
+ std::list<uint64> CreatureList;
+};
+#endif
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
index e6c92fce1ef..a6f8e3a7305 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
@@ -1,203 +1,203 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Mount_Hyjal
-SD%Complete: 100
-SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_hyjal.h"
-#include "WorldPacket.h"
-
-#define ENCOUNTERS 5
-
-/* Battle of Mount Hyjal encounters:
-0 - Rage Winterchill event
-1 - Anetheron event
-2 - Kaz'rogal event
-3 - Azgalor event
-4 - Archimonde event
-*/
-
-struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
-{
- instance_mount_hyjal(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 RageWinterchill;
- uint64 Anetheron;
- uint64 Kazrogal;
- uint64 Azgalor;
- uint64 Archimonde;
- uint64 JainaProudmoore;
- uint64 Thrall;
- uint64 TyrandeWhisperwind;
-
- uint32 Trash;
- uint32 Encounters[ENCOUNTERS];
-
- void Initialize()
- {
- RageWinterchill = 0;
- Anetheron = 0;
- Kazrogal = 0;
- Azgalor = 0;
- Archimonde = 0;
- JainaProudmoore = 0;
- Thrall = 0;
- TyrandeWhisperwind = 0;
-
- Trash = 0;
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- Encounters[i] = NOT_STARTED;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 17767: RageWinterchill = creature->GetGUID(); break;
- case 17808: Anetheron = creature->GetGUID(); break;
- case 17888: Kazrogal = creature->GetGUID(); break;
- case 17842: Azgalor = creature->GetGUID(); break;
- case 17968: Archimonde = creature->GetGUID(); break;
- case 17772: JainaProudmoore = creature->GetGUID(); break;
- case 17852: Thrall = creature->GetGUID(); break;
- case 17948: TyrandeWhisperwind = creature->GetGUID(); break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_RAGEWINTERCHILL: return RageWinterchill;
- case DATA_ANETHERON: return Anetheron;
- case DATA_KAZROGAL: return Kazrogal;
- case DATA_AZGALOR: return Azgalor;
- case DATA_ARCHIMONDE: return Archimonde;
- case DATA_JAINAPROUDMOORE: return JainaProudmoore;
- case DATA_THRALL: return Thrall;
- case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
- }
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
- case DATA_ANETHERONEVENT: Encounters[1] = data; break;
- case DATA_KAZROGALEVENT: Encounters[2] = data; break;
- case DATA_AZGALOREVENT: Encounters[3] = data; break;
- case DATA_ARCHIMONDEEVENT: Encounters[4] = data; break;
- case DATA_RESET_TRASH_COUNT: Trash = 0; break;
-
- case DATA_TRASH:
- if(data) Trash = data;
- else Trash--;
- UpdateWorldState(2453, data);
- break;
- }
-
- if(data == DONE)
- SaveToDB();
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_RAGEWINTERCHILLEVENT: return Encounters[0];
- case DATA_ANETHERONEVENT: return Encounters[1];
- case DATA_KAZROGALEVENT: return Encounters[2];
- case DATA_AZGALOREVENT: return Encounters[3];
- case DATA_ARCHIMONDEEVENT: return Encounters[4];
- case DATA_TRASH: return Trash;
- }
- return 0;
- }
-
- void UpdateWorldState(uint32 field, uint32 value)
- {
- WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
- data << field;
- data << value;
-
- ((InstanceMap*)instance)->SendToPlayers(&data);
- }
-
- const char* Save()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " "
- << Encounters[2] << " " << Encounters[3] << " "
- << Encounters[4];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if(out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
-
- return NULL;
- }
-
- void Load(const char* load)
- {
- if(!load)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(load);
- std::istringstream stream;
- stream >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4];
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
- Encounters[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
-};
-
-InstanceData* GetInstanceData_instance_mount_hyjal(Map* map)
-{
- return new instance_mount_hyjal(map);
-}
-
-void AddSC_instance_mount_hyjal()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_hyjal";
- newscript->GetInstanceData = GetInstanceData_instance_mount_hyjal;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Mount_Hyjal
+SD%Complete: 100
+SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_hyjal.h"
+#include "WorldPacket.h"
+
+#define ENCOUNTERS 5
+
+/* Battle of Mount Hyjal encounters:
+0 - Rage Winterchill event
+1 - Anetheron event
+2 - Kaz'rogal event
+3 - Azgalor event
+4 - Archimonde event
+*/
+
+struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
+{
+ instance_mount_hyjal(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 RageWinterchill;
+ uint64 Anetheron;
+ uint64 Kazrogal;
+ uint64 Azgalor;
+ uint64 Archimonde;
+ uint64 JainaProudmoore;
+ uint64 Thrall;
+ uint64 TyrandeWhisperwind;
+
+ uint32 Trash;
+ uint32 Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ RageWinterchill = 0;
+ Anetheron = 0;
+ Kazrogal = 0;
+ Azgalor = 0;
+ Archimonde = 0;
+ JainaProudmoore = 0;
+ Thrall = 0;
+ TyrandeWhisperwind = 0;
+
+ Trash = 0;
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 17767: RageWinterchill = creature->GetGUID(); break;
+ case 17808: Anetheron = creature->GetGUID(); break;
+ case 17888: Kazrogal = creature->GetGUID(); break;
+ case 17842: Azgalor = creature->GetGUID(); break;
+ case 17968: Archimonde = creature->GetGUID(); break;
+ case 17772: JainaProudmoore = creature->GetGUID(); break;
+ case 17852: Thrall = creature->GetGUID(); break;
+ case 17948: TyrandeWhisperwind = creature->GetGUID(); break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_RAGEWINTERCHILL: return RageWinterchill;
+ case DATA_ANETHERON: return Anetheron;
+ case DATA_KAZROGAL: return Kazrogal;
+ case DATA_AZGALOR: return Azgalor;
+ case DATA_ARCHIMONDE: return Archimonde;
+ case DATA_JAINAPROUDMOORE: return JainaProudmoore;
+ case DATA_THRALL: return Thrall;
+ case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
+ case DATA_ANETHERONEVENT: Encounters[1] = data; break;
+ case DATA_KAZROGALEVENT: Encounters[2] = data; break;
+ case DATA_AZGALOREVENT: Encounters[3] = data; break;
+ case DATA_ARCHIMONDEEVENT: Encounters[4] = data; break;
+ case DATA_RESET_TRASH_COUNT: Trash = 0; break;
+
+ case DATA_TRASH:
+ if(data) Trash = data;
+ else Trash--;
+ UpdateWorldState(2453, data);
+ break;
+ }
+
+ if(data == DONE)
+ SaveToDB();
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_RAGEWINTERCHILLEVENT: return Encounters[0];
+ case DATA_ANETHERONEVENT: return Encounters[1];
+ case DATA_KAZROGALEVENT: return Encounters[2];
+ case DATA_AZGALOREVENT: return Encounters[3];
+ case DATA_ARCHIMONDEEVENT: return Encounters[4];
+ case DATA_TRASH: return Trash;
+ }
+ return 0;
+ }
+
+ void UpdateWorldState(uint32 field, uint32 value)
+ {
+ WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
+ data << field;
+ data << value;
+
+ ((InstanceMap*)instance)->SendToPlayers(&data);
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << Encounters[0] << " " << Encounters[1] << " "
+ << Encounters[2] << " " << Encounters[3] << " "
+ << Encounters[4];
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if(out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+
+ return NULL;
+ }
+
+ void Load(const char* load)
+ {
+ if(!load)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(load);
+ std::istringstream stream;
+ stream >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4];
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
+ Encounters[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_mount_hyjal(Map* map)
+{
+ return new instance_mount_hyjal(map);
+}
+
+void AddSC_instance_mount_hyjal()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_hyjal";
+ newscript->GetInstanceData = GetInstanceData_instance_mount_hyjal;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
index 18b39cfbff5..1d4d4397241 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
@@ -1,177 +1,177 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Captain_Skarloc
-SD%Complete: 75
-SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat.
-SDCategory: Caverns of Time, Old Hillsbrad Foothills
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_old_hillsbrad.h"
-
-#define HOLY_LIGHT 29562
-#define CLEANSE 39078
-#define HAMMER_OF_JUSTICE 13005
-#define HOLY_SHIELD 31904
-#define DEVOTION_AURA 41452
-#define CONSECRATION 41541
-
-#define SAY_ENTER "Thrall! You didn't really think you would escape did you? You and your allies shall answer to Blackmoore - after I've had my fun!"
-#define SAY_AGGRO1 "You're a slave. That's all you'll ever be.'"
-#define SAY_AGGRO2 "I don't know what Blackmoore sees in you. For my money, you're just another ignorant savage!"
-#define SAY_SLAY1 "Thrall will never be free!"
-#define SAY_SLAY2 "Did you really think you would leave here alive?"
-#define SAY_DEATH "Guards! Urgh..Guards..!'"
-
-#define SOUND_ENTER 10406
-#define SOUND_AGGRO1 10407
-#define SOUND_AGGRO2 10408
-#define SOUND_SLAY1 10409
-#define SOUND_SLAY2 10410
-#define SOUND_DEATH 10411
-
-struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI
-{
- boss_captain_skarlocAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Holy_Light_Timer;
- uint32 Cleanse_Timer;
- uint32 HammerOfJustice_Timer;
- uint32 HolyShield_Timer;
- uint32 DevotionAura_Timer;
- uint32 Consecration_Timer;
-
- void Reset()
- {
- Holy_Light_Timer = 30000;
- Cleanse_Timer = 10000;
- HammerOfJustice_Timer = 60000;
- HolyShield_Timer = 240000;
- DevotionAura_Timer = 60000;
- Consecration_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- if( pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
- pInstance->SetData(TYPE_THRALL_PART1, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Holy_Light
- if (Holy_Light_Timer < diff)
- {
- DoCast(m_creature, HOLY_LIGHT);
- Holy_Light_Timer = 30000;
- }else Holy_Light_Timer -= diff;
-
- //Cleanse
- if(Cleanse_Timer < diff)
- {
- DoCast(m_creature, CLEANSE);
- Cleanse_Timer = 10000 ;
- } else Cleanse_Timer -= diff;
-
- //Hammer of Justice
- if (HammerOfJustice_Timer < diff)
- {
- DoCast(m_creature->getVictim(), HAMMER_OF_JUSTICE);
- HammerOfJustice_Timer = 60000;
- }else HammerOfJustice_Timer -= diff;
-
- //Holy Shield
- if (HolyShield_Timer < diff)
- {
- DoCast(m_creature,HOLY_SHIELD);
- HolyShield_Timer = 240000;
- }else HolyShield_Timer -= diff;
-
- //Devotion_Aura
- if (DevotionAura_Timer < diff)
- {
- DoCast(m_creature,DEVOTION_AURA);
- DevotionAura_Timer = 60000;
- }else DevotionAura_Timer -= diff;
-
- //Consecration
- if (Consecration_Timer < diff)
- {
- //DoCast(m_creature->getVictim(),CONSECRATION);
- Consecration_Timer = 8000;
- }else Consecration_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_captain_skarloc(Creature *_Creature)
-{
- return new boss_captain_skarlocAI (_Creature);
-}
-
-void AddSC_boss_captain_skarloc()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_captain_skarloc";
- newscript->GetAI = GetAI_boss_captain_skarloc;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Captain_Skarloc
+SD%Complete: 75
+SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat.
+SDCategory: Caverns of Time, Old Hillsbrad Foothills
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_old_hillsbrad.h"
+
+#define HOLY_LIGHT 29562
+#define CLEANSE 39078
+#define HAMMER_OF_JUSTICE 13005
+#define HOLY_SHIELD 31904
+#define DEVOTION_AURA 41452
+#define CONSECRATION 41541
+
+#define SAY_ENTER "Thrall! You didn't really think you would escape did you? You and your allies shall answer to Blackmoore - after I've had my fun!"
+#define SAY_AGGRO1 "You're a slave. That's all you'll ever be.'"
+#define SAY_AGGRO2 "I don't know what Blackmoore sees in you. For my money, you're just another ignorant savage!"
+#define SAY_SLAY1 "Thrall will never be free!"
+#define SAY_SLAY2 "Did you really think you would leave here alive?"
+#define SAY_DEATH "Guards! Urgh..Guards..!'"
+
+#define SOUND_ENTER 10406
+#define SOUND_AGGRO1 10407
+#define SOUND_AGGRO2 10408
+#define SOUND_SLAY1 10409
+#define SOUND_SLAY2 10410
+#define SOUND_DEATH 10411
+
+struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI
+{
+ boss_captain_skarlocAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Holy_Light_Timer;
+ uint32 Cleanse_Timer;
+ uint32 HammerOfJustice_Timer;
+ uint32 HolyShield_Timer;
+ uint32 DevotionAura_Timer;
+ uint32 Consecration_Timer;
+
+ void Reset()
+ {
+ Holy_Light_Timer = 30000;
+ Cleanse_Timer = 10000;
+ HammerOfJustice_Timer = 60000;
+ HolyShield_Timer = 240000;
+ DevotionAura_Timer = 60000;
+ Consecration_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ if( pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
+ pInstance->SetData(TYPE_THRALL_PART1, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Holy_Light
+ if (Holy_Light_Timer < diff)
+ {
+ DoCast(m_creature, HOLY_LIGHT);
+ Holy_Light_Timer = 30000;
+ }else Holy_Light_Timer -= diff;
+
+ //Cleanse
+ if(Cleanse_Timer < diff)
+ {
+ DoCast(m_creature, CLEANSE);
+ Cleanse_Timer = 10000 ;
+ } else Cleanse_Timer -= diff;
+
+ //Hammer of Justice
+ if (HammerOfJustice_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), HAMMER_OF_JUSTICE);
+ HammerOfJustice_Timer = 60000;
+ }else HammerOfJustice_Timer -= diff;
+
+ //Holy Shield
+ if (HolyShield_Timer < diff)
+ {
+ DoCast(m_creature,HOLY_SHIELD);
+ HolyShield_Timer = 240000;
+ }else HolyShield_Timer -= diff;
+
+ //Devotion_Aura
+ if (DevotionAura_Timer < diff)
+ {
+ DoCast(m_creature,DEVOTION_AURA);
+ DevotionAura_Timer = 60000;
+ }else DevotionAura_Timer -= diff;
+
+ //Consecration
+ if (Consecration_Timer < diff)
+ {
+ //DoCast(m_creature->getVictim(),CONSECRATION);
+ Consecration_Timer = 8000;
+ }else Consecration_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_captain_skarloc(Creature *_Creature)
+{
+ return new boss_captain_skarlocAI (_Creature);
+}
+
+void AddSC_boss_captain_skarloc()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_captain_skarloc";
+ newscript->GetAI = GetAI_boss_captain_skarloc;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
index 8b62fad9e32..ca3d26268fe 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
@@ -1,183 +1,183 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Epoch_Hunter
-SD%Complete: 60
-SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event.
-SDCategory: Caverns of Time, Old Hillsbrad Foothills
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_old_hillsbrad.h"
-
-#define SAY_ENTER1 "Thrall! Come outside and face your fate!"
-#define SOUND_ENTER1 10418
-#define SAY_ENTER2 "Taretha's life hangs in the balance. Surely you care for her. Surely you wish to save her..."
-#define SOUND_ENTER2 10419
-#define SAY_ENTER3 "Ah, there you are. I had hoped to accomplish this with a bit of subtlety, but I suppose direct confrontation was inevitable. Your future, Thrall, must not come to pass and so...you and your troublesome friends must die!"
-#define SOUND_ENTER3 10420
-
-#define SAY_AGGRO1 "Enough! I will erase your very existence!"
-#define SOUND_AGGRO1 10421
-#define SAY_AGGRO2 "You cannot fight fate!"
-#define SOUND_AGGRO2 10422
-
-#define SAY_SLAY1 "You are...irrelevant."
-#define SOUND_SLAY1 10425
-#define SAY_SLAY2 "Thrall will remain a slave. Taretha will die. You have failed."
-#define SOUND_SLAY2 10426
-
-#define SAY_BREATH1 "Not so fast!"
-#define SOUND_BREATH1 10423
-#define SAY_BREATH2 "Struggle as much as you like!"
-#define SOUND_BREATH2 10424
-
-#define SAY_DEATH "No!...The master... will not... be pleased."
-#define SOUND_DEATH 10427
-
-#define SPELL_SAND_BREATH 31914
-#define SPELL_IMPENDING_DEATH 31916
-#define SPELL_MAGIC_DISRUPTION_AURA 33834
-#define SPELL_WING_BUFFET 31475
-
-struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI
-{
- boss_epoch_hunterAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 SandBreath_Timer;
- uint32 ImpendingDeath_Timer;
- uint32 WingBuffet_Timer;
- uint32 Mda_Timer;
-
- void Reset()
- {
- SandBreath_Timer = 25000;
- ImpendingDeath_Timer = 30000;
- WingBuffet_Timer = 35000;
- Mda_Timer = 40000;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
- pInstance->SetData(TYPE_THRALL_PART4, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Sand Breath
- if( SandBreath_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(m_creature->getVictim(),SPELL_SAND_BREATH);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_BREATH1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_BREATH1);
- break;
- case 1:
- DoYell(SAY_BREATH2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_BREATH2);
- break;
- }
-
- SandBreath_Timer = 25000+rand()%5000;
- }else SandBreath_Timer -= diff;
-
- if( ImpendingDeath_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH);
- ImpendingDeath_Timer = 30000+rand()%5000;
- }else ImpendingDeath_Timer -= diff;
-
- if( WingBuffet_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_WING_BUFFET);
- WingBuffet_Timer = 25000+rand()%10000;
- }else WingBuffet_Timer -= diff;
-
- if( Mda_Timer < diff )
- {
- DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA);
- Mda_Timer = 15000;
- }else Mda_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_epoch_hunter(Creature *_Creature)
-{
- return new boss_epoch_hunterAI (_Creature);
-}
-
-void AddSC_boss_epoch_hunter()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_epoch_hunter";
- newscript->GetAI = GetAI_boss_epoch_hunter;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Epoch_Hunter
+SD%Complete: 60
+SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event.
+SDCategory: Caverns of Time, Old Hillsbrad Foothills
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_old_hillsbrad.h"
+
+#define SAY_ENTER1 "Thrall! Come outside and face your fate!"
+#define SOUND_ENTER1 10418
+#define SAY_ENTER2 "Taretha's life hangs in the balance. Surely you care for her. Surely you wish to save her..."
+#define SOUND_ENTER2 10419
+#define SAY_ENTER3 "Ah, there you are. I had hoped to accomplish this with a bit of subtlety, but I suppose direct confrontation was inevitable. Your future, Thrall, must not come to pass and so...you and your troublesome friends must die!"
+#define SOUND_ENTER3 10420
+
+#define SAY_AGGRO1 "Enough! I will erase your very existence!"
+#define SOUND_AGGRO1 10421
+#define SAY_AGGRO2 "You cannot fight fate!"
+#define SOUND_AGGRO2 10422
+
+#define SAY_SLAY1 "You are...irrelevant."
+#define SOUND_SLAY1 10425
+#define SAY_SLAY2 "Thrall will remain a slave. Taretha will die. You have failed."
+#define SOUND_SLAY2 10426
+
+#define SAY_BREATH1 "Not so fast!"
+#define SOUND_BREATH1 10423
+#define SAY_BREATH2 "Struggle as much as you like!"
+#define SOUND_BREATH2 10424
+
+#define SAY_DEATH "No!...The master... will not... be pleased."
+#define SOUND_DEATH 10427
+
+#define SPELL_SAND_BREATH 31914
+#define SPELL_IMPENDING_DEATH 31916
+#define SPELL_MAGIC_DISRUPTION_AURA 33834
+#define SPELL_WING_BUFFET 31475
+
+struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI
+{
+ boss_epoch_hunterAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 SandBreath_Timer;
+ uint32 ImpendingDeath_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 Mda_Timer;
+
+ void Reset()
+ {
+ SandBreath_Timer = 25000;
+ ImpendingDeath_Timer = 30000;
+ WingBuffet_Timer = 35000;
+ Mda_Timer = 40000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
+ pInstance->SetData(TYPE_THRALL_PART4, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Sand Breath
+ if( SandBreath_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(m_creature->getVictim(),SPELL_SAND_BREATH);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_BREATH1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BREATH1);
+ break;
+ case 1:
+ DoYell(SAY_BREATH2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BREATH2);
+ break;
+ }
+
+ SandBreath_Timer = 25000+rand()%5000;
+ }else SandBreath_Timer -= diff;
+
+ if( ImpendingDeath_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH);
+ ImpendingDeath_Timer = 30000+rand()%5000;
+ }else ImpendingDeath_Timer -= diff;
+
+ if( WingBuffet_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_WING_BUFFET);
+ WingBuffet_Timer = 25000+rand()%10000;
+ }else WingBuffet_Timer -= diff;
+
+ if( Mda_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA);
+ Mda_Timer = 15000;
+ }else Mda_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_epoch_hunter(Creature *_Creature)
+{
+ return new boss_epoch_hunterAI (_Creature);
+}
+
+void AddSC_boss_epoch_hunter()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_epoch_hunter";
+ newscript->GetAI = GetAI_boss_epoch_hunter;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
index 0acd4b9ef6a..b3f3a76a8b9 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
@@ -1,246 +1,246 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Luetenant_Drake
-SD%Complete: 70
-SDComment: Missing proper code for patrolling area after being spawned. Also script for GO (barrels)(missing Trinity support)
-SDCategory: Caverns of Time, Old Hillsbrad Foothills
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_old_hillsbrad.h"
-#include "../../../npc/npc_escortAI.h"
-
-/*######
-## go_barrel_old_hillsbrad
-######*/
-
-#define QUEST_ENTRY_DIVERSION 10283
-#define LODGE_QUEST_TRIGGER 20155
-
-bool GOHello_go_barrel_old_hillsbrad(Player *player, GameObject* _GO)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_GO->GetInstanceData());
-
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE )
- {
- pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
- }
- else if( pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE )
- {
- player->SummonCreature(17848,2128.43,71.01,64.42,1.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1200000);
- if( player->GetQuestStatus(QUEST_ENTRY_DIVERSION) == QUEST_STATUS_INCOMPLETE )
- player->KilledMonster(LODGE_QUEST_TRIGGER,0);
- }
- }
- return false;
-}
-
-/*######
-## boss_lieutenant_drake
-######*/
-
-#define WHIRLWIND 40236
-#define FEAR 33789
-#define MORTAL_STRIKE 40220
-#define EXPLODIG_SHOUT 33792
-
-#define SAY_ENTER1 "You there, fetch water quickly!"
-#define SAY_ENTER2 "Get these flames out before they spread to the rest of the keep!"
-#define SAY_ENTER3 "Hurry, damn you!"
-#define SAY_AGGRO "I know what you're up to, and I mean to put an end to it, permanently!"
-#define SAY_SLAY1 "No more middling for you."
-#define SAY_SLAY2 "You will not interfere!"
-#define SAY_MORTAL "Time to bleed!"
-#define SAY_SHOUT "Run, you blasted cowards!"
-#define SAY_DEATH "Thrall... must not... go free."
-
-#define SOUND_ENTER 10428
-#define SOUND_AGGRO 10429
-#define SOUND_SLAY1 10432
-#define SOUND_SLAY2 10433
-#define SOUND_MORTAL 10430
-#define SOUND_SHOUT 10431
-#define SOUND_DEATH 10434
-
-struct Location
-{
- uint32 wpId;
- float x;
- float y;
- float z;
-};
-
-static Location DrakeWP[]=
-{
- {0, 2125.84, 88.2535, 54.8830},
- {1, 2111.01, 93.8022, 52.6356},
- {2, 2106.70, 114.753, 53.1965},
- {3, 2107.76, 138.746, 52.5109},
- {4, 2114.83, 160.142, 52.4738},
- {5, 2125.24, 178.909, 52.7283},
- {6, 2151.02, 208.901, 53.1551},
- {7, 2177.00, 233.069, 52.4409},
- {8, 2190.71, 227.831, 53.2742},
- {9, 2178.14, 214.219, 53.0779},
- {10, 2154.99, 202.795, 52.6446},
- {11, 2132.00, 191.834, 52.5709},
- {12, 2117.59, 166.708, 52.7686},
- {13, 2093.61, 139.441, 52.7616},
- {14, 2086.29, 104.950, 52.9246},
- {15, 2094.23, 81.2788, 52.6946},
- {16, 2108.70, 85.3075, 53.3294},
- {17, 2125.50, 88.9481, 54.7953},
- {18, 2128.20, 70.9763, 64.4221}
-};
-
-struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI
-{
- boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool CanPatrol;
- uint32 wpId;
-
- uint32 Whirlwind_Timer;
- uint32 Fear_Timer;
- uint32 MortalStrike_Timer;
- uint32 ExplodingShout_Timer;
-
- void Reset()
- {
- CanPatrol = true;
- wpId = 0;
-
- Whirlwind_Timer = 20000;
- Fear_Timer = 30000;
- MortalStrike_Timer = 45000;
- ExplodingShout_Timer = 25000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //TODO: make this work
- if( CanPatrol && wpId == 0 )
- {
- m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
- wpId++;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Whirlwind
- if (Whirlwind_Timer < diff)
- {
- DoCast(m_creature->getVictim(), WHIRLWIND);
-
- Whirlwind_Timer = 20000+rand()%5000;
- }else Whirlwind_Timer -= diff;
-
- //Fear
- if (Fear_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (target)
- DoCast(target, FEAR);
-
- Fear_Timer = 30000+rand()%10000;
- }else Fear_Timer -= diff;
-
- //Mortal Strike
- if (MortalStrike_Timer < diff)
- {
- DoYell(SAY_MORTAL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_MORTAL);
-
- DoCast(m_creature->getVictim(), MORTAL_STRIKE);
-
- MortalStrike_Timer = 45000+rand()%5000;
- }else MortalStrike_Timer -= diff;
-
- /*
- //This only enabled on heroic?
- //Exploding Shout
- if (m_creature->IsHeroicCreature())
- {
- if (ExplodingShout_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoYell(SAY_SHOUT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SHOUT);
- DoCast(target,EXPLODING_SHOUT);
- ExplodingShout_Timer = 25000+rand()%5000;
- }else ExplodingShout_Timer -= diff;
- }
- */
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_lieutenant_drake(Creature *_Creature)
-{
- return new boss_lieutenant_drakeAI (_Creature);
-}
-
-void AddSC_boss_lieutenant_drake()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="go_barrel_old_hillsbrad";
- newscript->pGOHello = GOHello_go_barrel_old_hillsbrad;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lieutenant_drake";
- newscript->GetAI = GetAI_boss_lieutenant_drake;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Luetenant_Drake
+SD%Complete: 70
+SDComment: Missing proper code for patrolling area after being spawned. Also script for GO (barrels)(missing Trinity support)
+SDCategory: Caverns of Time, Old Hillsbrad Foothills
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_old_hillsbrad.h"
+#include "../../../npc/npc_escortAI.h"
+
+/*######
+## go_barrel_old_hillsbrad
+######*/
+
+#define QUEST_ENTRY_DIVERSION 10283
+#define LODGE_QUEST_TRIGGER 20155
+
+bool GOHello_go_barrel_old_hillsbrad(Player *player, GameObject* _GO)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_GO->GetInstanceData());
+
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE )
+ {
+ pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
+ }
+ else if( pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE )
+ {
+ player->SummonCreature(17848,2128.43,71.01,64.42,1.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1200000);
+ if( player->GetQuestStatus(QUEST_ENTRY_DIVERSION) == QUEST_STATUS_INCOMPLETE )
+ player->KilledMonster(LODGE_QUEST_TRIGGER,0);
+ }
+ }
+ return false;
+}
+
+/*######
+## boss_lieutenant_drake
+######*/
+
+#define WHIRLWIND 40236
+#define FEAR 33789
+#define MORTAL_STRIKE 40220
+#define EXPLODIG_SHOUT 33792
+
+#define SAY_ENTER1 "You there, fetch water quickly!"
+#define SAY_ENTER2 "Get these flames out before they spread to the rest of the keep!"
+#define SAY_ENTER3 "Hurry, damn you!"
+#define SAY_AGGRO "I know what you're up to, and I mean to put an end to it, permanently!"
+#define SAY_SLAY1 "No more middling for you."
+#define SAY_SLAY2 "You will not interfere!"
+#define SAY_MORTAL "Time to bleed!"
+#define SAY_SHOUT "Run, you blasted cowards!"
+#define SAY_DEATH "Thrall... must not... go free."
+
+#define SOUND_ENTER 10428
+#define SOUND_AGGRO 10429
+#define SOUND_SLAY1 10432
+#define SOUND_SLAY2 10433
+#define SOUND_MORTAL 10430
+#define SOUND_SHOUT 10431
+#define SOUND_DEATH 10434
+
+struct Location
+{
+ uint32 wpId;
+ float x;
+ float y;
+ float z;
+};
+
+static Location DrakeWP[]=
+{
+ {0, 2125.84, 88.2535, 54.8830},
+ {1, 2111.01, 93.8022, 52.6356},
+ {2, 2106.70, 114.753, 53.1965},
+ {3, 2107.76, 138.746, 52.5109},
+ {4, 2114.83, 160.142, 52.4738},
+ {5, 2125.24, 178.909, 52.7283},
+ {6, 2151.02, 208.901, 53.1551},
+ {7, 2177.00, 233.069, 52.4409},
+ {8, 2190.71, 227.831, 53.2742},
+ {9, 2178.14, 214.219, 53.0779},
+ {10, 2154.99, 202.795, 52.6446},
+ {11, 2132.00, 191.834, 52.5709},
+ {12, 2117.59, 166.708, 52.7686},
+ {13, 2093.61, 139.441, 52.7616},
+ {14, 2086.29, 104.950, 52.9246},
+ {15, 2094.23, 81.2788, 52.6946},
+ {16, 2108.70, 85.3075, 53.3294},
+ {17, 2125.50, 88.9481, 54.7953},
+ {18, 2128.20, 70.9763, 64.4221}
+};
+
+struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI
+{
+ boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool CanPatrol;
+ uint32 wpId;
+
+ uint32 Whirlwind_Timer;
+ uint32 Fear_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 ExplodingShout_Timer;
+
+ void Reset()
+ {
+ CanPatrol = true;
+ wpId = 0;
+
+ Whirlwind_Timer = 20000;
+ Fear_Timer = 30000;
+ MortalStrike_Timer = 45000;
+ ExplodingShout_Timer = 25000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //TODO: make this work
+ if( CanPatrol && wpId == 0 )
+ {
+ m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
+ wpId++;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Whirlwind
+ if (Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), WHIRLWIND);
+
+ Whirlwind_Timer = 20000+rand()%5000;
+ }else Whirlwind_Timer -= diff;
+
+ //Fear
+ if (Fear_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (target)
+ DoCast(target, FEAR);
+
+ Fear_Timer = 30000+rand()%10000;
+ }else Fear_Timer -= diff;
+
+ //Mortal Strike
+ if (MortalStrike_Timer < diff)
+ {
+ DoYell(SAY_MORTAL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MORTAL);
+
+ DoCast(m_creature->getVictim(), MORTAL_STRIKE);
+
+ MortalStrike_Timer = 45000+rand()%5000;
+ }else MortalStrike_Timer -= diff;
+
+ /*
+ //This only enabled on heroic?
+ //Exploding Shout
+ if (m_creature->IsHeroicCreature())
+ {
+ if (ExplodingShout_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoYell(SAY_SHOUT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SHOUT);
+ DoCast(target,EXPLODING_SHOUT);
+ ExplodingShout_Timer = 25000+rand()%5000;
+ }else ExplodingShout_Timer -= diff;
+ }
+ */
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_lieutenant_drake(Creature *_Creature)
+{
+ return new boss_lieutenant_drakeAI (_Creature);
+}
+
+void AddSC_boss_lieutenant_drake()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="go_barrel_old_hillsbrad";
+ newscript->pGOHello = GOHello_go_barrel_old_hillsbrad;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lieutenant_drake";
+ newscript->GetAI = GetAI_boss_lieutenant_drake;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
index 4d82a179a93..8a230919bbc 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
@@ -1,16 +1,16 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_OLD_HILLSBRAD_H
-#define DEF_OLD_HILLSBRAD_H
-
-#define TYPE_BARREL_DIVERSION 1
-#define TYPE_THRALL_EVENT 2
-#define TYPE_THRALL_PART1 3
-#define TYPE_THRALL_PART2 4
-#define TYPE_THRALL_PART3 5
-#define TYPE_THRALL_PART4 6
-#define DATA_THRALL 7
-#define DATA_TARETHA 8
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_OLD_HILLSBRAD_H
+#define DEF_OLD_HILLSBRAD_H
+
+#define TYPE_BARREL_DIVERSION 1
+#define TYPE_THRALL_EVENT 2
+#define TYPE_THRALL_PART1 3
+#define TYPE_THRALL_PART2 4
+#define TYPE_THRALL_PART3 5
+#define TYPE_THRALL_PART4 6
+#define DATA_THRALL 7
+#define DATA_TARETHA 8
+#endif
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
index 9e0ee15f758..a6e4b377358 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
@@ -1,178 +1,178 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Old_Hillsbrad
-SD%Complete: 60
-SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known.
-SDCategory: Caverns of Time, Old Hillsbrad Foothills
-EndScriptData */
-
-/*
--- UPDATE `gameobject_template` SET `ScriptName`='go_barrel_old_hillsbrad' WHERE `entry`=182589;
-*/
-
-#include "precompiled.h"
-#include "def_old_hillsbrad.h"
-
-#define ENCOUNTERS 6
-
-#define THRALL_ENTRY 17876
-#define TARETHA_ENTRY 18887
-
-struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
-{
- instance_old_hillsbrad(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
- uint32 mBarrelCount;
- uint32 mThrallEventCount;
-
- uint64 ThrallGUID;
- uint64 TarethaGUID;
-
- void Initialize()
- {
- mBarrelCount = 0;
- mThrallEventCount = 0;
- ThrallGUID = 0;
- TarethaGUID = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = NOT_STARTED;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case THRALL_ENTRY:
- ThrallGUID = creature->GetGUID();
- break;
- case TARETHA_ENTRY:
- TarethaGUID = creature->GetGUID();
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_BARREL_DIVERSION:
- {
- if( mBarrelCount < 5 )
- {
- mBarrelCount++;
- debug_log("SD2: go_barrel_old_hillsbrad count %u",mBarrelCount);
- }
- else if( mBarrelCount >= 5 )
- Encounter[0] = DONE;
- break;
- }
- case TYPE_THRALL_EVENT:
- {
- if( data == FAIL )
- {
- if( mThrallEventCount <= 20 )
- {
- mThrallEventCount++;
- Encounter[1] = NOT_STARTED;
- debug_log("SD2: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
- Encounter[2] = NOT_STARTED;
- Encounter[3] = NOT_STARTED;
- Encounter[4] = NOT_STARTED;
- Encounter[5] = NOT_STARTED;
- }
- else if( mThrallEventCount > 20 )
- {
- Encounter[1] = data;
- Encounter[2] = data;
- Encounter[3] = data;
- Encounter[4] = data;
- Encounter[5] = data;
- debug_log("SD2: Thrall event failed %u times. Reset instance required.",mThrallEventCount);
- }
- }
- else
- Encounter[1] = data;
- debug_log("SD2: Thrall escort event adjusted to data %u.",data);
- break;
- }
- case TYPE_THRALL_PART1:
- Encounter[2] = data;
- debug_log("SD2: Thrall event part I adjusted to data %u.",data);
- break;
- case TYPE_THRALL_PART2:
- Encounter[3] = data;
- debug_log("SD2: Thrall event part II adjusted to data %u.",data);
- break;
- case TYPE_THRALL_PART3:
- Encounter[4] = data;
- debug_log("SD2: Thrall event part III adjusted to data %u.",data);
- break;
- case TYPE_THRALL_PART4:
- Encounter[5] = data;
- debug_log("SD2: Thrall event part IV adjusted to data %u.",data);
- break;
- }
- }
-
- uint32 GetData(uint32 data)
- {
- switch(data)
- {
- case TYPE_BARREL_DIVERSION:
- return Encounter[0];
- case TYPE_THRALL_EVENT:
- return Encounter[1];
- case TYPE_THRALL_PART1:
- return Encounter[2];
- case TYPE_THRALL_PART2:
- return Encounter[3];
- case TYPE_THRALL_PART3:
- return Encounter[4];
- case TYPE_THRALL_PART4:
- return Encounter[5];
- }
- return 0;
- }
-
- uint64 GetData64(uint32 data)
- {
- switch(data)
- {
- case DATA_THRALL:
- return ThrallGUID;
- case DATA_TARETHA:
- return TarethaGUID;
- }
- return 0;
- }
-};
-InstanceData* GetInstanceData_instance_old_hillsbrad(Map* map)
-{
- return new instance_old_hillsbrad(map);
-}
-
-void AddSC_instance_old_hillsbrad()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_old_hillsbrad";
- newscript->GetInstanceData = GetInstanceData_instance_old_hillsbrad;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Old_Hillsbrad
+SD%Complete: 60
+SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known.
+SDCategory: Caverns of Time, Old Hillsbrad Foothills
+EndScriptData */
+
+/*
+-- UPDATE `gameobject_template` SET `ScriptName`='go_barrel_old_hillsbrad' WHERE `entry`=182589;
+*/
+
+#include "precompiled.h"
+#include "def_old_hillsbrad.h"
+
+#define ENCOUNTERS 6
+
+#define THRALL_ENTRY 17876
+#define TARETHA_ENTRY 18887
+
+struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
+{
+ instance_old_hillsbrad(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+ uint32 mBarrelCount;
+ uint32 mThrallEventCount;
+
+ uint64 ThrallGUID;
+ uint64 TarethaGUID;
+
+ void Initialize()
+ {
+ mBarrelCount = 0;
+ mThrallEventCount = 0;
+ ThrallGUID = 0;
+ TarethaGUID = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = NOT_STARTED;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case THRALL_ENTRY:
+ ThrallGUID = creature->GetGUID();
+ break;
+ case TARETHA_ENTRY:
+ TarethaGUID = creature->GetGUID();
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_BARREL_DIVERSION:
+ {
+ if( mBarrelCount < 5 )
+ {
+ mBarrelCount++;
+ debug_log("SD2: go_barrel_old_hillsbrad count %u",mBarrelCount);
+ }
+ else if( mBarrelCount >= 5 )
+ Encounter[0] = DONE;
+ break;
+ }
+ case TYPE_THRALL_EVENT:
+ {
+ if( data == FAIL )
+ {
+ if( mThrallEventCount <= 20 )
+ {
+ mThrallEventCount++;
+ Encounter[1] = NOT_STARTED;
+ debug_log("SD2: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
+ Encounter[2] = NOT_STARTED;
+ Encounter[3] = NOT_STARTED;
+ Encounter[4] = NOT_STARTED;
+ Encounter[5] = NOT_STARTED;
+ }
+ else if( mThrallEventCount > 20 )
+ {
+ Encounter[1] = data;
+ Encounter[2] = data;
+ Encounter[3] = data;
+ Encounter[4] = data;
+ Encounter[5] = data;
+ debug_log("SD2: Thrall event failed %u times. Reset instance required.",mThrallEventCount);
+ }
+ }
+ else
+ Encounter[1] = data;
+ debug_log("SD2: Thrall escort event adjusted to data %u.",data);
+ break;
+ }
+ case TYPE_THRALL_PART1:
+ Encounter[2] = data;
+ debug_log("SD2: Thrall event part I adjusted to data %u.",data);
+ break;
+ case TYPE_THRALL_PART2:
+ Encounter[3] = data;
+ debug_log("SD2: Thrall event part II adjusted to data %u.",data);
+ break;
+ case TYPE_THRALL_PART3:
+ Encounter[4] = data;
+ debug_log("SD2: Thrall event part III adjusted to data %u.",data);
+ break;
+ case TYPE_THRALL_PART4:
+ Encounter[5] = data;
+ debug_log("SD2: Thrall event part IV adjusted to data %u.",data);
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 data)
+ {
+ switch(data)
+ {
+ case TYPE_BARREL_DIVERSION:
+ return Encounter[0];
+ case TYPE_THRALL_EVENT:
+ return Encounter[1];
+ case TYPE_THRALL_PART1:
+ return Encounter[2];
+ case TYPE_THRALL_PART2:
+ return Encounter[3];
+ case TYPE_THRALL_PART3:
+ return Encounter[4];
+ case TYPE_THRALL_PART4:
+ return Encounter[5];
+ }
+ return 0;
+ }
+
+ uint64 GetData64(uint32 data)
+ {
+ switch(data)
+ {
+ case DATA_THRALL:
+ return ThrallGUID;
+ case DATA_TARETHA:
+ return TarethaGUID;
+ }
+ return 0;
+ }
+};
+InstanceData* GetInstanceData_instance_old_hillsbrad(Map* map)
+{
+ return new instance_old_hillsbrad(map);
+}
+
+void AddSC_instance_old_hillsbrad()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_old_hillsbrad";
+ newscript->GetInstanceData = GetInstanceData_instance_old_hillsbrad;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
index 9a08bf8510a..659636e1d35 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
@@ -1,916 +1,916 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Old_Hillsbrad
-SD%Complete: 40
-SDComment: All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort.
-SDCategory: Caverns of Time, Old Hillsbrad Foothills
-EndScriptData */
-
-/* ContentData
-npc_brazen
-npc_erozion
-npc_thrall_old_hillsbrad
-npc_taretha
-EndContentData */
-
-#include "precompiled.h"
-#include "../../../npc/npc_escortAI.h"
-#include "def_old_hillsbrad.h"
-
-#define QUEST_ENTRY_HILLSBRAD 10282
-#define QUEST_ENTRY_DIVERSION 10283
-#define QUEST_ENTRY_ESCAPE 10284
-#define QUEST_ENTRY_RETURN 10285
-#define ITEM_ENTRY_BOMBS 25853
-
-/*######
-## npc_brazen
-######*/
-
-bool GossipHello_npc_brazen(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM(0, "I am ready to go to Durnholde Keep.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_brazen(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- if( !player->HasItemCount(ITEM_ENTRY_BOMBS,1) )
- player->SEND_GOSSIP_MENU(9780, _Creature->GetGUID());
- else
- {
- player->CLOSE_GOSSIP_MENU();
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 115; //from brazen
- nodes[1] = 116; //end outside durnholde
- player->ActivateTaxiPathTo(nodes); //TaxiPath 534
- }
- }
- return true;
-}
-
-/*######
-## npc_erozion
-######*/
-
-bool GossipHello_npc_erozion(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if( pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS,1) )
- player->ADD_GOSSIP_ITEM( 0, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if( !player->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(9778, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_erozion(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1, false);
- if( msg == EQUIP_ERR_OK )
- {
- player->StoreNewItem( dest, ITEM_ENTRY_BOMBS, 1, true);
- }
- player->SEND_GOSSIP_MENU(9515, _Creature->GetGUID());
- }
- if( action == GOSSIP_ACTION_INFO_DEF+2 )
- {
- player->CLOSE_GOSSIP_MENU();
- }
- return true;
-}
-
-/*######
-## npc_thrall_old_hillsbrad
-######*/
-
-#define SPEED_WALK (0.5f)
-#define SPEED_RUN (1.0f)
-#define SPEED_MOUNT (1.6f)
-
-#define THRALL_WEAPON_MODEL 22106
-#define THRALL_WEAPON_INFO 218169346
-#define THRALL_SHIELD_MODEL 18662
-#define THRALL_SHIELD_INFO 234948100
-#define THRALL_MODEL_UNEQUIPPED 17292
-#define THRALL_MODEL_EQUIPPED 18165
-
-#define MOB_ENTRY_RIFLE 17820
-#define MOB_ENTRY_WARDEN 17833
-#define MOB_ENTRY_VETERAN 17860
-#define MOB_ENTRY_WATCHMAN 17814
-#define MOB_ENTRY_SENTRY 17815
-
-#define MOB_ENTRY_BARN_GUARDSMAN 18092
-#define MOB_ENTRY_BARN_PROTECTOR 18093
-#define MOB_ENTRY_BARN_LOOKOUT 18094
-
-#define MOB_ENTRY_CHURCH_GUARDSMAN 23175
-#define MOB_ENTRY_CHURCH_PROTECTOR 23179
-#define MOB_ENTRY_CHURCH_LOOKOUT 23177
-
-#define MOB_ENTRY_INN_GUARDSMAN 23176
-#define MOB_ENTRY_INN_PROTECTOR 23180
-#define MOB_ENTRY_INN_LOOKOUT 23178
-
-#define SKARLOC_MOUNT 18798
-#define SKARLOC_MOUNT_MODEL 18223
-#define EROZION_ENTRY 18723
-
-#define GOSSIP_ID_START 9568
-#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her...
-#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall."
-#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger?
-#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe."
-#define GOSSIP_ID_SKARLOC3 9580
-
-#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees
-#define GOSSIP_ITEM_TARREN "We're ready, Thrall."
-
-#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her
-
-#define THRALL_START_EVENT_PART1 "Very well then. Let's go!"
-#define SOUND_START_EVENT 10465
-
-#define THRALL_SAY_ARMOR "As long as we're going with a new plan, I may aswell pick up a weapon and some armor."
-
-#define THRALL_SKARLOC_MEET "A rider approaches!"
-#define SOUND_SKARLOC_MEET 10466
-#define THRALL_SKARLOC_TAUNT "I'll never be chained again!"
-#define SOUND_SKARLOC_TAUNT 10467
-
-#define THRALL_START_EVENT_PART2 "Very well. Tarren Mill lies just west of here. Since time is of the essence..."
-#define SOUND_START_EVENT_PART2 10468
-#define THRALL_MOUNTS_UP "Let's ride!"
-#define SOUND_MOUNTS_UP 10469
-
-#define THRALL_CHURCH_END "Taretha must be in the inn. Let's go."
-#define THRALL_MEET_TARETHA "Taretha! What foul magic is this?"
-
-#define THRALL_EPOCH_WONDER "Who or what was that?"
-#define SOUND_EPOCH_WONDER 10470
-#define THRALL_EPOCH_KILL_TARETHA "No!"
-#define SOUND_EPOCH_KILL_TARETHA 10471
-
-#define THRALL_EVENT_COMPLETE "Goodbye, Taretha. I will never forget your kindness."
-#define SOUND_EVENT_COMPLETE 10472
-
-#define THRALL_RANDOM_LOW_HP1 "Things are looking grim..."
-#define SOUND_RANDOM_LOW_HP1 10458
-#define THRALL_RANDOM_LOW_HP2 "I will fight to the last!"
-#define SOUND_RANDOM_LOW_HP2 10459
-
-#define THRALL_RANDOM_DIE1 "Taretha..."
-#define SOUND_RANDOM_DIE1 10460
-#define THRALL_RANDOM_DIE2 "A good day...to die..."
-#define SOUND_RANDOM_DIE2 10461
-
-#define THRALL_RANDOM_AGGRO1 "I have earned my freedom!"
-#define SOUND_RANDOM_AGGRO1 10448
-#define THRALL_RANDOM_AGGRO2 "This day is long overdue. Out of my way!"
-#define SOUND_RANDOM_AGGRO2 10449
-#define THRALL_RANDOM_AGGRO3 "I am a slave no longer!"
-#define SOUND_RANDOM_AGGRO3 10450
-#define THRALL_RANDOM_AGGRO4 "Blackmoore has much to answer for!"
-#define SOUND_RANDOM_AGGRO4 10451
-
-#define THRALL_RANDOM_KILL1 "You have forced my hand!"
-#define SOUND_RANDOM_KILL1 10452
-#define THRALL_RANDOM_KILL2 "It should not have come to this!"
-#define SOUND_RANDOM_KILL2 10453
-#define THRALL_RANDOM_KILL3 "I did not ask for this!"
-#define SOUND_RANDOM_KILL3 10454
-
-#define THRALL_LEAVE_COMBAT1 "I am truly in your debt, strangers."
-#define SOUND_LEAVE_COMBAT1 10455
-#define THRALL_LEAVE_COMBAT2 "Thank you, strangers. You have given me hope."
-#define SOUND_LEAVE_COMBAT2 10456
-#define THRALL_LEAVE_COMBAT3 "I will not waste this chance. I will seek out my destiny."
-#define SOUND_LEAVE_COMBAT3 10457
-
-struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
-{
- npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
- Creature* sum;
- uint64 TarethaGUID;
- bool LowHp;
- bool HadMount;
-
- void WaypointReached(uint32 i)
- {
- switch( i )
- {
- case 8:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- sum = m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 9:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- DoSay(THRALL_SAY_ARMOR, LANG_UNIVERSAL, NULL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, THRALL_SHIELD_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
- break;
- case 10:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED);
- break;
- case 11:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 15:
- sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 21:
- sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 25:
- sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 29:
- DoSay(THRALL_SKARLOC_MEET, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SKARLOC_MEET);
- sum = m_creature->SummonCreature(17862,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
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 30:
- IsOnHold = true;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 31:
- DoSay(THRALL_MOUNTS_UP, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MOUNTS_UP);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
- DoMount();
- break;
- case 37:
- //possibly regular patrollers? If so, remove this and let database handle them
- sum = m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 59:
- m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
- DoUnmount();
- HadMount = false;
- break;
- case 60:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
- //make horsie run off
- IsOnHold = true;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- if( pInstance )
- pInstance->SetData(TYPE_THRALL_PART2, DONE);
- break;
- case 64:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 68:
- m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- break;
- case 71:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 81:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 83:
- sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 84:
- DoSay(THRALL_CHURCH_END, LANG_UNIVERSAL, NULL);
- break;
- case 91:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- case 93:
- sum = m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- sum = m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- if( sum ) sum->AI()->AttackStart(m_creature);
- break;
- case 94:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- //trigger taretha Say("Thrall, you escaped!")
- break;
- case 95:
- DoSay(THRALL_MEET_TARETHA, LANG_UNIVERSAL, NULL);
- if( pInstance )
- pInstance->SetData(TYPE_THRALL_PART3,DONE);
- IsOnHold = true;
- break;
- case 96:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
- DoYell(THRALL_EPOCH_WONDER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_EPOCH_WONDER);
- break;
- case 97:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
- DoYell(THRALL_EPOCH_KILL_TARETHA, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_EPOCH_KILL_TARETHA);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 98:
- //trigger epoch Yell("Thrall! Come outside and face your fate! ....")
- break;
- case 106:
- {
- //trigger taretha to run down outside
- /*if( pInstance )
- uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA);
- if( TarethaGUID )
- {
- Creature* Taretha = ((Creature*)Unit::GetUnit((*m_creature), TarethaGUID));
- if( Taretha )
- ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, 0);
- }*/
-
- if( PlayerGUID )
- {
- Unit* player = ((Creature*)Unit::GetUnit((*m_creature), PlayerGUID));
- if( player && player->GetTypeId() == TYPEID_PLAYER )
- ((Player*)player)->KilledMonster(20156,m_creature->GetGUID());
- }
-
- //alot will happen here, thrall and taretha talk, erozion appear at spot to explain
- m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
- }
- break;
- }
- }
-
- void Reset()
- {
- sum = NULL;
- LowHp = false;
-
- if( HadMount )
- DoMount();
-
- if( !IsBeingEscorted )
- {
- DoUnmount();
- HadMount = false;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_UNEQUIPPED);
- }
- if( IsBeingEscorted )
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(THRALL_LEAVE_COMBAT1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT1);
- break;
- case 1:
- DoYell(THRALL_LEAVE_COMBAT2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT2);
- break;
- case 2:
- DoYell(THRALL_LEAVE_COMBAT3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT3);
- break;
- }
- }
- }
- void StartWP()
- {
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- IsOnHold = false;
- }
- void DoMount()
- {
- m_creature->Mount(SKARLOC_MOUNT_MODEL);
- m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- }
- void DoUnmount()
- {
- m_creature->Unmount();
- m_creature->SetSpeed(MOVE_RUN,SPEED_RUN);
- }
- void Aggro(Unit* who)
- {
- switch(rand()%4)
- {
- case 0:
- DoYell(THRALL_RANDOM_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO1);
- break;
- case 1:
- DoYell(THRALL_RANDOM_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO2);
- break;
- case 2:
- DoYell(THRALL_RANDOM_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO3);
- break;
- case 3:
- DoYell(THRALL_RANDOM_AGGRO4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO4);
- break;
- }
- if( m_creature->IsMounted() )
- {
- DoUnmount();
- HadMount = true;
- }
- }
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(THRALL_RANDOM_KILL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL1);
- break;
- case 1:
- DoYell(THRALL_RANDOM_KILL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL2);
- break;
- case 2:
- DoYell(THRALL_RANDOM_KILL3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL3);
- break;
- }
- }
- void JustDied(Unit *slayer)
- {
- if(slayer == m_creature) // Don't do a yell if he kills self (if player goes too far or at the end).
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(THRALL_RANDOM_DIE1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_DIE1);
- break;
- case 1:
- DoYell(THRALL_RANDOM_DIE2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_DIE2);
- break;
- }
- if( pInstance )
- pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
- }
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
-
- if( InCombat && m_creature->getVictim() )
- {
- //add his abilities'n-crap here
-
- if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) )
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(THRALL_RANDOM_LOW_HP1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP1);
- break;
- case 1:
- DoYell(THRALL_RANDOM_LOW_HP2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP2);
- break;
- }
- LowHp = true;
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature)
-{
- npc_thrall_old_hillsbradAI* thrall_walkAI = new npc_thrall_old_hillsbradAI(_Creature);
-
- thrall_walkAI->AddWaypoint(0, 2230.91, 118.765, 82.2947,5000);
- thrall_walkAI->AddWaypoint(1, 2230.33, 114.980, 82.2946);
- thrall_walkAI->AddWaypoint(2, 2233.36, 111.057, 82.2996);
- thrall_walkAI->AddWaypoint(3, 2231.17, 108.486, 82.6624);
- thrall_walkAI->AddWaypoint(4, 2220.22, 114.605, 89.4264);
- thrall_walkAI->AddWaypoint(5, 2215.23, 115.990, 89.4549);
- thrall_walkAI->AddWaypoint(6, 2210.00, 106.849, 89.4549);
- thrall_walkAI->AddWaypoint(7, 2205.66, 105.234, 89.4549);
- //spawn armorer
- thrall_walkAI->AddWaypoint(8, 2192.26, 112.618, 89.4549);
-
- //get weapon
- thrall_walkAI->AddWaypoint(9, 2181.28, 118.612, 89.4549,8000);
- //get armor
- thrall_walkAI->AddWaypoint(10, 2181.62, 120.385, 89.4549,5000);
-
- thrall_walkAI->AddWaypoint(11, 2189.44, 113.922, 89.4549);
- thrall_walkAI->AddWaypoint(12, 2195.63, 110.584, 89.4549);
- thrall_walkAI->AddWaypoint(13, 2201.09, 115.115, 89.4549);
- thrall_walkAI->AddWaypoint(14, 2204.34, 121.036, 89.4355);
- //first ambush
- thrall_walkAI->AddWaypoint(15, 2208.66, 129.127, 87.9560);
- thrall_walkAI->AddWaypoint(16, 2193.09, 137.940, 88.2164);
- thrall_walkAI->AddWaypoint(17, 2173.39, 149.064, 87.9227);
- thrall_walkAI->AddWaypoint(18, 2164.25, 137.965, 85.0595);
- thrall_walkAI->AddWaypoint(19, 2149.31, 125.645, 77.0858);
- thrall_walkAI->AddWaypoint(20, 2142.78, 127.173, 75.5954);
- //second ambush
- thrall_walkAI->AddWaypoint(21, 2139.28, 133.952, 73.6386);
- thrall_walkAI->AddWaypoint(22, 2139.54, 155.235, 67.1269);
- thrall_walkAI->AddWaypoint(23, 2145.38, 167.551, 64.8974);
- thrall_walkAI->AddWaypoint(24, 2134.28, 175.304, 67.9446);
- thrall_walkAI->AddWaypoint(25, 2118.08, 187.387, 68.8141);
- //third ambush
- thrall_walkAI->AddWaypoint(26, 2105.88, 195.461, 65.1854);
- thrall_walkAI->AddWaypoint(27, 2096.77, 196.939, 65.2117);
- thrall_walkAI->AddWaypoint(28, 2083.90, 209.395, 64.8736);
- //in front of keeps gate, meeting scarloc
- thrall_walkAI->AddWaypoint(29, 2067.84, 224.376, 64.8022,30000);
-
- //ref point after skarloc fight
- thrall_walkAI->AddWaypoint(30, 2055.40, 242.90, 63.3418);
-
- //mount up!
- thrall_walkAI->AddWaypoint(31, 2039.20, 266.460, 63.0182,10000);
- thrall_walkAI->AddWaypoint(32, 2011.77, 278.478, 65.3388);
- thrall_walkAI->AddWaypoint(33, 2005.08, 289.676, 66.1179);
- thrall_walkAI->AddWaypoint(34, 2033.11, 337.450, 66.0948);
- thrall_walkAI->AddWaypoint(35, 2070.30, 416.208, 66.0893);
- thrall_walkAI->AddWaypoint(36, 2086.76, 469.768, 65.9182);
- //possible road ambush
- thrall_walkAI->AddWaypoint(37, 2101.70, 497.955, 61.7881);
-
- thrall_walkAI->AddWaypoint(38, 2133.39, 530.933, 55.3700,5000);
- thrall_walkAI->AddWaypoint(39, 2157.91, 559.635, 48.5157);
- thrall_walkAI->AddWaypoint(40, 2167.34, 586.191, 42.4394);
- thrall_walkAI->AddWaypoint(41, 2174.17, 637.643, 33.9002);
- thrall_walkAI->AddWaypoint(42, 2179.31, 656.053, 34.723);
- thrall_walkAI->AddWaypoint(43, 2183.65, 670.941, 34.0318);
- thrall_walkAI->AddWaypoint(44, 2201.50, 668.616, 36.1236);
- thrall_walkAI->AddWaypoint(45, 2221.56, 652.747, 36.6153);
- thrall_walkAI->AddWaypoint(46, 2238.97, 640.125, 37.2214);
- thrall_walkAI->AddWaypoint(47, 2251.17, 620.574, 40.1473);
- thrall_walkAI->AddWaypoint(48, 2261.98, 595.303, 41.4117);
- thrall_walkAI->AddWaypoint(49, 2278.67, 560.172, 38.9090);
- thrall_walkAI->AddWaypoint(50, 2336.72, 528.327, 40.9369);
- thrall_walkAI->AddWaypoint(51, 2381.04, 519.612, 37.7312);
- thrall_walkAI->AddWaypoint(52, 2412.20, 515.425, 39.2068);
- thrall_walkAI->AddWaypoint(53, 2452.39, 516.174, 42.9387);
- thrall_walkAI->AddWaypoint(54, 2467.38, 539.389, 47.4992);
- thrall_walkAI->AddWaypoint(55, 2470.70, 554.333, 46.6668);
- thrall_walkAI->AddWaypoint(56, 2478.07, 575.321, 55.4549);
- thrall_walkAI->AddWaypoint(57, 2480.00, 585.408, 56.6921);
- thrall_walkAI->AddWaypoint(58, 2482.67, 608.817, 55.6643);
- //demount
- thrall_walkAI->AddWaypoint(59, 2485.62, 626.061, 58.0132,2000);
- //scare the shit out of horse, so it'll run off
- thrall_walkAI->AddWaypoint(60, 2486.91, 626.356, 58.0761);
-
- thrall_walkAI->AddWaypoint(61, 2488.58, 660.940, 57.3913);
- thrall_walkAI->AddWaypoint(62, 2502.56, 686.059, 55.6252);
- thrall_walkAI->AddWaypoint(63, 2502.08, 694.360, 55.5083);
- thrall_walkAI->AddWaypoint(64, 2491.46, 694.321, 55.7163);
- thrall_walkAI->AddWaypoint(65, 2491.10, 703.300, 55.7630);
- thrall_walkAI->AddWaypoint(66, 2485.64, 702.992, 55.7917);
-
- thrall_walkAI->AddWaypoint(67, 2479.10, 695.291, 55.7901,10000);
- //spawn mobs
- thrall_walkAI->AddWaypoint(68, 2476.75, 693.689, 55.7960);
- thrall_walkAI->AddWaypoint(69, 2475.39, 695.983, 55.8146);
- thrall_walkAI->AddWaypoint(70, 2477.75, 694.473, 55.7945);
- //meet mobs in doorway
- thrall_walkAI->AddWaypoint(71, 2481.27, 697.747, 55.7910);
-
- thrall_walkAI->AddWaypoint(72, 2486.31, 703.131, 55.7861,5000);
- thrall_walkAI->AddWaypoint(73, 2490.76, 703.511, 55.7662);
- thrall_walkAI->AddWaypoint(74, 2491.30, 694.792, 55.7195);
- thrall_walkAI->AddWaypoint(75, 2518.69, 693.876, 55.1383);
- thrall_walkAI->AddWaypoint(76, 2531.33, 681.914, 55.1383);
- thrall_walkAI->AddWaypoint(77, 2568.25, 682.654, 55.1778);
- thrall_walkAI->AddWaypoint(78, 2589.61, 689.981, 55.1421);
- thrall_walkAI->AddWaypoint(79, 2634.74, 679.833, 54.6613);
- thrall_walkAI->AddWaypoint(80, 2630.41, 661.464, 54.2761);
- thrall_walkAI->AddWaypoint(81, 2629.00, 656.982, 56.0651);
- //stop in church
- thrall_walkAI->AddWaypoint(82, 2620.84, 633.007, 56.0300,3000);
- //summon
- thrall_walkAI->AddWaypoint(83, 2622.99, 639.178, 56.0300);
-
- thrall_walkAI->AddWaypoint(84, 2628.73, 656.693, 56.0610,5000);
- thrall_walkAI->AddWaypoint(85, 2630.34, 661.135, 54.2738);
- thrall_walkAI->AddWaypoint(86, 2635.38, 672.243, 54.4508);
- thrall_walkAI->AddWaypoint(87, 2644.13, 668.158, 55.3797);
- thrall_walkAI->AddWaypoint(88, 2646.82, 666.740, 56.9898);
- thrall_walkAI->AddWaypoint(89, 2658.22, 665.432, 57.1725);
- thrall_walkAI->AddWaypoint(90, 2661.88, 674.849, 57.1725);
- thrall_walkAI->AddWaypoint(91, 2656.23, 677.208, 57.1725);
-
- thrall_walkAI->AddWaypoint(92, 2652.28, 670.270, 61.9353);
- //summon inn
- thrall_walkAI->AddWaypoint(93, 2650.79, 664.290, 61.9302);
- thrall_walkAI->AddWaypoint(94, 2658.19, 660.454, 61.9320,5000);
- //speak with Taretha
- thrall_walkAI->AddWaypoint(95, 2660.57, 659.173, 61.9370);
-
- //epoch calls
- thrall_walkAI->AddWaypoint(96, 2658.19, 660.454, 61.9320,5000);
- //taretha "dies"
- thrall_walkAI->AddWaypoint(97, 2659.84, 659.482, 61.9361,5000);
-
- thrall_walkAI->AddWaypoint(98, 2654.28, 662.722, 61.9313);
- thrall_walkAI->AddWaypoint(99, 2652.37, 670.561, 61.9368);
- thrall_walkAI->AddWaypoint(100, 2656.05, 676.761, 57.1727);
- thrall_walkAI->AddWaypoint(101, 2658.49, 677.166, 57.1727);
- thrall_walkAI->AddWaypoint(102, 2659.28, 667.117, 57.1727);
- thrall_walkAI->AddWaypoint(103, 2649.71, 665.387, 57.1727);
- //he's outside inn here
- thrall_walkAI->AddWaypoint(104, 2634.79, 672.964, 54.4577);
-
- //getting ready here, must start attack before 30secs up
- thrall_walkAI->AddWaypoint(105, 2635.06, 673.892, 54.4713,30000);
-
- //ref point, will move here when all dead and meet Taretha
- thrall_walkAI->AddWaypoint(106, 2634.79, 672.964, 54.4577,60000);
-
- //run off
- thrall_walkAI->AddWaypoint(107, 2631.72, 665.629, 54.2923);
- thrall_walkAI->AddWaypoint(108, 2647.40, 640.530, 55.7634);
-
- return (CreatureAI*)thrall_walkAI;
-}
-
-bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if( pInstance )
- {
- //if( pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && pInstance->GetData(TYPE_THRALL_EVENT) == NOT_STARTED )
- if( pInstance->GetData(TYPE_THRALL_EVENT) == NOT_STARTED )
- {
- player->ADD_GOSSIP_ITEM( 0, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_START, _Creature->GetGUID());
- }
- if( pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2) )
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, _Creature->GetGUID());
- }
- if( pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3) )
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, _Creature->GetGUID());
- }
- }
- return true;
-}
-
-bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- switch( action )
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS);
- pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS);
-
- _Creature->Say(THRALL_START_EVENT_PART1, LANG_UNIVERSAL, 0);
- ((npc_thrall_old_hillsbradAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_START_EVENT);
-
- ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, _Creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+20:
- player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, _Creature->GetGUID());
- _Creature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000);
- pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS);
-
- _Creature->Say(THRALL_START_EVENT_PART2, LANG_UNIVERSAL, 0);
- ((npc_thrall_old_hillsbradAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_START_EVENT_PART2);
-
- ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP();
- break;
-
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS);
- ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP();
- break;
- }
- return true;
-}
-
-/*######
-## npc_taretha
-######*/
-
-#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope
-#define GOSSIP_ITEM_EPOCH1 "Strange wizard?"
-#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of
-#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away."
-
-#define TARETHA_FREE "I'm free! Thank you all!"
-
-struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI
-{
- npc_tarethaAI(Creature *c) : npc_escortAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- void WaypointReached(uint32 i)
- {
- switch( i )
- {
- case 6:
- m_creature->Say(TARETHA_FREE, LANG_UNIVERSAL, 0);
- break;
- case 7:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
- break;
- }
- }
- void Reset() {}
- void Aggro(Unit* who) {}
-
-};
-CreatureAI* GetAI_npc_taretha(Creature *_Creature)
-{
- npc_tarethaAI* taretha_walkAI = new npc_tarethaAI(_Creature);
-
- taretha_walkAI->AddWaypoint(0, 2650.06, 665.473, 61.9305);
- taretha_walkAI->AddWaypoint(1, 2652.44, 670.761, 61.9370);
- taretha_walkAI->AddWaypoint(2, 2655.96, 676.913, 57.1725);
- taretha_walkAI->AddWaypoint(3, 2659.40, 677.317, 57.1725);
- taretha_walkAI->AddWaypoint(4, 2651.75, 664.482, 57.1725);
- taretha_walkAI->AddWaypoint(5, 2647.49, 666.595, 57.0824);
- taretha_walkAI->AddWaypoint(6, 2644.37, 668.167, 55.4182);
- taretha_walkAI->AddWaypoint(7, 2640.96, 669.890, 54.7567,60000);
-
- return (CreatureAI*)taretha_walkAI;
-}
-
-bool GossipHello_npc_taretha(Player *player, Creature *_Creature)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if( pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, _Creature->GetGUID());
- }
- return true;
-}
-
-bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, _Creature->GetGUID());
- }
- if( action == GOSSIP_ACTION_INFO_DEF+2 )
- {
- player->CLOSE_GOSSIP_MENU();
-
- if( pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
- {
- pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS);
- _Creature->SummonCreature(18096,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
-
- uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL);
- if(ThrallGUID)
- {
- Creature* Thrall = ((Creature*)Unit::GetUnit((*_Creature), ThrallGUID));
- if(Thrall)
- ((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP();
- }
- }
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_old_hillsbrad()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_brazen";
- newscript->pGossipHello = &GossipHello_npc_brazen;
- newscript->pGossipSelect = &GossipSelect_npc_brazen;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_erozion";
- newscript->pGossipHello = &GossipHello_npc_erozion;
- newscript->pGossipSelect = &GossipSelect_npc_erozion;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_thrall_old_hillsbrad";
- newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad;
- newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad;
- newscript->GetAI = GetAI_npc_thrall_old_hillsbrad;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_taretha";
- newscript->pGossipHello = &GossipHello_npc_taretha;
- newscript->pGossipSelect = &GossipSelect_npc_taretha;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Old_Hillsbrad
+SD%Complete: 40
+SDComment: All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort.
+SDCategory: Caverns of Time, Old Hillsbrad Foothills
+EndScriptData */
+
+/* ContentData
+npc_brazen
+npc_erozion
+npc_thrall_old_hillsbrad
+npc_taretha
+EndContentData */
+
+#include "precompiled.h"
+#include "../../../npc/npc_escortAI.h"
+#include "def_old_hillsbrad.h"
+
+#define QUEST_ENTRY_HILLSBRAD 10282
+#define QUEST_ENTRY_DIVERSION 10283
+#define QUEST_ENTRY_ESCAPE 10284
+#define QUEST_ENTRY_RETURN 10285
+#define ITEM_ENTRY_BOMBS 25853
+
+/*######
+## npc_brazen
+######*/
+
+bool GossipHello_npc_brazen(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, "I am ready to go to Durnholde Keep.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_brazen(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ if( !player->HasItemCount(ITEM_ENTRY_BOMBS,1) )
+ player->SEND_GOSSIP_MENU(9780, _Creature->GetGUID());
+ else
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 115; //from brazen
+ nodes[1] = 116; //end outside durnholde
+ player->ActivateTaxiPathTo(nodes); //TaxiPath 534
+ }
+ }
+ return true;
+}
+
+/*######
+## npc_erozion
+######*/
+
+bool GossipHello_npc_erozion(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if( pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS,1) )
+ player->ADD_GOSSIP_ITEM( 0, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if( !player->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->SEND_GOSSIP_MENU(9778, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_erozion(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ {
+ player->StoreNewItem( dest, ITEM_ENTRY_BOMBS, 1, true);
+ }
+ player->SEND_GOSSIP_MENU(9515, _Creature->GetGUID());
+ }
+ if( action == GOSSIP_ACTION_INFO_DEF+2 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ }
+ return true;
+}
+
+/*######
+## npc_thrall_old_hillsbrad
+######*/
+
+#define SPEED_WALK (0.5f)
+#define SPEED_RUN (1.0f)
+#define SPEED_MOUNT (1.6f)
+
+#define THRALL_WEAPON_MODEL 22106
+#define THRALL_WEAPON_INFO 218169346
+#define THRALL_SHIELD_MODEL 18662
+#define THRALL_SHIELD_INFO 234948100
+#define THRALL_MODEL_UNEQUIPPED 17292
+#define THRALL_MODEL_EQUIPPED 18165
+
+#define MOB_ENTRY_RIFLE 17820
+#define MOB_ENTRY_WARDEN 17833
+#define MOB_ENTRY_VETERAN 17860
+#define MOB_ENTRY_WATCHMAN 17814
+#define MOB_ENTRY_SENTRY 17815
+
+#define MOB_ENTRY_BARN_GUARDSMAN 18092
+#define MOB_ENTRY_BARN_PROTECTOR 18093
+#define MOB_ENTRY_BARN_LOOKOUT 18094
+
+#define MOB_ENTRY_CHURCH_GUARDSMAN 23175
+#define MOB_ENTRY_CHURCH_PROTECTOR 23179
+#define MOB_ENTRY_CHURCH_LOOKOUT 23177
+
+#define MOB_ENTRY_INN_GUARDSMAN 23176
+#define MOB_ENTRY_INN_PROTECTOR 23180
+#define MOB_ENTRY_INN_LOOKOUT 23178
+
+#define SKARLOC_MOUNT 18798
+#define SKARLOC_MOUNT_MODEL 18223
+#define EROZION_ENTRY 18723
+
+#define GOSSIP_ID_START 9568
+#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her...
+#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall."
+#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger?
+#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe."
+#define GOSSIP_ID_SKARLOC3 9580
+
+#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees
+#define GOSSIP_ITEM_TARREN "We're ready, Thrall."
+
+#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her
+
+#define THRALL_START_EVENT_PART1 "Very well then. Let's go!"
+#define SOUND_START_EVENT 10465
+
+#define THRALL_SAY_ARMOR "As long as we're going with a new plan, I may aswell pick up a weapon and some armor."
+
+#define THRALL_SKARLOC_MEET "A rider approaches!"
+#define SOUND_SKARLOC_MEET 10466
+#define THRALL_SKARLOC_TAUNT "I'll never be chained again!"
+#define SOUND_SKARLOC_TAUNT 10467
+
+#define THRALL_START_EVENT_PART2 "Very well. Tarren Mill lies just west of here. Since time is of the essence..."
+#define SOUND_START_EVENT_PART2 10468
+#define THRALL_MOUNTS_UP "Let's ride!"
+#define SOUND_MOUNTS_UP 10469
+
+#define THRALL_CHURCH_END "Taretha must be in the inn. Let's go."
+#define THRALL_MEET_TARETHA "Taretha! What foul magic is this?"
+
+#define THRALL_EPOCH_WONDER "Who or what was that?"
+#define SOUND_EPOCH_WONDER 10470
+#define THRALL_EPOCH_KILL_TARETHA "No!"
+#define SOUND_EPOCH_KILL_TARETHA 10471
+
+#define THRALL_EVENT_COMPLETE "Goodbye, Taretha. I will never forget your kindness."
+#define SOUND_EVENT_COMPLETE 10472
+
+#define THRALL_RANDOM_LOW_HP1 "Things are looking grim..."
+#define SOUND_RANDOM_LOW_HP1 10458
+#define THRALL_RANDOM_LOW_HP2 "I will fight to the last!"
+#define SOUND_RANDOM_LOW_HP2 10459
+
+#define THRALL_RANDOM_DIE1 "Taretha..."
+#define SOUND_RANDOM_DIE1 10460
+#define THRALL_RANDOM_DIE2 "A good day...to die..."
+#define SOUND_RANDOM_DIE2 10461
+
+#define THRALL_RANDOM_AGGRO1 "I have earned my freedom!"
+#define SOUND_RANDOM_AGGRO1 10448
+#define THRALL_RANDOM_AGGRO2 "This day is long overdue. Out of my way!"
+#define SOUND_RANDOM_AGGRO2 10449
+#define THRALL_RANDOM_AGGRO3 "I am a slave no longer!"
+#define SOUND_RANDOM_AGGRO3 10450
+#define THRALL_RANDOM_AGGRO4 "Blackmoore has much to answer for!"
+#define SOUND_RANDOM_AGGRO4 10451
+
+#define THRALL_RANDOM_KILL1 "You have forced my hand!"
+#define SOUND_RANDOM_KILL1 10452
+#define THRALL_RANDOM_KILL2 "It should not have come to this!"
+#define SOUND_RANDOM_KILL2 10453
+#define THRALL_RANDOM_KILL3 "I did not ask for this!"
+#define SOUND_RANDOM_KILL3 10454
+
+#define THRALL_LEAVE_COMBAT1 "I am truly in your debt, strangers."
+#define SOUND_LEAVE_COMBAT1 10455
+#define THRALL_LEAVE_COMBAT2 "Thank you, strangers. You have given me hope."
+#define SOUND_LEAVE_COMBAT2 10456
+#define THRALL_LEAVE_COMBAT3 "I will not waste this chance. I will seek out my destiny."
+#define SOUND_LEAVE_COMBAT3 10457
+
+struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
+{
+ npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ Creature* sum;
+ uint64 TarethaGUID;
+ bool LowHp;
+ bool HadMount;
+
+ void WaypointReached(uint32 i)
+ {
+ switch( i )
+ {
+ case 8:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ sum = m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 9:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ DoSay(THRALL_SAY_ARMOR, LANG_UNIVERSAL, NULL);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, THRALL_SHIELD_MODEL);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
+ break;
+ case 10:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED);
+ break;
+ case 11:
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 15:
+ sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 21:
+ sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 25:
+ sum = m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 29:
+ DoSay(THRALL_SKARLOC_MEET, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARLOC_MEET);
+ sum = m_creature->SummonCreature(17862,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
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 30:
+ IsOnHold = true;
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 31:
+ DoSay(THRALL_MOUNTS_UP, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MOUNTS_UP);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
+ DoMount();
+ break;
+ case 37:
+ //possibly regular patrollers? If so, remove this and let database handle them
+ sum = m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 59:
+ m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
+ DoUnmount();
+ HadMount = false;
+ break;
+ case 60:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ //make horsie run off
+ IsOnHold = true;
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ if( pInstance )
+ pInstance->SetData(TYPE_THRALL_PART2, DONE);
+ break;
+ case 64:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 68:
+ m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ break;
+ case 71:
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 81:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 83:
+ sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 84:
+ DoSay(THRALL_CHURCH_END, LANG_UNIVERSAL, NULL);
+ break;
+ case 91:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ case 93:
+ sum = m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ sum = m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ if( sum ) sum->AI()->AttackStart(m_creature);
+ break;
+ case 94:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ //trigger taretha Say("Thrall, you escaped!")
+ break;
+ case 95:
+ DoSay(THRALL_MEET_TARETHA, LANG_UNIVERSAL, NULL);
+ if( pInstance )
+ pInstance->SetData(TYPE_THRALL_PART3,DONE);
+ IsOnHold = true;
+ break;
+ case 96:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
+ DoYell(THRALL_EPOCH_WONDER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_EPOCH_WONDER);
+ break;
+ case 97:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ DoYell(THRALL_EPOCH_KILL_TARETHA, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_EPOCH_KILL_TARETHA);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 98:
+ //trigger epoch Yell("Thrall! Come outside and face your fate! ....")
+ break;
+ case 106:
+ {
+ //trigger taretha to run down outside
+ /*if( pInstance )
+ uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA);
+ if( TarethaGUID )
+ {
+ Creature* Taretha = ((Creature*)Unit::GetUnit((*m_creature), TarethaGUID));
+ if( Taretha )
+ ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, 0);
+ }*/
+
+ if( PlayerGUID )
+ {
+ Unit* player = ((Creature*)Unit::GetUnit((*m_creature), PlayerGUID));
+ if( player && player->GetTypeId() == TYPEID_PLAYER )
+ ((Player*)player)->KilledMonster(20156,m_creature->GetGUID());
+ }
+
+ //alot will happen here, thrall and taretha talk, erozion appear at spot to explain
+ m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
+ }
+ break;
+ }
+ }
+
+ void Reset()
+ {
+ sum = NULL;
+ LowHp = false;
+
+ if( HadMount )
+ DoMount();
+
+ if( !IsBeingEscorted )
+ {
+ DoUnmount();
+ HadMount = false;
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 0);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_UNEQUIPPED);
+ }
+ if( IsBeingEscorted )
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(THRALL_LEAVE_COMBAT1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT1);
+ break;
+ case 1:
+ DoYell(THRALL_LEAVE_COMBAT2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT2);
+ break;
+ case 2:
+ DoYell(THRALL_LEAVE_COMBAT3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LEAVE_COMBAT3);
+ break;
+ }
+ }
+ }
+ void StartWP()
+ {
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ IsOnHold = false;
+ }
+ void DoMount()
+ {
+ m_creature->Mount(SKARLOC_MOUNT_MODEL);
+ m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ }
+ void DoUnmount()
+ {
+ m_creature->Unmount();
+ m_creature->SetSpeed(MOVE_RUN,SPEED_RUN);
+ }
+ void Aggro(Unit* who)
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ DoYell(THRALL_RANDOM_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO1);
+ break;
+ case 1:
+ DoYell(THRALL_RANDOM_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO2);
+ break;
+ case 2:
+ DoYell(THRALL_RANDOM_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO3);
+ break;
+ case 3:
+ DoYell(THRALL_RANDOM_AGGRO4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO4);
+ break;
+ }
+ if( m_creature->IsMounted() )
+ {
+ DoUnmount();
+ HadMount = true;
+ }
+ }
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(THRALL_RANDOM_KILL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL1);
+ break;
+ case 1:
+ DoYell(THRALL_RANDOM_KILL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL2);
+ break;
+ case 2:
+ DoYell(THRALL_RANDOM_KILL3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_KILL3);
+ break;
+ }
+ }
+ void JustDied(Unit *slayer)
+ {
+ if(slayer == m_creature) // Don't do a yell if he kills self (if player goes too far or at the end).
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(THRALL_RANDOM_DIE1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_DIE1);
+ break;
+ case 1:
+ DoYell(THRALL_RANDOM_DIE2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_DIE2);
+ break;
+ }
+ if( pInstance )
+ pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+
+ if( InCombat && m_creature->getVictim() )
+ {
+ //add his abilities'n-crap here
+
+ if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) )
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(THRALL_RANDOM_LOW_HP1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP1);
+ break;
+ case 1:
+ DoYell(THRALL_RANDOM_LOW_HP2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP2);
+ break;
+ }
+ LowHp = true;
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature)
+{
+ npc_thrall_old_hillsbradAI* thrall_walkAI = new npc_thrall_old_hillsbradAI(_Creature);
+
+ thrall_walkAI->AddWaypoint(0, 2230.91, 118.765, 82.2947,5000);
+ thrall_walkAI->AddWaypoint(1, 2230.33, 114.980, 82.2946);
+ thrall_walkAI->AddWaypoint(2, 2233.36, 111.057, 82.2996);
+ thrall_walkAI->AddWaypoint(3, 2231.17, 108.486, 82.6624);
+ thrall_walkAI->AddWaypoint(4, 2220.22, 114.605, 89.4264);
+ thrall_walkAI->AddWaypoint(5, 2215.23, 115.990, 89.4549);
+ thrall_walkAI->AddWaypoint(6, 2210.00, 106.849, 89.4549);
+ thrall_walkAI->AddWaypoint(7, 2205.66, 105.234, 89.4549);
+ //spawn armorer
+ thrall_walkAI->AddWaypoint(8, 2192.26, 112.618, 89.4549);
+
+ //get weapon
+ thrall_walkAI->AddWaypoint(9, 2181.28, 118.612, 89.4549,8000);
+ //get armor
+ thrall_walkAI->AddWaypoint(10, 2181.62, 120.385, 89.4549,5000);
+
+ thrall_walkAI->AddWaypoint(11, 2189.44, 113.922, 89.4549);
+ thrall_walkAI->AddWaypoint(12, 2195.63, 110.584, 89.4549);
+ thrall_walkAI->AddWaypoint(13, 2201.09, 115.115, 89.4549);
+ thrall_walkAI->AddWaypoint(14, 2204.34, 121.036, 89.4355);
+ //first ambush
+ thrall_walkAI->AddWaypoint(15, 2208.66, 129.127, 87.9560);
+ thrall_walkAI->AddWaypoint(16, 2193.09, 137.940, 88.2164);
+ thrall_walkAI->AddWaypoint(17, 2173.39, 149.064, 87.9227);
+ thrall_walkAI->AddWaypoint(18, 2164.25, 137.965, 85.0595);
+ thrall_walkAI->AddWaypoint(19, 2149.31, 125.645, 77.0858);
+ thrall_walkAI->AddWaypoint(20, 2142.78, 127.173, 75.5954);
+ //second ambush
+ thrall_walkAI->AddWaypoint(21, 2139.28, 133.952, 73.6386);
+ thrall_walkAI->AddWaypoint(22, 2139.54, 155.235, 67.1269);
+ thrall_walkAI->AddWaypoint(23, 2145.38, 167.551, 64.8974);
+ thrall_walkAI->AddWaypoint(24, 2134.28, 175.304, 67.9446);
+ thrall_walkAI->AddWaypoint(25, 2118.08, 187.387, 68.8141);
+ //third ambush
+ thrall_walkAI->AddWaypoint(26, 2105.88, 195.461, 65.1854);
+ thrall_walkAI->AddWaypoint(27, 2096.77, 196.939, 65.2117);
+ thrall_walkAI->AddWaypoint(28, 2083.90, 209.395, 64.8736);
+ //in front of keeps gate, meeting scarloc
+ thrall_walkAI->AddWaypoint(29, 2067.84, 224.376, 64.8022,30000);
+
+ //ref point after skarloc fight
+ thrall_walkAI->AddWaypoint(30, 2055.40, 242.90, 63.3418);
+
+ //mount up!
+ thrall_walkAI->AddWaypoint(31, 2039.20, 266.460, 63.0182,10000);
+ thrall_walkAI->AddWaypoint(32, 2011.77, 278.478, 65.3388);
+ thrall_walkAI->AddWaypoint(33, 2005.08, 289.676, 66.1179);
+ thrall_walkAI->AddWaypoint(34, 2033.11, 337.450, 66.0948);
+ thrall_walkAI->AddWaypoint(35, 2070.30, 416.208, 66.0893);
+ thrall_walkAI->AddWaypoint(36, 2086.76, 469.768, 65.9182);
+ //possible road ambush
+ thrall_walkAI->AddWaypoint(37, 2101.70, 497.955, 61.7881);
+
+ thrall_walkAI->AddWaypoint(38, 2133.39, 530.933, 55.3700,5000);
+ thrall_walkAI->AddWaypoint(39, 2157.91, 559.635, 48.5157);
+ thrall_walkAI->AddWaypoint(40, 2167.34, 586.191, 42.4394);
+ thrall_walkAI->AddWaypoint(41, 2174.17, 637.643, 33.9002);
+ thrall_walkAI->AddWaypoint(42, 2179.31, 656.053, 34.723);
+ thrall_walkAI->AddWaypoint(43, 2183.65, 670.941, 34.0318);
+ thrall_walkAI->AddWaypoint(44, 2201.50, 668.616, 36.1236);
+ thrall_walkAI->AddWaypoint(45, 2221.56, 652.747, 36.6153);
+ thrall_walkAI->AddWaypoint(46, 2238.97, 640.125, 37.2214);
+ thrall_walkAI->AddWaypoint(47, 2251.17, 620.574, 40.1473);
+ thrall_walkAI->AddWaypoint(48, 2261.98, 595.303, 41.4117);
+ thrall_walkAI->AddWaypoint(49, 2278.67, 560.172, 38.9090);
+ thrall_walkAI->AddWaypoint(50, 2336.72, 528.327, 40.9369);
+ thrall_walkAI->AddWaypoint(51, 2381.04, 519.612, 37.7312);
+ thrall_walkAI->AddWaypoint(52, 2412.20, 515.425, 39.2068);
+ thrall_walkAI->AddWaypoint(53, 2452.39, 516.174, 42.9387);
+ thrall_walkAI->AddWaypoint(54, 2467.38, 539.389, 47.4992);
+ thrall_walkAI->AddWaypoint(55, 2470.70, 554.333, 46.6668);
+ thrall_walkAI->AddWaypoint(56, 2478.07, 575.321, 55.4549);
+ thrall_walkAI->AddWaypoint(57, 2480.00, 585.408, 56.6921);
+ thrall_walkAI->AddWaypoint(58, 2482.67, 608.817, 55.6643);
+ //demount
+ thrall_walkAI->AddWaypoint(59, 2485.62, 626.061, 58.0132,2000);
+ //scare the shit out of horse, so it'll run off
+ thrall_walkAI->AddWaypoint(60, 2486.91, 626.356, 58.0761);
+
+ thrall_walkAI->AddWaypoint(61, 2488.58, 660.940, 57.3913);
+ thrall_walkAI->AddWaypoint(62, 2502.56, 686.059, 55.6252);
+ thrall_walkAI->AddWaypoint(63, 2502.08, 694.360, 55.5083);
+ thrall_walkAI->AddWaypoint(64, 2491.46, 694.321, 55.7163);
+ thrall_walkAI->AddWaypoint(65, 2491.10, 703.300, 55.7630);
+ thrall_walkAI->AddWaypoint(66, 2485.64, 702.992, 55.7917);
+
+ thrall_walkAI->AddWaypoint(67, 2479.10, 695.291, 55.7901,10000);
+ //spawn mobs
+ thrall_walkAI->AddWaypoint(68, 2476.75, 693.689, 55.7960);
+ thrall_walkAI->AddWaypoint(69, 2475.39, 695.983, 55.8146);
+ thrall_walkAI->AddWaypoint(70, 2477.75, 694.473, 55.7945);
+ //meet mobs in doorway
+ thrall_walkAI->AddWaypoint(71, 2481.27, 697.747, 55.7910);
+
+ thrall_walkAI->AddWaypoint(72, 2486.31, 703.131, 55.7861,5000);
+ thrall_walkAI->AddWaypoint(73, 2490.76, 703.511, 55.7662);
+ thrall_walkAI->AddWaypoint(74, 2491.30, 694.792, 55.7195);
+ thrall_walkAI->AddWaypoint(75, 2518.69, 693.876, 55.1383);
+ thrall_walkAI->AddWaypoint(76, 2531.33, 681.914, 55.1383);
+ thrall_walkAI->AddWaypoint(77, 2568.25, 682.654, 55.1778);
+ thrall_walkAI->AddWaypoint(78, 2589.61, 689.981, 55.1421);
+ thrall_walkAI->AddWaypoint(79, 2634.74, 679.833, 54.6613);
+ thrall_walkAI->AddWaypoint(80, 2630.41, 661.464, 54.2761);
+ thrall_walkAI->AddWaypoint(81, 2629.00, 656.982, 56.0651);
+ //stop in church
+ thrall_walkAI->AddWaypoint(82, 2620.84, 633.007, 56.0300,3000);
+ //summon
+ thrall_walkAI->AddWaypoint(83, 2622.99, 639.178, 56.0300);
+
+ thrall_walkAI->AddWaypoint(84, 2628.73, 656.693, 56.0610,5000);
+ thrall_walkAI->AddWaypoint(85, 2630.34, 661.135, 54.2738);
+ thrall_walkAI->AddWaypoint(86, 2635.38, 672.243, 54.4508);
+ thrall_walkAI->AddWaypoint(87, 2644.13, 668.158, 55.3797);
+ thrall_walkAI->AddWaypoint(88, 2646.82, 666.740, 56.9898);
+ thrall_walkAI->AddWaypoint(89, 2658.22, 665.432, 57.1725);
+ thrall_walkAI->AddWaypoint(90, 2661.88, 674.849, 57.1725);
+ thrall_walkAI->AddWaypoint(91, 2656.23, 677.208, 57.1725);
+
+ thrall_walkAI->AddWaypoint(92, 2652.28, 670.270, 61.9353);
+ //summon inn
+ thrall_walkAI->AddWaypoint(93, 2650.79, 664.290, 61.9302);
+ thrall_walkAI->AddWaypoint(94, 2658.19, 660.454, 61.9320,5000);
+ //speak with Taretha
+ thrall_walkAI->AddWaypoint(95, 2660.57, 659.173, 61.9370);
+
+ //epoch calls
+ thrall_walkAI->AddWaypoint(96, 2658.19, 660.454, 61.9320,5000);
+ //taretha "dies"
+ thrall_walkAI->AddWaypoint(97, 2659.84, 659.482, 61.9361,5000);
+
+ thrall_walkAI->AddWaypoint(98, 2654.28, 662.722, 61.9313);
+ thrall_walkAI->AddWaypoint(99, 2652.37, 670.561, 61.9368);
+ thrall_walkAI->AddWaypoint(100, 2656.05, 676.761, 57.1727);
+ thrall_walkAI->AddWaypoint(101, 2658.49, 677.166, 57.1727);
+ thrall_walkAI->AddWaypoint(102, 2659.28, 667.117, 57.1727);
+ thrall_walkAI->AddWaypoint(103, 2649.71, 665.387, 57.1727);
+ //he's outside inn here
+ thrall_walkAI->AddWaypoint(104, 2634.79, 672.964, 54.4577);
+
+ //getting ready here, must start attack before 30secs up
+ thrall_walkAI->AddWaypoint(105, 2635.06, 673.892, 54.4713,30000);
+
+ //ref point, will move here when all dead and meet Taretha
+ thrall_walkAI->AddWaypoint(106, 2634.79, 672.964, 54.4577,60000);
+
+ //run off
+ thrall_walkAI->AddWaypoint(107, 2631.72, 665.629, 54.2923);
+ thrall_walkAI->AddWaypoint(108, 2647.40, 640.530, 55.7634);
+
+ return (CreatureAI*)thrall_walkAI;
+}
+
+bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if( pInstance )
+ {
+ //if( pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && pInstance->GetData(TYPE_THRALL_EVENT) == NOT_STARTED )
+ if( pInstance->GetData(TYPE_THRALL_EVENT) == NOT_STARTED )
+ {
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_START, _Creature->GetGUID());
+ }
+ if( pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2) )
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, _Creature->GetGUID());
+ }
+ if( pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3) )
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, _Creature->GetGUID());
+ }
+ }
+ return true;
+}
+
+bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ switch( action )
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->CLOSE_GOSSIP_MENU();
+ pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS);
+ pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS);
+
+ _Creature->Say(THRALL_START_EVENT_PART1, LANG_UNIVERSAL, 0);
+ ((npc_thrall_old_hillsbradAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_START_EVENT);
+
+ ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, _Creature->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+20:
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, _Creature->GetGUID());
+ _Creature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000);
+ pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS);
+
+ _Creature->Say(THRALL_START_EVENT_PART2, LANG_UNIVERSAL, 0);
+ ((npc_thrall_old_hillsbradAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_START_EVENT_PART2);
+
+ ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP();
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->CLOSE_GOSSIP_MENU();
+ pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS);
+ ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP();
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_taretha
+######*/
+
+#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope
+#define GOSSIP_ITEM_EPOCH1 "Strange wizard?"
+#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of
+#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away."
+
+#define TARETHA_FREE "I'm free! Thank you all!"
+
+struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI
+{
+ npc_tarethaAI(Creature *c) : npc_escortAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ void WaypointReached(uint32 i)
+ {
+ switch( i )
+ {
+ case 6:
+ m_creature->Say(TARETHA_FREE, LANG_UNIVERSAL, 0);
+ break;
+ case 7:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
+ break;
+ }
+ }
+ void Reset() {}
+ void Aggro(Unit* who) {}
+
+};
+CreatureAI* GetAI_npc_taretha(Creature *_Creature)
+{
+ npc_tarethaAI* taretha_walkAI = new npc_tarethaAI(_Creature);
+
+ taretha_walkAI->AddWaypoint(0, 2650.06, 665.473, 61.9305);
+ taretha_walkAI->AddWaypoint(1, 2652.44, 670.761, 61.9370);
+ taretha_walkAI->AddWaypoint(2, 2655.96, 676.913, 57.1725);
+ taretha_walkAI->AddWaypoint(3, 2659.40, 677.317, 57.1725);
+ taretha_walkAI->AddWaypoint(4, 2651.75, 664.482, 57.1725);
+ taretha_walkAI->AddWaypoint(5, 2647.49, 666.595, 57.0824);
+ taretha_walkAI->AddWaypoint(6, 2644.37, 668.167, 55.4182);
+ taretha_walkAI->AddWaypoint(7, 2640.96, 669.890, 54.7567,60000);
+
+ return (CreatureAI*)taretha_walkAI;
+}
+
+bool GossipHello_npc_taretha(Player *player, Creature *_Creature)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if( pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, _Creature->GetGUID());
+ }
+ return true;
+}
+
+bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, _Creature->GetGUID());
+ }
+ if( action == GOSSIP_ACTION_INFO_DEF+2 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ if( pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
+ {
+ pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS);
+ _Creature->SummonCreature(18096,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
+
+ uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL);
+ if(ThrallGUID)
+ {
+ Creature* Thrall = ((Creature*)Unit::GetUnit((*_Creature), ThrallGUID));
+ if(Thrall)
+ ((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP();
+ }
+ }
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_old_hillsbrad()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_brazen";
+ newscript->pGossipHello = &GossipHello_npc_brazen;
+ newscript->pGossipSelect = &GossipSelect_npc_brazen;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_erozion";
+ newscript->pGossipHello = &GossipHello_npc_erozion;
+ newscript->pGossipSelect = &GossipSelect_npc_erozion;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_thrall_old_hillsbrad";
+ newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad;
+ newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad;
+ newscript->GetAI = GetAI_npc_thrall_old_hillsbrad;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_taretha";
+ newscript->pGossipHello = &GossipHello_npc_taretha;
+ newscript->pGossipSelect = &GossipSelect_npc_taretha;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
index db027b1729c..ba5bb5fea72 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
@@ -1,559 +1,559 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Fathomlord_Karathress
-SD%Complete: 50
-SDComment: Missing Multishot, pet, Totems, Windfury, Whirlwind
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-
-//Karathress spells
-#define SPELL_CATACLYSMIC_BOLT 38441
-#define SPELL_POWER_OF_SHARKKIS 38455
-#define SPELL_POWER_OF_TIDALVESS 38452
-#define SPELL_POWER_OF_CARIBDIS 38451
-#define SPELL_ENRAGE 24318
-//Sharkkis spells
-#define SPELL_LEECHING_THROW 29436
-#define SPELL_THE_BEAST_WITHIN 38373
-//Tidalvess spells
-#define SPELL_FROST_SHOCK 38234
-//Caribdis Spells
-#define SPELL_WATER_BOLT_VOLLEY 38335
-#define SPELL_TIDAL_SURGE 38353
-#define SPELL_HEAL 41386
-
-#define SAY_AGGRO "Guards, attention! We have visitors..."
-#define SAY_SLAY1 "I am rid of you."
-#define SAY_GAIN_ABILITY1 "I am more powerful than ever!"
-#define SAY_GAIN_ABILITY2 "Go on, kill them! I'll be the better for it!"
-#define SAY_GAIN_ABILITY3 "More knowledge, more power!"
-#define SAY_DEATH "Her ... excellency ... awaits!"
-
-#define SOUND_AGGRO 11277
-#define SOUND_PLYR_ATTACK 11278
-#define SOUND_GAIN_ABILITY1 11279
-#define SOUND_GAIN_ABILITY2 11280
-#define SOUND_GAIN_ABILITY3 11281
-#define SOUND_SLAY1 11282
-#define SOUND_SLAY2 11283
-#define SOUND_SLAY3 11284
-#define SOUND_DEATH 11285
-
-//entry and position for Seer Olum
-#define SEER_OLUM 22820
-#define OLUM_X 446.78f
-#define OLUM_Y -542.76f
-#define OLUM_Z -7.54773f
-#define OLUM_O 0.401581f
-
-//Fathom-Lord Karathress AI
-struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
-{
- boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Advisors[0] = 0;
- Advisors[1] = 0;
- Advisors[2] = 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 CataclysmicBolt_Timer;
- uint32 Enrage_Timer;
-
- uint64 Advisors[3];
-
- void Reset()
- {
- CataclysmicBolt_Timer = 10000;
- Enrage_Timer = 600000; //10 minutes
-
- Creature* Advisor;
- for(uint8 i = 0; i < 3; ++i)
- if(Advisors[i])
- {
- Advisor = ((Creature*)Unit::GetUnit(*m_creature, Advisors[i]));
- if(Advisor)
- {
- if(Advisor->isAlive())
- {
- Advisor->DealDamage(Advisor, Advisor->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- Advisor->RemoveCorpse();
- Advisor->Respawn();
- }
- Advisor->AI()->EnterEvadeMode();
- }
- }
-
- if( pInstance )
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
-
- void EventSharkkisDeath()
- {
- DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY1);
- DoYell(SAY_GAIN_ABILITY1, LANG_UNIVERSAL, NULL);
- DoCast(m_creature, SPELL_POWER_OF_SHARKKIS);
- }
-
- void EventTidalvessDeath()
- {
- DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY2);
- DoYell(SAY_GAIN_ABILITY2, LANG_UNIVERSAL, NULL);
- DoCast(m_creature, SPELL_POWER_OF_TIDALVESS);
- }
-
- void EventCaribdisDeath()
- {
- DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY3);
- DoYell(SAY_GAIN_ABILITY3, LANG_UNIVERSAL, NULL);
- DoCast(m_creature, SPELL_POWER_OF_CARIBDIS);
- }
-
- void GetAdvisors()
- {
- if(!pInstance)
- return;
-
- Advisors[0] = pInstance->GetData64(DATA_SHARKKIS);
- Advisors[1] = pInstance->GetData64(DATA_TIDALVESS);
- Advisors[2] = pInstance->GetData64(DATA_CARIBDIS);
- }
-
- void StartEvent(Unit *who)
- {
- if(!pInstance)
- return;
-
- GetAdvisors();
-
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
-
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *killer)
- {
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
-
- if( pInstance )
- pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, NOT_STARTED);
-
- //support for quest 10944
- m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
- }
-
- void Aggro(Unit *who)
- {
- StartEvent(who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
-
- GetAdvisors();
-
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- EnterEvadeMode();
-
- //CataclysmicBolt_Timer
- if(CataclysmicBolt_Timer < diff)
- {
- //select a random unit other than the main tank
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- //if there aren't other units, cast on the tank
- if(!target)
- target = m_creature->getVictim();
-
- int32 dmg = target->GetMaxHealth() / 2;
- m_creature->CastCustomSpell(target, SPELL_CATACLYSMIC_BOLT, &dmg, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
-
- CataclysmicBolt_Timer = 10000;
- }else CataclysmicBolt_Timer -= diff;
-
- //Enrage_Timer
- if(Enrage_Timer < diff)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enrage_Timer = 90000;
- }else Enrage_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Fathom-Guard Sharkkis AI
-struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
-{
- boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 LeechingThrow_Timer;
- uint32 TheBeastWithin_Timer;
-
- void Reset()
- {
- LeechingThrow_Timer = 20000;
- TheBeastWithin_Timer = 30000;
-
- if( pInstance )
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
-
- if(Karathress)
- ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath();
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- EnterEvadeMode();
-
- //LeechingThrow_Timer
- if(LeechingThrow_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW);
- LeechingThrow_Timer = 20000;
- }else LeechingThrow_Timer -= diff;
-
- //TheBeastWithin_Timer
- if(TheBeastWithin_Timer < diff)
- {
- DoCast(m_creature, SPELL_THE_BEAST_WITHIN);
- TheBeastWithin_Timer = 30000;
- }else TheBeastWithin_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Fathom-Guard Tidalvess AI
-struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
-{
- boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 FrostShock_Timer;
-
- void Reset()
- {
- FrostShock_Timer = 25000;
-
- if( pInstance )
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
-
- if(Karathress)
- ((boss_fathomlord_karathressAI*)Karathress->AI())->EventTidalvessDeath();
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- EnterEvadeMode();
-
- //FrostShock_Timer
- if(FrostShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
- FrostShock_Timer = 25000+rand()%5000;
- }else FrostShock_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Fathom-Guard Caribdis AI
-struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
-{
- boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 WaterBoltVolley_Timer;
- uint32 TidalSurge_Timer;
- uint32 Heal_Timer;
-
- void Reset()
- {
- WaterBoltVolley_Timer = 35000;
- TidalSurge_Timer = 15000+rand()%5000;
- Heal_Timer = 55000;
-
- if(pInstance)
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
-
- if(Karathress)
- ((boss_fathomlord_karathressAI*)Karathress->AI())->EventCaribdisDeath();
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- EnterEvadeMode();
-
- //WaterBoltVolley_Timer
- if(WaterBoltVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY);
- WaterBoltVolley_Timer = 30000;
- }else WaterBoltVolley_Timer -= diff;
-
- //TidalSurge_Timer
- if(TidalSurge_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE);
- TidalSurge_Timer = 15000+rand()%5000;
- }else TidalSurge_Timer -= diff;
-
- //Heal_Timer
- if(Heal_Timer < diff)
- {
- // It can be cast on any of the mobs
- Unit *pUnit = NULL;
-
- if(pInstance)
- {
- switch(rand()%4)
- {
- case 0:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS));
- break;
- case 1:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS));
- break;
- case 2:
- pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS));
- break;
- case 3:
- pUnit = m_creature;
- break;
- }
- }else pUnit = m_creature;
-
- if(pUnit && pUnit->isAlive())
- DoCast(pUnit, SPELL_HEAL);
-
- Heal_Timer = 60000;
- }else Heal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_fathomlord_karathress(Creature *_Creature)
-{
- return new boss_fathomlord_karathressAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature *_Creature)
-{
- return new boss_fathomguard_sharkkisAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature *_Creature)
-{
- return new boss_fathomguard_tidalvessAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_fathomguard_caribdis(Creature *_Creature)
-{
- return new boss_fathomguard_caribdisAI (_Creature);
-}
-
-void AddSC_boss_fathomlord_karathress()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_fathomlord_karathress";
- newscript->GetAI = GetAI_boss_fathomlord_karathress;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_fathomguard_sharkkis";
- newscript->GetAI = GetAI_boss_fathomguard_sharkkis;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_fathomguard_tidalvess";
- newscript->GetAI = GetAI_boss_fathomguard_tidalvess;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_fathomguard_caribdis";
- newscript->GetAI = GetAI_boss_fathomguard_caribdis;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Fathomlord_Karathress
+SD%Complete: 50
+SDComment: Missing Multishot, pet, Totems, Windfury, Whirlwind
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+
+//Karathress spells
+#define SPELL_CATACLYSMIC_BOLT 38441
+#define SPELL_POWER_OF_SHARKKIS 38455
+#define SPELL_POWER_OF_TIDALVESS 38452
+#define SPELL_POWER_OF_CARIBDIS 38451
+#define SPELL_ENRAGE 24318
+//Sharkkis spells
+#define SPELL_LEECHING_THROW 29436
+#define SPELL_THE_BEAST_WITHIN 38373
+//Tidalvess spells
+#define SPELL_FROST_SHOCK 38234
+//Caribdis Spells
+#define SPELL_WATER_BOLT_VOLLEY 38335
+#define SPELL_TIDAL_SURGE 38353
+#define SPELL_HEAL 41386
+
+#define SAY_AGGRO "Guards, attention! We have visitors..."
+#define SAY_SLAY1 "I am rid of you."
+#define SAY_GAIN_ABILITY1 "I am more powerful than ever!"
+#define SAY_GAIN_ABILITY2 "Go on, kill them! I'll be the better for it!"
+#define SAY_GAIN_ABILITY3 "More knowledge, more power!"
+#define SAY_DEATH "Her ... excellency ... awaits!"
+
+#define SOUND_AGGRO 11277
+#define SOUND_PLYR_ATTACK 11278
+#define SOUND_GAIN_ABILITY1 11279
+#define SOUND_GAIN_ABILITY2 11280
+#define SOUND_GAIN_ABILITY3 11281
+#define SOUND_SLAY1 11282
+#define SOUND_SLAY2 11283
+#define SOUND_SLAY3 11284
+#define SOUND_DEATH 11285
+
+//entry and position for Seer Olum
+#define SEER_OLUM 22820
+#define OLUM_X 446.78f
+#define OLUM_Y -542.76f
+#define OLUM_Z -7.54773f
+#define OLUM_O 0.401581f
+
+//Fathom-Lord Karathress AI
+struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
+{
+ boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Advisors[0] = 0;
+ Advisors[1] = 0;
+ Advisors[2] = 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 CataclysmicBolt_Timer;
+ uint32 Enrage_Timer;
+
+ uint64 Advisors[3];
+
+ void Reset()
+ {
+ CataclysmicBolt_Timer = 10000;
+ Enrage_Timer = 600000; //10 minutes
+
+ Creature* Advisor;
+ for(uint8 i = 0; i < 3; ++i)
+ if(Advisors[i])
+ {
+ Advisor = ((Creature*)Unit::GetUnit(*m_creature, Advisors[i]));
+ if(Advisor)
+ {
+ if(Advisor->isAlive())
+ {
+ Advisor->DealDamage(Advisor, Advisor->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ Advisor->RemoveCorpse();
+ Advisor->Respawn();
+ }
+ Advisor->AI()->EnterEvadeMode();
+ }
+ }
+
+ if( pInstance )
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ }
+
+ void EventSharkkisDeath()
+ {
+ DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY1);
+ DoYell(SAY_GAIN_ABILITY1, LANG_UNIVERSAL, NULL);
+ DoCast(m_creature, SPELL_POWER_OF_SHARKKIS);
+ }
+
+ void EventTidalvessDeath()
+ {
+ DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY2);
+ DoYell(SAY_GAIN_ABILITY2, LANG_UNIVERSAL, NULL);
+ DoCast(m_creature, SPELL_POWER_OF_TIDALVESS);
+ }
+
+ void EventCaribdisDeath()
+ {
+ DoPlaySoundToSet(m_creature, SOUND_GAIN_ABILITY3);
+ DoYell(SAY_GAIN_ABILITY3, LANG_UNIVERSAL, NULL);
+ DoCast(m_creature, SPELL_POWER_OF_CARIBDIS);
+ }
+
+ void GetAdvisors()
+ {
+ if(!pInstance)
+ return;
+
+ Advisors[0] = pInstance->GetData64(DATA_SHARKKIS);
+ Advisors[1] = pInstance->GetData64(DATA_TIDALVESS);
+ Advisors[2] = pInstance->GetData64(DATA_CARIBDIS);
+ }
+
+ void StartEvent(Unit *who)
+ {
+ if(!pInstance)
+ return;
+
+ GetAdvisors();
+
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *killer)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+
+ if( pInstance )
+ pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, NOT_STARTED);
+
+ //support for quest 10944
+ m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
+ }
+
+ void Aggro(Unit *who)
+ {
+ StartEvent(who);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+
+ GetAdvisors();
+
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ EnterEvadeMode();
+
+ //CataclysmicBolt_Timer
+ if(CataclysmicBolt_Timer < diff)
+ {
+ //select a random unit other than the main tank
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ //if there aren't other units, cast on the tank
+ if(!target)
+ target = m_creature->getVictim();
+
+ int32 dmg = target->GetMaxHealth() / 2;
+ m_creature->CastCustomSpell(target, SPELL_CATACLYSMIC_BOLT, &dmg, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
+
+ CataclysmicBolt_Timer = 10000;
+ }else CataclysmicBolt_Timer -= diff;
+
+ //Enrage_Timer
+ if(Enrage_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enrage_Timer = 90000;
+ }else Enrage_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Fathom-Guard Sharkkis AI
+struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
+{
+ boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 LeechingThrow_Timer;
+ uint32 TheBeastWithin_Timer;
+
+ void Reset()
+ {
+ LeechingThrow_Timer = 20000;
+ TheBeastWithin_Timer = 30000;
+
+ if( pInstance )
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+
+ if(Karathress)
+ ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ EnterEvadeMode();
+
+ //LeechingThrow_Timer
+ if(LeechingThrow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW);
+ LeechingThrow_Timer = 20000;
+ }else LeechingThrow_Timer -= diff;
+
+ //TheBeastWithin_Timer
+ if(TheBeastWithin_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_THE_BEAST_WITHIN);
+ TheBeastWithin_Timer = 30000;
+ }else TheBeastWithin_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Fathom-Guard Tidalvess AI
+struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
+{
+ boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 FrostShock_Timer;
+
+ void Reset()
+ {
+ FrostShock_Timer = 25000;
+
+ if( pInstance )
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+
+ if(Karathress)
+ ((boss_fathomlord_karathressAI*)Karathress->AI())->EventTidalvessDeath();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ EnterEvadeMode();
+
+ //FrostShock_Timer
+ if(FrostShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ FrostShock_Timer = 25000+rand()%5000;
+ }else FrostShock_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Fathom-Guard Caribdis AI
+struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
+{
+ boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 WaterBoltVolley_Timer;
+ uint32 TidalSurge_Timer;
+ uint32 Heal_Timer;
+
+ void Reset()
+ {
+ WaterBoltVolley_Timer = 35000;
+ TidalSurge_Timer = 15000+rand()%5000;
+ Heal_Timer = 55000;
+
+ if(pInstance)
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+
+ if(Karathress)
+ ((boss_fathomlord_karathressAI*)Karathress->AI())->EventCaribdisDeath();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ EnterEvadeMode();
+
+ //WaterBoltVolley_Timer
+ if(WaterBoltVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY);
+ WaterBoltVolley_Timer = 30000;
+ }else WaterBoltVolley_Timer -= diff;
+
+ //TidalSurge_Timer
+ if(TidalSurge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE);
+ TidalSurge_Timer = 15000+rand()%5000;
+ }else TidalSurge_Timer -= diff;
+
+ //Heal_Timer
+ if(Heal_Timer < diff)
+ {
+ // It can be cast on any of the mobs
+ Unit *pUnit = NULL;
+
+ if(pInstance)
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS));
+ break;
+ case 1:
+ pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS));
+ break;
+ case 2:
+ pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS));
+ break;
+ case 3:
+ pUnit = m_creature;
+ break;
+ }
+ }else pUnit = m_creature;
+
+ if(pUnit && pUnit->isAlive())
+ DoCast(pUnit, SPELL_HEAL);
+
+ Heal_Timer = 60000;
+ }else Heal_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_fathomlord_karathress(Creature *_Creature)
+{
+ return new boss_fathomlord_karathressAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature *_Creature)
+{
+ return new boss_fathomguard_sharkkisAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature *_Creature)
+{
+ return new boss_fathomguard_tidalvessAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_fathomguard_caribdis(Creature *_Creature)
+{
+ return new boss_fathomguard_caribdisAI (_Creature);
+}
+
+void AddSC_boss_fathomlord_karathress()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_fathomlord_karathress";
+ newscript->GetAI = GetAI_boss_fathomlord_karathress;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_fathomguard_sharkkis";
+ newscript->GetAI = GetAI_boss_fathomguard_sharkkis;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_fathomguard_tidalvess";
+ newscript->GetAI = GetAI_boss_fathomguard_tidalvess;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_fathomguard_caribdis";
+ newscript->GetAI = GetAI_boss_fathomguard_caribdis;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
index 508b28a5525..44debd8d485 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
@@ -1,357 +1,357 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Hydross_The_Unstable
-SD%Complete: 90
-SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location.
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-
-#define SWITCH_RADIUS 18
-
-#define MODEL_CORRUPT 20609
-#define MODEL_CLEAN 20162
-
-#define SPELL_WATER_TOMB 38235
-#define SPELL_MARK_OF_HYDROSS1 38215
-#define SPELL_MARK_OF_HYDROSS2 38216
-#define SPELL_MARK_OF_HYDROSS3 38217
-#define SPELL_MARK_OF_HYDROSS4 38218
-#define SPELL_MARK_OF_HYDROSS5 38231
-#define SPELL_MARK_OF_HYDROSS6 40584
-#define SPELL_MARK_OF_CORRUPTION1 38219
-#define SPELL_MARK_OF_CORRUPTION2 38220
-#define SPELL_MARK_OF_CORRUPTION3 38221
-#define SPELL_MARK_OF_CORRUPTION4 38222
-#define SPELL_MARK_OF_CORRUPTION5 38230
-#define SPELL_MARK_OF_CORRUPTION6 40583
-#define SPELL_VILE_SLUDGE 38246
-#define SPELL_ENRAGE 27680 //this spell need verification
-#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?)
-#define SPELL_ELEMENTAL_SPAWNIN 25035
-//#define SPELL_BLUE_BEAM 38015 //channeled Hydross Beam Helper (not in use yet)
-
-#define ENTRY_PURE_SPAWN 22035
-#define ENTRY_TAINTED_SPAWN 22036
-
-#define SAY_AGGRO "I cannot allow you to interfere!"
-#define SAY_SWITCH_TO_CLEAN "Better, much better."
-#define SAY_CLEAN_SLAY1 "They have forced me to this..."
-#define SAY_CLEAN_SLAY2 "I have no choice."
-#define SAY_CLEAN_DEATH "I am... released..."
-#define SAY_SWITCH_TO_CORRUPT "Aaghh, the poison..."
-#define SAY_CORRUPT_SLAY1 "I will purge you from this place."
-#define SAY_CORRUPT_SLAY2 "You are no better than they!"
-#define SAY_CORRUPT_DEATH "You are the disease, not I"
-
-#define SOUND_AGGRO 11289
-#define SOUND_SWITCH_TO_CLEAN 11290
-#define SOUND_CLEAN_SLAY1 11291
-#define SOUND_CLEAN_SLAY2 11292
-#define SOUND_CLEAN_DEATH 11293
-#define SOUND_SWITCH_TO_CORRUPT 11297
-#define SOUND_CORRUPT_SLAY1 11298
-#define SOUND_CORRUPT_SLAY2 11299
-#define SOUND_CORRUPT_DEATH 11300
-
-#define HYDROSS_X -239.439
-#define HYDROSS_Y -363.481
-
-#define SPAWN_X_DIFF1 6.934003
-#define SPAWN_Y_DIFF1 -11.255012
-#define SPAWN_X_DIFF2 -6.934003
-#define SPAWN_Y_DIFF2 11.255012
-#define SPAWN_X_DIFF3 -12.577011
-#define SPAWN_Y_DIFF3 -4.72702
-#define SPAWN_X_DIFF4 12.577011
-#define SPAWN_Y_DIFF4 4.72702
-
-struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
-{
- boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 PosCheck_Timer;
- uint32 MarkOfHydross_Timer;
- uint32 MarkOfCorruption_Timer;
- uint32 WaterTomb_Timer;
- uint32 VileSludge_Timer;
- uint32 MarkOfHydross_Count;
- uint32 MarkOfCorruption_Count;
- uint32 EnrageTimer;
- bool CorruptedForm;
-
- void Reset()
- {
- PosCheck_Timer = 2500;
- MarkOfHydross_Timer = 15000;
- MarkOfCorruption_Timer = 15000;
- WaterTomb_Timer = 7000;
- VileSludge_Timer = 7000;
- MarkOfHydross_Count = 0;
- MarkOfCorruption_Count = 0;
- EnrageTimer = 600000;
-
- CorruptedForm = false;
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CLEAN);
-
- if( pInstance )
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- if( pInstance )
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- if(CorruptedForm)
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_CORRUPT_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CORRUPT_SLAY1);
- break;
- case 1:
- DoYell(SAY_CORRUPT_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CORRUPT_SLAY2);
- break;
- }
- else
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_CLEAN_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CLEAN_SLAY1);
- break;
- case 1:
- DoYell(SAY_CLEAN_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CLEAN_SLAY2);
- break;
- }
- }
- }
-
- void JustSummoned(Creature* summoned)
- {
- if( summoned->GetEntry() == ENTRY_PURE_SPAWN )
- summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- if( summoned->GetEntry() == ENTRY_TAINTED_SPAWN )
- summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
-
- summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
- }
-
- void JustDied(Unit *victim)
- {
- if( CorruptedForm )
- {
- DoYell(SAY_CORRUPT_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CORRUPT_DEATH);
- }
- else
- {
- DoYell(SAY_CLEAN_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CLEAN_DEATH);
- }
-
- if( pInstance )
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- // corrupted form
- if( CorruptedForm )
- {
- //MarkOfCorruption_Timer
- if( MarkOfCorruption_Timer < diff )
- {
- if( MarkOfCorruption_Count <= 5 )
- {
- uint32 mark_spell;
-
- switch(MarkOfCorruption_Count)
- {
- case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break;
- case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break;
- case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break;
- case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break;
- case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break;
- case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
- }
-
- DoCast(m_creature->getVictim(), mark_spell);
-
- if( MarkOfCorruption_Count < 5 )
- MarkOfCorruption_Count++;
- }
-
- MarkOfCorruption_Timer = 15000;
- }else MarkOfCorruption_Timer -= diff;
-
- //VileSludge_Timer
- if( VileSludge_Timer < diff )
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if( target )
- DoCast(target, SPELL_VILE_SLUDGE);
-
- VileSludge_Timer = 15000;
- }else VileSludge_Timer -= diff;
-
- //PosCheck_Timer
- if( PosCheck_Timer < diff )
- {
- if( m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) < SWITCH_RADIUS )
- {
- // switch to clean form
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CLEAN);
- CorruptedForm = false;
- MarkOfHydross_Count = 0;
-
- DoYell(SAY_SWITCH_TO_CLEAN, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_CLEAN);
- DoResetThreat();
-
- // spawn 4 adds
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- }
-
- PosCheck_Timer = 2500;
- }else PosCheck_Timer -=diff;
- }
- // clean form
- else
- {
- //MarkOfHydross_Timer
- if( MarkOfHydross_Timer < diff )
- {
- if( MarkOfHydross_Count <= 5 )
- {
- uint32 mark_spell;
-
- switch(MarkOfHydross_Count)
- {
- case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break;
- case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break;
- case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break;
- case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break;
- case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break;
- case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
- }
-
- DoCast(m_creature->getVictim(), mark_spell);
-
- if( MarkOfHydross_Count < 5 )
- MarkOfHydross_Count++;
- }
-
- MarkOfHydross_Timer = 15000;
- }else MarkOfHydross_Timer -= diff;
-
- //WaterTomb_Timer
- if( WaterTomb_Timer < diff )
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if( target )
- DoCast(target, SPELL_WATER_TOMB);
-
- WaterTomb_Timer = 7000;
- }else WaterTomb_Timer -= diff;
-
- //PosCheck_Timer
- if( PosCheck_Timer < diff )
- {
- if( m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) >= SWITCH_RADIUS )
- {
- // switch to corrupted form
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CORRUPT);
- MarkOfCorruption_Count = 0;
- CorruptedForm = true;
-
- DoYell(SAY_SWITCH_TO_CORRUPT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_CORRUPT);
- DoResetThreat();
-
- // spawn 4 adds
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- }
-
- PosCheck_Timer = 2500;
- }else PosCheck_Timer -=diff;
- }
-
- //EnrageTimer
- if( EnrageTimer < diff )
- {
- DoCast(m_creature, SPELL_ENRAGE);
- EnrageTimer = 60000;
- }else EnrageTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_hydross_the_unstable(Creature *_Creature)
-{
- return new boss_hydross_the_unstableAI (_Creature);
-}
-
-void AddSC_boss_hydross_the_unstable()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_hydross_the_unstable";
- newscript->GetAI = GetAI_boss_hydross_the_unstable;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Hydross_The_Unstable
+SD%Complete: 90
+SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location.
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+
+#define SWITCH_RADIUS 18
+
+#define MODEL_CORRUPT 20609
+#define MODEL_CLEAN 20162
+
+#define SPELL_WATER_TOMB 38235
+#define SPELL_MARK_OF_HYDROSS1 38215
+#define SPELL_MARK_OF_HYDROSS2 38216
+#define SPELL_MARK_OF_HYDROSS3 38217
+#define SPELL_MARK_OF_HYDROSS4 38218
+#define SPELL_MARK_OF_HYDROSS5 38231
+#define SPELL_MARK_OF_HYDROSS6 40584
+#define SPELL_MARK_OF_CORRUPTION1 38219
+#define SPELL_MARK_OF_CORRUPTION2 38220
+#define SPELL_MARK_OF_CORRUPTION3 38221
+#define SPELL_MARK_OF_CORRUPTION4 38222
+#define SPELL_MARK_OF_CORRUPTION5 38230
+#define SPELL_MARK_OF_CORRUPTION6 40583
+#define SPELL_VILE_SLUDGE 38246
+#define SPELL_ENRAGE 27680 //this spell need verification
+#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?)
+#define SPELL_ELEMENTAL_SPAWNIN 25035
+//#define SPELL_BLUE_BEAM 38015 //channeled Hydross Beam Helper (not in use yet)
+
+#define ENTRY_PURE_SPAWN 22035
+#define ENTRY_TAINTED_SPAWN 22036
+
+#define SAY_AGGRO "I cannot allow you to interfere!"
+#define SAY_SWITCH_TO_CLEAN "Better, much better."
+#define SAY_CLEAN_SLAY1 "They have forced me to this..."
+#define SAY_CLEAN_SLAY2 "I have no choice."
+#define SAY_CLEAN_DEATH "I am... released..."
+#define SAY_SWITCH_TO_CORRUPT "Aaghh, the poison..."
+#define SAY_CORRUPT_SLAY1 "I will purge you from this place."
+#define SAY_CORRUPT_SLAY2 "You are no better than they!"
+#define SAY_CORRUPT_DEATH "You are the disease, not I"
+
+#define SOUND_AGGRO 11289
+#define SOUND_SWITCH_TO_CLEAN 11290
+#define SOUND_CLEAN_SLAY1 11291
+#define SOUND_CLEAN_SLAY2 11292
+#define SOUND_CLEAN_DEATH 11293
+#define SOUND_SWITCH_TO_CORRUPT 11297
+#define SOUND_CORRUPT_SLAY1 11298
+#define SOUND_CORRUPT_SLAY2 11299
+#define SOUND_CORRUPT_DEATH 11300
+
+#define HYDROSS_X -239.439
+#define HYDROSS_Y -363.481
+
+#define SPAWN_X_DIFF1 6.934003
+#define SPAWN_Y_DIFF1 -11.255012
+#define SPAWN_X_DIFF2 -6.934003
+#define SPAWN_Y_DIFF2 11.255012
+#define SPAWN_X_DIFF3 -12.577011
+#define SPAWN_Y_DIFF3 -4.72702
+#define SPAWN_X_DIFF4 12.577011
+#define SPAWN_Y_DIFF4 4.72702
+
+struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
+{
+ boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 PosCheck_Timer;
+ uint32 MarkOfHydross_Timer;
+ uint32 MarkOfCorruption_Timer;
+ uint32 WaterTomb_Timer;
+ uint32 VileSludge_Timer;
+ uint32 MarkOfHydross_Count;
+ uint32 MarkOfCorruption_Count;
+ uint32 EnrageTimer;
+ bool CorruptedForm;
+
+ void Reset()
+ {
+ PosCheck_Timer = 2500;
+ MarkOfHydross_Timer = 15000;
+ MarkOfCorruption_Timer = 15000;
+ WaterTomb_Timer = 7000;
+ VileSludge_Timer = 7000;
+ MarkOfHydross_Count = 0;
+ MarkOfCorruption_Count = 0;
+ EnrageTimer = 600000;
+
+ CorruptedForm = false;
+ m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CLEAN);
+
+ if( pInstance )
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ if( pInstance )
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(CorruptedForm)
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_CORRUPT_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CORRUPT_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_CORRUPT_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CORRUPT_SLAY2);
+ break;
+ }
+ else
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_CLEAN_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CLEAN_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_CLEAN_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CLEAN_SLAY2);
+ break;
+ }
+ }
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_PURE_SPAWN )
+ summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ if( summoned->GetEntry() == ENTRY_TAINTED_SPAWN )
+ summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+
+ summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if( CorruptedForm )
+ {
+ DoYell(SAY_CORRUPT_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CORRUPT_DEATH);
+ }
+ else
+ {
+ DoYell(SAY_CLEAN_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CLEAN_DEATH);
+ }
+
+ if( pInstance )
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ // corrupted form
+ if( CorruptedForm )
+ {
+ //MarkOfCorruption_Timer
+ if( MarkOfCorruption_Timer < diff )
+ {
+ if( MarkOfCorruption_Count <= 5 )
+ {
+ uint32 mark_spell;
+
+ switch(MarkOfCorruption_Count)
+ {
+ case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break;
+ case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break;
+ case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break;
+ case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break;
+ case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break;
+ case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
+ }
+
+ DoCast(m_creature->getVictim(), mark_spell);
+
+ if( MarkOfCorruption_Count < 5 )
+ MarkOfCorruption_Count++;
+ }
+
+ MarkOfCorruption_Timer = 15000;
+ }else MarkOfCorruption_Timer -= diff;
+
+ //VileSludge_Timer
+ if( VileSludge_Timer < diff )
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if( target )
+ DoCast(target, SPELL_VILE_SLUDGE);
+
+ VileSludge_Timer = 15000;
+ }else VileSludge_Timer -= diff;
+
+ //PosCheck_Timer
+ if( PosCheck_Timer < diff )
+ {
+ if( m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) < SWITCH_RADIUS )
+ {
+ // switch to clean form
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CLEAN);
+ CorruptedForm = false;
+ MarkOfHydross_Count = 0;
+
+ DoYell(SAY_SWITCH_TO_CLEAN, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_CLEAN);
+ DoResetThreat();
+
+ // spawn 4 adds
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ }
+
+ PosCheck_Timer = 2500;
+ }else PosCheck_Timer -=diff;
+ }
+ // clean form
+ else
+ {
+ //MarkOfHydross_Timer
+ if( MarkOfHydross_Timer < diff )
+ {
+ if( MarkOfHydross_Count <= 5 )
+ {
+ uint32 mark_spell;
+
+ switch(MarkOfHydross_Count)
+ {
+ case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break;
+ case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break;
+ case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break;
+ case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break;
+ case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break;
+ case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
+ }
+
+ DoCast(m_creature->getVictim(), mark_spell);
+
+ if( MarkOfHydross_Count < 5 )
+ MarkOfHydross_Count++;
+ }
+
+ MarkOfHydross_Timer = 15000;
+ }else MarkOfHydross_Timer -= diff;
+
+ //WaterTomb_Timer
+ if( WaterTomb_Timer < diff )
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if( target )
+ DoCast(target, SPELL_WATER_TOMB);
+
+ WaterTomb_Timer = 7000;
+ }else WaterTomb_Timer -= diff;
+
+ //PosCheck_Timer
+ if( PosCheck_Timer < diff )
+ {
+ if( m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) >= SWITCH_RADIUS )
+ {
+ // switch to corrupted form
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_CORRUPT);
+ MarkOfCorruption_Count = 0;
+ CorruptedForm = true;
+
+ DoYell(SAY_SWITCH_TO_CORRUPT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_CORRUPT);
+ DoResetThreat();
+
+ // spawn 4 adds
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ }
+
+ PosCheck_Timer = 2500;
+ }else PosCheck_Timer -=diff;
+ }
+
+ //EnrageTimer
+ if( EnrageTimer < diff )
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ EnrageTimer = 60000;
+ }else EnrageTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_hydross_the_unstable(Creature *_Creature)
+{
+ return new boss_hydross_the_unstableAI (_Creature);
+}
+
+void AddSC_boss_hydross_the_unstable()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_hydross_the_unstable";
+ newscript->GetAI = GetAI_boss_hydross_the_unstable;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
index 3ea23f617bb..0264a45f63f 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
@@ -1,922 +1,922 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
- */
-
-/* ScriptData
-SDName: Boss_Lady_Vashj
-SD%Complete: 99
-SDComment: Missing blizzlike Shield Generators coords
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-#include "../../../creature/simple_ai.h"
-#include "Item.h"
-#include "Spell.h"
-
-#define SPELL_MULTI_SHOT 38310
-#define SPELL_SHOCK_BLAST 38509
-#define SPELL_ENTANGLE 38316
-#define SPELL_STATIC_CHARGE_TRIGGER 38280
-#define SPELL_FORKED_LIGHTNING 40088
-#define SPELL_SHOOT 40873
-#define SPELL_POISON_BOLT 40095
-#define SPELL_TOXIC_SPORES 38575
-#define SPELL_MAGIC_BARRIER 38112
-
-#define SAY_INTRO "Water is life. It has become a rare commodity here in Outland. A commodity that we alone shall control. We are the Highborne, and the time has come at last for us to retake our rightful place in the world!"
-#define SAY_AGGRO1 "I'll split you from stem to stern! "
-#define SAY_AGGRO2 "Victory to Lord Illidan!"
-#define SAY_AGGRO3 "I spit on you, surface filth!"
-#define SAY_AGGRO4 "Death to the outsiders!"
-#define SAY_PHASE1 "I did not wish to lower myself by engaging your kind, but you leave me little choice!"
-#define SAY_PHASE2 "The time is now! Leave none standing!"
-#define SAY_PHASE3 "You may want to take cover."
-#define SAY_BOWSHOT1 "Straight to the heart!"
-#define SAY_BOWSHOT2 "Seek your mark!"
-#define SAY_SLAY1 "Your time ends now!"
-#define SAY_SLAY2 "You have failed!"
-#define SAY_DEATH "Lord Illidan, I... I am... sorry."
-
-#define SOUND_INTRO 11531
-#define SOUND_AGGRO1 11532
-#define SOUND_AGGRO2 11533
-#define SOUND_AGGRO3 11534
-#define SOUND_AGGRO4 11535
-#define SOUND_PHASE1 11538
-#define SOUND_PHASE2 11539
-#define SOUND_PHASE3 11540
-#define SOUND_BOWSHOT1 11536
-#define SOUND_BOWSHOT2 11537
-#define SOUND_SLAY1 11541
-#define SOUND_SLAY2 11542
-#define SOUND_DEATH 11544
-
-#define MIDDLE_X 30.134
-#define MIDDLE_Y -923.65
-#define MIDDLE_Z 42.9
-
-#define SPOREBAT_X 30.977156
-#define SPOREBAT_Y -925.297761
-#define SPOREBAT_Z 77.176567
-#define SPOREBAT_O 5.223932
-
-#define SHIED_GENERATOR_CHANNEL 19870
-#define ENCHANTED_ELEMENTAL 21958
-#define TAINTED_ELEMENTAL 22009
-#define COILFANG_STRIDER 22056
-#define COILFANG_ELITE 22055
-#define FATHOM_SPOREBAT 22140
-
-float ElementPos[8][4] =
-{
- {8.3, -835.3, 21.9, 5},
- {53.4, -835.3, 21.9, 4.5},
- {96, -861.9, 21.8, 4},
- {96, -986.4, 21.4, 2.5},
- {54.4, -1010.6, 22, 1.8},
- {9.8, -1012, 21.7, 1.4},
- {-35, -987.6, 21.5, 0.8},
- {-58.9, -901.6, 21.5, 6}
-};
-
-float CoilfangElitePos[3][4] =
-{
- {28.84, -923.28, 42.9, 6},
- {31.183281, -953.502625, 41.523602, 1.640957},
- {58.895180, -923.124268, 41.545307, 3.152848}
-};
-
-float CoilfangStriderPos[3][4] =
-{
- {66.427010, -948.778503, 41.262245, 2.584220},
- {7.513962, -959.538208, 41.300422, 1.034629},
- {-12.843201, -907.798401, 41.239620, 6.087094}
-};
-
-float ShieldGeneratorChannelPos[4][4] =
-{
- {49.6262, -902.181, 43.0975, 3.95683},
- {10.988, -901.616, 42.5371, 5.4373},
- {10.3859, -944.036, 42.5446, 0.779888},
- {49.3126, -943.398, 42.5501, 2.40174}
-};
-
-//Lady Vashj AI
-struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
-{
- boss_lady_vashjAI (Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint64 ShieldGeneratorChannel[4];
-
- uint32 ShockBlast_Timer;
- uint32 Entangle_Timer;
- uint32 StaticCharge_Timer;
- uint32 ForkedLightning_Timer;
- uint32 Check_Timer;
- uint32 EnchantedElemental_Timer;
- uint32 TaintedElemental_Timer;
- uint32 CoilfangElite_Timer;
- uint32 CoilfangStrider_Timer;
- uint32 SummonSporebat_Timer;
- uint32 SummonSporebat_StaticTimer;
- uint8 EnchantedElemental_Pos;
- uint8 Phase;
-
- bool Entangle;
-
- void Reset()
- {
- ShockBlast_Timer = 1+rand()%60000;
- Entangle_Timer = 30000;
- StaticCharge_Timer = 10000+rand()%15000;
- ForkedLightning_Timer = 2000;
- Check_Timer = 1000;
- EnchantedElemental_Timer = 5000;
- TaintedElemental_Timer = 50000;
- CoilfangElite_Timer = 45000+rand()%5000;
- CoilfangStrider_Timer = 60000+rand()%10000;
- SummonSporebat_Timer = 10000;
- SummonSporebat_StaticTimer = 30000;
- EnchantedElemental_Pos = 0;
- Phase = 0;
-
- Entangle = false;
-
- if(pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, 0);
-
- ShieldGeneratorChannel[0] = 0;
- ShieldGeneratorChannel[1] = 0;
- ShieldGeneratorChannel[2] = 0;
- ShieldGeneratorChannel[3] = 0;
-
- }
-
- //Called when a tainted elemental dies
- void EventTaintedElementalDeath()
- {
- //the next will spawn 50 seconds after the previous one's death
- if(TaintedElemental_Timer > 50000)
- TaintedElemental_Timer = 50000;
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
-
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
-
- if(pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, 0);
- }
-
- void StartEvent()
- {
- switch(rand()%4)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- break;
- case 2:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- break;
- case 3:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO4);
- DoYell(SAY_AGGRO4, LANG_UNIVERSAL, NULL);
- break;
- }
-
- Phase = 1;
-
- if(pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, 1);
- }
-
- void Aggro(Unit *who)
- {
- //Begin melee attack if we are within range
- if(Phase != 2)
- DoStartAttackAndMovement(who);
-
- StartEvent();
- }
-
- void CastShootOrMultishot()
- {
- switch(rand()%2)
- {
- case 0:
- //Shoot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
- break;
- case 1:
- //Multishot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
- DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
- break;
- }
-
- if(rand()%3)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_BOWSHOT1);
- DoYell(SAY_BOWSHOT1, LANG_UNIVERSAL, NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_BOWSHOT2);
- DoYell(SAY_BOWSHOT2, LANG_UNIVERSAL, NULL);
- break;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //to prevent abuses during phase 2
- if(Phase == 2 && !m_creature->getVictim() && InCombat)
- EnterEvadeMode();
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(Phase == 1 || Phase == 3)
- {
- //ShockBlast_Timer
- if (ShockBlast_Timer < diff)
- {
- //Shock Burst
- //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
- DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST);
- m_creature->TauntApply(m_creature->getVictim());
-
- ShockBlast_Timer = 1000+rand()%14000; //random cooldown
- }else ShockBlast_Timer -= diff;
-
- //StaticCharge_Timer
- if(StaticCharge_Timer < diff)
- {
- //Static Charge
- //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER, 0))
- //cast Static Charge every 2 seconds for 20 seconds
- DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
-
- StaticCharge_Timer = 10000+rand()%20000; //blizzlike
- }else StaticCharge_Timer -= diff;
-
- //Entangle_Timer
- if (Entangle_Timer < diff)
- {
- if(!Entangle)
- {
- //Entangle
- //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
- DoCast(m_creature->getVictim(), SPELL_ENTANGLE);
- Entangle = true;
- Entangle_Timer = 10000;
- }
- else
- {
- CastShootOrMultishot();
- Entangle = false;
- Entangle_Timer = 20000+rand()%5000;
- }
- }else Entangle_Timer -= diff;
-
- //Phase 1
- if(Phase == 1)
- {
- //Start phase 2
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70)
- {
- //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
- Phase = 2;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->GetMotionMaster()->Clear();
- m_creature->Relocate(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- m_creature->SendMonsterMove(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 0, 0, 0);
-
- m_creature->RemoveAllAuras();
- // This needs an entry in spell_script_target
- DoCast(m_creature, SPELL_MAGIC_BARRIER, true);
-
- Creature *pCreature;
- for(uint8 i = 0; i < 4; i++)
- {
- pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (pCreature)
- ShieldGeneratorChannel[i] = pCreature->GetGUID();
- }
-
- DoPlaySoundToSet(m_creature, SOUND_PHASE2);
- DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
- }
- }
- //Phase 3
- else
- {
- //SummonSporebat_Timer
- if(SummonSporebat_Timer < diff)
- {
- Creature *Sporebat = NULL;
- Sporebat = m_creature->SummonCreature(FATHOM_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
-
- if(Sporebat)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Sporebat->AI()->AttackStart(target);
- }
-
- //summon sporebats faster and faster
- if(SummonSporebat_StaticTimer > 1000)
- SummonSporebat_StaticTimer -= 1000;
-
- SummonSporebat_Timer = SummonSporebat_StaticTimer;
- }else SummonSporebat_Timer -= diff;
- }
-
- //Melee attack
- DoMeleeAttackIfReady();
-
- //Check_Timer - used to check if somebody is in melee range
- if(Check_Timer < diff)
- {
- bool InMeleeRange = false;
- Unit *target;
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //if in melee range
- if(target && target->IsWithinDistInMap(m_creature, 5))
- {
- InMeleeRange = true;
- break;
- }
- }
-
- //if nobody is in melee range
- if(!InMeleeRange)
- CastShootOrMultishot();
-
- Check_Timer = 1000;
- }else Check_Timer -= diff;
- }
- //Phase 2
- else
- {
- //ForkedLightning_Timer
- if(ForkedLightning_Timer < diff)
- {
- //Forked Lightning
- //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(!target)
- target = m_creature->getVictim();
-
- DoCast(target, SPELL_FORKED_LIGHTNING);
-
- ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
- }else ForkedLightning_Timer -= diff;
-
- //EnchantedElemental_Timer
- if(EnchantedElemental_Timer < diff)
- {
- Creature *Elemental;
- Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Elemental)
- Elemental->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
-
- if(EnchantedElemental_Pos == 7)
- EnchantedElemental_Pos = 0;
- else
- EnchantedElemental_Pos++;
-
- EnchantedElemental_Timer = 10000+rand()%5000;
- }else EnchantedElemental_Timer -= diff;
-
- //TaintedElemental_Timer
- if(TaintedElemental_Timer < diff)
- {
- Creature *Tain_Elemental;
- uint32 pos = rand()%8;
- Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- if(Tain_Elemental)
- {
- Tain_Elemental->GetMotionMaster()->Clear();
- Tain_Elemental->GetMotionMaster()->MoveIdle();
- }
-
- TaintedElemental_Timer = 120000;
- }else TaintedElemental_Timer -= diff;
-
- //CoilfangElite_Timer
- if(CoilfangElite_Timer < diff)
- {
- Creature *CoilfangElite;
- uint32 pos = rand()%3;
- CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
- if(CoilfangElite)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- CoilfangElite->AI()->AttackStart(target);
- }
-
- CoilfangElite_Timer = 45000+rand()%5000; //wowwiki says 50 seconds, bosskillers says 45
- }else CoilfangElite_Timer -= diff;
-
- //CoilfangStrider_Timer
- if(CoilfangStrider_Timer < diff)
- {
- Creature *CoilfangStrider;
- uint32 pos = rand()%3;
- CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(CoilfangStrider)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- CoilfangStrider->AI()->AttackStart(target);
- }
-
- CoilfangStrider_Timer = 60000+rand()%10000; //wowwiki says 60 seconds, bosskillers says 60-70
- }else CoilfangStrider_Timer -= diff;
-
- //Check_Timer
- if(Check_Timer < diff)
- {
- //Start Phase 3
- if(pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
- {
- //set life 50%
- m_creature->SetHealth(m_creature->GetMaxHealth()/2);
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
-
- DoPlaySoundToSet(m_creature, SOUND_PHASE3);
- DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
-
- Phase = 3;
-
- //return to the tank
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
- Check_Timer = 1000;
- }else Check_Timer -= diff;
- }
- }
-};
-
-//Enchanted Elemental
-//If one of them reaches Vashj he will increase her damage done by 5%.
-struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
-{
- mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Check_Timer;
- uint32 Movement_Timer;
-
- void Reset()
- {
- Check_Timer = 5000;
- Movement_Timer = 500;
- }
-
- void Aggro(Unit *who) { return; }
-
- void MoveInLineOfSight(Unit *who) { return; }
-
- void UpdateAI(const uint32 diff)
- {
- //Check_Timer
- if(Check_Timer < diff)
- {
- if(pInstance)
- {
- Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
- if(Vashj)
- {
- if(Vashj->IsWithinDistInMap(m_creature, 5))
- {
- //increase lady vashj damage (+5%)
- const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
- Vashj->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 5)));
- Vashj->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 5)));
- m_creature->UpdateDamagePhysical(BASE_ATTACK);
-
- //call Unsummon()
- m_creature->setDeathState(JUST_DIED);
- }
- else if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false)
- {
- //call Unsummon()
- m_creature->setDeathState(JUST_DIED);
- }
- }
- }
- else error_log("ERROR: Instance Data for Serpentshrine Caverns not set");
- Check_Timer = 1000;
- }else Check_Timer -= diff;
- }
-};
-
-//Tainted Elemental
-//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
-struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI
-{
- mob_tainted_elementalAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 PoisonBolt_Timer;
-
- void Reset()
- {
- PoisonBolt_Timer = 5000+rand()%5000;
- }
-
- void JustDied(Unit *killer)
- {
- if(pInstance)
- {
- Creature *Vashj = NULL;
- Vashj = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)));
-
- if(Vashj)
- ((boss_lady_vashjAI*)Vashj->AI())->EventTaintedElementalDeath();
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //PoisonBolt_Timer
- if(PoisonBolt_Timer < diff)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(target && target->IsWithinDistInMap(m_creature, 30))
- DoCast(target, SPELL_POISON_BOLT);
-
- PoisonBolt_Timer = 5000+rand()%5000;
- }else PoisonBolt_Timer -= diff;
- }
-};
-
-//Fathom Sporebat
-//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it.
-struct TRINITY_DLL_DECL mob_fathom_sporebatAI : public ScriptedAI
-{
- mob_fathom_sporebatAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 ToxicSpore_Timer;
- uint32 Check_Timer;
-
- void Reset()
- {
- m_creature->setFaction(14);
- ToxicSpore_Timer = 5000;
- Check_Timer = 1000;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI (const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ToxicSpore_Timer
- if(ToxicSpore_Timer < diff)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- //The Spores will hit you anywhere in the instance: underwater, at the elevator, at the entrance, wherever.
- if(target)
- DoCast(target, SPELL_TOXIC_SPORES);
-
- ToxicSpore_Timer = 20000+rand()%5000;
- }else ToxicSpore_Timer -= diff;
-
- //Check_Timer
- if(Check_Timer < diff)
- {
- if(pInstance)
- {
- //check if vashj is death
- Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
- if(!Vashj || (Vashj && !Vashj->isAlive()))
- {
- //remove
- m_creature->setDeathState(DEAD);
- m_creature->RemoveCorpse();
- m_creature->setFaction(35);
- }
- }
-
- Check_Timer = 1000;
- }else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Coilfang Elite
-//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage
-CreatureAI* GetAI_mob_coilfang_elite(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 31345; //Cleave
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].CooldownRandomAddition = 5000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-//Coilfang Strifer
-//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear.
-CreatureAI* GetAI_mob_coilfang_strider(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 41374; //Mind Blast
- ai->Spell[0].Cooldown = 30000;
- ai->Spell[0].CooldownRandomAddition = 10000;
- ai->Spell[0].First_Cast = 8000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Scream aura not implemented
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI
-{
- mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Check_Timer;
- bool Channeled;
-
- void Reset()
- {
- Check_Timer = 1000;
- Channeled = false;
- //invisible
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who) { return; }
-
- void MoveInLineOfSight(Unit *who) { return; }
-
- void UpdateAI (const uint32 diff)
- {
- if(!pInstance)
- return;
-
- if(!Channeled)
- {
- Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
-
- if(Vashj && Vashj->isAlive())
- {
- //start visual channel
- m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, Vashj->GetGUID());
- m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_MAGIC_BARRIER);
- Channeled = true;
- }
- }
- }
-};
-
-bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- ScriptedInstance *pInstance = ((ScriptedInstance*)player->GetInstanceData());
-
- if(!pInstance)
- {
- player->GetSession()->SendNotification("ERROR: Instance script not initialized. Notify your administrator.");
- error_log("ERROR: Lady Vashj Tainted Core: Instance Script Not Initialized");
- return true;
- }
-
- Creature *Vashj = NULL;
- Vashj = (Creature*)(Unit::GetUnit((*player), pInstance->GetData64(DATA_LADYVASHJ)));
- if(Vashj && ((boss_lady_vashjAI*)Vashj->AI())->Phase == 2)
- {
- if(targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT)
- {
- uint32 identifier;
- uint8 channel_identifier;
- switch(targets.getGOTarget()->GetEntry())
- {
- case 185052:
- identifier = DATA_SHIELDGENERATOR1;
- channel_identifier = 0;
- break;
- case 185053:
- identifier = DATA_SHIELDGENERATOR2;
- channel_identifier = 1;
- break;
- case 185051:
- identifier = DATA_SHIELDGENERATOR3;
- channel_identifier = 2;
- break;
- case 185054:
- identifier = DATA_SHIELDGENERATOR4;
- channel_identifier = 3;
- break;
- default:
- return true;
- break;
- }
-
- if(pInstance->GetData(identifier))
- {
- player->GetSession()->SendNotification("Already deactivated");
- return true;
- }
-
- //get and remove channel
- Unit *Channel = NULL;
- Channel = Unit::GetUnit((*Vashj), ((boss_lady_vashjAI*)Vashj->AI())->ShieldGeneratorChannel[channel_identifier]);
- if(Channel)
- {
- //call Unsummon()
- Channel->setDeathState(JUST_DIED);
- }
-
- pInstance->SetData(identifier, 1);
-
- //remove this item
- player->DestroyItemCount(31088, 1, true);
- }
- }
- return true;
-}
-
-CreatureAI* GetAI_boss_lady_vashj(Creature *_Creature)
-{
- return new boss_lady_vashjAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_enchanted_elemental(Creature *_Creature)
-{
- return new mob_enchanted_elementalAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_tainted_elemental(Creature *_Creature)
-{
- return new mob_tainted_elementalAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_fathom_sporebat(Creature *_Creature)
-{
- return new mob_fathom_sporebatAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_shield_generator_channel(Creature *_Creature)
-{
- return new mob_shield_generator_channelAI (_Creature);
-}
-
-void AddSC_boss_lady_vashj()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_lady_vashj";
- newscript->GetAI = GetAI_boss_lady_vashj;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_enchanted_elemental";
- newscript->GetAI = GetAI_mob_enchanted_elemental;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_tainted_elemental";
- newscript->GetAI = GetAI_mob_tainted_elemental;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_fathom_sporebat";
- newscript->GetAI = GetAI_mob_fathom_sporebat;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_coilfang_elite";
- newscript->GetAI = GetAI_mob_coilfang_elite;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_coilfang_strider";
- newscript->GetAI = GetAI_mob_coilfang_strider;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_shield_generator_channel";
- newscript->GetAI = GetAI_mob_shield_generator_channel;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_tainted_core";
- newscript->pItemUse = ItemUse_item_tainted_core;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
+ */
+
+/* ScriptData
+SDName: Boss_Lady_Vashj
+SD%Complete: 99
+SDComment: Missing blizzlike Shield Generators coords
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+#include "../../../creature/simple_ai.h"
+#include "Item.h"
+#include "Spell.h"
+
+#define SPELL_MULTI_SHOT 38310
+#define SPELL_SHOCK_BLAST 38509
+#define SPELL_ENTANGLE 38316
+#define SPELL_STATIC_CHARGE_TRIGGER 38280
+#define SPELL_FORKED_LIGHTNING 40088
+#define SPELL_SHOOT 40873
+#define SPELL_POISON_BOLT 40095
+#define SPELL_TOXIC_SPORES 38575
+#define SPELL_MAGIC_BARRIER 38112
+
+#define SAY_INTRO "Water is life. It has become a rare commodity here in Outland. A commodity that we alone shall control. We are the Highborne, and the time has come at last for us to retake our rightful place in the world!"
+#define SAY_AGGRO1 "I'll split you from stem to stern! "
+#define SAY_AGGRO2 "Victory to Lord Illidan!"
+#define SAY_AGGRO3 "I spit on you, surface filth!"
+#define SAY_AGGRO4 "Death to the outsiders!"
+#define SAY_PHASE1 "I did not wish to lower myself by engaging your kind, but you leave me little choice!"
+#define SAY_PHASE2 "The time is now! Leave none standing!"
+#define SAY_PHASE3 "You may want to take cover."
+#define SAY_BOWSHOT1 "Straight to the heart!"
+#define SAY_BOWSHOT2 "Seek your mark!"
+#define SAY_SLAY1 "Your time ends now!"
+#define SAY_SLAY2 "You have failed!"
+#define SAY_DEATH "Lord Illidan, I... I am... sorry."
+
+#define SOUND_INTRO 11531
+#define SOUND_AGGRO1 11532
+#define SOUND_AGGRO2 11533
+#define SOUND_AGGRO3 11534
+#define SOUND_AGGRO4 11535
+#define SOUND_PHASE1 11538
+#define SOUND_PHASE2 11539
+#define SOUND_PHASE3 11540
+#define SOUND_BOWSHOT1 11536
+#define SOUND_BOWSHOT2 11537
+#define SOUND_SLAY1 11541
+#define SOUND_SLAY2 11542
+#define SOUND_DEATH 11544
+
+#define MIDDLE_X 30.134
+#define MIDDLE_Y -923.65
+#define MIDDLE_Z 42.9
+
+#define SPOREBAT_X 30.977156
+#define SPOREBAT_Y -925.297761
+#define SPOREBAT_Z 77.176567
+#define SPOREBAT_O 5.223932
+
+#define SHIED_GENERATOR_CHANNEL 19870
+#define ENCHANTED_ELEMENTAL 21958
+#define TAINTED_ELEMENTAL 22009
+#define COILFANG_STRIDER 22056
+#define COILFANG_ELITE 22055
+#define FATHOM_SPOREBAT 22140
+
+float ElementPos[8][4] =
+{
+ {8.3, -835.3, 21.9, 5},
+ {53.4, -835.3, 21.9, 4.5},
+ {96, -861.9, 21.8, 4},
+ {96, -986.4, 21.4, 2.5},
+ {54.4, -1010.6, 22, 1.8},
+ {9.8, -1012, 21.7, 1.4},
+ {-35, -987.6, 21.5, 0.8},
+ {-58.9, -901.6, 21.5, 6}
+};
+
+float CoilfangElitePos[3][4] =
+{
+ {28.84, -923.28, 42.9, 6},
+ {31.183281, -953.502625, 41.523602, 1.640957},
+ {58.895180, -923.124268, 41.545307, 3.152848}
+};
+
+float CoilfangStriderPos[3][4] =
+{
+ {66.427010, -948.778503, 41.262245, 2.584220},
+ {7.513962, -959.538208, 41.300422, 1.034629},
+ {-12.843201, -907.798401, 41.239620, 6.087094}
+};
+
+float ShieldGeneratorChannelPos[4][4] =
+{
+ {49.6262, -902.181, 43.0975, 3.95683},
+ {10.988, -901.616, 42.5371, 5.4373},
+ {10.3859, -944.036, 42.5446, 0.779888},
+ {49.3126, -943.398, 42.5501, 2.40174}
+};
+
+//Lady Vashj AI
+struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
+{
+ boss_lady_vashjAI (Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint64 ShieldGeneratorChannel[4];
+
+ uint32 ShockBlast_Timer;
+ uint32 Entangle_Timer;
+ uint32 StaticCharge_Timer;
+ uint32 ForkedLightning_Timer;
+ uint32 Check_Timer;
+ uint32 EnchantedElemental_Timer;
+ uint32 TaintedElemental_Timer;
+ uint32 CoilfangElite_Timer;
+ uint32 CoilfangStrider_Timer;
+ uint32 SummonSporebat_Timer;
+ uint32 SummonSporebat_StaticTimer;
+ uint8 EnchantedElemental_Pos;
+ uint8 Phase;
+
+ bool Entangle;
+
+ void Reset()
+ {
+ ShockBlast_Timer = 1+rand()%60000;
+ Entangle_Timer = 30000;
+ StaticCharge_Timer = 10000+rand()%15000;
+ ForkedLightning_Timer = 2000;
+ Check_Timer = 1000;
+ EnchantedElemental_Timer = 5000;
+ TaintedElemental_Timer = 50000;
+ CoilfangElite_Timer = 45000+rand()%5000;
+ CoilfangStrider_Timer = 60000+rand()%10000;
+ SummonSporebat_Timer = 10000;
+ SummonSporebat_StaticTimer = 30000;
+ EnchantedElemental_Pos = 0;
+ Phase = 0;
+
+ Entangle = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, 0);
+
+ ShieldGeneratorChannel[0] = 0;
+ ShieldGeneratorChannel[1] = 0;
+ ShieldGeneratorChannel[2] = 0;
+ ShieldGeneratorChannel[3] = 0;
+
+ }
+
+ //Called when a tainted elemental dies
+ void EventTaintedElementalDeath()
+ {
+ //the next will spawn 50 seconds after the previous one's death
+ if(TaintedElemental_Timer > 50000)
+ TaintedElemental_Timer = 50000;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+
+ if(pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, 0);
+ }
+
+ void StartEvent()
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ break;
+ case 3:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO4);
+ DoYell(SAY_AGGRO4, LANG_UNIVERSAL, NULL);
+ break;
+ }
+
+ Phase = 1;
+
+ if(pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, 1);
+ }
+
+ void Aggro(Unit *who)
+ {
+ //Begin melee attack if we are within range
+ if(Phase != 2)
+ DoStartAttackAndMovement(who);
+
+ StartEvent();
+ }
+
+ void CastShootOrMultishot()
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ //Shoot
+ //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
+ DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ break;
+ case 1:
+ //Multishot
+ //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
+ DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
+ break;
+ }
+
+ if(rand()%3)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_BOWSHOT1);
+ DoYell(SAY_BOWSHOT1, LANG_UNIVERSAL, NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_BOWSHOT2);
+ DoYell(SAY_BOWSHOT2, LANG_UNIVERSAL, NULL);
+ break;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //to prevent abuses during phase 2
+ if(Phase == 2 && !m_creature->getVictim() && InCombat)
+ EnterEvadeMode();
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(Phase == 1 || Phase == 3)
+ {
+ //ShockBlast_Timer
+ if (ShockBlast_Timer < diff)
+ {
+ //Shock Burst
+ //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
+ DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST);
+ m_creature->TauntApply(m_creature->getVictim());
+
+ ShockBlast_Timer = 1000+rand()%14000; //random cooldown
+ }else ShockBlast_Timer -= diff;
+
+ //StaticCharge_Timer
+ if(StaticCharge_Timer < diff)
+ {
+ //Static Charge
+ //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER, 0))
+ //cast Static Charge every 2 seconds for 20 seconds
+ DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
+
+ StaticCharge_Timer = 10000+rand()%20000; //blizzlike
+ }else StaticCharge_Timer -= diff;
+
+ //Entangle_Timer
+ if (Entangle_Timer < diff)
+ {
+ if(!Entangle)
+ {
+ //Entangle
+ //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
+ DoCast(m_creature->getVictim(), SPELL_ENTANGLE);
+ Entangle = true;
+ Entangle_Timer = 10000;
+ }
+ else
+ {
+ CastShootOrMultishot();
+ Entangle = false;
+ Entangle_Timer = 20000+rand()%5000;
+ }
+ }else Entangle_Timer -= diff;
+
+ //Phase 1
+ if(Phase == 1)
+ {
+ //Start phase 2
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70)
+ {
+ //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
+ Phase = 2;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->Relocate(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+ m_creature->SendMonsterMove(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 0, 0, 0);
+
+ m_creature->RemoveAllAuras();
+ // This needs an entry in spell_script_target
+ DoCast(m_creature, SPELL_MAGIC_BARRIER, true);
+
+ Creature *pCreature;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (pCreature)
+ ShieldGeneratorChannel[i] = pCreature->GetGUID();
+ }
+
+ DoPlaySoundToSet(m_creature, SOUND_PHASE2);
+ DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
+ }
+ }
+ //Phase 3
+ else
+ {
+ //SummonSporebat_Timer
+ if(SummonSporebat_Timer < diff)
+ {
+ Creature *Sporebat = NULL;
+ Sporebat = m_creature->SummonCreature(FATHOM_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+
+ if(Sporebat)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Sporebat->AI()->AttackStart(target);
+ }
+
+ //summon sporebats faster and faster
+ if(SummonSporebat_StaticTimer > 1000)
+ SummonSporebat_StaticTimer -= 1000;
+
+ SummonSporebat_Timer = SummonSporebat_StaticTimer;
+ }else SummonSporebat_Timer -= diff;
+ }
+
+ //Melee attack
+ DoMeleeAttackIfReady();
+
+ //Check_Timer - used to check if somebody is in melee range
+ if(Check_Timer < diff)
+ {
+ bool InMeleeRange = false;
+ Unit *target;
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //if in melee range
+ if(target && target->IsWithinDistInMap(m_creature, 5))
+ {
+ InMeleeRange = true;
+ break;
+ }
+ }
+
+ //if nobody is in melee range
+ if(!InMeleeRange)
+ CastShootOrMultishot();
+
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+ }
+ //Phase 2
+ else
+ {
+ //ForkedLightning_Timer
+ if(ForkedLightning_Timer < diff)
+ {
+ //Forked Lightning
+ //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ DoCast(target, SPELL_FORKED_LIGHTNING);
+
+ ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
+ }else ForkedLightning_Timer -= diff;
+
+ //EnchantedElemental_Timer
+ if(EnchantedElemental_Timer < diff)
+ {
+ Creature *Elemental;
+ Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Elemental)
+ Elemental->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+
+ if(EnchantedElemental_Pos == 7)
+ EnchantedElemental_Pos = 0;
+ else
+ EnchantedElemental_Pos++;
+
+ EnchantedElemental_Timer = 10000+rand()%5000;
+ }else EnchantedElemental_Timer -= diff;
+
+ //TaintedElemental_Timer
+ if(TaintedElemental_Timer < diff)
+ {
+ Creature *Tain_Elemental;
+ uint32 pos = rand()%8;
+ Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+ if(Tain_Elemental)
+ {
+ Tain_Elemental->GetMotionMaster()->Clear();
+ Tain_Elemental->GetMotionMaster()->MoveIdle();
+ }
+
+ TaintedElemental_Timer = 120000;
+ }else TaintedElemental_Timer -= diff;
+
+ //CoilfangElite_Timer
+ if(CoilfangElite_Timer < diff)
+ {
+ Creature *CoilfangElite;
+ uint32 pos = rand()%3;
+ CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
+ if(CoilfangElite)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ CoilfangElite->AI()->AttackStart(target);
+ }
+
+ CoilfangElite_Timer = 45000+rand()%5000; //wowwiki says 50 seconds, bosskillers says 45
+ }else CoilfangElite_Timer -= diff;
+
+ //CoilfangStrider_Timer
+ if(CoilfangStrider_Timer < diff)
+ {
+ Creature *CoilfangStrider;
+ uint32 pos = rand()%3;
+ CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if(CoilfangStrider)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ CoilfangStrider->AI()->AttackStart(target);
+ }
+
+ CoilfangStrider_Timer = 60000+rand()%10000; //wowwiki says 60 seconds, bosskillers says 60-70
+ }else CoilfangStrider_Timer -= diff;
+
+ //Check_Timer
+ if(Check_Timer < diff)
+ {
+ //Start Phase 3
+ if(pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
+ {
+ //set life 50%
+ m_creature->SetHealth(m_creature->GetMaxHealth()/2);
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
+
+ DoPlaySoundToSet(m_creature, SOUND_PHASE3);
+ DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
+
+ Phase = 3;
+
+ //return to the tank
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+ }
+ }
+};
+
+//Enchanted Elemental
+//If one of them reaches Vashj he will increase her damage done by 5%.
+struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
+{
+ mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Check_Timer;
+ uint32 Movement_Timer;
+
+ void Reset()
+ {
+ Check_Timer = 5000;
+ Movement_Timer = 500;
+ }
+
+ void Aggro(Unit *who) { return; }
+
+ void MoveInLineOfSight(Unit *who) { return; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check_Timer
+ if(Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *Vashj = NULL;
+ Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
+ if(Vashj)
+ {
+ if(Vashj->IsWithinDistInMap(m_creature, 5))
+ {
+ //increase lady vashj damage (+5%)
+ const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
+ Vashj->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 5)));
+ Vashj->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 5)));
+ m_creature->UpdateDamagePhysical(BASE_ATTACK);
+
+ //call Unsummon()
+ m_creature->setDeathState(JUST_DIED);
+ }
+ else if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false)
+ {
+ //call Unsummon()
+ m_creature->setDeathState(JUST_DIED);
+ }
+ }
+ }
+ else error_log("ERROR: Instance Data for Serpentshrine Caverns not set");
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+ }
+};
+
+//Tainted Elemental
+//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
+struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI
+{
+ mob_tainted_elementalAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 PoisonBolt_Timer;
+
+ void Reset()
+ {
+ PoisonBolt_Timer = 5000+rand()%5000;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ if(pInstance)
+ {
+ Creature *Vashj = NULL;
+ Vashj = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)));
+
+ if(Vashj)
+ ((boss_lady_vashjAI*)Vashj->AI())->EventTaintedElementalDeath();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //PoisonBolt_Timer
+ if(PoisonBolt_Timer < diff)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(target && target->IsWithinDistInMap(m_creature, 30))
+ DoCast(target, SPELL_POISON_BOLT);
+
+ PoisonBolt_Timer = 5000+rand()%5000;
+ }else PoisonBolt_Timer -= diff;
+ }
+};
+
+//Fathom Sporebat
+//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it.
+struct TRINITY_DLL_DECL mob_fathom_sporebatAI : public ScriptedAI
+{
+ mob_fathom_sporebatAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 ToxicSpore_Timer;
+ uint32 Check_Timer;
+
+ void Reset()
+ {
+ m_creature->setFaction(14);
+ ToxicSpore_Timer = 5000;
+ Check_Timer = 1000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI (const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ToxicSpore_Timer
+ if(ToxicSpore_Timer < diff)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ //The Spores will hit you anywhere in the instance: underwater, at the elevator, at the entrance, wherever.
+ if(target)
+ DoCast(target, SPELL_TOXIC_SPORES);
+
+ ToxicSpore_Timer = 20000+rand()%5000;
+ }else ToxicSpore_Timer -= diff;
+
+ //Check_Timer
+ if(Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ //check if vashj is death
+ Unit *Vashj = NULL;
+ Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
+ if(!Vashj || (Vashj && !Vashj->isAlive()))
+ {
+ //remove
+ m_creature->setDeathState(DEAD);
+ m_creature->RemoveCorpse();
+ m_creature->setFaction(35);
+ }
+ }
+
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Coilfang Elite
+//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage
+CreatureAI* GetAI_mob_coilfang_elite(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 31345; //Cleave
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].CooldownRandomAddition = 5000;
+ ai->Spell[0].First_Cast = 5000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+//Coilfang Strifer
+//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear.
+CreatureAI* GetAI_mob_coilfang_strider(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 41374; //Mind Blast
+ ai->Spell[0].Cooldown = 30000;
+ ai->Spell[0].CooldownRandomAddition = 10000;
+ ai->Spell[0].First_Cast = 8000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ //Scream aura not implemented
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI
+{
+ mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Check_Timer;
+ bool Channeled;
+
+ void Reset()
+ {
+ Check_Timer = 1000;
+ Channeled = false;
+ //invisible
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who) { return; }
+
+ void MoveInLineOfSight(Unit *who) { return; }
+
+ void UpdateAI (const uint32 diff)
+ {
+ if(!pInstance)
+ return;
+
+ if(!Channeled)
+ {
+ Unit *Vashj = NULL;
+ Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
+
+ if(Vashj && Vashj->isAlive())
+ {
+ //start visual channel
+ m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, Vashj->GetGUID());
+ m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_MAGIC_BARRIER);
+ Channeled = true;
+ }
+ }
+ }
+};
+
+bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ ScriptedInstance *pInstance = ((ScriptedInstance*)player->GetInstanceData());
+
+ if(!pInstance)
+ {
+ player->GetSession()->SendNotification("ERROR: Instance script not initialized. Notify your administrator.");
+ error_log("ERROR: Lady Vashj Tainted Core: Instance Script Not Initialized");
+ return true;
+ }
+
+ Creature *Vashj = NULL;
+ Vashj = (Creature*)(Unit::GetUnit((*player), pInstance->GetData64(DATA_LADYVASHJ)));
+ if(Vashj && ((boss_lady_vashjAI*)Vashj->AI())->Phase == 2)
+ {
+ if(targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT)
+ {
+ uint32 identifier;
+ uint8 channel_identifier;
+ switch(targets.getGOTarget()->GetEntry())
+ {
+ case 185052:
+ identifier = DATA_SHIELDGENERATOR1;
+ channel_identifier = 0;
+ break;
+ case 185053:
+ identifier = DATA_SHIELDGENERATOR2;
+ channel_identifier = 1;
+ break;
+ case 185051:
+ identifier = DATA_SHIELDGENERATOR3;
+ channel_identifier = 2;
+ break;
+ case 185054:
+ identifier = DATA_SHIELDGENERATOR4;
+ channel_identifier = 3;
+ break;
+ default:
+ return true;
+ break;
+ }
+
+ if(pInstance->GetData(identifier))
+ {
+ player->GetSession()->SendNotification("Already deactivated");
+ return true;
+ }
+
+ //get and remove channel
+ Unit *Channel = NULL;
+ Channel = Unit::GetUnit((*Vashj), ((boss_lady_vashjAI*)Vashj->AI())->ShieldGeneratorChannel[channel_identifier]);
+ if(Channel)
+ {
+ //call Unsummon()
+ Channel->setDeathState(JUST_DIED);
+ }
+
+ pInstance->SetData(identifier, 1);
+
+ //remove this item
+ player->DestroyItemCount(31088, 1, true);
+ }
+ }
+ return true;
+}
+
+CreatureAI* GetAI_boss_lady_vashj(Creature *_Creature)
+{
+ return new boss_lady_vashjAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_enchanted_elemental(Creature *_Creature)
+{
+ return new mob_enchanted_elementalAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_tainted_elemental(Creature *_Creature)
+{
+ return new mob_tainted_elementalAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_fathom_sporebat(Creature *_Creature)
+{
+ return new mob_fathom_sporebatAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_shield_generator_channel(Creature *_Creature)
+{
+ return new mob_shield_generator_channelAI (_Creature);
+}
+
+void AddSC_boss_lady_vashj()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_lady_vashj";
+ newscript->GetAI = GetAI_boss_lady_vashj;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_enchanted_elemental";
+ newscript->GetAI = GetAI_mob_enchanted_elemental;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_tainted_elemental";
+ newscript->GetAI = GetAI_mob_tainted_elemental;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_fathom_sporebat";
+ newscript->GetAI = GetAI_mob_fathom_sporebat;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_coilfang_elite";
+ newscript->GetAI = GetAI_mob_coilfang_elite;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_coilfang_strider";
+ newscript->GetAI = GetAI_mob_coilfang_strider;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shield_generator_channel";
+ newscript->GetAI = GetAI_mob_shield_generator_channel;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_tainted_core";
+ newscript->pItemUse = ItemUse_item_tainted_core;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
index 1cf56a2ffa6..5f0dc7e1c04 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
@@ -1,338 +1,338 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Leotheras_The_Blind
-SD%Complete: 50
-SDComment: Missing Inner Demons
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-
-#define SPELL_WHIRLWIND 40653
-#define SPELL_CHAOS_BLAST 37675
-//#define SPELL_INSIDIOUS_WHISPER 37676 // useless - dummy effect that can't be implemented
-
-#define SAY_AGGRO "Finally my banishment ends!"
-#define SAY_SWITCH_TO_DEMON "Be gone trifling elf. I'm in control now."
-#define SAY_INNER_DEMONS "We all have our demons..."
-#define SAY_DEMON_SLAY1 "I have no equal."
-#define SAY_DEMON_SLAY2 "Perish, mortal."
-#define SAY_DEMON_SLAY3 "Yes, YES! Ahahah!"
-#define SAY_NIGHTELF_SLAY1 "Kill! KILL!"
-#define SAY_NIGHTELF_SLAY2 "That's right! Yes!"
-#define SAY_NIGHTELF_SLAY3 "Who's the master now?"
-#define SAY_FINAL_FORM "No! NO! What have you done?! I am the master, do you hear me? I... aaghh... Can't... contain him..."
-#define SAY_FREE "At last I am liberated. It has been too long since I have tasted true freedom!"
-#define SAY_DEATH "You cannot kill me! Fools, I'll be back! I'll... aarghh..."
-
-#define SOUND_AGGRO 11312
-#define SOUND_SWITCH_TO_DEMON 11304
-#define SOUND_INNER_DEMONS 11305
-#define SOUND_DEMON_SLAY1 11306
-#define SOUND_DEMON_SLAY2 11307
-#define SOUND_DEMON_SLAY3 11308
-#define SOUND_NIGHTELF_SLAY1 11314
-#define SOUND_NIGHTELF_SLAY2 11315
-#define SOUND_NIGHTELF_SLAY3 11316
-#define SOUND_FINAL_FORM 11313
-#define SOUND_FREE 11309
-#define SOUND_DEATH 11317
-
-#define MODEL_DEMON 14555
-#define MODEL_NIGHTELF 20514
-
-#define DEMON_FORM 21845
-
-//Original Leotheras the Blind AI
-struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
-{
- boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Demon = 0;
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Whirlwind_Timer;
- uint32 ChaosBlast_Timer;
- uint32 Switch_Timer;
-
- bool DemonForm;
- bool IsFinalForm;
-
- uint64 Demon;
-
- void Reset()
- {
- Whirlwind_Timer = 20000;
- ChaosBlast_Timer = 1000;
- Switch_Timer = 45000;
-
- DemonForm = false;
- IsFinalForm = false;
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
-
- if(pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 0);
- }
-
- void StartEvent()
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- if(pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 1);
- }
-
- void KilledUnit(Unit *victim)
- {
- if(victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if(DemonForm)
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_DEMON_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY1);
- break;
- case 1:
- DoYell(SAY_DEMON_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY2);
- break;
- case 2:
- DoYell(SAY_DEMON_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY3);
- break;
- }
- else
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_NIGHTELF_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY1);
- break;
- case 1:
- DoYell(SAY_NIGHTELF_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY2);
- break;
- case 2:
- DoYell(SAY_NIGHTELF_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- //despawn copy
- if(Demon)
- {
- Unit *pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), Demon);
-
- if(pUnit)
- pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- if(pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 0);
- }
-
- void Aggro(Unit *who)
- {
- StartEvent();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(!DemonForm)
- {
- //Whirlwind_Timer
- if(Whirlwind_Timer < diff)
- {
- DoCast(m_creature, SPELL_WHIRLWIND);
- Whirlwind_Timer = 25000;
- }else Whirlwind_Timer -= diff;
-
- //Switch_Timer
- if(!IsFinalForm)
- if(Switch_Timer < diff)
- {
- //switch to demon form
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
- DoYell(SAY_SWITCH_TO_DEMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_DEMON);
- DemonForm = true;
-
- Switch_Timer = 60000;
- }else Switch_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- else
- {
- //ChaosBlast_Timer
- if(ChaosBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST);
- ChaosBlast_Timer = 1500;
- }else ChaosBlast_Timer -= diff;
-
- //Switch_Timer
- if(Switch_Timer < diff)
- {
- //switch to nightelf form
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
- DemonForm = false;
-
- Switch_Timer = 45000;
- }else Switch_Timer -= diff;
- }
-
- if(!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15)
- {
- //at this point he divides himself in two parts
- Creature *Copy = NULL;
- Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
-
- if(Copy)
- {
- Demon = Copy->GetGUID();
- Copy->AI()->AttackStart(m_creature->getVictim());
- }
-
- //set nightelf final form
- IsFinalForm = true;
- DemonForm = false;
-
- DoYell(SAY_FINAL_FORM, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FINAL_FORM);
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
- }
- }
-};
-
-//Leotheras the Blind Demon Form AI
-struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
-{
- boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 ChaosBlast_Timer;
-
- void Reset()
- {
- ChaosBlast_Timer = 1000;
- }
-
- void StartEvent()
- {
- DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FREE);
- }
-
- void KilledUnit(Unit *victim)
- {
- if(victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_DEMON_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY1);
- break;
- case 1:
- DoYell(SAY_DEMON_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY2);
- break;
- case 2:
- DoYell(SAY_DEMON_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears)
- m_creature->CastSpell(m_creature, 8149, true);
- }
-
- void Aggro(Unit *who)
- {
- StartEvent();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ChaosBlast_Timer
- if(ChaosBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST);
- ChaosBlast_Timer = 1500;
- }else ChaosBlast_Timer -= diff;
-
- //Do NOT deal any melee damage to the target.
- }
-};
-
-CreatureAI* GetAI_boss_leotheras_the_blind(Creature *_Creature)
-{
- return new boss_leotheras_the_blindAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature *_Creature)
-{
- return new boss_leotheras_the_blind_demonformAI (_Creature);
-}
-
-void AddSC_boss_leotheras_the_blind()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_leotheras_the_blind";
- newscript->GetAI = GetAI_boss_leotheras_the_blind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_leotheras_the_blind_demonform";
- newscript->GetAI = GetAI_boss_leotheras_the_blind_demonform;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Leotheras_The_Blind
+SD%Complete: 50
+SDComment: Missing Inner Demons
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+
+#define SPELL_WHIRLWIND 40653
+#define SPELL_CHAOS_BLAST 37675
+//#define SPELL_INSIDIOUS_WHISPER 37676 // useless - dummy effect that can't be implemented
+
+#define SAY_AGGRO "Finally my banishment ends!"
+#define SAY_SWITCH_TO_DEMON "Be gone trifling elf. I'm in control now."
+#define SAY_INNER_DEMONS "We all have our demons..."
+#define SAY_DEMON_SLAY1 "I have no equal."
+#define SAY_DEMON_SLAY2 "Perish, mortal."
+#define SAY_DEMON_SLAY3 "Yes, YES! Ahahah!"
+#define SAY_NIGHTELF_SLAY1 "Kill! KILL!"
+#define SAY_NIGHTELF_SLAY2 "That's right! Yes!"
+#define SAY_NIGHTELF_SLAY3 "Who's the master now?"
+#define SAY_FINAL_FORM "No! NO! What have you done?! I am the master, do you hear me? I... aaghh... Can't... contain him..."
+#define SAY_FREE "At last I am liberated. It has been too long since I have tasted true freedom!"
+#define SAY_DEATH "You cannot kill me! Fools, I'll be back! I'll... aarghh..."
+
+#define SOUND_AGGRO 11312
+#define SOUND_SWITCH_TO_DEMON 11304
+#define SOUND_INNER_DEMONS 11305
+#define SOUND_DEMON_SLAY1 11306
+#define SOUND_DEMON_SLAY2 11307
+#define SOUND_DEMON_SLAY3 11308
+#define SOUND_NIGHTELF_SLAY1 11314
+#define SOUND_NIGHTELF_SLAY2 11315
+#define SOUND_NIGHTELF_SLAY3 11316
+#define SOUND_FINAL_FORM 11313
+#define SOUND_FREE 11309
+#define SOUND_DEATH 11317
+
+#define MODEL_DEMON 14555
+#define MODEL_NIGHTELF 20514
+
+#define DEMON_FORM 21845
+
+//Original Leotheras the Blind AI
+struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
+{
+ boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Demon = 0;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Whirlwind_Timer;
+ uint32 ChaosBlast_Timer;
+ uint32 Switch_Timer;
+
+ bool DemonForm;
+ bool IsFinalForm;
+
+ uint64 Demon;
+
+ void Reset()
+ {
+ Whirlwind_Timer = 20000;
+ ChaosBlast_Timer = 1000;
+ Switch_Timer = 45000;
+
+ DemonForm = false;
+ IsFinalForm = false;
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
+
+ if(pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 0);
+ }
+
+ void StartEvent()
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ if(pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 1);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(DemonForm)
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_DEMON_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_DEMON_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_DEMON_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY3);
+ break;
+ }
+ else
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_NIGHTELF_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_NIGHTELF_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_NIGHTELF_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NIGHTELF_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ //despawn copy
+ if(Demon)
+ {
+ Unit *pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), Demon);
+
+ if(pUnit)
+ pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ if(pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ StartEvent();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(!DemonForm)
+ {
+ //Whirlwind_Timer
+ if(Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WHIRLWIND);
+ Whirlwind_Timer = 25000;
+ }else Whirlwind_Timer -= diff;
+
+ //Switch_Timer
+ if(!IsFinalForm)
+ if(Switch_Timer < diff)
+ {
+ //switch to demon form
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
+ DoYell(SAY_SWITCH_TO_DEMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SWITCH_TO_DEMON);
+ DemonForm = true;
+
+ Switch_Timer = 60000;
+ }else Switch_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else
+ {
+ //ChaosBlast_Timer
+ if(ChaosBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST);
+ ChaosBlast_Timer = 1500;
+ }else ChaosBlast_Timer -= diff;
+
+ //Switch_Timer
+ if(Switch_Timer < diff)
+ {
+ //switch to nightelf form
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
+ DemonForm = false;
+
+ Switch_Timer = 45000;
+ }else Switch_Timer -= diff;
+ }
+
+ if(!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15)
+ {
+ //at this point he divides himself in two parts
+ Creature *Copy = NULL;
+ Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+
+ if(Copy)
+ {
+ Demon = Copy->GetGUID();
+ Copy->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ //set nightelf final form
+ IsFinalForm = true;
+ DemonForm = false;
+
+ DoYell(SAY_FINAL_FORM, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FINAL_FORM);
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
+ }
+ }
+};
+
+//Leotheras the Blind Demon Form AI
+struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
+{
+ boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 ChaosBlast_Timer;
+
+ void Reset()
+ {
+ ChaosBlast_Timer = 1000;
+ }
+
+ void StartEvent()
+ {
+ DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FREE);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_DEMON_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_DEMON_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_DEMON_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEMON_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears)
+ m_creature->CastSpell(m_creature, 8149, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ StartEvent();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ChaosBlast_Timer
+ if(ChaosBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST);
+ ChaosBlast_Timer = 1500;
+ }else ChaosBlast_Timer -= diff;
+
+ //Do NOT deal any melee damage to the target.
+ }
+};
+
+CreatureAI* GetAI_boss_leotheras_the_blind(Creature *_Creature)
+{
+ return new boss_leotheras_the_blindAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature *_Creature)
+{
+ return new boss_leotheras_the_blind_demonformAI (_Creature);
+}
+
+void AddSC_boss_leotheras_the_blind()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_leotheras_the_blind";
+ newscript->GetAI = GetAI_boss_leotheras_the_blind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_leotheras_the_blind_demonform";
+ newscript->GetAI = GetAI_boss_leotheras_the_blind_demonform;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
index 8eca61a0089..c2cea88c744 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
@@ -1,406 +1,406 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Morogrim_Tidewalker
-SD%Complete: 90
-SDComment: Water globules don't explode properly
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-
-#define SPELL_TIDAL_WAVE 37730
-#define SPELL_WATERY_GRAVE 38049
-#define SPELL_EARTHQUAKE 37764
-#define SPELL_WATERY_GRAVE_EXPLOSION 37852
-
-#define SAY_AGGRO "Flood of the deep, take you!"
-#define SAY_SUMMON1 "By the Tides, kill them at once!"
-#define SAY_SUMMON2 "Destroy them my subjects!"
-#define SAY_SLAY1 "It is done!"
-#define SAY_SLAY2 "Strugging only makes it worse."
-#define SAY_SLAY3 "Only the strong survive."
-#define SAY_SUMMON_BUBL1 "There is nowhere to hide!"
-#define SAY_SUMMON_BUBL2 "Soon it will be finished!"
-#define SAY_DEATH "Great... currents of... Ageon."
-
-#define SOUND_AGGRO 11321
-#define SOUND_SUMMON1 11322
-#define SOUND_SUMMON2 11323
-#define SOUND_SLAY1 11326
-#define SOUND_SLAY2 11327
-#define SOUND_SLAY3 11328
-#define SOUND_SUMMON_BUBL1 11324
-#define SOUND_SUMMON_BUBL2 11325
-#define SOUND_DEATH 11329
-
-#define WATERY_GRAVE_X1 334.64
-#define WATERY_GRAVE_Y1 -728.89
-#define WATERY_GRAVE_Z1 -14.42
-#define WATERY_GRAVE_X2 365.51
-#define WATERY_GRAVE_Y2 -737.14
-#define WATERY_GRAVE_Z2 -14.44
-#define WATERY_GRAVE_X3 366.19
-#define WATERY_GRAVE_Y3 -709.59
-#define WATERY_GRAVE_Z3 -14.36
-#define WATERY_GRAVE_X4 372.93
-#define WATERY_GRAVE_Y4 -690.96
-#define WATERY_GRAVE_Z4 -14.44
-
-#define EMOTE_WATERY_GRAVE "sends his enemies to their watery graves!"
-#define EMOTE_EARTHQUAKE "The violent earthquake has alerted nearby murlocs!"
-#define EMOTE_WATERY_GLOBULES "summons Watery Globules!"
-
-#define WATER_GLOBULE 21913
-#define TIDEWALKER_LURKER 21920
-
-//Morogrim Tidewalker AI
-struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
-{
- boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 TidalWave_Timer;
- uint32 WateryGrave_Timer;
- uint32 Earthquake_Timer;
- uint32 WateryGlobules_Timer;
-
- bool Earthquake;
- bool Phase2;
-
- void Reset()
- {
- TidalWave_Timer = 10000;
- WateryGrave_Timer = 30000;
- Earthquake_Timer = 40000;
- WateryGlobules_Timer = 0;
-
- Earthquake = false;
- Phase2 = false;
-
- if(pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
- }
-
- void StartEvent()
- {
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
-
- if(pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- break;
-
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- break;
-
- case 2:
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
-
- if(pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
- }
-
- void Aggro(Unit *who) { StartEvent(); }
-
- void ApplyWateryGrave(Unit *player, uint8 pos)
- {
- float x, y, z;
-
- switch(pos)
- {
- case 0:
- x = WATERY_GRAVE_X1;
- y = WATERY_GRAVE_Y1;
- z = WATERY_GRAVE_Z1;
- break;
-
- case 1:
- x = WATERY_GRAVE_X2;
- y = WATERY_GRAVE_Y2;
- z = WATERY_GRAVE_Z2;
- break;
-
- case 2:
- x = WATERY_GRAVE_X3;
- y = WATERY_GRAVE_Y3;
- z = WATERY_GRAVE_Z3;
- break;
-
- case 3:
- x = WATERY_GRAVE_X4;
- y = WATERY_GRAVE_Y4;
- z = WATERY_GRAVE_Z4;
- break;
- }
-
- DoTeleportPlayer(player, x, y, z+1, player->GetOrientation());
- DoCast(player, SPELL_WATERY_GRAVE);
- }
-
- void SummonMurloc(float x, float y, float z)
- {
- Creature *Summoned;
-
- Summoned = m_creature->SummonCreature(TIDEWALKER_LURKER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(Summoned)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Summoned->AI()->AttackStart(target);
- }
- }
-
- void SummonWaterGlobule(float x, float y, float z)
- {
- Creature *Globule;
-
- Globule = m_creature->SummonCreature(WATER_GLOBULE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); //they despawn after 30 seconds
- if(Globule)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Globule->AI()->AttackStart(target);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Earthquake_Timer
- if(Earthquake_Timer < diff)
- {
- if(!Earthquake)
- {
- DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
- Earthquake = true;
- Earthquake_Timer = 10000;
- }
- else
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
- DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
- break;
-
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
- DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- break;
- }
-
- //north
- SummonMurloc(486.10, -723.64, -7.14);
- SummonMurloc(482.58, -723.78, -7.14);
- SummonMurloc(479.38, -723.91, -7.14);
- SummonMurloc(476.03, -723.86, -7.14);
- SummonMurloc(472.69, -723.69, -7.14);
- SummonMurloc(469.04, -723.63, -7.14);
-
- //south
- SummonMurloc(311.63, -725.04, -13.15);
- SummonMurloc(307.81, -725.34, -13.15);
- SummonMurloc(303.91, -725.64, -13.06);
- SummonMurloc(300.23, -726, -11.89);
- SummonMurloc(296.82, -726.33, -10.82);
- SummonMurloc(293.64, -726.64, -9.81);
-
- DoTextEmote(EMOTE_EARTHQUAKE, NULL);
-
- Earthquake = false;
- Earthquake_Timer = 40000+rand()%5000;
- }
- }else Earthquake_Timer -= diff;
-
- //TidalWave_Timer
- if(TidalWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE);
- TidalWave_Timer = 20000;
- }else TidalWave_Timer -= diff;
-
- if(!Phase2)
- {
- //WateryGrave_Timer
- if(WateryGrave_Timer < diff)
- {
- //Teleport 4 players under the waterfalls
- Unit *target;
- for(uint8 i = 0; i < 4; i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && (target->GetTypeId() == TYPEID_PLAYER) && !target->HasAura(SPELL_WATERY_GRAVE, 0) && target->IsWithinDistInMap(m_creature, 50))
- ApplyWateryGrave(target, i);
- }
-
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SUMMON_BUBL1);
- DoYell(SAY_SUMMON_BUBL1, LANG_UNIVERSAL, NULL);
- break;
-
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SUMMON_BUBL2);
- DoYell(SAY_SUMMON_BUBL2, LANG_UNIVERSAL, NULL);
- break;
-
- case 2:
- break;
- }
-
- DoTextEmote(EMOTE_WATERY_GRAVE, NULL);
-
- WateryGrave_Timer = 30000;
- }else WateryGrave_Timer -= diff;
-
- //Start Phase2
- if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
- Phase2 = true;
- }
- else
- {
- //WateryGlobules_Timer
- if(WateryGlobules_Timer < diff)
- {
- SummonWaterGlobule(WATERY_GRAVE_X1, WATERY_GRAVE_Y1, WATERY_GRAVE_Z1);
- SummonWaterGlobule(WATERY_GRAVE_X2, WATERY_GRAVE_Y2, WATERY_GRAVE_Z2);
- SummonWaterGlobule(WATERY_GRAVE_X3, WATERY_GRAVE_Y3, WATERY_GRAVE_Z3);
- SummonWaterGlobule(WATERY_GRAVE_X4, WATERY_GRAVE_Y4, WATERY_GRAVE_Z4);
-
- DoTextEmote(EMOTE_WATERY_GLOBULES, NULL);
-
- WateryGlobules_Timer = 25000;
- }else WateryGlobules_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Water Globule AI
-struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI
-{
- mob_water_globuleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Check_Timer;
-
- void Reset()
- {
- Check_Timer = 1000;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- //no attack radius check - it attacks the first target that moves in his los
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(Check_Timer < diff)
- {
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
- {
- uint32 damage = 4000+rand()%2000;
- m_creature->DealDamage(m_creature->getVictim(), damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FROST, NULL, false);
-
- //despawn
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- Check_Timer = 500;
- }else Check_Timer -= diff;
-
- //do NOT deal any melee damage to the target.
- }
-};
-
-CreatureAI* GetAI_boss_morogrim_tidewalker(Creature *_Creature)
-{
- return new boss_morogrim_tidewalkerAI (_Creature);
-}
-CreatureAI* GetAI_mob_water_globule(Creature *_Creature)
-{
- return new mob_water_globuleAI (_Creature);
-}
-
-void AddSC_boss_morogrim_tidewalker()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_morogrim_tidewalker";
- newscript->GetAI = GetAI_boss_morogrim_tidewalker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_water_globule";
- newscript->GetAI = GetAI_mob_water_globule;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Morogrim_Tidewalker
+SD%Complete: 90
+SDComment: Water globules don't explode properly
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+
+#define SPELL_TIDAL_WAVE 37730
+#define SPELL_WATERY_GRAVE 38049
+#define SPELL_EARTHQUAKE 37764
+#define SPELL_WATERY_GRAVE_EXPLOSION 37852
+
+#define SAY_AGGRO "Flood of the deep, take you!"
+#define SAY_SUMMON1 "By the Tides, kill them at once!"
+#define SAY_SUMMON2 "Destroy them my subjects!"
+#define SAY_SLAY1 "It is done!"
+#define SAY_SLAY2 "Strugging only makes it worse."
+#define SAY_SLAY3 "Only the strong survive."
+#define SAY_SUMMON_BUBL1 "There is nowhere to hide!"
+#define SAY_SUMMON_BUBL2 "Soon it will be finished!"
+#define SAY_DEATH "Great... currents of... Ageon."
+
+#define SOUND_AGGRO 11321
+#define SOUND_SUMMON1 11322
+#define SOUND_SUMMON2 11323
+#define SOUND_SLAY1 11326
+#define SOUND_SLAY2 11327
+#define SOUND_SLAY3 11328
+#define SOUND_SUMMON_BUBL1 11324
+#define SOUND_SUMMON_BUBL2 11325
+#define SOUND_DEATH 11329
+
+#define WATERY_GRAVE_X1 334.64
+#define WATERY_GRAVE_Y1 -728.89
+#define WATERY_GRAVE_Z1 -14.42
+#define WATERY_GRAVE_X2 365.51
+#define WATERY_GRAVE_Y2 -737.14
+#define WATERY_GRAVE_Z2 -14.44
+#define WATERY_GRAVE_X3 366.19
+#define WATERY_GRAVE_Y3 -709.59
+#define WATERY_GRAVE_Z3 -14.36
+#define WATERY_GRAVE_X4 372.93
+#define WATERY_GRAVE_Y4 -690.96
+#define WATERY_GRAVE_Z4 -14.44
+
+#define EMOTE_WATERY_GRAVE "sends his enemies to their watery graves!"
+#define EMOTE_EARTHQUAKE "The violent earthquake has alerted nearby murlocs!"
+#define EMOTE_WATERY_GLOBULES "summons Watery Globules!"
+
+#define WATER_GLOBULE 21913
+#define TIDEWALKER_LURKER 21920
+
+//Morogrim Tidewalker AI
+struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
+{
+ boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 TidalWave_Timer;
+ uint32 WateryGrave_Timer;
+ uint32 Earthquake_Timer;
+ uint32 WateryGlobules_Timer;
+
+ bool Earthquake;
+ bool Phase2;
+
+ void Reset()
+ {
+ TidalWave_Timer = 10000;
+ WateryGrave_Timer = 30000;
+ Earthquake_Timer = 40000;
+ WateryGlobules_Timer = 0;
+
+ Earthquake = false;
+ Phase2 = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
+ }
+
+ void StartEvent()
+ {
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ break;
+
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ break;
+
+ case 2:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who) { StartEvent(); }
+
+ void ApplyWateryGrave(Unit *player, uint8 pos)
+ {
+ float x, y, z;
+
+ switch(pos)
+ {
+ case 0:
+ x = WATERY_GRAVE_X1;
+ y = WATERY_GRAVE_Y1;
+ z = WATERY_GRAVE_Z1;
+ break;
+
+ case 1:
+ x = WATERY_GRAVE_X2;
+ y = WATERY_GRAVE_Y2;
+ z = WATERY_GRAVE_Z2;
+ break;
+
+ case 2:
+ x = WATERY_GRAVE_X3;
+ y = WATERY_GRAVE_Y3;
+ z = WATERY_GRAVE_Z3;
+ break;
+
+ case 3:
+ x = WATERY_GRAVE_X4;
+ y = WATERY_GRAVE_Y4;
+ z = WATERY_GRAVE_Z4;
+ break;
+ }
+
+ DoTeleportPlayer(player, x, y, z+1, player->GetOrientation());
+ DoCast(player, SPELL_WATERY_GRAVE);
+ }
+
+ void SummonMurloc(float x, float y, float z)
+ {
+ Creature *Summoned;
+
+ Summoned = m_creature->SummonCreature(TIDEWALKER_LURKER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if(Summoned)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Summoned->AI()->AttackStart(target);
+ }
+ }
+
+ void SummonWaterGlobule(float x, float y, float z)
+ {
+ Creature *Globule;
+
+ Globule = m_creature->SummonCreature(WATER_GLOBULE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); //they despawn after 30 seconds
+ if(Globule)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Globule->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Earthquake_Timer
+ if(Earthquake_Timer < diff)
+ {
+ if(!Earthquake)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
+ Earthquake = true;
+ Earthquake_Timer = 10000;
+ }
+ else
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
+ DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
+ break;
+
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
+ DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ break;
+ }
+
+ //north
+ SummonMurloc(486.10, -723.64, -7.14);
+ SummonMurloc(482.58, -723.78, -7.14);
+ SummonMurloc(479.38, -723.91, -7.14);
+ SummonMurloc(476.03, -723.86, -7.14);
+ SummonMurloc(472.69, -723.69, -7.14);
+ SummonMurloc(469.04, -723.63, -7.14);
+
+ //south
+ SummonMurloc(311.63, -725.04, -13.15);
+ SummonMurloc(307.81, -725.34, -13.15);
+ SummonMurloc(303.91, -725.64, -13.06);
+ SummonMurloc(300.23, -726, -11.89);
+ SummonMurloc(296.82, -726.33, -10.82);
+ SummonMurloc(293.64, -726.64, -9.81);
+
+ DoTextEmote(EMOTE_EARTHQUAKE, NULL);
+
+ Earthquake = false;
+ Earthquake_Timer = 40000+rand()%5000;
+ }
+ }else Earthquake_Timer -= diff;
+
+ //TidalWave_Timer
+ if(TidalWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE);
+ TidalWave_Timer = 20000;
+ }else TidalWave_Timer -= diff;
+
+ if(!Phase2)
+ {
+ //WateryGrave_Timer
+ if(WateryGrave_Timer < diff)
+ {
+ //Teleport 4 players under the waterfalls
+ Unit *target;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && (target->GetTypeId() == TYPEID_PLAYER) && !target->HasAura(SPELL_WATERY_GRAVE, 0) && target->IsWithinDistInMap(m_creature, 50))
+ ApplyWateryGrave(target, i);
+ }
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON_BUBL1);
+ DoYell(SAY_SUMMON_BUBL1, LANG_UNIVERSAL, NULL);
+ break;
+
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON_BUBL2);
+ DoYell(SAY_SUMMON_BUBL2, LANG_UNIVERSAL, NULL);
+ break;
+
+ case 2:
+ break;
+ }
+
+ DoTextEmote(EMOTE_WATERY_GRAVE, NULL);
+
+ WateryGrave_Timer = 30000;
+ }else WateryGrave_Timer -= diff;
+
+ //Start Phase2
+ if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
+ Phase2 = true;
+ }
+ else
+ {
+ //WateryGlobules_Timer
+ if(WateryGlobules_Timer < diff)
+ {
+ SummonWaterGlobule(WATERY_GRAVE_X1, WATERY_GRAVE_Y1, WATERY_GRAVE_Z1);
+ SummonWaterGlobule(WATERY_GRAVE_X2, WATERY_GRAVE_Y2, WATERY_GRAVE_Z2);
+ SummonWaterGlobule(WATERY_GRAVE_X3, WATERY_GRAVE_Y3, WATERY_GRAVE_Z3);
+ SummonWaterGlobule(WATERY_GRAVE_X4, WATERY_GRAVE_Y4, WATERY_GRAVE_Z4);
+
+ DoTextEmote(EMOTE_WATERY_GLOBULES, NULL);
+
+ WateryGlobules_Timer = 25000;
+ }else WateryGlobules_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Water Globule AI
+struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI
+{
+ mob_water_globuleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Check_Timer;
+
+ void Reset()
+ {
+ Check_Timer = 1000;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(14);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ //no attack radius check - it attacks the first target that moves in his los
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(Check_Timer < diff)
+ {
+ if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
+ {
+ uint32 damage = 4000+rand()%2000;
+ m_creature->DealDamage(m_creature->getVictim(), damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FROST, NULL, false);
+
+ //despawn
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ Check_Timer = 500;
+ }else Check_Timer -= diff;
+
+ //do NOT deal any melee damage to the target.
+ }
+};
+
+CreatureAI* GetAI_boss_morogrim_tidewalker(Creature *_Creature)
+{
+ return new boss_morogrim_tidewalkerAI (_Creature);
+}
+CreatureAI* GetAI_mob_water_globule(Creature *_Creature)
+{
+ return new mob_water_globuleAI (_Creature);
+}
+
+void AddSC_boss_morogrim_tidewalker()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_morogrim_tidewalker";
+ newscript->GetAI = GetAI_boss_morogrim_tidewalker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_water_globule";
+ newscript->GetAI = GetAI_mob_water_globule;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
index 52b8a88ebc3..21d76d6854a 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
@@ -1,26 +1,26 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SERPENT_SHRINE_H
-#define DEF_SERPENT_SHRINE_H
-
-#define DATA_CANSTARTPHASE3 1
-#define DATA_CARIBDIS 2
-#define DATA_HYDROSSTHEUNSTABLEEVENT 3
-#define DATA_KARATHRESS 4
-#define DATA_KARATHRESSEVENT 5
-#define DATA_KARATHRESSEVENT_STARTER 6
-#define DATA_LADYVASHJ 7
-#define DATA_LADYVASHJEVENT 8
-#define DATA_LEOTHERASTHEBLINDEVENT 9
-#define DATA_MOROGRIMTIDEWALKEREVENT 10
-#define DATA_SHARKKIS 11
-#define DATA_SHIELDGENERATOR1 12
-#define DATA_SHIELDGENERATOR2 13
-#define DATA_SHIELDGENERATOR3 14
-#define DATA_SHIELDGENERATOR4 15
-#define DATA_THELURKERBELOWEVENT 16
-#define DATA_TIDALVESS 17
-#define DATA_FATHOMLORDKARATHRESSEVENT 18
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SERPENT_SHRINE_H
+#define DEF_SERPENT_SHRINE_H
+
+#define DATA_CANSTARTPHASE3 1
+#define DATA_CARIBDIS 2
+#define DATA_HYDROSSTHEUNSTABLEEVENT 3
+#define DATA_KARATHRESS 4
+#define DATA_KARATHRESSEVENT 5
+#define DATA_KARATHRESSEVENT_STARTER 6
+#define DATA_LADYVASHJ 7
+#define DATA_LADYVASHJEVENT 8
+#define DATA_LEOTHERASTHEBLINDEVENT 9
+#define DATA_MOROGRIMTIDEWALKEREVENT 10
+#define DATA_SHARKKIS 11
+#define DATA_SHIELDGENERATOR1 12
+#define DATA_SHIELDGENERATOR2 13
+#define DATA_SHIELDGENERATOR3 14
+#define DATA_SHIELDGENERATOR4 15
+#define DATA_THELURKERBELOWEVENT 16
+#define DATA_TIDALVESS 17
+#define DATA_FATHOMLORDKARATHRESSEVENT 18
+#endif
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
index d15398eb00e..cc4992a000a 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
@@ -1,227 +1,227 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Serpent_Shrine
-SD%Complete: 0
-SDComment: VERIFY SCRIPT
-SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-
-#define ENCOUNTERS 6
-
-/* Serpentshrine cavern encounters:
-0 - Hydross The Unstable event
-1 - Leotheras The Blind Event
-2 - The Lurker Below Event
-3 - Fathom-Lord Karathress Event
-4 - Morogrim Tidewalker Event
-5 - Lady Vashj Event
-*/
-
-struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
-{
- instance_serpentshrine_cavern(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 Sharkkis;
- uint64 Tidalvess;
- uint64 Caribdis;
- uint64 LadyVashj;
- uint64 Karathress;
- uint64 KarathressEvent_Starter;
-
- bool ShieldGeneratorDeactivated[4];
-
- bool Encounters[ENCOUNTERS];
-
- void Initialize()
- {
- Sharkkis = 0;
- Tidalvess = 0;
- Caribdis = 0;
- LadyVashj = 0;
- Karathress = 0;
- KarathressEvent_Starter = 0;
-
- ShieldGeneratorDeactivated[0] = false;
- ShieldGeneratorDeactivated[1] = false;
- ShieldGeneratorDeactivated[2] = false;
- ShieldGeneratorDeactivated[3] = false;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i]) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 21212: LadyVashj = creature->GetGUID(); break;
- case 21214: Karathress = creature->GetGUID(); break;
- case 21966: Sharkkis = creature->GetGUID(); break;
- case 21965: Tidalvess = creature->GetGUID(); break;
- case 21964: Caribdis = creature->GetGUID(); break;
- }
- }
-
- void SetData64(uint32 type, uint64 data)
- {
- if(type == DATA_KARATHRESSEVENT_STARTER)
- KarathressEvent_Starter = data;
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_SHARKKIS:
- return Sharkkis;
- case DATA_TIDALVESS:
- return Tidalvess;
- case DATA_CARIBDIS:
- return Caribdis;
- case DATA_LADYVASHJ:
- return LadyVashj;
- case DATA_KARATHRESS:
- return Karathress;
- case DATA_KARATHRESSEVENT_STARTER:
- return KarathressEvent_Starter;
- }
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_HYDROSSTHEUNSTABLEEVENT:
- Encounters[0] = (data) ? true : false;
- break;
-
- case DATA_LEOTHERASTHEBLINDEVENT:
- Encounters[1] = (data) ? true : false;
- break;
-
- case DATA_THELURKERBELOWEVENT:
- Encounters[2] = (data) ? true : false;
- break;
-
- case DATA_KARATHRESSEVENT:
- Encounters[3] = (data) ? true : false;
- break;
-
- case DATA_MOROGRIMTIDEWALKEREVENT:
- Encounters[4] = (data) ? true : false;
- break;
- //Lady Vashj
- case DATA_LADYVASHJEVENT:
- if(data == 0)
- {
- ShieldGeneratorDeactivated[0] = false;
- ShieldGeneratorDeactivated[1] = false;
- ShieldGeneratorDeactivated[2] = false;
- ShieldGeneratorDeactivated[3] = false;
- }
- Encounters[5] = (data) ? true : false;
- break;
-
- case DATA_SHIELDGENERATOR1:
- ShieldGeneratorDeactivated[0] = (data) ? true : false;
- break;
-
- case DATA_SHIELDGENERATOR2:
- ShieldGeneratorDeactivated[1] = (data) ? true : false;
- break;
-
- case DATA_SHIELDGENERATOR3:
- ShieldGeneratorDeactivated[2] = (data) ? true : false;
- break;
-
- case DATA_SHIELDGENERATOR4:
- ShieldGeneratorDeactivated[3] = (data) ? true : false;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_HYDROSSTHEUNSTABLEEVENT:
- return Encounters[0];
-
- case DATA_LEOTHERASTHEBLINDEVENT:
- return Encounters[1];
-
- case DATA_THELURKERBELOWEVENT:
- return Encounters[2];
-
- case DATA_KARATHRESSEVENT:
- return Encounters[3];
-
- case DATA_MOROGRIMTIDEWALKEREVENT:
- return Encounters[4];
-
- //Lady Vashj
- case DATA_LADYVASHJEVENT:
- return Encounters[5];
-
- case DATA_SHIELDGENERATOR1:
- return ShieldGeneratorDeactivated[0];
-
- case DATA_SHIELDGENERATOR2:
- return ShieldGeneratorDeactivated[1];
-
- case DATA_SHIELDGENERATOR3:
- return ShieldGeneratorDeactivated[2];
-
- case DATA_SHIELDGENERATOR4:
- return ShieldGeneratorDeactivated[3];
-
- case DATA_CANSTARTPHASE3:
- if(ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])
- return 1;
- break;
- }
-
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* map)
-{
- return new instance_serpentshrine_cavern(map);
-}
-
-void AddSC_instance_serpentshrine_cavern()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_serpent_shrine";
- newscript->GetInstanceData = GetInstanceData_instance_serpentshrine_cavern;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Serpent_Shrine
+SD%Complete: 0
+SDComment: VERIFY SCRIPT
+SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_serpent_shrine.h"
+
+#define ENCOUNTERS 6
+
+/* Serpentshrine cavern encounters:
+0 - Hydross The Unstable event
+1 - Leotheras The Blind Event
+2 - The Lurker Below Event
+3 - Fathom-Lord Karathress Event
+4 - Morogrim Tidewalker Event
+5 - Lady Vashj Event
+*/
+
+struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
+{
+ instance_serpentshrine_cavern(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Sharkkis;
+ uint64 Tidalvess;
+ uint64 Caribdis;
+ uint64 LadyVashj;
+ uint64 Karathress;
+ uint64 KarathressEvent_Starter;
+
+ bool ShieldGeneratorDeactivated[4];
+
+ bool Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ Sharkkis = 0;
+ Tidalvess = 0;
+ Caribdis = 0;
+ LadyVashj = 0;
+ Karathress = 0;
+ KarathressEvent_Starter = 0;
+
+ ShieldGeneratorDeactivated[0] = false;
+ ShieldGeneratorDeactivated[1] = false;
+ ShieldGeneratorDeactivated[2] = false;
+ ShieldGeneratorDeactivated[3] = false;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i]) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 21212: LadyVashj = creature->GetGUID(); break;
+ case 21214: Karathress = creature->GetGUID(); break;
+ case 21966: Sharkkis = creature->GetGUID(); break;
+ case 21965: Tidalvess = creature->GetGUID(); break;
+ case 21964: Caribdis = creature->GetGUID(); break;
+ }
+ }
+
+ void SetData64(uint32 type, uint64 data)
+ {
+ if(type == DATA_KARATHRESSEVENT_STARTER)
+ KarathressEvent_Starter = data;
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_SHARKKIS:
+ return Sharkkis;
+ case DATA_TIDALVESS:
+ return Tidalvess;
+ case DATA_CARIBDIS:
+ return Caribdis;
+ case DATA_LADYVASHJ:
+ return LadyVashj;
+ case DATA_KARATHRESS:
+ return Karathress;
+ case DATA_KARATHRESSEVENT_STARTER:
+ return KarathressEvent_Starter;
+ }
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_HYDROSSTHEUNSTABLEEVENT:
+ Encounters[0] = (data) ? true : false;
+ break;
+
+ case DATA_LEOTHERASTHEBLINDEVENT:
+ Encounters[1] = (data) ? true : false;
+ break;
+
+ case DATA_THELURKERBELOWEVENT:
+ Encounters[2] = (data) ? true : false;
+ break;
+
+ case DATA_KARATHRESSEVENT:
+ Encounters[3] = (data) ? true : false;
+ break;
+
+ case DATA_MOROGRIMTIDEWALKEREVENT:
+ Encounters[4] = (data) ? true : false;
+ break;
+ //Lady Vashj
+ case DATA_LADYVASHJEVENT:
+ if(data == 0)
+ {
+ ShieldGeneratorDeactivated[0] = false;
+ ShieldGeneratorDeactivated[1] = false;
+ ShieldGeneratorDeactivated[2] = false;
+ ShieldGeneratorDeactivated[3] = false;
+ }
+ Encounters[5] = (data) ? true : false;
+ break;
+
+ case DATA_SHIELDGENERATOR1:
+ ShieldGeneratorDeactivated[0] = (data) ? true : false;
+ break;
+
+ case DATA_SHIELDGENERATOR2:
+ ShieldGeneratorDeactivated[1] = (data) ? true : false;
+ break;
+
+ case DATA_SHIELDGENERATOR3:
+ ShieldGeneratorDeactivated[2] = (data) ? true : false;
+ break;
+
+ case DATA_SHIELDGENERATOR4:
+ ShieldGeneratorDeactivated[3] = (data) ? true : false;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_HYDROSSTHEUNSTABLEEVENT:
+ return Encounters[0];
+
+ case DATA_LEOTHERASTHEBLINDEVENT:
+ return Encounters[1];
+
+ case DATA_THELURKERBELOWEVENT:
+ return Encounters[2];
+
+ case DATA_KARATHRESSEVENT:
+ return Encounters[3];
+
+ case DATA_MOROGRIMTIDEWALKEREVENT:
+ return Encounters[4];
+
+ //Lady Vashj
+ case DATA_LADYVASHJEVENT:
+ return Encounters[5];
+
+ case DATA_SHIELDGENERATOR1:
+ return ShieldGeneratorDeactivated[0];
+
+ case DATA_SHIELDGENERATOR2:
+ return ShieldGeneratorDeactivated[1];
+
+ case DATA_SHIELDGENERATOR3:
+ return ShieldGeneratorDeactivated[2];
+
+ case DATA_SHIELDGENERATOR4:
+ return ShieldGeneratorDeactivated[3];
+
+ case DATA_CANSTARTPHASE3:
+ if(ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])
+ return 1;
+ break;
+ }
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* map)
+{
+ return new instance_serpentshrine_cavern(map);
+}
+
+void AddSC_instance_serpentshrine_cavern()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_serpent_shrine";
+ newscript->GetInstanceData = GetInstanceData_instance_serpentshrine_cavern;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp
index e43bd6f7492..5c8ee98efa7 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp
@@ -1,65 +1,65 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Rokmar
-SD%Complete: 100
-SDComment:
-SDCategory: Coilfang Resevoir, Slave Pens
-EndScriptData */
-
-#include "../../../creature/simple_ai.h"
-
-#define SPELL_WATTER_SPIT 40086
-#define SPELL_GRIEVOUS_WOUND 31956
-#define SPELL_ENSARING_MOSS 31948
-
-CreatureAI* GetAI_boss_rokmar_the_crackler(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- //Watter Spit
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_WATTER_SPIT;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 15000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Grievous Wound
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = SPELL_GRIEVOUS_WOUND;
- ai->Spell[1].Cooldown = 25000;
- ai->Spell[1].First_Cast = 15000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Ensaring Moss
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = SPELL_ENSARING_MOSS;
- ai->Spell[2].Cooldown = 15000 + (rand()%10000);
- ai->Spell[2].First_Cast = 25000;
- ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- return ai;
-}
-
-void AddSC_boss_rokmar_the_crackler()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_rokmar_the_crackler";
- newscript->GetAI = GetAI_boss_rokmar_the_crackler;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Rokmar
+SD%Complete: 100
+SDComment:
+SDCategory: Coilfang Resevoir, Slave Pens
+EndScriptData */
+
+#include "../../../creature/simple_ai.h"
+
+#define SPELL_WATTER_SPIT 40086
+#define SPELL_GRIEVOUS_WOUND 31956
+#define SPELL_ENSARING_MOSS 31948
+
+CreatureAI* GetAI_boss_rokmar_the_crackler(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ //Watter Spit
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = SPELL_WATTER_SPIT;
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].First_Cast = 15000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ //Grievous Wound
+ ai->Spell[1].Enabled = true;
+ ai->Spell[1].Spell_Id = SPELL_GRIEVOUS_WOUND;
+ ai->Spell[1].Cooldown = 25000;
+ ai->Spell[1].First_Cast = 15000;
+ ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ //Ensaring Moss
+ ai->Spell[2].Enabled = true;
+ ai->Spell[2].Spell_Id = SPELL_ENSARING_MOSS;
+ ai->Spell[2].Cooldown = 15000 + (rand()%10000);
+ ai->Spell[2].First_Cast = 25000;
+ ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ return ai;
+}
+
+void AddSC_boss_rokmar_the_crackler()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_rokmar_the_crackler";
+ newscript->GetAI = GetAI_boss_rokmar_the_crackler;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
index 736c2ccc312..8a7c75c00bb 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
@@ -1,223 +1,223 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Hydromancer_Thespia
-SD%Complete: 80
-SDComment: Normal/heroic mode: to be tested. Needs additional adjustments (when instance script is adjusted)
-SDCategory: Coilfang Resevoir, The Steamvault
-EndScriptData */
-
-/* ContentData
-boss_hydromancer_thespia
-mob_coilfang_waterelemental
-EndContentData */
-
-#include "precompiled.h"
-#include "def_steam_vault.h"
-
-#define SAY_SUMMON "Surge forth my pets!"
-#define SOUND_SUMMON 10360
-
-#define SAY_AGGRO_1 "The depths will consume you!"
-#define SOUND_AGGRO_1 10361
-#define SAY_AGGRO_2 "Meet your doom, surface dwellers!"
-#define SOUND_AGGRO_2 10362
-#define SAY_AGGRO_3 "You will drown in blood!"
-#define SOUND_AGGRO_3 10363
-
-#define SAY_SLAY_1 "To the depths of oblivion with you!"
-#define SOUND_SLAY_1 10364
-#define SAY_SLAY_2 "For my lady and master!"
-#define SOUND_SLAY_2 10365
-
-#define SAY_DEAD "Our matron will be.. the end of.. you.."
-#define SOUND_DEAD 10366
-
-#define SPELL_LIGHTNING_CLOUD 25033
-#define SPELL_LUNG_BURST 31481
-#define SPELL_ENVELOPING_WINDS 31718
-
-struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI
-{
- boss_thespiaAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool HeroicMode;
-
- uint32 LightningCloud_Timer;
- uint32 LungBurst_Timer;
- uint32 EnvelopingWinds_Timer;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- LightningCloud_Timer = 28000;
- LungBurst_Timer = 7000;
- EnvelopingWinds_Timer = 9000;
-
- if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEAD);
-
- if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
-
- if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //LightningCloud_Timer
- if( LightningCloud_Timer < diff )
- {
- //cast twice in Heroic mode
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target, SPELL_LIGHTNING_CLOUD);
- if( HeroicMode )
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target, SPELL_LIGHTNING_CLOUD);
- LightningCloud_Timer = 28000;
- }else LightningCloud_Timer -=diff;
-
- //LungBurst_Timer
- if( LungBurst_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target, SPELL_LUNG_BURST);
- LungBurst_Timer = 10000+rand()%5000;
- }else LungBurst_Timer -=diff;
-
- //EnvelopingWinds_Timer
- if( EnvelopingWinds_Timer < diff )
- {
- //cast twice in Heroic mode
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target, SPELL_ENVELOPING_WINDS);
- if( HeroicMode )
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target, SPELL_ENVELOPING_WINDS);
- EnvelopingWinds_Timer = 10000+rand()%5000;
- }else EnvelopingWinds_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_WATER_BOLT_VOLLEY 34449
-#define H_SPELL_WATER_BOLT_VOLLEY 37924
-
-struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI
-{
- mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool HeroicMode;
- uint32 WaterBoltVolley_Timer;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- WaterBoltVolley_Timer = 3000+rand()%3000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( WaterBoltVolley_Timer < diff )
- {
- if( HeroicMode ) DoCast(m_creature,H_SPELL_WATER_BOLT_VOLLEY);
- else DoCast(m_creature,SPELL_WATER_BOLT_VOLLEY);
-
- WaterBoltVolley_Timer = 10000+rand()%5000;
- }else WaterBoltVolley_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_thespiaAI(Creature *_Creature)
-{
- return new boss_thespiaAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature *_Creature)
-{
- return new mob_coilfang_waterelementalAI (_Creature);
-}
-
-void AddSC_boss_hydromancer_thespia()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_hydromancer_thespia";
- newscript->GetAI = GetAI_boss_thespiaAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_coilfang_waterelemental";
- newscript->GetAI = GetAI_mob_coilfang_waterelementalAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Hydromancer_Thespia
+SD%Complete: 80
+SDComment: Normal/heroic mode: to be tested. Needs additional adjustments (when instance script is adjusted)
+SDCategory: Coilfang Resevoir, The Steamvault
+EndScriptData */
+
+/* ContentData
+boss_hydromancer_thespia
+mob_coilfang_waterelemental
+EndContentData */
+
+#include "precompiled.h"
+#include "def_steam_vault.h"
+
+#define SAY_SUMMON "Surge forth my pets!"
+#define SOUND_SUMMON 10360
+
+#define SAY_AGGRO_1 "The depths will consume you!"
+#define SOUND_AGGRO_1 10361
+#define SAY_AGGRO_2 "Meet your doom, surface dwellers!"
+#define SOUND_AGGRO_2 10362
+#define SAY_AGGRO_3 "You will drown in blood!"
+#define SOUND_AGGRO_3 10363
+
+#define SAY_SLAY_1 "To the depths of oblivion with you!"
+#define SOUND_SLAY_1 10364
+#define SAY_SLAY_2 "For my lady and master!"
+#define SOUND_SLAY_2 10365
+
+#define SAY_DEAD "Our matron will be.. the end of.. you.."
+#define SOUND_DEAD 10366
+
+#define SPELL_LIGHTNING_CLOUD 25033
+#define SPELL_LUNG_BURST 31481
+#define SPELL_ENVELOPING_WINDS 31718
+
+struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI
+{
+ boss_thespiaAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool HeroicMode;
+
+ uint32 LightningCloud_Timer;
+ uint32 LungBurst_Timer;
+ uint32 EnvelopingWinds_Timer;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ LightningCloud_Timer = 28000;
+ LungBurst_Timer = 7000;
+ EnvelopingWinds_Timer = 9000;
+
+ if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEAD);
+
+ if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+
+ if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //LightningCloud_Timer
+ if( LightningCloud_Timer < diff )
+ {
+ //cast twice in Heroic mode
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target, SPELL_LIGHTNING_CLOUD);
+ if( HeroicMode )
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target, SPELL_LIGHTNING_CLOUD);
+ LightningCloud_Timer = 28000;
+ }else LightningCloud_Timer -=diff;
+
+ //LungBurst_Timer
+ if( LungBurst_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target, SPELL_LUNG_BURST);
+ LungBurst_Timer = 10000+rand()%5000;
+ }else LungBurst_Timer -=diff;
+
+ //EnvelopingWinds_Timer
+ if( EnvelopingWinds_Timer < diff )
+ {
+ //cast twice in Heroic mode
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target, SPELL_ENVELOPING_WINDS);
+ if( HeroicMode )
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target, SPELL_ENVELOPING_WINDS);
+ EnvelopingWinds_Timer = 10000+rand()%5000;
+ }else EnvelopingWinds_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_WATER_BOLT_VOLLEY 34449
+#define H_SPELL_WATER_BOLT_VOLLEY 37924
+
+struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI
+{
+ mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool HeroicMode;
+ uint32 WaterBoltVolley_Timer;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ WaterBoltVolley_Timer = 3000+rand()%3000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( WaterBoltVolley_Timer < diff )
+ {
+ if( HeroicMode ) DoCast(m_creature,H_SPELL_WATER_BOLT_VOLLEY);
+ else DoCast(m_creature,SPELL_WATER_BOLT_VOLLEY);
+
+ WaterBoltVolley_Timer = 10000+rand()%5000;
+ }else WaterBoltVolley_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_thespiaAI(Creature *_Creature)
+{
+ return new boss_thespiaAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature *_Creature)
+{
+ return new mob_coilfang_waterelementalAI (_Creature);
+}
+
+void AddSC_boss_hydromancer_thespia()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_hydromancer_thespia";
+ newscript->GetAI = GetAI_boss_thespiaAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_coilfang_waterelemental";
+ newscript->GetAI = GetAI_mob_coilfang_waterelementalAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
index 170bc9d1621..091e0694b1b 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
@@ -1,297 +1,297 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mekgineer_Steamrigger
-SD%Complete: 60
-SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair.
-SDCategory: Coilfang Resevoir, The Steamvault
-EndScriptData */
-
-/* ContentData
-boss_mekgineer_steamrigger
-mob_steamrigger_mechanic
-EndContentData */
-
-#include "precompiled.h"
-#include "def_steam_vault.h"
-
-#define SAY_MECHANICS "I'm bringin' the pain!"
-#define SOUND_MECHANICS 10367
-
-#define SAY_AGGRO_1 "You're in for a world of hurt!"
-#define SOUND_AGGRO_1 10368
-#define SAY_AGGRO_2 "Eat hot metal, scumbag!"
-#define SOUND_AGGRO_2 10369
-#define SAY_AGGRO_3 "I'll come over there!"
-#define SOUND_AGGRO_3 10370
-#define SAY_AGGRO_4 "I'm bringin' the pain!"
-#define SOUND_AGGRO_4 10371
-
-#define SAY_SLAY_1 "You just got served, punk!"
-#define SOUND_SLAY_1 10372
-#define SAY_SLAY_2 "I own you!"
-#define SOUND_SLAY_2 10373
-#define SAY_SLAY_3 "Have fun dyin', cupcake!"
-#define SOUND_SLAY_3 10374
-
-#define SAY_DEATH "Mommy!"
-#define SOUND_DEATH 10375
-
-#define SPELL_SUPER_SHRINK_RAY 31485
-#define SPELL_SAW_BLADE 31486
-#define SPELL_ELECTRIFIED_NET 35107
-#define H_SPELL_ENRAGE 1 //corrent enrage spell not known
-
-#define ENTRY_STREAMRIGGER_MECHANIC 17951
-
-struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI
-{
- boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Shrink_Timer;
- uint32 Saw_Blade_Timer;
- uint32 Electrified_Net_Timer;
- bool Summon75;
- bool Summon50;
- bool Summon25;
-
- void Reset()
- {
- Shrink_Timer = 20000;
- Saw_Blade_Timer = 15000;
- Electrified_Net_Timer = 10000;
-
- Summon75 = false;
- Summon50 = false;
- Summon25 = false;
-
- if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- case 2:
- DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_3);
- break;
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
-
- if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
- }
-
- //no known summon spells exist
- void SummonMechanichs()
- {
- DoYell(SAY_MECHANICS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MECHANICS);
-
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
-
- if( rand()%2 )
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- if( rand()%2 )
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Shrink_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY);
- Shrink_Timer = 20000;
- }else Shrink_Timer -= diff;
-
- if( Saw_Blade_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) ) DoCast(target,SPELL_SAW_BLADE);
- else DoCast(m_creature->getVictim(),SPELL_SAW_BLADE);
- Saw_Blade_Timer = 15000;
- } else Saw_Blade_Timer -= diff;
-
- if( Electrified_Net_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET);
- Electrified_Net_Timer = 10000;
- }
- else Electrified_Net_Timer -= diff;
-
- if( !Summon75 )
- if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75 )
- {
- SummonMechanichs();
- Summon75 = true;
- }
- if( !Summon50 )
- if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50 )
- {
- SummonMechanichs();
- Summon50 = true;
- }
- if( !Summon25 )
- if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25 )
- {
- SummonMechanichs();
- Summon25 = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature *_Creature)
-{
- return new boss_mekgineer_steamriggerAI (_Creature);
-}
-
-#define SPELL_DISPEL_MAGIC 17201
-#define SPELL_REPAIR 31532
-#define H_SPELL_REPAIR 37936
-
-#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair
-#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required
-
-struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI
-{
- mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 Repair_Timer;
- bool HeroicMode;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Repair_Timer = 2000;
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- //react only if attacked
- return;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( Repair_Timer < diff )
- {
- if( pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
- {
- if( Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)) )
- {
- if( m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE) )
- {
- //are we already channeling? Doesn't work very well, find better check?
- if( !m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL) )
- {
- //m_creature->GetMotionMaster()->MovementExpired();
- //m_creature->GetMotionMaster()->MoveIdle();
-
- if( HeroicMode ) DoCast(m_creature,H_SPELL_REPAIR,true);
- else DoCast(m_creature,SPELL_REPAIR,true);
- }
- Repair_Timer = 5000;
- }
- else
- {
- //m_creature->GetMotionMaster()->MovementExpired();
- //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
- }
- }
- }else Repair_Timer = 5000;
- }else Repair_Timer -= diff;
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_steamrigger_mechanic(Creature *_Creature)
-{
- return new mob_steamrigger_mechanicAI (_Creature);
-}
-
-void AddSC_boss_mekgineer_steamrigger()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_mekgineer_steamrigger";
- newscript->GetAI = GetAI_boss_mekgineer_steamrigger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_steamrigger_mechanic";
- newscript->GetAI = GetAI_mob_steamrigger_mechanic;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mekgineer_Steamrigger
+SD%Complete: 60
+SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair.
+SDCategory: Coilfang Resevoir, The Steamvault
+EndScriptData */
+
+/* ContentData
+boss_mekgineer_steamrigger
+mob_steamrigger_mechanic
+EndContentData */
+
+#include "precompiled.h"
+#include "def_steam_vault.h"
+
+#define SAY_MECHANICS "I'm bringin' the pain!"
+#define SOUND_MECHANICS 10367
+
+#define SAY_AGGRO_1 "You're in for a world of hurt!"
+#define SOUND_AGGRO_1 10368
+#define SAY_AGGRO_2 "Eat hot metal, scumbag!"
+#define SOUND_AGGRO_2 10369
+#define SAY_AGGRO_3 "I'll come over there!"
+#define SOUND_AGGRO_3 10370
+#define SAY_AGGRO_4 "I'm bringin' the pain!"
+#define SOUND_AGGRO_4 10371
+
+#define SAY_SLAY_1 "You just got served, punk!"
+#define SOUND_SLAY_1 10372
+#define SAY_SLAY_2 "I own you!"
+#define SOUND_SLAY_2 10373
+#define SAY_SLAY_3 "Have fun dyin', cupcake!"
+#define SOUND_SLAY_3 10374
+
+#define SAY_DEATH "Mommy!"
+#define SOUND_DEATH 10375
+
+#define SPELL_SUPER_SHRINK_RAY 31485
+#define SPELL_SAW_BLADE 31486
+#define SPELL_ELECTRIFIED_NET 35107
+#define H_SPELL_ENRAGE 1 //corrent enrage spell not known
+
+#define ENTRY_STREAMRIGGER_MECHANIC 17951
+
+struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI
+{
+ boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Shrink_Timer;
+ uint32 Saw_Blade_Timer;
+ uint32 Electrified_Net_Timer;
+ bool Summon75;
+ bool Summon50;
+ bool Summon25;
+
+ void Reset()
+ {
+ Shrink_Timer = 20000;
+ Saw_Blade_Timer = 15000;
+ Electrified_Net_Timer = 10000;
+
+ Summon75 = false;
+ Summon50 = false;
+ Summon25 = false;
+
+ if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_3);
+ break;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+
+ if( pInstance ) pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
+ }
+
+ //no known summon spells exist
+ void SummonMechanichs()
+ {
+ DoYell(SAY_MECHANICS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MECHANICS);
+
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+
+ if( rand()%2 )
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ if( rand()%2 )
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Shrink_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY);
+ Shrink_Timer = 20000;
+ }else Shrink_Timer -= diff;
+
+ if( Saw_Blade_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) ) DoCast(target,SPELL_SAW_BLADE);
+ else DoCast(m_creature->getVictim(),SPELL_SAW_BLADE);
+ Saw_Blade_Timer = 15000;
+ } else Saw_Blade_Timer -= diff;
+
+ if( Electrified_Net_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET);
+ Electrified_Net_Timer = 10000;
+ }
+ else Electrified_Net_Timer -= diff;
+
+ if( !Summon75 )
+ if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75 )
+ {
+ SummonMechanichs();
+ Summon75 = true;
+ }
+ if( !Summon50 )
+ if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50 )
+ {
+ SummonMechanichs();
+ Summon50 = true;
+ }
+ if( !Summon25 )
+ if( (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25 )
+ {
+ SummonMechanichs();
+ Summon25 = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature *_Creature)
+{
+ return new boss_mekgineer_steamriggerAI (_Creature);
+}
+
+#define SPELL_DISPEL_MAGIC 17201
+#define SPELL_REPAIR 31532
+#define H_SPELL_REPAIR 37936
+
+#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair
+#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required
+
+struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI
+{
+ mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 Repair_Timer;
+ bool HeroicMode;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Repair_Timer = 2000;
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ //react only if attacked
+ return;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( Repair_Timer < diff )
+ {
+ if( pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
+ {
+ if( Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)) )
+ {
+ if( m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE) )
+ {
+ //are we already channeling? Doesn't work very well, find better check?
+ if( !m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL) )
+ {
+ //m_creature->GetMotionMaster()->MovementExpired();
+ //m_creature->GetMotionMaster()->MoveIdle();
+
+ if( HeroicMode ) DoCast(m_creature,H_SPELL_REPAIR,true);
+ else DoCast(m_creature,SPELL_REPAIR,true);
+ }
+ Repair_Timer = 5000;
+ }
+ else
+ {
+ //m_creature->GetMotionMaster()->MovementExpired();
+ //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
+ }
+ }
+ }else Repair_Timer = 5000;
+ }else Repair_Timer -= diff;
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_steamrigger_mechanic(Creature *_Creature)
+{
+ return new mob_steamrigger_mechanicAI (_Creature);
+}
+
+void AddSC_boss_mekgineer_steamrigger()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_mekgineer_steamrigger";
+ newscript->GetAI = GetAI_boss_mekgineer_steamrigger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_steamrigger_mechanic";
+ newscript->GetAI = GetAI_mob_steamrigger_mechanic;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
index b9850d65534..7c3de1e80d5 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
@@ -1,255 +1,255 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warlord_Kalithres
-SD%Complete: 65
-SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning.
-SDCategory: Coilfang Resevoir, The Steamvault
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_steam_vault.h"
-
-#define SAY_INTRO "You deem yourselves worthy simply because you bested my guards? Our work here will not be compromised!"
-#define SOUND_INTRO 10390
-
-#define SAY_REGEN "This is not nearly over..."
-#define SOUND_REGEN 10391
-
-#define SAY_AGGRO1 "Your head will roll!"
-#define SOUND_AGGRO1 10392
-#define SAY_AGGRO2 "I despise all of your kind!"
-#define SOUND_AGGRO2 10393
-#define SAY_AGGRO3 "Ba'ahntha sol'dorei!"
-#define SOUND_AGGRO3 10394
-
-#define SAY_SLAY1 "Scram, surface filth!"
-#define SOUND_SLAY1 10395
-#define SAY_SLAY2 "Ah ha ha ha ha ha ha!"
-#define SOUND_SLAY2 10396
-
-#define SAY_DEATH "For her Excellency... for... Vashj!"
-#define SOUND_DEATH 10397
-
-#define SPELL_SPELL_REFLECTION 31534
-#define SPELL_IMPALE 39061
-#define SPELL_WARLORDS_RAGE 37081
-#define SPELL_WARLORDS_RAGE_NAGA 31543
-
-#define SPELL_WARLORDS_RAGE_PROC 36453
-
-struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI
-{
- mob_naga_distillerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- //hack, due to really weird spell behaviour :(
- if( pInstance )
- if( pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS )
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- }
-
- void Aggro(Unit *who) { }
-
- void StartRageGen(Unit *caster)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true);
- if( pInstance ) pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( m_creature->GetHealth() <= damage )
- if( pInstance ) pInstance->SetData(TYPE_DISTILLER,DONE);
- }
-};
-
-struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI
-{
- boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Reflection_Timer;
- uint32 Impale_Timer;
- uint32 Rage_Timer;
- bool CanRage;
-
- void Reset()
- {
- Reflection_Timer = 10000;
- Impale_Timer = 30000;
- Rage_Timer = 45000;
- CanRage = false;
-
- if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
-
- if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_SLAY2);
- break;
- }
- }
-
- Creature* SelectCreatureInGrid(uint32 entry, float range)
- {
- Creature* pCreature = NULL;
-
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
-
- TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap()));
-
- return pCreature;
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- //hack :(
- if( spell->Id == SPELL_WARLORDS_RAGE_PROC )
- if( pInstance )
- if( pInstance->GetData(TYPE_DISTILLER) == DONE )
- m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( Rage_Timer < diff )
- {
- Creature* distiller = SelectCreatureInGrid(17954, 100);
- if( distiller )
- {
- DoYell(SAY_REGEN, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_REGEN);
- DoCast(m_creature,SPELL_WARLORDS_RAGE);
- ((mob_naga_distillerAI*)distiller->AI())->StartRageGen(m_creature);
- }
- Rage_Timer = 45000;
- }else Rage_Timer -= diff;
-
- //Reflection_Timer
- if( Reflection_Timer < diff )
- {
- DoCast(m_creature, SPELL_SPELL_REFLECTION);
- Reflection_Timer = 20000+rand()%5000;
- }else Reflection_Timer -= diff;
-
- //Impale_Timer
- if( Impale_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_IMPALE);
-
- Impale_Timer = 7500+rand()%5000;
- }else Impale_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_naga_distiller(Creature *_Creature)
-{
- return new mob_naga_distillerAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_warlord_kalithresh(Creature *_Creature)
-{
- return new boss_warlord_kalithreshAI (_Creature);
-}
-
-void AddSC_boss_warlord_kalithresh()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_naga_distiller";
- newscript->GetAI = GetAI_mob_naga_distiller;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_warlord_kalithresh";
- newscript->GetAI = GetAI_boss_warlord_kalithresh;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warlord_Kalithres
+SD%Complete: 65
+SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning.
+SDCategory: Coilfang Resevoir, The Steamvault
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_steam_vault.h"
+
+#define SAY_INTRO "You deem yourselves worthy simply because you bested my guards? Our work here will not be compromised!"
+#define SOUND_INTRO 10390
+
+#define SAY_REGEN "This is not nearly over..."
+#define SOUND_REGEN 10391
+
+#define SAY_AGGRO1 "Your head will roll!"
+#define SOUND_AGGRO1 10392
+#define SAY_AGGRO2 "I despise all of your kind!"
+#define SOUND_AGGRO2 10393
+#define SAY_AGGRO3 "Ba'ahntha sol'dorei!"
+#define SOUND_AGGRO3 10394
+
+#define SAY_SLAY1 "Scram, surface filth!"
+#define SOUND_SLAY1 10395
+#define SAY_SLAY2 "Ah ha ha ha ha ha ha!"
+#define SOUND_SLAY2 10396
+
+#define SAY_DEATH "For her Excellency... for... Vashj!"
+#define SOUND_DEATH 10397
+
+#define SPELL_SPELL_REFLECTION 31534
+#define SPELL_IMPALE 39061
+#define SPELL_WARLORDS_RAGE 37081
+#define SPELL_WARLORDS_RAGE_NAGA 31543
+
+#define SPELL_WARLORDS_RAGE_PROC 36453
+
+struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI
+{
+ mob_naga_distillerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ //hack, due to really weird spell behaviour :(
+ if( pInstance )
+ if( pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS )
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ }
+
+ void Aggro(Unit *who) { }
+
+ void StartRageGen(Unit *caster)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true);
+ if( pInstance ) pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( m_creature->GetHealth() <= damage )
+ if( pInstance ) pInstance->SetData(TYPE_DISTILLER,DONE);
+ }
+};
+
+struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI
+{
+ boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Reflection_Timer;
+ uint32 Impale_Timer;
+ uint32 Rage_Timer;
+ bool CanRage;
+
+ void Reset()
+ {
+ Reflection_Timer = 10000;
+ Impale_Timer = 30000;
+ Rage_Timer = 45000;
+ CanRage = false;
+
+ if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ }
+
+ if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ Creature* SelectCreatureInGrid(uint32 entry, float range)
+ {
+ Creature* pCreature = NULL;
+
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
+
+ TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap()));
+
+ return pCreature;
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ //hack :(
+ if( spell->Id == SPELL_WARLORDS_RAGE_PROC )
+ if( pInstance )
+ if( pInstance->GetData(TYPE_DISTILLER) == DONE )
+ m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance ) pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( Rage_Timer < diff )
+ {
+ Creature* distiller = SelectCreatureInGrid(17954, 100);
+ if( distiller )
+ {
+ DoYell(SAY_REGEN, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_REGEN);
+ DoCast(m_creature,SPELL_WARLORDS_RAGE);
+ ((mob_naga_distillerAI*)distiller->AI())->StartRageGen(m_creature);
+ }
+ Rage_Timer = 45000;
+ }else Rage_Timer -= diff;
+
+ //Reflection_Timer
+ if( Reflection_Timer < diff )
+ {
+ DoCast(m_creature, SPELL_SPELL_REFLECTION);
+ Reflection_Timer = 20000+rand()%5000;
+ }else Reflection_Timer -= diff;
+
+ //Impale_Timer
+ if( Impale_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_IMPALE);
+
+ Impale_Timer = 7500+rand()%5000;
+ }else Impale_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_naga_distiller(Creature *_Creature)
+{
+ return new mob_naga_distillerAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_warlord_kalithresh(Creature *_Creature)
+{
+ return new boss_warlord_kalithreshAI (_Creature);
+}
+
+void AddSC_boss_warlord_kalithresh()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_naga_distiller";
+ newscript->GetAI = GetAI_mob_naga_distiller;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_warlord_kalithresh";
+ newscript->GetAI = GetAI_boss_warlord_kalithresh;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
index 2841ed84fa5..0f8ae80fe2c 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
@@ -1,16 +1,16 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_STEAM_VAULT_H
-#define DEF_STEAM_VAULT_H
-
-#define TYPE_HYDROMANCER_THESPIA 1
-#define TYPE_MEKGINEER_STEAMRIGGER 2
-#define TYPE_WARLORD_KALITHRESH 3
-#define TYPE_DISTILLER 4
-
-#define DATA_MEKGINEERSTEAMRIGGER 5
-#define DATA_KALITRESH 6
-#define DATA_THESPIA 7
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_STEAM_VAULT_H
+#define DEF_STEAM_VAULT_H
+
+#define TYPE_HYDROMANCER_THESPIA 1
+#define TYPE_MEKGINEER_STEAMRIGGER 2
+#define TYPE_WARLORD_KALITHRESH 3
+#define TYPE_DISTILLER 4
+
+#define DATA_MEKGINEERSTEAMRIGGER 5
+#define DATA_KALITRESH 6
+#define DATA_THESPIA 7
+#endif
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
index e4a505d0560..798d04d6cfb 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
@@ -1,170 +1,170 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Steam_Vault
-SD%Complete: 60
-SDComment: Workaround for opening of Main Chamber door. Trinity does not support scripting of Gameobject as this instance require.
-SDCategory: Coilfang Resevoir, The Steamvault
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_steam_vault.h"
-
-#define ENCOUNTERS 4
-
-#define MAIN_CHAMBERS_DOOR 183049 //door opened when hydromancer and mekgineer are died
-#define ACCESS_PANEL_HYDRO 184125
-#define ACCESS_PANEL_MEK 184126
-
-/* Steam Vaults encounters:
-1 - Hydromancer Thespia Event
-2 - Mekgineer Steamrigger Event
-3 - Warlord Kalithresh Event
-*/
-
-struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
-{
- instance_steam_vault(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 ThespiaGUID;
- uint64 MekgineerGUID;
- uint64 KalithreshGUID;
- uint32 Encounter[ENCOUNTERS];
-
- bool IsHydromancerDead, IsMekgineerDead;
- GameObject *MainChambersDoor;
- GameObject *AccessPanelHydro;
- GameObject *AccessPanelMek;
-
- void Initialize()
- {
- ThespiaGUID = 0;
- MekgineerGUID = 0;
- KalithreshGUID = 0;
- IsHydromancerDead = false;
- IsMekgineerDead = false;
- MainChambersDoor = NULL;
- AccessPanelHydro = NULL;
- AccessPanelMek = NULL;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if( Encounter[i] ) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 17797: ThespiaGUID = creature->GetGUID(); break;
- case 17796: MekgineerGUID = creature->GetGUID(); break;
- case 17798: KalithreshGUID = creature->GetGUID(); break;
- }
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case MAIN_CHAMBERS_DOOR: MainChambersDoor = go; break;
- case ACCESS_PANEL_HYDRO: AccessPanelHydro = go; break;
- case ACCESS_PANEL_MEK: AccessPanelMek = go; break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_HYDROMANCER_THESPIA:
- if(data == DONE)
- {
- IsHydromancerDead = true;
- if( IsMekgineerDead && MainChambersDoor )
- MainChambersDoor->SetGoState(0);
- }
- Encounter[0] = data;
- break;
- case TYPE_MEKGINEER_STEAMRIGGER:
- if(data == DONE)
- {
- IsMekgineerDead = true;
- if( IsHydromancerDead && MainChambersDoor )
- MainChambersDoor->SetGoState(0);
- }
- Encounter[1] = data;
- break;
- case TYPE_WARLORD_KALITHRESH:
- Encounter[2] = data;
- break;
- case TYPE_DISTILLER:
- Encounter[3] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case TYPE_HYDROMANCER_THESPIA:
- return Encounter[0];
- case TYPE_MEKGINEER_STEAMRIGGER:
- return Encounter[1];
- case TYPE_WARLORD_KALITHRESH:
- return Encounter[2];
- case TYPE_DISTILLER:
- return Encounter[3];
- }
- return 0;
- }
-
- uint64 GetData64(uint32 data)
- {
- switch(data)
- {
- case DATA_THESPIA:
- return ThespiaGUID;
- case DATA_MEKGINEERSTEAMRIGGER:
- return MekgineerGUID;
- case DATA_KALITRESH:
- return KalithreshGUID;
- }
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_steam_vault(Map* map)
-{
- return new instance_steam_vault(map);
-}
-
-void AddSC_instance_steam_vault()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_steam_vault";
- newscript->GetInstanceData = GetInstanceData_instance_steam_vault;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Steam_Vault
+SD%Complete: 60
+SDComment: Workaround for opening of Main Chamber door. Trinity does not support scripting of Gameobject as this instance require.
+SDCategory: Coilfang Resevoir, The Steamvault
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_steam_vault.h"
+
+#define ENCOUNTERS 4
+
+#define MAIN_CHAMBERS_DOOR 183049 //door opened when hydromancer and mekgineer are died
+#define ACCESS_PANEL_HYDRO 184125
+#define ACCESS_PANEL_MEK 184126
+
+/* Steam Vaults encounters:
+1 - Hydromancer Thespia Event
+2 - Mekgineer Steamrigger Event
+3 - Warlord Kalithresh Event
+*/
+
+struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
+{
+ instance_steam_vault(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 ThespiaGUID;
+ uint64 MekgineerGUID;
+ uint64 KalithreshGUID;
+ uint32 Encounter[ENCOUNTERS];
+
+ bool IsHydromancerDead, IsMekgineerDead;
+ GameObject *MainChambersDoor;
+ GameObject *AccessPanelHydro;
+ GameObject *AccessPanelMek;
+
+ void Initialize()
+ {
+ ThespiaGUID = 0;
+ MekgineerGUID = 0;
+ KalithreshGUID = 0;
+ IsHydromancerDead = false;
+ IsMekgineerDead = false;
+ MainChambersDoor = NULL;
+ AccessPanelHydro = NULL;
+ AccessPanelMek = NULL;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if( Encounter[i] ) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 17797: ThespiaGUID = creature->GetGUID(); break;
+ case 17796: MekgineerGUID = creature->GetGUID(); break;
+ case 17798: KalithreshGUID = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case MAIN_CHAMBERS_DOOR: MainChambersDoor = go; break;
+ case ACCESS_PANEL_HYDRO: AccessPanelHydro = go; break;
+ case ACCESS_PANEL_MEK: AccessPanelMek = go; break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_HYDROMANCER_THESPIA:
+ if(data == DONE)
+ {
+ IsHydromancerDead = true;
+ if( IsMekgineerDead && MainChambersDoor )
+ MainChambersDoor->SetGoState(0);
+ }
+ Encounter[0] = data;
+ break;
+ case TYPE_MEKGINEER_STEAMRIGGER:
+ if(data == DONE)
+ {
+ IsMekgineerDead = true;
+ if( IsHydromancerDead && MainChambersDoor )
+ MainChambersDoor->SetGoState(0);
+ }
+ Encounter[1] = data;
+ break;
+ case TYPE_WARLORD_KALITHRESH:
+ Encounter[2] = data;
+ break;
+ case TYPE_DISTILLER:
+ Encounter[3] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case TYPE_HYDROMANCER_THESPIA:
+ return Encounter[0];
+ case TYPE_MEKGINEER_STEAMRIGGER:
+ return Encounter[1];
+ case TYPE_WARLORD_KALITHRESH:
+ return Encounter[2];
+ case TYPE_DISTILLER:
+ return Encounter[3];
+ }
+ return 0;
+ }
+
+ uint64 GetData64(uint32 data)
+ {
+ switch(data)
+ {
+ case DATA_THESPIA:
+ return ThespiaGUID;
+ case DATA_MEKGINEERSTEAMRIGGER:
+ return MekgineerGUID;
+ case DATA_KALITRESH:
+ return KalithreshGUID;
+ }
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_steam_vault(Map* map)
+{
+ return new instance_steam_vault(map);
+}
+
+void AddSC_instance_steam_vault()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_steam_vault";
+ newscript->GetInstanceData = GetInstanceData_instance_steam_vault;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
index d480d7ef5b5..38be763ee90 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
@@ -1,78 +1,78 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ghazan
-SD%Complete: 100
-SDComment:
-SDCategory: Coilfang Resevoir, Underbog
-EndScriptData */
-
-#include "../../../creature/simple_ai.h"
-
-/*
---== Ghaz'an ==--
-*Acid Spit - 34290; timer: 8sec
-*Enrage - 20% hp; 40683
-*Tail Sweep - 34267; timer: ~10sec
-*Acid Breath - 34268; timer: 5sec
-*/
-
-CreatureAI* GetAI_boss_ghazan(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- // Acid Spit - 34290; timer: 8sec
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 34290;
- ai->Spell[0].Cooldown = 8000;
- ai->Spell[0].First_Cast = 8000;
- ai->Spell[0].Cast_Target_Type = CAST_SELF;
-
- // Acid Breath - 34268; timer: 5sec
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = 34268;
- ai->Spell[1].Cooldown = 5000;
- ai->Spell[1].First_Cast = 5000;
- ai->Spell[1].Cast_Target_Type = CAST_SELF;
-
- // Tail Sweep - 34267
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = 34267;
- ai->Spell[2].Cooldown = 10000;
- ai->Spell[2].First_Cast = 10000;
- ai->Spell[2].Cast_Target_Type = CAST_SELF;
-
- // Enrage - 20% hp; 40683
- ai->Spell[3].Enabled = true;
- ai->Spell[3].Spell_Id = 40683;
- ai->Spell[3].Cooldown = -1;
- ai->Spell[3].First_Cast = -80;
- ai->Spell[3].Cast_Target_Type = CAST_SELF;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-void AddSC_boss_ghazan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ghazan";
- newscript->GetAI = GetAI_boss_ghazan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ghazan
+SD%Complete: 100
+SDComment:
+SDCategory: Coilfang Resevoir, Underbog
+EndScriptData */
+
+#include "../../../creature/simple_ai.h"
+
+/*
+--== Ghaz'an ==--
+*Acid Spit - 34290; timer: 8sec
+*Enrage - 20% hp; 40683
+*Tail Sweep - 34267; timer: ~10sec
+*Acid Breath - 34268; timer: 5sec
+*/
+
+CreatureAI* GetAI_boss_ghazan(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ // Acid Spit - 34290; timer: 8sec
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 34290;
+ ai->Spell[0].Cooldown = 8000;
+ ai->Spell[0].First_Cast = 8000;
+ ai->Spell[0].Cast_Target_Type = CAST_SELF;
+
+ // Acid Breath - 34268; timer: 5sec
+ ai->Spell[1].Enabled = true;
+ ai->Spell[1].Spell_Id = 34268;
+ ai->Spell[1].Cooldown = 5000;
+ ai->Spell[1].First_Cast = 5000;
+ ai->Spell[1].Cast_Target_Type = CAST_SELF;
+
+ // Tail Sweep - 34267
+ ai->Spell[2].Enabled = true;
+ ai->Spell[2].Spell_Id = 34267;
+ ai->Spell[2].Cooldown = 10000;
+ ai->Spell[2].First_Cast = 10000;
+ ai->Spell[2].Cast_Target_Type = CAST_SELF;
+
+ // Enrage - 20% hp; 40683
+ ai->Spell[3].Enabled = true;
+ ai->Spell[3].Spell_Id = 40683;
+ ai->Spell[3].Cooldown = -1;
+ ai->Spell[3].First_Cast = -80;
+ ai->Spell[3].Cast_Target_Type = CAST_SELF;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+void AddSC_boss_ghazan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ghazan";
+ newscript->GetAI = GetAI_boss_ghazan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
index 68226e6b7ba..13ac880295b 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
@@ -1,156 +1,156 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Hungarfen
-SD%Complete: 95
-SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic
-SDCategory: Coilfang Resevoir, Underbog
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FOUL_SPORES 31673
-#define SPELL_ACID_GEYSER 38739
-
-struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI
-{
- boss_hungarfenAI(Creature *c) : ScriptedAI(c)
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- bool HeroicMode;
- bool Root;
- uint32 Mushroom_Timer;
- uint32 AcidGeyser_Timer;
-
- void Reset()
- {
- Root = false;
- Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
- AcidGeyser_Timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20 )
- {
- if( !Root )
- {
- DoCast(m_creature,SPELL_FOUL_SPORES);
- Root = true;
- }
- }
-
- if( Mushroom_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
- else
- m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
-
- Mushroom_Timer = 10000;
- }else Mushroom_Timer -= diff;
-
- if( AcidGeyser_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ACID_GEYSER);
- AcidGeyser_Timer = 10000+rand()%7500;
- }else AcidGeyser_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_hungarfen(Creature *_Creature)
-{
- return new boss_hungarfenAI (_Creature);
-}
-
-#define SPELL_SPORE_CLOUD 34168
-#define SPELL_PUTRID_MUSHROOM 31690
-#define SPELL_GROW 31698
-
-struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI
-{
- mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- bool Stop;
- uint32 Grow_Timer;
- uint32 Shrink_Timer;
-
- void Reset()
- {
- Stop = false;
- Grow_Timer = 0;
- Shrink_Timer = 20000;
-
- DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true);
- DoCast(m_creature,SPELL_SPORE_CLOUD,true);
- }
-
- void MoveInLineOfSight(Unit *who) { return; }
-
- void AttackStart(Unit* who) { return; }
-
- void Aggro(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( Stop )
- return;
-
- if( Grow_Timer <= diff )
- {
- DoCast(m_creature,SPELL_GROW);
- Grow_Timer = 3000;
- }else Grow_Timer -= diff;
-
- if( Shrink_Timer <= diff )
- {
- m_creature->RemoveAurasDueToSpell(SPELL_GROW);
- Stop = true;
- }else Shrink_Timer -= diff;
- }
-};
-CreatureAI* GetAI_mob_underbog_mushroom(Creature *_Creature)
-{
- return new mob_underbog_mushroomAI (_Creature);
-}
-
-void AddSC_boss_hungarfen()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_hungarfen";
- newscript->GetAI = GetAI_boss_hungarfen;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_underbog_mushroom";
- newscript->GetAI = GetAI_mob_underbog_mushroom;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Hungarfen
+SD%Complete: 95
+SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic
+SDCategory: Coilfang Resevoir, Underbog
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FOUL_SPORES 31673
+#define SPELL_ACID_GEYSER 38739
+
+struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI
+{
+ boss_hungarfenAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ bool Root;
+ uint32 Mushroom_Timer;
+ uint32 AcidGeyser_Timer;
+
+ void Reset()
+ {
+ Root = false;
+ Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
+ AcidGeyser_Timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20 )
+ {
+ if( !Root )
+ {
+ DoCast(m_creature,SPELL_FOUL_SPORES);
+ Root = true;
+ }
+ }
+
+ if( Mushroom_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+ else
+ m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+
+ Mushroom_Timer = 10000;
+ }else Mushroom_Timer -= diff;
+
+ if( AcidGeyser_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ACID_GEYSER);
+ AcidGeyser_Timer = 10000+rand()%7500;
+ }else AcidGeyser_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_hungarfen(Creature *_Creature)
+{
+ return new boss_hungarfenAI (_Creature);
+}
+
+#define SPELL_SPORE_CLOUD 34168
+#define SPELL_PUTRID_MUSHROOM 31690
+#define SPELL_GROW 31698
+
+struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI
+{
+ mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ bool Stop;
+ uint32 Grow_Timer;
+ uint32 Shrink_Timer;
+
+ void Reset()
+ {
+ Stop = false;
+ Grow_Timer = 0;
+ Shrink_Timer = 20000;
+
+ DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true);
+ DoCast(m_creature,SPELL_SPORE_CLOUD,true);
+ }
+
+ void MoveInLineOfSight(Unit *who) { return; }
+
+ void AttackStart(Unit* who) { return; }
+
+ void Aggro(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( Stop )
+ return;
+
+ if( Grow_Timer <= diff )
+ {
+ DoCast(m_creature,SPELL_GROW);
+ Grow_Timer = 3000;
+ }else Grow_Timer -= diff;
+
+ if( Shrink_Timer <= diff )
+ {
+ m_creature->RemoveAurasDueToSpell(SPELL_GROW);
+ Stop = true;
+ }else Shrink_Timer -= diff;
+ }
+};
+CreatureAI* GetAI_mob_underbog_mushroom(Creature *_Creature)
+{
+ return new mob_underbog_mushroomAI (_Creature);
+}
+
+void AddSC_boss_hungarfen()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_hungarfen";
+ newscript->GetAI = GetAI_boss_hungarfen;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_underbog_mushroom";
+ newscript->GetAI = GetAI_mob_underbog_mushroom;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
index a02a5122af9..01a76b6d00c 100644
--- a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
+++ b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Darkshore
-SD%Complete: 0
-SDComment: Placeholder
-SDCategory: Darkshore
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Darkshore
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Darkshore
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
index eefb99e7761..08bba7d4bc6 100644
--- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
+++ b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Deadmines
-SD%Complete: 0
-SDComment: Placeholder
-SDCategory: Deadmines
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Deadmines
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Deadmines
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp
index 5e9d8c588de..ed74c6f8cbc 100644
--- a/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp
+++ b/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp
@@ -1,22 +1,22 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Deadmines
-SD%Complete: 0
-SDComment: Placeholder
-SDCategory: Deadmines
-EndScriptData */
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Deadmines
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Deadmines
+EndScriptData */
diff --git a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
index d149eac15f8..c5f7bf6fc07 100644
--- a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
+++ b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
@@ -1,98 +1,98 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Dun_Morogh
-SD%Complete: 50
-SDComment: Quest support: 1783
-SDCategory: Dun Morogh
-EndScriptData */
-
-/* ContentData
-npc_narm_faulk
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_narm_faulk
-######*/
-
-#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
-
-struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
-{
- uint32 lifeTimer;
- bool spellHit;
-
- npc_narm_faulkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
- spellHit = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
- {
- if(lifeTimer < diff)
- m_creature->AI()->EnterEvadeMode();
- else
- lifeTimer -= diff;
- }
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if(Spellkind->Id == 8593 && !spellHit)
- {
- DoCast(m_creature,32343);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoSay(SAY_HEAL,LANG_COMMON,NULL);
- spellHit = true;
- }
- }
-
-};
-CreatureAI* GetAI_npc_narm_faulk(Creature *_Creature)
-{
- return new npc_narm_faulkAI (_Creature);
-}
-
-void AddSC_dun_morogh()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_narm_faulk";
- newscript->GetAI = GetAI_npc_narm_faulk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Dun_Morogh
+SD%Complete: 50
+SDComment: Quest support: 1783
+SDCategory: Dun Morogh
+EndScriptData */
+
+/* ContentData
+npc_narm_faulk
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_narm_faulk
+######*/
+
+#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
+
+struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
+{
+ uint32 lifeTimer;
+ bool spellHit;
+
+ npc_narm_faulkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ lifeTimer = 120000;
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ spellHit = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ {
+ if(lifeTimer < diff)
+ m_creature->AI()->EnterEvadeMode();
+ else
+ lifeTimer -= diff;
+ }
+ }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if(Spellkind->Id == 8593 && !spellHit)
+ {
+ DoCast(m_creature,32343);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //m_creature->RemoveAllAuras();
+ DoSay(SAY_HEAL,LANG_COMMON,NULL);
+ spellHit = true;
+ }
+ }
+
+};
+CreatureAI* GetAI_npc_narm_faulk(Creature *_Creature)
+{
+ return new npc_narm_faulkAI (_Creature);
+}
+
+void AddSC_dun_morogh()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_narm_faulk";
+ newscript->GetAI = GetAI_npc_narm_faulk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
index 522a3a651a5..7a8c1329b36 100644
--- a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
+++ b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
@@ -1,231 +1,231 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Dustwallow_Marsh
-SD%Complete: 95
-SDComment: Quest support: 11180, 558, 11126. Vendor Nat Pagle
-SDCategory: Dustwallow Marsh
-EndScriptData */
-
-/* ContentData
-mobs_risen_husk_spirit
-npc_restless_apparition
-npc_deserter_agitator
-npc_lady_jaina_proudmoore
-npc_nat_pagle
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mobs_risen_husk_spirit
-######*/
-
-#define SPELL_SUMMON_RESTLESS_APPARITION 42511
-#define SPELL_CONSUME_FLESH 37933 //Risen Husk
-#define SPELL_INTANGIBLE_PRESENCE 43127 //Risen Spirit
-
-struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI
-{
- mobs_risen_husk_spiritAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ConsumeFlesh_Timer;
- uint32 IntangiblePresence_Timer;
-
- void Reset()
- {
- ConsumeFlesh_Timer = 10000;
- IntangiblePresence_Timer = 5000;
- }
-
- void Aggro(Unit* who) { }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( done_by->GetTypeId() == TYPEID_PLAYER )
- if( damage >= m_creature->GetHealth() && ((Player*)done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE )
- m_creature->CastSpell(done_by,SPELL_SUMMON_RESTLESS_APPARITION,false);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ConsumeFlesh_Timer < diff )
- {
- if( m_creature->GetEntry() == 23555 )
- DoCast(m_creature->getVictim(),SPELL_CONSUME_FLESH);
- ConsumeFlesh_Timer = 15000;
- } else ConsumeFlesh_Timer -= diff;
-
- if( IntangiblePresence_Timer < diff )
- {
- if( m_creature->GetEntry() == 23554 )
- DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
- IntangiblePresence_Timer = 20000;
- } else IntangiblePresence_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_risen_husk_spirit(Creature *_Creature)
-{
- return new mobs_risen_husk_spiritAI (_Creature);
-}
-
-/*######
-## npc_restless_apparition
-######*/
-
-bool GossipHello_npc_restless_apparition(Player *player, Creature *_Creature)
-{
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- _Creature->SetInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- return true;
-}
-
-/*######
-## npc_deserter_agitator
-######*/
-
-struct TRINITY_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI
-{
- npc_deserter_agitatorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->setFaction(894);
- }
-
- void Aggro(Unit* who) {}
-};
-
-CreatureAI* GetAI_npc_deserter_agitator(Creature *_Creature)
-{
- return new npc_deserter_agitatorAI (_Creature);
-}
-
-bool GossipHello_npc_deserter_agitator(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(11126) == QUEST_STATUS_INCOMPLETE)
- {
- _Creature->setFaction(1883);
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-/*######
-## npc_lady_jaina_proudmoore
-######*/
-
-#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph."
-
-bool GossipHello_npc_lady_jaina_proudmoore(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(558) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO );
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lady_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_SENDER_INFO )
- {
- player->SEND_GOSSIP_MENU( 7012, _Creature->GetGUID() );
- player->CastSpell( player, 23122, false);
- }
- return true;
-}
-
-/*######
-## npc_nat_pagle
-######*/
-
-bool GossipHello_npc_nat_pagle(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if(_Creature->isVendor() && player->GetQuestRewardStatus(8227))
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU( 7640, _Creature->GetGUID() );
- }
- else
- player->SEND_GOSSIP_MENU( 7638, _Creature->GetGUID() );
-
- return true;
-}
-
-bool GossipSelect_npc_nat_pagle(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_dustwallow_marsh()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_risen_husk_spirit";
- newscript->GetAI = GetAI_mobs_risen_husk_spirit;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_restless_apparition";
- newscript->pGossipHello = &GossipHello_npc_restless_apparition;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_deserter_agitator";
- newscript->GetAI = GetAI_npc_deserter_agitator;
- newscript->pGossipHello = &GossipHello_npc_deserter_agitator;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lady_jaina_proudmoore";
- newscript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore;
- newscript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_nat_pagle";
- newscript->pGossipHello = &GossipHello_npc_nat_pagle;
- newscript->pGossipSelect = &GossipSelect_npc_nat_pagle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Dustwallow_Marsh
+SD%Complete: 95
+SDComment: Quest support: 11180, 558, 11126. Vendor Nat Pagle
+SDCategory: Dustwallow Marsh
+EndScriptData */
+
+/* ContentData
+mobs_risen_husk_spirit
+npc_restless_apparition
+npc_deserter_agitator
+npc_lady_jaina_proudmoore
+npc_nat_pagle
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mobs_risen_husk_spirit
+######*/
+
+#define SPELL_SUMMON_RESTLESS_APPARITION 42511
+#define SPELL_CONSUME_FLESH 37933 //Risen Husk
+#define SPELL_INTANGIBLE_PRESENCE 43127 //Risen Spirit
+
+struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI
+{
+ mobs_risen_husk_spiritAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ConsumeFlesh_Timer;
+ uint32 IntangiblePresence_Timer;
+
+ void Reset()
+ {
+ ConsumeFlesh_Timer = 10000;
+ IntangiblePresence_Timer = 5000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( done_by->GetTypeId() == TYPEID_PLAYER )
+ if( damage >= m_creature->GetHealth() && ((Player*)done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE )
+ m_creature->CastSpell(done_by,SPELL_SUMMON_RESTLESS_APPARITION,false);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ConsumeFlesh_Timer < diff )
+ {
+ if( m_creature->GetEntry() == 23555 )
+ DoCast(m_creature->getVictim(),SPELL_CONSUME_FLESH);
+ ConsumeFlesh_Timer = 15000;
+ } else ConsumeFlesh_Timer -= diff;
+
+ if( IntangiblePresence_Timer < diff )
+ {
+ if( m_creature->GetEntry() == 23554 )
+ DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
+ IntangiblePresence_Timer = 20000;
+ } else IntangiblePresence_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_risen_husk_spirit(Creature *_Creature)
+{
+ return new mobs_risen_husk_spiritAI (_Creature);
+}
+
+/*######
+## npc_restless_apparition
+######*/
+
+bool GossipHello_npc_restless_apparition(Player *player, Creature *_Creature)
+{
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ _Creature->SetInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ return true;
+}
+
+/*######
+## npc_deserter_agitator
+######*/
+
+struct TRINITY_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI
+{
+ npc_deserter_agitatorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->setFaction(894);
+ }
+
+ void Aggro(Unit* who) {}
+};
+
+CreatureAI* GetAI_npc_deserter_agitator(Creature *_Creature)
+{
+ return new npc_deserter_agitatorAI (_Creature);
+}
+
+bool GossipHello_npc_deserter_agitator(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(11126) == QUEST_STATUS_INCOMPLETE)
+ {
+ _Creature->setFaction(1883);
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+/*######
+## npc_lady_jaina_proudmoore
+######*/
+
+#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph."
+
+bool GossipHello_npc_lady_jaina_proudmoore(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(558) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO );
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lady_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_SENDER_INFO )
+ {
+ player->SEND_GOSSIP_MENU( 7012, _Creature->GetGUID() );
+ player->CastSpell( player, 23122, false);
+ }
+ return true;
+}
+
+/*######
+## npc_nat_pagle
+######*/
+
+bool GossipHello_npc_nat_pagle(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if(_Creature->isVendor() && player->GetQuestRewardStatus(8227))
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU( 7640, _Creature->GetGUID() );
+ }
+ else
+ player->SEND_GOSSIP_MENU( 7638, _Creature->GetGUID() );
+
+ return true;
+}
+
+bool GossipSelect_npc_nat_pagle(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_dustwallow_marsh()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_risen_husk_spirit";
+ newscript->GetAI = GetAI_mobs_risen_husk_spirit;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_restless_apparition";
+ newscript->pGossipHello = &GossipHello_npc_restless_apparition;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_deserter_agitator";
+ newscript->GetAI = GetAI_npc_deserter_agitator;
+ newscript->pGossipHello = &GossipHello_npc_deserter_agitator;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lady_jaina_proudmoore";
+ newscript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore;
+ newscript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_nat_pagle";
+ newscript->pGossipHello = &GossipHello_npc_nat_pagle;
+ newscript->pGossipSelect = &GossipSelect_npc_nat_pagle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
index a9484b424d0..e8d44931f11 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
@@ -1,180 +1,180 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Eastern_Plaguelands
-SD%Complete: 100
-SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
-SDCategory: Eastern Plaguelands
-EndScriptData */
-
-/* ContentData
-mobs_ghoul_flayer
-npc_augustus_the_touched
-npc_darrowshire_spirit
-npc_tirion_fordring
-EndContentData */
-
-#include "precompiled.h"
-
-//id8530 - cannibal ghoul
-//id8531 - gibbering ghoul
-//id8532 - diseased flayer
-
-struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI
-{
- mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() { }
-
- void Aggro(Unit* who) { }
-
- void JustDied(Unit* Killer)
- {
- if( Killer->GetTypeId() == TYPEID_PLAYER )
- DoSpawnCreature(11064,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000);
- }
-
-};
-
-CreatureAI* GetAI_mobs_ghoul_flayer(Creature *_Creature)
-{
- return new mobs_ghoul_flayerAI (_Creature);
-}
-
-/*######
-## npc_augustus_the_touched
-######*/
-
-bool GossipHello_npc_augustus_the_touched(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isVendor() && player->GetQuestRewardStatus(6164) )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_augustus_the_touched(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_TRADE )
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- return true;
-}
-
-/*######
-## npc_darrowshire_spirit
-######*/
-
-#define SPELL_SPIRIT_SPAWNIN 17321
-
-struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI
-{
- npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- DoCast(m_creature,SPELL_SPIRIT_SPAWNIN);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who) { }
-
-};
-CreatureAI* GetAI_npc_darrowshire_spirit(Creature *_Creature)
-{
- return new npc_darrowshire_spiritAI (_Creature);
-}
-
-bool GossipHello_npc_darrowshire_spirit(Player *player, Creature *_Creature)
-{
- player->SEND_GOSSIP_MENU(3873,_Creature->GetGUID());
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- return true;
-}
-
-/*######
-## npc_tirion_fordring
-######*/
-
-bool GossipHello_npc_tirion_fordring(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == PLAYER_STATE_SIT )
- player->ADD_GOSSIP_ITEM( 0, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_tirion_fordring(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Thank you, Tirion. What of your identity?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(4493, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "That is terrible.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(4494, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "I will, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(4495, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(5742);
- break;
- }
- return true;
-}
-
-void AddSC_eastern_plaguelands()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_ghoul_flayer";
- newscript->GetAI = GetAI_mobs_ghoul_flayer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_augustus_the_touched";
- newscript->pGossipHello = &GossipHello_npc_augustus_the_touched;
- newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_darrowshire_spirit";
- newscript->GetAI = GetAI_npc_darrowshire_spirit;
- newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_tirion_fordring";
- newscript->pGossipHello = &GossipHello_npc_tirion_fordring;
- newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Eastern_Plaguelands
+SD%Complete: 100
+SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
+SDCategory: Eastern Plaguelands
+EndScriptData */
+
+/* ContentData
+mobs_ghoul_flayer
+npc_augustus_the_touched
+npc_darrowshire_spirit
+npc_tirion_fordring
+EndContentData */
+
+#include "precompiled.h"
+
+//id8530 - cannibal ghoul
+//id8531 - gibbering ghoul
+//id8532 - diseased flayer
+
+struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI
+{
+ mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+
+ void Aggro(Unit* who) { }
+
+ void JustDied(Unit* Killer)
+ {
+ if( Killer->GetTypeId() == TYPEID_PLAYER )
+ DoSpawnCreature(11064,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000);
+ }
+
+};
+
+CreatureAI* GetAI_mobs_ghoul_flayer(Creature *_Creature)
+{
+ return new mobs_ghoul_flayerAI (_Creature);
+}
+
+/*######
+## npc_augustus_the_touched
+######*/
+
+bool GossipHello_npc_augustus_the_touched(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isVendor() && player->GetQuestRewardStatus(6164) )
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_augustus_the_touched(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_TRADE )
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ return true;
+}
+
+/*######
+## npc_darrowshire_spirit
+######*/
+
+#define SPELL_SPIRIT_SPAWNIN 17321
+
+struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI
+{
+ npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ DoCast(m_creature,SPELL_SPIRIT_SPAWNIN);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who) { }
+
+};
+CreatureAI* GetAI_npc_darrowshire_spirit(Creature *_Creature)
+{
+ return new npc_darrowshire_spiritAI (_Creature);
+}
+
+bool GossipHello_npc_darrowshire_spirit(Player *player, Creature *_Creature)
+{
+ player->SEND_GOSSIP_MENU(3873,_Creature->GetGUID());
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ return true;
+}
+
+/*######
+## npc_tirion_fordring
+######*/
+
+bool GossipHello_npc_tirion_fordring(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == PLAYER_STATE_SIT )
+ player->ADD_GOSSIP_ITEM( 0, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_tirion_fordring(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Thank you, Tirion. What of your identity?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(4493, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "That is terrible.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(4494, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "I will, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(4495, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(5742);
+ break;
+ }
+ return true;
+}
+
+void AddSC_eastern_plaguelands()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_ghoul_flayer";
+ newscript->GetAI = GetAI_mobs_ghoul_flayer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_augustus_the_touched";
+ newscript->pGossipHello = &GossipHello_npc_augustus_the_touched;
+ newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_darrowshire_spirit";
+ newscript->GetAI = GetAI_npc_darrowshire_spirit;
+ newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_tirion_fordring";
+ newscript->pGossipHello = &GossipHello_npc_tirion_fordring;
+ newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
index 6ad06abb105..d91b4533de2 100644
--- a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
@@ -1,98 +1,98 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Elwynn_Forest
-SD%Complete: 50
-SDComment: Quest support: 1786
-SDCategory: Elwynn Forest
-EndScriptData */
-
-/* ContentData
-npc_henze_faulk
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_henze_faulk
-######*/
-
-#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
-
-struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
-{
- uint32 lifeTimer;
- bool spellHit;
-
- npc_henze_faulkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
- spellHit = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
- {
- if(lifeTimer < diff)
- m_creature->AI()->EnterEvadeMode();
- else
- lifeTimer -= diff;
- }
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if(Spellkind->Id == 8593 && !spellHit)
- {
- DoCast(m_creature,32343);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoSay(SAY_HEAL,LANG_COMMON,NULL);
- spellHit = true;
- }
- }
-
-};
-CreatureAI* GetAI_npc_henze_faulk(Creature *_Creature)
-{
- return new npc_henze_faulkAI (_Creature);
-}
-
-void AddSC_elwynn_forest()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_henze_faulk";
- newscript->GetAI = GetAI_npc_henze_faulk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Elwynn_Forest
+SD%Complete: 50
+SDComment: Quest support: 1786
+SDCategory: Elwynn Forest
+EndScriptData */
+
+/* ContentData
+npc_henze_faulk
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_henze_faulk
+######*/
+
+#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
+
+struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
+{
+ uint32 lifeTimer;
+ bool spellHit;
+
+ npc_henze_faulkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ lifeTimer = 120000;
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ spellHit = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ {
+ if(lifeTimer < diff)
+ m_creature->AI()->EnterEvadeMode();
+ else
+ lifeTimer -= diff;
+ }
+ }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if(Spellkind->Id == 8593 && !spellHit)
+ {
+ DoCast(m_creature,32343);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //m_creature->RemoveAllAuras();
+ DoSay(SAY_HEAL,LANG_COMMON,NULL);
+ spellHit = true;
+ }
+ }
+
+};
+CreatureAI* GetAI_npc_henze_faulk(Creature *_Creature)
+{
+ return new npc_henze_faulkAI (_Creature);
+}
+
+void AddSC_elwynn_forest()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_henze_faulk";
+ newscript->GetAI = GetAI_npc_henze_faulk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
index 465685882b4..932dea11a60 100644
--- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
+++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
@@ -1,163 +1,163 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Eversong_Woods
-SD%Complete: 100
-SDComment: Quest support: 8346, 8483
-SDCategory: Eversong Woods
-EndScriptData */
-
-/* ContentData
-mobs_mana_tapped
-npc_prospector_anvilward
-EndContentData */
-
-#include "precompiled.h"
-#include "../../npc/npc_escortAI.h"
-
-/*######
-## mobs_mana_tapped
-######*/
-
-struct TRINITY_DLL_DECL mobs_mana_tappedAI : public ScriptedAI
-{
- mobs_mana_tappedAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() { }
-
- void Aggro(Unit *who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( caster->GetTypeId() == TYPEID_PLAYER)
- if( ((Player*)caster)->GetQuestStatus(8346) == QUEST_STATUS_INCOMPLETE && !((Player*)caster)->GetReqKillOrCastCurrentCount(8346, m_creature->GetEntry()) && spell->Id == 28734)
- ((Player*)caster)->CastedCreatureOrGO(15468, m_creature->GetGUID(), spell->Id);
- return;
- }
-};
-CreatureAI* GetAI_mobs_mana_tapped(Creature *_Creature)
-{
- return new mobs_mana_tappedAI (_Creature);
-}
-
-/*######
-## npc_prospector_anvilward
-######*/
-
-#define QUEST_THE_DWARVEN_SPY 8483
-
-struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
-{
- // CreatureAI functions
- npc_prospector_anvilwardAI(Creature *c) : npc_escortAI(c) {Reset();}
-
- // Pure Virtual Functions
- void WaypointReached(uint32 i)
- {
- switch (i)
- {
- case 0:
- m_creature->Say("Very well. Let's see what you have to show me, $N.", LANG_UNIVERSAL, PlayerGUID);
- break;
- case 5:
- m_creature->Say("What manner of trick is this, $R? If you seek to ambush me, I warn you I will not go down quietly!", LANG_UNIVERSAL, PlayerGUID);
- break;
- case 6:
- m_creature->setFaction(24);
- break;
- }
- }
-
- void Aggro(Unit* who) { }
-
- void Reset()
- {
- //Default npc faction
- m_creature->setFaction(35);
- }
-
- void JustDied(Unit* killer)
- {
- //Default npc faction
- m_creature->setFaction(35);
- }
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff); //Must update npc_escortAI
-
- }
-};
-
-CreatureAI* GetAI_npc_prospector_anvilward(Creature *_Creature)
-{
- npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(_Creature);
-
- thisAI->AddWaypoint(0, 9294.78, -6682.51, 22.42);
- thisAI->AddWaypoint(1, 9298.27, -6667.99, 22.42);
- thisAI->AddWaypoint(2, 9309.63, -6658.84, 22.43);
- thisAI->AddWaypoint(3, 9304.43, -6649.31, 26.46);
- thisAI->AddWaypoint(4, 9298.83, -6648.00, 28.61);
- thisAI->AddWaypoint(5, 9291.06, -6653.46, 31.83,2500);
- thisAI->AddWaypoint(6, 9289.08, -6660.17, 31.85,5000);
- thisAI->AddWaypoint(7, 9291.06, -6653.46, 31.83);
-
- return (CreatureAI*)thisAI;
-}
-
-bool GossipHello_npc_prospector_anvilward(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(0, "I need a moment of your time, sir.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(8239, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_prospector_anvilward(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(8240, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- //attack,defend,walk
- ((npc_escortAI*)(_Creature->AI()))->Start(true, true, false, player->GetGUID());
- break;
- }
- return true;
-}
-
-void AddSC_eversong_woods()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_mana_tapped";
- newscript->GetAI = GetAI_mobs_mana_tapped;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name= "npc_prospector_anvilward";
- newscript->GetAI = GetAI_npc_prospector_anvilward;
- newscript->pGossipHello = &GossipHello_npc_prospector_anvilward;
- newscript->pGossipSelect = &GossipSelect_npc_prospector_anvilward;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Eversong_Woods
+SD%Complete: 100
+SDComment: Quest support: 8346, 8483
+SDCategory: Eversong Woods
+EndScriptData */
+
+/* ContentData
+mobs_mana_tapped
+npc_prospector_anvilward
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+
+/*######
+## mobs_mana_tapped
+######*/
+
+struct TRINITY_DLL_DECL mobs_mana_tappedAI : public ScriptedAI
+{
+ mobs_mana_tappedAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+
+ void Aggro(Unit *who) { }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( caster->GetTypeId() == TYPEID_PLAYER)
+ if( ((Player*)caster)->GetQuestStatus(8346) == QUEST_STATUS_INCOMPLETE && !((Player*)caster)->GetReqKillOrCastCurrentCount(8346, m_creature->GetEntry()) && spell->Id == 28734)
+ ((Player*)caster)->CastedCreatureOrGO(15468, m_creature->GetGUID(), spell->Id);
+ return;
+ }
+};
+CreatureAI* GetAI_mobs_mana_tapped(Creature *_Creature)
+{
+ return new mobs_mana_tappedAI (_Creature);
+}
+
+/*######
+## npc_prospector_anvilward
+######*/
+
+#define QUEST_THE_DWARVEN_SPY 8483
+
+struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
+{
+ // CreatureAI functions
+ npc_prospector_anvilwardAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ // Pure Virtual Functions
+ void WaypointReached(uint32 i)
+ {
+ switch (i)
+ {
+ case 0:
+ m_creature->Say("Very well. Let's see what you have to show me, $N.", LANG_UNIVERSAL, PlayerGUID);
+ break;
+ case 5:
+ m_creature->Say("What manner of trick is this, $R? If you seek to ambush me, I warn you I will not go down quietly!", LANG_UNIVERSAL, PlayerGUID);
+ break;
+ case 6:
+ m_creature->setFaction(24);
+ break;
+ }
+ }
+
+ void Aggro(Unit* who) { }
+
+ void Reset()
+ {
+ //Default npc faction
+ m_creature->setFaction(35);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ //Default npc faction
+ m_creature->setFaction(35);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff); //Must update npc_escortAI
+
+ }
+};
+
+CreatureAI* GetAI_npc_prospector_anvilward(Creature *_Creature)
+{
+ npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(_Creature);
+
+ thisAI->AddWaypoint(0, 9294.78, -6682.51, 22.42);
+ thisAI->AddWaypoint(1, 9298.27, -6667.99, 22.42);
+ thisAI->AddWaypoint(2, 9309.63, -6658.84, 22.43);
+ thisAI->AddWaypoint(3, 9304.43, -6649.31, 26.46);
+ thisAI->AddWaypoint(4, 9298.83, -6648.00, 28.61);
+ thisAI->AddWaypoint(5, 9291.06, -6653.46, 31.83,2500);
+ thisAI->AddWaypoint(6, 9289.08, -6660.17, 31.85,5000);
+ thisAI->AddWaypoint(7, 9291.06, -6653.46, 31.83);
+
+ return (CreatureAI*)thisAI;
+}
+
+bool GossipHello_npc_prospector_anvilward(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, "I need a moment of your time, sir.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(8239, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_prospector_anvilward(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(8240, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->CLOSE_GOSSIP_MENU();
+ //attack,defend,walk
+ ((npc_escortAI*)(_Creature->AI()))->Start(true, true, false, player->GetGUID());
+ break;
+ }
+ return true;
+}
+
+void AddSC_eversong_woods()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_mana_tapped";
+ newscript->GetAI = GetAI_mobs_mana_tapped;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name= "npc_prospector_anvilward";
+ newscript->GetAI = GetAI_npc_prospector_anvilward;
+ newscript->pGossipHello = &GossipHello_npc_prospector_anvilward;
+ newscript->pGossipSelect = &GossipSelect_npc_prospector_anvilward;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
index 5f9bbb6a78b..59dc03456a4 100644
--- a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
+++ b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
@@ -1,89 +1,89 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Felwood
-SD%Complete: 95
-SDComment: Quest support: related to 4101&4102 (To obtain Cenarion Beacon)
-SDCategory: Felwood
-EndScriptData */
-
-/* ContentData
-npcs_riverbreeze_and_silversky
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npcs_riverbreeze_and_silversky
-######*/
-
-#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon"
-
-bool GossipHello_npcs_riverbreeze_and_silversky(Player *player, Creature *_Creature)
-{
- uint32 eCreature = _Creature->GetEntry();
-
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( eCreature==9528 )
- {
- if( player->GetQuestRewardStatus(4101) )
- {
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2848, _Creature->GetGUID());
- }else if( player->GetTeam()==HORDE )
- player->SEND_GOSSIP_MENU(2845, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2844, _Creature->GetGUID());
- }
-
- if( eCreature==9529 )
- {
- if( player->GetQuestRewardStatus(4102) )
- {
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2849, _Creature->GetGUID());
- }else if( player->GetTeam()==ALLIANCE )
- player->SEND_GOSSIP_MENU(2843, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2842, _Creature->GetGUID());
- }
-
- return true;
-}
-
-bool GossipSelect_npcs_riverbreeze_and_silversky(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if( action==GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 15120, false);
- }
- return true;
-}
-
-void AddSC_felwood()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npcs_riverbreeze_and_silversky";
- newscript->pGossipHello = &GossipHello_npcs_riverbreeze_and_silversky;
- newscript->pGossipSelect = &GossipSelect_npcs_riverbreeze_and_silversky;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Felwood
+SD%Complete: 95
+SDComment: Quest support: related to 4101&4102 (To obtain Cenarion Beacon)
+SDCategory: Felwood
+EndScriptData */
+
+/* ContentData
+npcs_riverbreeze_and_silversky
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npcs_riverbreeze_and_silversky
+######*/
+
+#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon"
+
+bool GossipHello_npcs_riverbreeze_and_silversky(Player *player, Creature *_Creature)
+{
+ uint32 eCreature = _Creature->GetEntry();
+
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( eCreature==9528 )
+ {
+ if( player->GetQuestRewardStatus(4101) )
+ {
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(2848, _Creature->GetGUID());
+ }else if( player->GetTeam()==HORDE )
+ player->SEND_GOSSIP_MENU(2845, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(2844, _Creature->GetGUID());
+ }
+
+ if( eCreature==9529 )
+ {
+ if( player->GetQuestRewardStatus(4102) )
+ {
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(2849, _Creature->GetGUID());
+ }else if( player->GetTeam()==ALLIANCE )
+ player->SEND_GOSSIP_MENU(2843, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(2842, _Creature->GetGUID());
+ }
+
+ return true;
+}
+
+bool GossipSelect_npcs_riverbreeze_and_silversky(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if( action==GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 15120, false);
+ }
+ return true;
+}
+
+void AddSC_felwood()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npcs_riverbreeze_and_silversky";
+ newscript->pGossipHello = &GossipHello_npcs_riverbreeze_and_silversky;
+ newscript->pGossipSelect = &GossipSelect_npcs_riverbreeze_and_silversky;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
index da65d334d9e..ca8c5d0a02d 100644
--- a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
+++ b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
@@ -1,85 +1,85 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Feralas
-SD%Complete: 100
-SDComment: Quest support: 3520. Special vendor Gregan Brewspewer
-SDCategory: Feralas
-EndScriptData */
-
-#include "precompiled.h"
-
-/*######
-## npc_gregan_brewspewer
-######*/
-
-bool GossipHello_npc_gregan_brewspewer(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(0, "Buy somethin', will ya?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(2433,_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_gregan_brewspewer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(2434,_Creature->GetGUID());
- }
- if( action == GOSSIP_ACTION_TRADE )
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- return true;
-}
-
-/*######
-## npc_screecher_spirit
-######*/
-
-bool GossipHello_npc_screecher_spirit(Player *player, Creature *_Creature)
-{
- player->SEND_GOSSIP_MENU(2039,_Creature->GetGUID() );
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_feralas()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_gregan_brewspewer";
- newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer;
- newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_screecher_spirit";
- newscript->pGossipHello = &GossipHello_npc_screecher_spirit;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Feralas
+SD%Complete: 100
+SDComment: Quest support: 3520. Special vendor Gregan Brewspewer
+SDCategory: Feralas
+EndScriptData */
+
+#include "precompiled.h"
+
+/*######
+## npc_gregan_brewspewer
+######*/
+
+bool GossipHello_npc_gregan_brewspewer(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, "Buy somethin', will ya?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(2433,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_gregan_brewspewer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(2434,_Creature->GetGUID());
+ }
+ if( action == GOSSIP_ACTION_TRADE )
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ return true;
+}
+
+/*######
+## npc_screecher_spirit
+######*/
+
+bool GossipHello_npc_screecher_spirit(Player *player, Creature *_Creature)
+{
+ player->SEND_GOSSIP_MENU(2039,_Creature->GetGUID() );
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_feralas()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_gregan_brewspewer";
+ newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer;
+ newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_screecher_spirit";
+ newscript->pGossipHello = &GossipHello_npc_screecher_spirit;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
index cef922dacd3..f2d4b0ce34a 100644
--- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
+++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
@@ -1,134 +1,134 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Ghostlands
-SD%Complete: 100
-SDComment: Quest support: 9692. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
-SDCategory: Ghostlands
-EndScriptData */
-
-/* ContentData
-npc_blood_knight_dawnstar
-npc_budd_nedreck
-npc_rathis_tomber
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_blood_knight_dawnstar
-######*/
-
-bool GossipHello_npc_blood_knight_dawnstar(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(24226,1,true))
- player->ADD_GOSSIP_ITEM( 0, "Take Blood Knight Insignia", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_blood_knight_dawnstar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 24226, 1, false);
- if( msg == EQUIP_ERR_OK )
- {
- player->StoreNewItem( dest, 24226, 1, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- return true;
-}
-
-/*######
-## npc_budd_nedreck
-######*/
-
-bool GossipHello_npc_budd_nedreck(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0,"You gave the crew disguises?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_budd_nedreck(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action==GOSSIP_ACTION_INFO_DEF )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 42540, false);
- }
- return true;
-}
-
-/*######
-## npc_rathis_tomber
-######*/
-
-bool GossipHello_npc_rathis_tomber(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isVendor() && player->GetQuestRewardStatus(9152) )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(8432,_Creature->GetGUID());
- }else
- player->SEND_GOSSIP_MENU(8431,_Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_rathis_tomber(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_TRADE )
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- return true;
-}
-
-void AddSC_ghostlands()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_blood_knight_dawnstar";
- newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar;
- newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_budd_nedreck";
- newscript->pGossipHello = &GossipHello_npc_budd_nedreck;
- newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_rathis_tomber";
- newscript->pGossipHello = &GossipHello_npc_rathis_tomber;
- newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Ghostlands
+SD%Complete: 100
+SDComment: Quest support: 9692. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
+SDCategory: Ghostlands
+EndScriptData */
+
+/* ContentData
+npc_blood_knight_dawnstar
+npc_budd_nedreck
+npc_rathis_tomber
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_blood_knight_dawnstar
+######*/
+
+bool GossipHello_npc_blood_knight_dawnstar(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(24226,1,true))
+ player->ADD_GOSSIP_ITEM( 0, "Take Blood Knight Insignia", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_blood_knight_dawnstar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 24226, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ {
+ player->StoreNewItem( dest, 24226, 1, true);
+ player->PlayerTalkClass->ClearMenus();
+ }
+ }
+ return true;
+}
+
+/*######
+## npc_budd_nedreck
+######*/
+
+bool GossipHello_npc_budd_nedreck(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"You gave the crew disguises?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_budd_nedreck(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action==GOSSIP_ACTION_INFO_DEF )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 42540, false);
+ }
+ return true;
+}
+
+/*######
+## npc_rathis_tomber
+######*/
+
+bool GossipHello_npc_rathis_tomber(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isVendor() && player->GetQuestRewardStatus(9152) )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(8432,_Creature->GetGUID());
+ }else
+ player->SEND_GOSSIP_MENU(8431,_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_rathis_tomber(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_TRADE )
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ return true;
+}
+
+void AddSC_ghostlands()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_blood_knight_dawnstar";
+ newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar;
+ newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_budd_nedreck";
+ newscript->pGossipHello = &GossipHello_npc_budd_nedreck;
+ newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_rathis_tomber";
+ newscript->pGossipHello = &GossipHello_npc_rathis_tomber;
+ newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
index 7b0ea9f295c..462650fcb31 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
@@ -1,281 +1,281 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gruul
-SD%Complete: 25
-SDComment: Ground Slam seriously messed up due to core problem
-SDCategory: Gruul's Lair
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_gruuls_lair.h"
-
-#define SPELL_GROWTH 36300
-#define SPELL_CAVE_IN 36240
-#define SPELL_GROUND_SLAM 33525 // AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback)
-#define SPELL_SHATTER_EFFECT 33671
-#define SPELL_HURTFUL_STRIKE 33813
-#define SPELL_REVERBERATION 36297 //AoE Silence
-#define SPELL_GRONN_LORDS_GRASP 33572 //Already handled in GroundSlam
-#define SPELL_STONED 33652 //-- Spell is self cast
-#define SPELL_SHATTER 33654
-#define SPELL_MAGNETIC_PULL 28337
-#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made
-
-#define EMOTE_GROW "grows in size!"
-#define SAY_AGGRO "Come.... and die."
-
-struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
-{
- boss_gruulAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- ScriptedInstance *pInstance;
-
- uint32 Growth_Timer;
- uint32 CaveIn_Timer;
- uint32 GroundSlamTimer;
- uint32 GroundSlamStage;
- uint32 PerformingGroundSlam;
- uint32 HurtfulStrike_Timer;
- uint32 Reverberation_Timer;
-
- void Reset()
- {
- pInstance = (ScriptedInstance*)m_creature->GetInstanceData();
-
- Growth_Timer= 30000;
- CaveIn_Timer= 40000;
- GroundSlamTimer= 35000;
- GroundSlamStage= 0;
- PerformingGroundSlam= false;
- HurtfulStrike_Timer= 8000;
- Reverberation_Timer= 60000+45000;
-
- if(pInstance)
- pInstance->SetData(DATA_GRUULEVENT, 0);
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_GRUULEVENT, 1);
- }
-
- void Aggro(Unit *who)
- {
-
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
-
- if(pInstance)
- pInstance->SetData(DATA_GRUULEVENT, 1);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- // Growth
- // Gruul can cast this spell up to 30 times
- if (Growth_Timer < diff)
- {
- DoCast(m_creature,SPELL_GROWTH);
- DoTextEmote(EMOTE_GROW,NULL);
- Growth_Timer = 30000;
- }else Growth_Timer -= diff;
-
- if(PerformingGroundSlam)
- {
- if(GroundSlamTimer < diff)
- {
- switch(GroundSlamStage)
- {
- case 0:
- {
- //Begin the whole ordeal
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
-
- std::vector<Unit*> knockback_targets;
-
- //First limit the list to only players
- for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
-
- if(target && target->GetTypeId() == TYPEID_PLAYER)
- knockback_targets.push_back(target);
- }
-
- //Now to totally disoriend those players
- for(std::vector<Unit*>::iterator itr = knockback_targets.begin(); itr!= knockback_targets.end(); ++itr)
- {
- Unit *target = *itr;
- Unit *target2 = *(knockback_targets.begin() + rand()%knockback_targets.size());
-
- if(target && target2)
- {
- switch(rand()%2)
- {
- case 0: target2->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break;
- case 1: target2->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break;
- }
- }
- }
-
- GroundSlamTimer = 7000;
- } break;
-
- case 1:
- {
- //Players are going to get stoned
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
-
- for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
-
- if(target)
- {
- target->RemoveAurasDueToSpell(SPELL_GRONN_LORDS_GRASP);
- target->CastSpell(target, SPELL_STONED, true, NULL, NULL, m_creature->GetGUID());
- }
- }
-
- GroundSlamTimer = 5000;
-
- } break;
-
- case 2:
- {
- //The dummy shatter spell is cast
- DoCast(m_creature, SPELL_SHATTER);
-
- GroundSlamTimer = 1000;
-
- } break;
-
- case 3:
- {
- //Shatter takes effect
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
-
- for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
-
- if(target)
- {
- target->RemoveAurasDueToSpell(SPELL_STONED);
-
- if(target->GetTypeId() == TYPEID_PLAYER)
- target->CastSpell(target, SPELL_SHATTER_EFFECT, false, NULL, NULL, m_creature->GetGUID());
- }
-
- }
-
- m_creature->GetMotionMaster()->Clear();
-
- Unit *victim = m_creature->getVictim();
- if(victim)
- {
- m_creature->GetMotionMaster()->MoveChase(victim);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
- }
-
- PerformingGroundSlam = false;
-
- GroundSlamTimer =120000;
- HurtfulStrike_Timer= 8000;
- if(Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
- Reverberation_Timer += 10000;
-
- } break;
- }
-
- GroundSlamStage++;
- }
- else
- GroundSlamTimer-=diff;
- }
- else
- {
- // Hurtful Strike
- if (HurtfulStrike_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
-
- if (target && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- DoCast(target,SPELL_HURTFUL_STRIKE);
- else
- DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE);
-
- HurtfulStrike_Timer= 8000;
- }else HurtfulStrike_Timer -= diff;
-
- // Reverberation
- if (Reverberation_Timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(), SPELL_REVERBERATION, true);
-
- Reverberation_Timer = 30000;
- }else Reverberation_Timer -= diff;
-
- // Cave In
- if (CaveIn_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if(target)
- DoCast(target,SPELL_CAVE_IN);
-
- CaveIn_Timer = 20000;
- }else CaveIn_Timer -= diff;
-
- // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
- if (GroundSlamTimer < diff)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
-
- PerformingGroundSlam= true;
- GroundSlamTimer = 0;
- GroundSlamStage = 0;
- DoCast(m_creature->getVictim(), SPELL_GROUND_SLAM);
- } else GroundSlamTimer -=diff;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-CreatureAI* GetAI_boss_gruul(Creature *_Creature)
-{
- return new boss_gruulAI (_Creature);
-}
-
-void AddSC_boss_gruul()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gruul";
- newscript->GetAI = GetAI_boss_gruul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gruul
+SD%Complete: 25
+SDComment: Ground Slam seriously messed up due to core problem
+SDCategory: Gruul's Lair
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_gruuls_lair.h"
+
+#define SPELL_GROWTH 36300
+#define SPELL_CAVE_IN 36240
+#define SPELL_GROUND_SLAM 33525 // AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback)
+#define SPELL_SHATTER_EFFECT 33671
+#define SPELL_HURTFUL_STRIKE 33813
+#define SPELL_REVERBERATION 36297 //AoE Silence
+#define SPELL_GRONN_LORDS_GRASP 33572 //Already handled in GroundSlam
+#define SPELL_STONED 33652 //-- Spell is self cast
+#define SPELL_SHATTER 33654
+#define SPELL_MAGNETIC_PULL 28337
+#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made
+
+#define EMOTE_GROW "grows in size!"
+#define SAY_AGGRO "Come.... and die."
+
+struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
+{
+ boss_gruulAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Growth_Timer;
+ uint32 CaveIn_Timer;
+ uint32 GroundSlamTimer;
+ uint32 GroundSlamStage;
+ uint32 PerformingGroundSlam;
+ uint32 HurtfulStrike_Timer;
+ uint32 Reverberation_Timer;
+
+ void Reset()
+ {
+ pInstance = (ScriptedInstance*)m_creature->GetInstanceData();
+
+ Growth_Timer= 30000;
+ CaveIn_Timer= 40000;
+ GroundSlamTimer= 35000;
+ GroundSlamStage= 0;
+ PerformingGroundSlam= false;
+ HurtfulStrike_Timer= 8000;
+ Reverberation_Timer= 60000+45000;
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRUULEVENT, 0);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_GRUULEVENT, 1);
+ }
+
+ void Aggro(Unit *who)
+ {
+
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRUULEVENT, 1);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ // Growth
+ // Gruul can cast this spell up to 30 times
+ if (Growth_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_GROWTH);
+ DoTextEmote(EMOTE_GROW,NULL);
+ Growth_Timer = 30000;
+ }else Growth_Timer -= diff;
+
+ if(PerformingGroundSlam)
+ {
+ if(GroundSlamTimer < diff)
+ {
+ switch(GroundSlamStage)
+ {
+ case 0:
+ {
+ //Begin the whole ordeal
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ std::vector<Unit*> knockback_targets;
+
+ //First limit the list to only players
+ for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+
+ if(target && target->GetTypeId() == TYPEID_PLAYER)
+ knockback_targets.push_back(target);
+ }
+
+ //Now to totally disoriend those players
+ for(std::vector<Unit*>::iterator itr = knockback_targets.begin(); itr!= knockback_targets.end(); ++itr)
+ {
+ Unit *target = *itr;
+ Unit *target2 = *(knockback_targets.begin() + rand()%knockback_targets.size());
+
+ if(target && target2)
+ {
+ switch(rand()%2)
+ {
+ case 0: target2->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break;
+ case 1: target2->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break;
+ }
+ }
+ }
+
+ GroundSlamTimer = 7000;
+ } break;
+
+ case 1:
+ {
+ //Players are going to get stoned
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+
+ if(target)
+ {
+ target->RemoveAurasDueToSpell(SPELL_GRONN_LORDS_GRASP);
+ target->CastSpell(target, SPELL_STONED, true, NULL, NULL, m_creature->GetGUID());
+ }
+ }
+
+ GroundSlamTimer = 5000;
+
+ } break;
+
+ case 2:
+ {
+ //The dummy shatter spell is cast
+ DoCast(m_creature, SPELL_SHATTER);
+
+ GroundSlamTimer = 1000;
+
+ } break;
+
+ case 3:
+ {
+ //Shatter takes effect
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+
+ if(target)
+ {
+ target->RemoveAurasDueToSpell(SPELL_STONED);
+
+ if(target->GetTypeId() == TYPEID_PLAYER)
+ target->CastSpell(target, SPELL_SHATTER_EFFECT, false, NULL, NULL, m_creature->GetGUID());
+ }
+
+ }
+
+ m_creature->GetMotionMaster()->Clear();
+
+ Unit *victim = m_creature->getVictim();
+ if(victim)
+ {
+ m_creature->GetMotionMaster()->MoveChase(victim);
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
+ }
+
+ PerformingGroundSlam = false;
+
+ GroundSlamTimer =120000;
+ HurtfulStrike_Timer= 8000;
+ if(Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
+ Reverberation_Timer += 10000;
+
+ } break;
+ }
+
+ GroundSlamStage++;
+ }
+ else
+ GroundSlamTimer-=diff;
+ }
+ else
+ {
+ // Hurtful Strike
+ if (HurtfulStrike_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+
+ if (target && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ DoCast(target,SPELL_HURTFUL_STRIKE);
+ else
+ DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE);
+
+ HurtfulStrike_Timer= 8000;
+ }else HurtfulStrike_Timer -= diff;
+
+ // Reverberation
+ if (Reverberation_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_REVERBERATION, true);
+
+ Reverberation_Timer = 30000;
+ }else Reverberation_Timer -= diff;
+
+ // Cave In
+ if (CaveIn_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if(target)
+ DoCast(target,SPELL_CAVE_IN);
+
+ CaveIn_Timer = 20000;
+ }else CaveIn_Timer -= diff;
+
+ // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
+ if (GroundSlamTimer < diff)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ PerformingGroundSlam= true;
+ GroundSlamTimer = 0;
+ GroundSlamStage = 0;
+ DoCast(m_creature->getVictim(), SPELL_GROUND_SLAM);
+ } else GroundSlamTimer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_gruul(Creature *_Creature)
+{
+ return new boss_gruulAI (_Creature);
+}
+
+void AddSC_boss_gruul()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gruul";
+ newscript->GetAI = GetAI_boss_gruul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
index 3dcc401ce50..dbdbc7c9bf1 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
@@ -1,687 +1,687 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_King_Maulgar
-SD%Complete: 80
-SDComment: Verify that the script is working properly
-SDCategory: Gruul's Lair
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_gruuls_lair.h"
-
-#define SOUND_AGGRO 11367 //"Gronn are the real power in outland."
-
-#define SOUND_ENRAGE 11368 //"You will not defeat the hand of Gruul!"
-
-#define SOUND_OGRE_DEATH1 11369 //"You won't kill next one so easy!"
-#define SOUND_OGRE_DEATH2 11370 //"Pah! Does not prove anything!"
-#define SOUND_OGRE_DEATH3 11371 //"I'm not afraid of you."
-#define SOUND_OGRE_DEATH4 11372 //"Good, now you fight me!"
-
-#define SOUND_SLAY1 11373 //"You not so tough afterall!"
-#define SOUND_SLAY2 11374 //"Aha ha ha ha!"
-#define SOUND_SLAY3 11375 //"Mulgar is king!"
-
-#define SOUND_DEATH 11376 //"Gruul ...will crush you..."
-
-// High King Maulgar
-#define SPELL_ARCING_SMASH 39144
-#define SPELL_MIGHTY_BLOW 33230
-#define SPELL_WHIRLWIND 33238
-#define SPELL_ENRAGE 34970
-
-// Council spells
-#define SPELL_DARK_DECAY 33129
-#define SPELL_GREATER_POLYMORPH 33173
-#define SPELL_LIGHTNING_BOLT 36152
-#define SPELL_ARCANE_SHOCK 33175
-#define SPELL_ARCANE_EXPLOSION 33237
-#define SPELL_GREATER_PW_SHIELD 33147
-#define SPELL_HEAL 33144
-#define SPELL_GREATER_FIREBALL 33051
-#define SPELL_SPELLSHIELD 33054
-#define SPELL_BLAST_WAVE 33061
-
-//High King Maulgar AI
-struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
-{
- boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 ArcingSmash_Timer;
- uint32 MightyBlow_Timer;
- uint32 Whirlwind_Timer;
- uint32 Charging_Timer;
-
- bool Phase2;
-
- uint64 Council[4];
-
- void Reset()
- {
- ArcingSmash_Timer = 10000;
- MightyBlow_Timer = 40000;
- Whirlwind_Timer = 30000;
- Charging_Timer = 0;
- Phase2 = false;
-
- Creature *pCreature = NULL;
- for(uint8 i = 0; i < 4; i++)
- {
- if(Council[i])
- {
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), Council[i]));
- if(pCreature && !pCreature->isAlive())
- {
- pCreature->Respawn();
- pCreature->AI()->EnterEvadeMode();
- }
- }
- }
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void KilledUnit()
- {
- switch(rand()%2)
- {
- case 0: DoPlaySoundToSet(m_creature, SOUND_SLAY1); break;
- case 1: DoPlaySoundToSet(m_creature, SOUND_SLAY2); break;
- case 2: DoPlaySoundToSet(m_creature, SOUND_SLAY3); break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void Aggro(Unit *who) { StartEvent(who); }
-
- void GetCouncil()
- {
- //get council member's guid to respawn them if needed
- Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
- Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER);
- Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER);
- Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND);
- }
-
- void StartEvent(Unit *who)
- {
- if(!pInstance)
- return;
-
- GetCouncil();
-
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
-
- GetCouncil();
-
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- EnterEvadeMode();
-
- //ArcingSmash_Timer
- if (ArcingSmash_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
- ArcingSmash_Timer = 10000;
- }else ArcingSmash_Timer -= diff;
-
- //Whirlwind_Timer
- if (Whirlwind_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
- Whirlwind_Timer = 55000;
- }else Whirlwind_Timer -= diff;
-
- //MightyBlow_Timer
- if (MightyBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW);
- MightyBlow_Timer = 30000+rand()%10000;
- }else MightyBlow_Timer -= diff;
-
- //Entering Phase 2
- if(!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- {
- Phase2 = true;
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
-
- if(Phase2)
- {
- //Charging_Timer
- if(Charging_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- DoStartAttackAndMovement(target);
-
- Charging_Timer = 20000;
- }else Charging_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Olm The Summoner AI
-struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
-{
- boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 DarkDecay_Timer;
- uint32 Summon_Timer;
-
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- DarkDecay_Timer = 10000;
- Summon_Timer = 15000;
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
-
- float DoCalculateRandomLocation()
- {
- float Loc;
- float Rand = rand()%8;
-
- switch(rand()%2)
- {
- case 0: Loc = 0 + Rand; break;
- case 1: Loc = 0 - Rand; break;
- }
- return Loc;
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- EnterEvadeMode();
-
- //DarkDecay_Timer
- if(DarkDecay_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DARK_DECAY);
- DarkDecay_Timer = 20000;
- }else DarkDecay_Timer -= diff;
-
- //Summon_Timer
- if(Summon_Timer < diff)
- {
- Creature *Add = NULL;
- Add = DoSpawnCreature(18847, DoCalculateRandomLocation(), DoCalculateRandomLocation(), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- Summon_Timer = 30000;
- }else Summon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Kiggler The Crazed AI
-struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
-{
- boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 GreatherPolymorph_Timer;
- uint32 LightningBolt_Timer;
- uint32 ArcaneShock_Timer;
- uint32 ArcaneExplosion_Timer;
-
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- GreatherPolymorph_Timer = 5000;
- LightningBolt_Timer = 10000;
- ArcaneShock_Timer = 20000;
- ArcaneExplosion_Timer = 30000;
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if(!InCombat)
- {
- DoStartAttackAndMovement(who);
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- EnterEvadeMode();
-
- //GreaterPolymorph_Timer / disabled: it makes you fall under the texture / if you've got vmaps feel free to uncomment this
- /*if(GreaterPolymorph_Timer < diff)
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- DoCast(target, SPELL_GREATER_POLYMORPH);
-
- GreaterPolymorph_Timer = 20000;
- }else GreaterPolymorph_Timer -= diff;*/
-
- //LightningBolt_Timer
- if(LightningBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
- LightningBolt_Timer = 15000;
- }else LightningBolt_Timer -= diff;
-
- //ArcaneShock_Timer
- if(ArcaneShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK);
- ArcaneShock_Timer = 20000;
- }else ArcaneShock_Timer -= diff;
-
- //ArcaneExplosion_Timer
- if(ArcaneExplosion_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
- ArcaneExplosion_Timer = 30000;
- }else ArcaneExplosion_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Blindeye The Seer AI
-struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
-{
- boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 GreaterPowerWordShield_Timer;
- uint32 Heal_Timer;
-
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- GreaterPowerWordShield_Timer = 5000;
- Heal_Timer = 30000;
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if(!InCombat)
- {
- DoStartAttackAndMovement(who);
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- EnterEvadeMode();
-
- //GreaterPowerWordShield_Timer
- if(GreaterPowerWordShield_Timer < diff)
- {
- DoCast(m_creature, SPELL_GREATER_PW_SHIELD);
- GreaterPowerWordShield_Timer = 40000;
- }else GreaterPowerWordShield_Timer -= diff;
-
- //Heal_Timer
- if(Heal_Timer < diff)
- {
- DoCast(m_creature, SPELL_HEAL);
- Heal_Timer = 60000;
- }else Heal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Krosh Firehand AI
-struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
-{
- boss_krosh_firehandAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 GreaterFireball_Timer;
- uint32 SpellShield_Timer;
- uint32 BlastWave_Timer;
-
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- GreaterFireball_Timer = 1000;
- SpellShield_Timer = 5000;
- BlastWave_Timer = 20000;
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, 0);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if(!InCombat)
- {
- DoStartAttackAndMovement(who);
- if(pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, 1);
- }
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
- {
- Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //someone evaded!
- if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- EnterEvadeMode();
-
- //GreaterFireball_Timer
- if(GreaterFireball_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL);
- GreaterFireball_Timer = 2000;
- }else GreaterFireball_Timer -= diff;
-
- //SpellShield_Timer
- if(SpellShield_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD);
- SpellShield_Timer = 30000;
- }else SpellShield_Timer -= diff;
-
- //BlastWave_Timer
- if(BlastWave_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE);
- BlastWave_Timer = 60000;
- }else BlastWave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_high_king_maulgar(Creature *_Creature)
-{
- return new boss_high_king_maulgarAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_olm_the_summoner(Creature *_Creature)
-{
- return new boss_olm_the_summonerAI (_Creature);
-}
-
-CreatureAI *GetAI_boss_kiggler_the_crazed(Creature *_Creature)
-{
- return new boss_kiggler_the_crazedAI (_Creature);
-}
-
-CreatureAI *GetAI_boss_blindeye_the_seer(Creature *_Creature)
-{
- return new boss_blindeye_the_seerAI (_Creature);
-}
-
-CreatureAI *GetAI_boss_krosh_firehand(Creature *_Creature)
-{
- return new boss_krosh_firehandAI (_Creature);
-}
-
-void AddSC_boss_high_king_maulgar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_high_king_maulgar";
- newscript->GetAI = GetAI_boss_high_king_maulgar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_kiggler_the_crazed";
- newscript->GetAI = GetAI_boss_kiggler_the_crazed;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_blindeye_the_seer";
- newscript->GetAI = GetAI_boss_blindeye_the_seer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_olm_the_summoner";
- newscript->GetAI = GetAI_boss_olm_the_summoner;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_krosh_firehand";
- newscript->GetAI = GetAI_boss_krosh_firehand;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_King_Maulgar
+SD%Complete: 80
+SDComment: Verify that the script is working properly
+SDCategory: Gruul's Lair
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_gruuls_lair.h"
+
+#define SOUND_AGGRO 11367 //"Gronn are the real power in outland."
+
+#define SOUND_ENRAGE 11368 //"You will not defeat the hand of Gruul!"
+
+#define SOUND_OGRE_DEATH1 11369 //"You won't kill next one so easy!"
+#define SOUND_OGRE_DEATH2 11370 //"Pah! Does not prove anything!"
+#define SOUND_OGRE_DEATH3 11371 //"I'm not afraid of you."
+#define SOUND_OGRE_DEATH4 11372 //"Good, now you fight me!"
+
+#define SOUND_SLAY1 11373 //"You not so tough afterall!"
+#define SOUND_SLAY2 11374 //"Aha ha ha ha!"
+#define SOUND_SLAY3 11375 //"Mulgar is king!"
+
+#define SOUND_DEATH 11376 //"Gruul ...will crush you..."
+
+// High King Maulgar
+#define SPELL_ARCING_SMASH 39144
+#define SPELL_MIGHTY_BLOW 33230
+#define SPELL_WHIRLWIND 33238
+#define SPELL_ENRAGE 34970
+
+// Council spells
+#define SPELL_DARK_DECAY 33129
+#define SPELL_GREATER_POLYMORPH 33173
+#define SPELL_LIGHTNING_BOLT 36152
+#define SPELL_ARCANE_SHOCK 33175
+#define SPELL_ARCANE_EXPLOSION 33237
+#define SPELL_GREATER_PW_SHIELD 33147
+#define SPELL_HEAL 33144
+#define SPELL_GREATER_FIREBALL 33051
+#define SPELL_SPELLSHIELD 33054
+#define SPELL_BLAST_WAVE 33061
+
+//High King Maulgar AI
+struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
+{
+ boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 ArcingSmash_Timer;
+ uint32 MightyBlow_Timer;
+ uint32 Whirlwind_Timer;
+ uint32 Charging_Timer;
+
+ bool Phase2;
+
+ uint64 Council[4];
+
+ void Reset()
+ {
+ ArcingSmash_Timer = 10000;
+ MightyBlow_Timer = 40000;
+ Whirlwind_Timer = 30000;
+ Charging_Timer = 0;
+ Phase2 = false;
+
+ Creature *pCreature = NULL;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ if(Council[i])
+ {
+ pCreature = (Creature*)(Unit::GetUnit((*m_creature), Council[i]));
+ if(pCreature && !pCreature->isAlive())
+ {
+ pCreature->Respawn();
+ pCreature->AI()->EnterEvadeMode();
+ }
+ }
+ }
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void KilledUnit()
+ {
+ switch(rand()%2)
+ {
+ case 0: DoPlaySoundToSet(m_creature, SOUND_SLAY1); break;
+ case 1: DoPlaySoundToSet(m_creature, SOUND_SLAY2); break;
+ case 2: DoPlaySoundToSet(m_creature, SOUND_SLAY3); break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void Aggro(Unit *who) { StartEvent(who); }
+
+ void GetCouncil()
+ {
+ //get council member's guid to respawn them if needed
+ Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
+ Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER);
+ Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER);
+ Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND);
+ }
+
+ void StartEvent(Unit *who)
+ {
+ if(!pInstance)
+ return;
+
+ GetCouncil();
+
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+
+ GetCouncil();
+
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ EnterEvadeMode();
+
+ //ArcingSmash_Timer
+ if (ArcingSmash_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ ArcingSmash_Timer = 10000;
+ }else ArcingSmash_Timer -= diff;
+
+ //Whirlwind_Timer
+ if (Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ Whirlwind_Timer = 55000;
+ }else Whirlwind_Timer -= diff;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW);
+ MightyBlow_Timer = 30000+rand()%10000;
+ }else MightyBlow_Timer -= diff;
+
+ //Entering Phase 2
+ if(!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ {
+ Phase2 = true;
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+
+ if(Phase2)
+ {
+ //Charging_Timer
+ if(Charging_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ DoStartAttackAndMovement(target);
+
+ Charging_Timer = 20000;
+ }else Charging_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Olm The Summoner AI
+struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
+{
+ boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 DarkDecay_Timer;
+ uint32 Summon_Timer;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ DarkDecay_Timer = 10000;
+ Summon_Timer = 15000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+
+ float DoCalculateRandomLocation()
+ {
+ float Loc;
+ float Rand = rand()%8;
+
+ switch(rand()%2)
+ {
+ case 0: Loc = 0 + Rand; break;
+ case 1: Loc = 0 - Rand; break;
+ }
+ return Loc;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ EnterEvadeMode();
+
+ //DarkDecay_Timer
+ if(DarkDecay_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DARK_DECAY);
+ DarkDecay_Timer = 20000;
+ }else DarkDecay_Timer -= diff;
+
+ //Summon_Timer
+ if(Summon_Timer < diff)
+ {
+ Creature *Add = NULL;
+ Add = DoSpawnCreature(18847, DoCalculateRandomLocation(), DoCalculateRandomLocation(), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Summon_Timer = 30000;
+ }else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Kiggler The Crazed AI
+struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
+{
+ boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 GreatherPolymorph_Timer;
+ uint32 LightningBolt_Timer;
+ uint32 ArcaneShock_Timer;
+ uint32 ArcaneExplosion_Timer;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ GreatherPolymorph_Timer = 5000;
+ LightningBolt_Timer = 10000;
+ ArcaneShock_Timer = 20000;
+ ArcaneExplosion_Timer = 30000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if(!InCombat)
+ {
+ DoStartAttackAndMovement(who);
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ EnterEvadeMode();
+
+ //GreaterPolymorph_Timer / disabled: it makes you fall under the texture / if you've got vmaps feel free to uncomment this
+ /*if(GreaterPolymorph_Timer < diff)
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ DoCast(target, SPELL_GREATER_POLYMORPH);
+
+ GreaterPolymorph_Timer = 20000;
+ }else GreaterPolymorph_Timer -= diff;*/
+
+ //LightningBolt_Timer
+ if(LightningBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ LightningBolt_Timer = 15000;
+ }else LightningBolt_Timer -= diff;
+
+ //ArcaneShock_Timer
+ if(ArcaneShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK);
+ ArcaneShock_Timer = 20000;
+ }else ArcaneShock_Timer -= diff;
+
+ //ArcaneExplosion_Timer
+ if(ArcaneExplosion_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ ArcaneExplosion_Timer = 30000;
+ }else ArcaneExplosion_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Blindeye The Seer AI
+struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
+{
+ boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 GreaterPowerWordShield_Timer;
+ uint32 Heal_Timer;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ GreaterPowerWordShield_Timer = 5000;
+ Heal_Timer = 30000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if(!InCombat)
+ {
+ DoStartAttackAndMovement(who);
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ EnterEvadeMode();
+
+ //GreaterPowerWordShield_Timer
+ if(GreaterPowerWordShield_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_GREATER_PW_SHIELD);
+ GreaterPowerWordShield_Timer = 40000;
+ }else GreaterPowerWordShield_Timer -= diff;
+
+ //Heal_Timer
+ if(Heal_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HEAL);
+ Heal_Timer = 60000;
+ }else Heal_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Krosh Firehand AI
+struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
+{
+ boss_krosh_firehandAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 GreaterFireball_Timer;
+ uint32 SpellShield_Timer;
+ uint32 BlastWave_Timer;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ GreaterFireball_Timer = 1000;
+ SpellShield_Timer = 5000;
+ BlastWave_Timer = 20000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if(!InCombat)
+ {
+ DoStartAttackAndMovement(who);
+ if(pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, 1);
+ }
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //someone evaded!
+ if(pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ EnterEvadeMode();
+
+ //GreaterFireball_Timer
+ if(GreaterFireball_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL);
+ GreaterFireball_Timer = 2000;
+ }else GreaterFireball_Timer -= diff;
+
+ //SpellShield_Timer
+ if(SpellShield_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD);
+ SpellShield_Timer = 30000;
+ }else SpellShield_Timer -= diff;
+
+ //BlastWave_Timer
+ if(BlastWave_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE);
+ BlastWave_Timer = 60000;
+ }else BlastWave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_high_king_maulgar(Creature *_Creature)
+{
+ return new boss_high_king_maulgarAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_olm_the_summoner(Creature *_Creature)
+{
+ return new boss_olm_the_summonerAI (_Creature);
+}
+
+CreatureAI *GetAI_boss_kiggler_the_crazed(Creature *_Creature)
+{
+ return new boss_kiggler_the_crazedAI (_Creature);
+}
+
+CreatureAI *GetAI_boss_blindeye_the_seer(Creature *_Creature)
+{
+ return new boss_blindeye_the_seerAI (_Creature);
+}
+
+CreatureAI *GetAI_boss_krosh_firehand(Creature *_Creature)
+{
+ return new boss_krosh_firehandAI (_Creature);
+}
+
+void AddSC_boss_high_king_maulgar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_high_king_maulgar";
+ newscript->GetAI = GetAI_boss_high_king_maulgar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_kiggler_the_crazed";
+ newscript->GetAI = GetAI_boss_kiggler_the_crazed;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_blindeye_the_seer";
+ newscript->GetAI = GetAI_boss_blindeye_the_seer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_olm_the_summoner";
+ newscript->GetAI = GetAI_boss_olm_the_summoner;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_krosh_firehand";
+ newscript->GetAI = GetAI_boss_krosh_firehand;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
index 4c432a8f5d5..e2d780dabda 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
@@ -1,15 +1,15 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_GRUULS_LAIR_H
-#define DEF_GRUULS_LAIR_H
-
-#define DATA_BLINDEYETHESEER 1
-#define DATA_GRUULEVENT 2
-#define DATA_KIGGLERTHECRAZED 3
-#define DATA_KROSHFIREHAND 4
-#define DATA_MAULGAREVENT 5
-#define DATA_MAULGAREVENT_TANK 6
-#define DATA_OLMTHESUMMONER 7
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_GRUULS_LAIR_H
+#define DEF_GRUULS_LAIR_H
+
+#define DATA_BLINDEYETHESEER 1
+#define DATA_GRUULEVENT 2
+#define DATA_KIGGLERTHECRAZED 3
+#define DATA_KROSHFIREHAND 4
+#define DATA_MAULGAREVENT 5
+#define DATA_MAULGAREVENT_TANK 6
+#define DATA_OLMTHESUMMONER 7
+#endif
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
index 1bafb91a422..dc48fe0ea81 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
@@ -1,139 +1,139 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Gruuls_Lair
-SD%Complete: 100
-SDComment:
-SDCategory: Gruul's Lair
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_gruuls_lair.h"
-
-#define ENCOUNTERS 2
-
-/* Gruuls Lair encounters:
-1 - High King Maulgar event
-2 - Gruul event
-*/
-
-struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
-{
- instance_gruuls_lair(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- bool Encounters[ENCOUNTERS];
-
- uint64 MaulgarEvent_Tank;
- uint64 KigglerTheCrazed;
- uint64 BlindeyeTheSeer;
- uint64 OlmTheSummoner;
- uint64 KroshFirehand;
-
- void Initialize()
- {
- MaulgarEvent_Tank = 0;
- KigglerTheCrazed = 0;
- BlindeyeTheSeer = 0;
- OlmTheSummoner = 0;
- KroshFirehand = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i]) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 18835: KigglerTheCrazed = creature->GetGUID(); break;
- case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
- case 18834: OlmTheSummoner = creature->GetGUID(); break;
- case 18832: KroshFirehand = creature->GetGUID(); break;
- }
- }
-
- void SetData64(uint32 type, uint64 data)
- {
- if(type == DATA_MAULGAREVENT_TANK)
- MaulgarEvent_Tank = data;
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_MAULGAREVENT_TANK:
- return MaulgarEvent_Tank;
- case DATA_KIGGLERTHECRAZED:
- return KigglerTheCrazed;
- case DATA_BLINDEYETHESEER:
- return BlindeyeTheSeer;
- case DATA_OLMTHESUMMONER:
- return OlmTheSummoner;
- case DATA_KROSHFIREHAND:
- return KroshFirehand;
- }
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_MAULGAREVENT:
- Encounters[0] = (data) ? true : false;
- break;
- case DATA_GRUULEVENT:
- Encounters[1] = (data) ? true : false;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_MAULGAREVENT:
- return Encounters[0];
- case DATA_GRUULEVENT:
- return Encounters[1];
- }
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_gruuls_lair(Map* map)
-{
- return new instance_gruuls_lair(map);
-}
-
-void AddSC_instance_gruuls_lair()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_gruuls_lair";
- newscript->GetInstanceData = GetInstanceData_instance_gruuls_lair;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Gruuls_Lair
+SD%Complete: 100
+SDComment:
+SDCategory: Gruul's Lair
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_gruuls_lair.h"
+
+#define ENCOUNTERS 2
+
+/* Gruuls Lair encounters:
+1 - High King Maulgar event
+2 - Gruul event
+*/
+
+struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
+{
+ instance_gruuls_lair(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ bool Encounters[ENCOUNTERS];
+
+ uint64 MaulgarEvent_Tank;
+ uint64 KigglerTheCrazed;
+ uint64 BlindeyeTheSeer;
+ uint64 OlmTheSummoner;
+ uint64 KroshFirehand;
+
+ void Initialize()
+ {
+ MaulgarEvent_Tank = 0;
+ KigglerTheCrazed = 0;
+ BlindeyeTheSeer = 0;
+ OlmTheSummoner = 0;
+ KroshFirehand = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i]) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 18835: KigglerTheCrazed = creature->GetGUID(); break;
+ case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
+ case 18834: OlmTheSummoner = creature->GetGUID(); break;
+ case 18832: KroshFirehand = creature->GetGUID(); break;
+ }
+ }
+
+ void SetData64(uint32 type, uint64 data)
+ {
+ if(type == DATA_MAULGAREVENT_TANK)
+ MaulgarEvent_Tank = data;
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_MAULGAREVENT_TANK:
+ return MaulgarEvent_Tank;
+ case DATA_KIGGLERTHECRAZED:
+ return KigglerTheCrazed;
+ case DATA_BLINDEYETHESEER:
+ return BlindeyeTheSeer;
+ case DATA_OLMTHESUMMONER:
+ return OlmTheSummoner;
+ case DATA_KROSHFIREHAND:
+ return KroshFirehand;
+ }
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_MAULGAREVENT:
+ Encounters[0] = (data) ? true : false;
+ break;
+ case DATA_GRUULEVENT:
+ Encounters[1] = (data) ? true : false;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_MAULGAREVENT:
+ return Encounters[0];
+ case DATA_GRUULEVENT:
+ return Encounters[1];
+ }
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_gruuls_lair(Map* map)
+{
+ return new instance_gruuls_lair(map);
+}
+
+void AddSC_instance_gruuls_lair()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_gruuls_lair";
+ newscript->GetInstanceData = GetInstanceData_instance_gruuls_lair;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
index a9bf4bc23cf..f89adfe08eb 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
@@ -1,132 +1,132 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Broggok
-SD%Complete: 100
-SDComment:
-SDCategory: Hellfire Citadel, Blood Furnace
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLIME_SPRAY 30913
-#define SPELL_POISON_CLOUD 30916
-#define SPELL_POISON_BOLT 30917
-
-#define SPELL_POISON 30914
-
-#define SAY_AGGRO "Come intruders...."
-
-struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
-{
- boss_broggokAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 AcidSpray_Timer;
- uint32 PoisonSpawn_Timer;
- uint32 PoisonBolt_Timer;
-
- void Reset()
- {
- AcidSpray_Timer = 10000;
- PoisonSpawn_Timer = 5000;
- PoisonBolt_Timer = 7000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(AcidSpray_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY);
- AcidSpray_Timer = 4000+rand()%8000;
- }else AcidSpray_Timer -=diff;
-
- if(PoisonBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POISON_BOLT);
- PoisonBolt_Timer = 4000+rand()%8000;
- }else PoisonBolt_Timer -=diff;
-
- if(PoisonSpawn_Timer < diff)
- {
- DoCast(m_creature,SPELL_POISON_CLOUD);
- PoisonSpawn_Timer = 20000;
- }else PoisonSpawn_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI
-{
- mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool Start;
-
- void Reset()
- {
- Start = false;
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!Start)
- {
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(45);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Start = true;
- DoCast(m_creature,SPELL_POISON);
- }
- }
-};
-
-CreatureAI* GetAI_boss_broggokAI(Creature *_Creature)
-{
- return new boss_broggokAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_broggok_poisoncloudAI(Creature *_Creature)
-{
- return new mob_broggok_poisoncloudAI (_Creature);
-}
-
-void AddSC_boss_broggok()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_broggok";
- newscript->GetAI = GetAI_boss_broggokAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_broggok_poisoncloud";
- newscript->GetAI = GetAI_mob_broggok_poisoncloudAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Broggok
+SD%Complete: 100
+SDComment:
+SDCategory: Hellfire Citadel, Blood Furnace
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLIME_SPRAY 30913
+#define SPELL_POISON_CLOUD 30916
+#define SPELL_POISON_BOLT 30917
+
+#define SPELL_POISON 30914
+
+#define SAY_AGGRO "Come intruders...."
+
+struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
+{
+ boss_broggokAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 AcidSpray_Timer;
+ uint32 PoisonSpawn_Timer;
+ uint32 PoisonBolt_Timer;
+
+ void Reset()
+ {
+ AcidSpray_Timer = 10000;
+ PoisonSpawn_Timer = 5000;
+ PoisonBolt_Timer = 7000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(AcidSpray_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY);
+ AcidSpray_Timer = 4000+rand()%8000;
+ }else AcidSpray_Timer -=diff;
+
+ if(PoisonBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POISON_BOLT);
+ PoisonBolt_Timer = 4000+rand()%8000;
+ }else PoisonBolt_Timer -=diff;
+
+ if(PoisonSpawn_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_POISON_CLOUD);
+ PoisonSpawn_Timer = 20000;
+ }else PoisonSpawn_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI
+{
+ mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool Start;
+
+ void Reset()
+ {
+ Start = false;
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!Start)
+ {
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ m_creature->setFaction(45);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Start = true;
+ DoCast(m_creature,SPELL_POISON);
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_broggokAI(Creature *_Creature)
+{
+ return new boss_broggokAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_broggok_poisoncloudAI(Creature *_Creature)
+{
+ return new mob_broggok_poisoncloudAI (_Creature);
+}
+
+void AddSC_boss_broggok()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_broggok";
+ newscript->GetAI = GetAI_boss_broggokAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_broggok_poisoncloud";
+ newscript->GetAI = GetAI_mob_broggok_poisoncloudAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
index 98344d2d50e..597ed369c62 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
@@ -1,253 +1,253 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kelidan_The_Breaker
-SD%Complete: 60
-SDComment: Event with channeleres vs. boss not implemented yet
-SDCategory: Hellfire Citadel, Blood Furnace
-EndScriptData */
-
-/* ContentData
-boss_kelidan_the_breaker
-mob_shadowmoon_channeler
-EndContentData */
-
-#include "precompiled.h"
-
-#define SAY_WAKE "Who dares interrupt... What is this? What have you done? You ruin everything!"
-#define SOUND_WAKE 10164
-
-#define SAY_ADD_AGGRO_1 "You mustn't let him loose!"
-#define SOUND_ADD_AGGRO_1 10166
-#define SAY_ADD_AGGRO_2 "Ignorant whelps!"
-#define SOUND_ADD_AGGRO_2 10167
-#define SAY_ADD_AGGRO_3 "You fools! He'll kill us all!"
-#define SOUND_ADD_AGGRO_3 10168
-
-#define SAY_KILL_1 "Just as you deserve!"
-#define SOUND_KILL_1 10169
-#define SAY_KILL_2 "Your friends will soon be joining you."
-#define SOUND_KILL_2 10170
-
-#define SAY_NOVA "Closer... Come closer.. and burn!"
-#define SOUND_NOVA 10165
-
-#define SAY_DIE "Good luck... you'll need it.."
-#define SOUND_DIE 10171
-
-#define SPELL_CORRUPTION 30938
-
-#define SPELL_FIRE_NOVA 33775
-#define H_SPELL_FIRE_NOVA 37371
-
-#define SPELL_SHADOW_BOLT_VOLLEY 17228
-#define H_SPELL_SHADOW_BOLT_VOLLEY 40070
-
-#define SPELL_BURNING_NOVA 30940
-#define SPELL_VORTEX 37370
-
-struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
-{
- boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- ScriptedInstance* pInstance;
- bool HeroicMode;
-
- uint32 ShadowVolley_Timer;
- uint32 BurningNova_Timer;
- uint32 Firenova_Timer;
- uint32 Corruption_Timer;
- bool Firenova;
-
- void Reset()
- {
- ShadowVolley_Timer = 1000;
- BurningNova_Timer = 15000;
- Corruption_Timer = 5000;
- Firenova = false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_WAKE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_WAKE);
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DIE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( Firenova )
- {
- if( Firenova_Timer < diff )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA);
- Firenova = false;
- ShadowVolley_Timer = 2000;
- }else Firenova_Timer -=diff;
-
- return;
- }
-
- if( ShadowVolley_Timer < diff )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY);
- ShadowVolley_Timer = 5000+rand()%8000;
- }else ShadowVolley_Timer -=diff;
-
- if( Corruption_Timer < diff )
- {
- DoCast(m_creature,SPELL_CORRUPTION);
- Corruption_Timer = 30000+rand()%20000;
- }else Corruption_Timer -=diff;
-
- if( BurningNova_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoYell(SAY_NOVA, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_NOVA);
-
- if( HeroicMode )
- DoCast(m_creature,SPELL_VORTEX);
-
- DoCast(m_creature,SPELL_BURNING_NOVA);
-
- BurningNova_Timer = 20000+rand()%8000;
- Firenova_Timer= 5000;
- Firenova = true;
- }else BurningNova_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature)
-{
- return new boss_kelidan_the_breakerAI (_Creature);
-}
-
-/*######
-## mob_shadowmoon_channeler
-######*/
-
-#define SPELL_SHADOW_BOLT 12739
-#define H_SPELL_SHADOW_BOLT 15472
-
-#define SPELL_MARK_OF_SHADOW 30937
-
-#define SPELL_CHANNELING 0 //initial spell channeling boss/each other not known
- //when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage.
-
-struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
-{
- mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- ScriptedInstance* pInstance;
- bool HeroicMode;
-
- uint32 ShadowBolt_Timer;
- uint32 MarkOfShadow_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 1000+rand()%1000;
- MarkOfShadow_Timer = 5000+rand()%2000;
- }
-
- void Aggro(Unit* who)
- {
- //trigger boss to yell
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( MarkOfShadow_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
- DoCast(target,SPELL_MARK_OF_SHADOW);
- MarkOfShadow_Timer = 15000+rand()%5000;
- }else MarkOfShadow_Timer -=diff;
-
- if( ShadowBolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT);
- ShadowBolt_Timer = 5000+rand()%1000;
- }else ShadowBolt_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_shadowmoon_channeler(Creature *_Creature)
-{
- return new mob_shadowmoon_channelerAI (_Creature);
-}
-
-void AddSC_boss_kelidan_the_breaker()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_kelidan_the_breaker";
- newscript->GetAI = GetAI_boss_kelidan_the_breaker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_shadowmoon_channeler";
- newscript->GetAI = GetAI_mob_shadowmoon_channeler;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kelidan_The_Breaker
+SD%Complete: 60
+SDComment: Event with channeleres vs. boss not implemented yet
+SDCategory: Hellfire Citadel, Blood Furnace
+EndScriptData */
+
+/* ContentData
+boss_kelidan_the_breaker
+mob_shadowmoon_channeler
+EndContentData */
+
+#include "precompiled.h"
+
+#define SAY_WAKE "Who dares interrupt... What is this? What have you done? You ruin everything!"
+#define SOUND_WAKE 10164
+
+#define SAY_ADD_AGGRO_1 "You mustn't let him loose!"
+#define SOUND_ADD_AGGRO_1 10166
+#define SAY_ADD_AGGRO_2 "Ignorant whelps!"
+#define SOUND_ADD_AGGRO_2 10167
+#define SAY_ADD_AGGRO_3 "You fools! He'll kill us all!"
+#define SOUND_ADD_AGGRO_3 10168
+
+#define SAY_KILL_1 "Just as you deserve!"
+#define SOUND_KILL_1 10169
+#define SAY_KILL_2 "Your friends will soon be joining you."
+#define SOUND_KILL_2 10170
+
+#define SAY_NOVA "Closer... Come closer.. and burn!"
+#define SOUND_NOVA 10165
+
+#define SAY_DIE "Good luck... you'll need it.."
+#define SOUND_DIE 10171
+
+#define SPELL_CORRUPTION 30938
+
+#define SPELL_FIRE_NOVA 33775
+#define H_SPELL_FIRE_NOVA 37371
+
+#define SPELL_SHADOW_BOLT_VOLLEY 17228
+#define H_SPELL_SHADOW_BOLT_VOLLEY 40070
+
+#define SPELL_BURNING_NOVA 30940
+#define SPELL_VORTEX 37370
+
+struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
+{
+ boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ bool HeroicMode;
+
+ uint32 ShadowVolley_Timer;
+ uint32 BurningNova_Timer;
+ uint32 Firenova_Timer;
+ uint32 Corruption_Timer;
+ bool Firenova;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 1000;
+ BurningNova_Timer = 15000;
+ Corruption_Timer = 5000;
+ Firenova = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_WAKE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WAKE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DIE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( Firenova )
+ {
+ if( Firenova_Timer < diff )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA);
+ Firenova = false;
+ ShadowVolley_Timer = 2000;
+ }else Firenova_Timer -=diff;
+
+ return;
+ }
+
+ if( ShadowVolley_Timer < diff )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY);
+ ShadowVolley_Timer = 5000+rand()%8000;
+ }else ShadowVolley_Timer -=diff;
+
+ if( Corruption_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_CORRUPTION);
+ Corruption_Timer = 30000+rand()%20000;
+ }else Corruption_Timer -=diff;
+
+ if( BurningNova_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoYell(SAY_NOVA, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_NOVA);
+
+ if( HeroicMode )
+ DoCast(m_creature,SPELL_VORTEX);
+
+ DoCast(m_creature,SPELL_BURNING_NOVA);
+
+ BurningNova_Timer = 20000+rand()%8000;
+ Firenova_Timer= 5000;
+ Firenova = true;
+ }else BurningNova_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature)
+{
+ return new boss_kelidan_the_breakerAI (_Creature);
+}
+
+/*######
+## mob_shadowmoon_channeler
+######*/
+
+#define SPELL_SHADOW_BOLT 12739
+#define H_SPELL_SHADOW_BOLT 15472
+
+#define SPELL_MARK_OF_SHADOW 30937
+
+#define SPELL_CHANNELING 0 //initial spell channeling boss/each other not known
+ //when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage.
+
+struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
+{
+ mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ bool HeroicMode;
+
+ uint32 ShadowBolt_Timer;
+ uint32 MarkOfShadow_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 1000+rand()%1000;
+ MarkOfShadow_Timer = 5000+rand()%2000;
+ }
+
+ void Aggro(Unit* who)
+ {
+ //trigger boss to yell
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( MarkOfShadow_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
+ DoCast(target,SPELL_MARK_OF_SHADOW);
+ MarkOfShadow_Timer = 15000+rand()%5000;
+ }else MarkOfShadow_Timer -=diff;
+
+ if( ShadowBolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT);
+ ShadowBolt_Timer = 5000+rand()%1000;
+ }else ShadowBolt_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_shadowmoon_channeler(Creature *_Creature)
+{
+ return new mob_shadowmoon_channelerAI (_Creature);
+}
+
+void AddSC_boss_kelidan_the_breaker()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_kelidan_the_breaker";
+ newscript->GetAI = GetAI_boss_kelidan_the_breaker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shadowmoon_channeler";
+ newscript->GetAI = GetAI_mob_shadowmoon_channeler;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
index ea9fa1fd884..74bb2ed66e7 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
@@ -1,160 +1,160 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_The_Maker
-SD%Complete: 80
-SDComment: Mind control no support
-SDCategory: Hellfire Citadel, Blood Furnace
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ACID_SPRAY 38153 // heroic 38973 ??? 38153
-#define SPELL_EXPLODING_BREAKER 30925
-#define SPELL_KNOCKDOWN 20276
-#define SPELL_DOMINATION 25772 // ???
-
-#define SAY_KILL_1 "Let's see what I can make of you."
-#define SOUND_KILL_1 10289
-#define SAY_KILL_2 "It is pointless to resist."
-#define SOUND_KILL_2 10290
-
-#define SAY_AGGRO_1 "My work must not be interrupted."
-#define SOUND_AGGRO_1 10286
-#define SAY_AGGRO_2 "Perhaps I can find a use for you."
-#define SOUND_AGGRO_2 10287
-#define SAY_AGGRO_3 "Anger... Hate... These are tools I can use."
-#define SOUND_AGGRO_3 10288
-
-#define SAY_DIE "Stay away from... me."
-#define SOUND_DIE 10291
-
-struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI
-{
- boss_the_makerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 AcidSpray_Timer;
- uint32 ExplodingBreaker_Timer;
- uint32 Domination_Timer;
- uint32 Knockdown_Timer;
-
- void Reset()
- {
- AcidSpray_Timer = 10000;
- ExplodingBreaker_Timer = 4000;
- Domination_Timer = 120000;
- Knockdown_Timer = 6000;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%5)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DIE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(AcidSpray_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY);
- AcidSpray_Timer = 16000+rand()%8000;
- }else AcidSpray_Timer -=diff;
-
- if(ExplodingBreaker_Timer < diff)
- {
- Unit* target;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_EXPLODING_BREAKER);
- ExplodingBreaker_Timer = 4000+rand()%8000;
- }else ExplodingBreaker_Timer -=diff;
-
- /* // Disabled until Core Support for mind control
- if(domination_timer_timer < diff)
- {
- Unit* target;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_DOMINATION);
-
- domination_timer = 120000;
- }else domination_timer -=diff;
- */
-
- if(Knockdown_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
- Knockdown_Timer = 4000+rand()%8000;
- }else Knockdown_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_the_makerAI(Creature *_Creature)
-{
- return new boss_the_makerAI (_Creature);
-}
-
-void AddSC_boss_the_maker()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_the_maker";
- newscript->GetAI = GetAI_boss_the_makerAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_The_Maker
+SD%Complete: 80
+SDComment: Mind control no support
+SDCategory: Hellfire Citadel, Blood Furnace
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ACID_SPRAY 38153 // heroic 38973 ??? 38153
+#define SPELL_EXPLODING_BREAKER 30925
+#define SPELL_KNOCKDOWN 20276
+#define SPELL_DOMINATION 25772 // ???
+
+#define SAY_KILL_1 "Let's see what I can make of you."
+#define SOUND_KILL_1 10289
+#define SAY_KILL_2 "It is pointless to resist."
+#define SOUND_KILL_2 10290
+
+#define SAY_AGGRO_1 "My work must not be interrupted."
+#define SOUND_AGGRO_1 10286
+#define SAY_AGGRO_2 "Perhaps I can find a use for you."
+#define SOUND_AGGRO_2 10287
+#define SAY_AGGRO_3 "Anger... Hate... These are tools I can use."
+#define SOUND_AGGRO_3 10288
+
+#define SAY_DIE "Stay away from... me."
+#define SOUND_DIE 10291
+
+struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI
+{
+ boss_the_makerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 AcidSpray_Timer;
+ uint32 ExplodingBreaker_Timer;
+ uint32 Domination_Timer;
+ uint32 Knockdown_Timer;
+
+ void Reset()
+ {
+ AcidSpray_Timer = 10000;
+ ExplodingBreaker_Timer = 4000;
+ Domination_Timer = 120000;
+ Knockdown_Timer = 6000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%5)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DIE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(AcidSpray_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY);
+ AcidSpray_Timer = 16000+rand()%8000;
+ }else AcidSpray_Timer -=diff;
+
+ if(ExplodingBreaker_Timer < diff)
+ {
+ Unit* target;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_EXPLODING_BREAKER);
+ ExplodingBreaker_Timer = 4000+rand()%8000;
+ }else ExplodingBreaker_Timer -=diff;
+
+ /* // Disabled until Core Support for mind control
+ if(domination_timer_timer < diff)
+ {
+ Unit* target;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_DOMINATION);
+
+ domination_timer = 120000;
+ }else domination_timer -=diff;
+ */
+
+ if(Knockdown_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
+ Knockdown_Timer = 4000+rand()%8000;
+ }else Knockdown_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_the_makerAI(Creature *_Creature)
+{
+ return new boss_the_makerAI (_Creature);
+}
+
+void AddSC_boss_the_maker()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_the_maker";
+ newscript->GetAI = GetAI_boss_the_makerAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
index dd2572cc632..0866ca826bc 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
@@ -1,279 +1,279 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Omar_The_Unscarred
-SD%Complete: 90
-SDComment: Normal/Heroic support: both, to be tested. Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper.
-SDCategory: Hellfire Citadel, Hellfire Ramparts
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ORBITAL_STRIKE 30637
-#define SPELL_SHADOW_WHIP 30638
-#define SPELL_TREACHEROUS_AURA 30695
-#define H_SPELL_BANE_OF_TREACHERY 37566
-#define SPELL_DEMONIC_SHIELD 31901
-#define SPELL_SHADOW_BOLT 30686
-#define H_SPELL_SHADOW_BOLT 39297
-#define SPELL_SUMMON_FIENDISH_HOUND 30707
-
-#define SAY_AGGRO_1 "You dare stand against me?!"
-#define SOUND_AGGRO_1 10280
-#define SAY_AGGRO_2 "I will not be defeated!"
-#define SOUND_AGGRO_2 10279
-#define SAY_AGGRO_3 "Your insolence will be your death."
-#define SOUND_AGGRO_3 10281
-
-#define SAY_SUMMON "Achor-she-ki! Feast my pet! Eat your fill!"
-#define SOUND_SUMMON 10277
-
-#define SAY_CURSE "A-Kreesh!"
-#define SOUND_CURSE 10278
-
-#define SAY_KILL_1 "Die, weakling!"
-#define SOUND_KILL_1 10282
-
-#define SAY_DIE "It is... not over."
-#define SOUND_DIE 10284
-
-#define SAY_WIPE "I am victorious!"
-#define SOUND_WIPE 10283
-
-struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI
-{
- boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 OrbitalStrike_Timer;
- uint32 ShadowWhip_Timer;
- uint32 Aura_Timer;
- uint32 DemonicShield_Timer;
- uint32 Shadowbolt_Timer;
- uint32 Summon_Timer;
- uint32 SummonedCount;
- uint64 playerGUID;
- bool CanPullBack;
- bool HeroicMode;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- DoYell(SAY_WIPE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_WIPE);
-
- OrbitalStrike_Timer = 25000;
- ShadowWhip_Timer = 2000;
- Aura_Timer = 10000;
- DemonicShield_Timer = 1000;
- Shadowbolt_Timer = 2000;
- Summon_Timer = 10000;
- SummonedCount = 0;
- playerGUID = 0;
- CanPullBack = false;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- DoStartAttackNoMovement(who);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- DoStartAttackNoMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- DoYell(SAY_KILL_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- }
-
- void JustSummoned(Creature* summoned)
- {
- DoYell(SAY_SUMMON,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- if( Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0) )
- summoned->AI()->AttackStart(random);
-
- ++SummonedCount;
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DIE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //only two may be wrong, perhaps increase timer and spawn periodically instead.
- if( SummonedCount < 2 )
- {
- if( Summon_Timer < diff )
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND);
- Summon_Timer = 15000+rand()%15000;
- }else Summon_Timer -= diff;
- }
-
- if( CanPullBack )
- {
- if( ShadowWhip_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
- {
- //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
- if( temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) )
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(temp,SPELL_SHADOW_WHIP);
- }
- }
- playerGUID = 0;
- ShadowWhip_Timer = 2000;
- CanPullBack = false;
- }else ShadowWhip_Timer -= diff;
- }
- else if( OrbitalStrike_Timer < diff )
- {
- Unit* temp = NULL;
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
- temp = m_creature->getVictim();
- else temp = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if( temp && temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp,SPELL_ORBITAL_STRIKE);
- OrbitalStrike_Timer = 14000+rand()%2000;
- playerGUID = temp->GetGUID();
- if( playerGUID )
- CanPullBack = true;
- }
- }else OrbitalStrike_Timer -= diff;
-
- if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20 )
- {
- if( DemonicShield_Timer < diff )
- {
- DoCast(m_creature,SPELL_DEMONIC_SHIELD);
- DemonicShield_Timer = 15000;
- }else DemonicShield_Timer -= diff;
- }
-
- if( Aura_Timer < diff )
- {
- DoYell(SAY_CURSE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_CURSE);
-
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( HeroicMode ) DoCast(target,H_SPELL_BANE_OF_TREACHERY);
- else DoCast(target,SPELL_TREACHEROUS_AURA);
-
- Aura_Timer = 8000+rand()%8000;
- }
- }else Aura_Timer -= diff;
-
- if( Shadowbolt_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( target )
- target = m_creature->getVictim();
-
- if( HeroicMode ) DoCast(target,H_SPELL_SHADOW_BOLT);
- else DoCast(target,SPELL_SHADOW_BOLT);
-
- Shadowbolt_Timer = 4000+rand()%2500;
- }
- }else Shadowbolt_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature *_Creature)
-{
- return new boss_omor_the_unscarredAI (_Creature);
-}
-
-void AddSC_boss_omor_the_unscarred()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_omor_the_unscarred";
- newscript->GetAI = GetAI_boss_omor_the_unscarredAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Omar_The_Unscarred
+SD%Complete: 90
+SDComment: Normal/Heroic support: both, to be tested. Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper.
+SDCategory: Hellfire Citadel, Hellfire Ramparts
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ORBITAL_STRIKE 30637
+#define SPELL_SHADOW_WHIP 30638
+#define SPELL_TREACHEROUS_AURA 30695
+#define H_SPELL_BANE_OF_TREACHERY 37566
+#define SPELL_DEMONIC_SHIELD 31901
+#define SPELL_SHADOW_BOLT 30686
+#define H_SPELL_SHADOW_BOLT 39297
+#define SPELL_SUMMON_FIENDISH_HOUND 30707
+
+#define SAY_AGGRO_1 "You dare stand against me?!"
+#define SOUND_AGGRO_1 10280
+#define SAY_AGGRO_2 "I will not be defeated!"
+#define SOUND_AGGRO_2 10279
+#define SAY_AGGRO_3 "Your insolence will be your death."
+#define SOUND_AGGRO_3 10281
+
+#define SAY_SUMMON "Achor-she-ki! Feast my pet! Eat your fill!"
+#define SOUND_SUMMON 10277
+
+#define SAY_CURSE "A-Kreesh!"
+#define SOUND_CURSE 10278
+
+#define SAY_KILL_1 "Die, weakling!"
+#define SOUND_KILL_1 10282
+
+#define SAY_DIE "It is... not over."
+#define SOUND_DIE 10284
+
+#define SAY_WIPE "I am victorious!"
+#define SOUND_WIPE 10283
+
+struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI
+{
+ boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 OrbitalStrike_Timer;
+ uint32 ShadowWhip_Timer;
+ uint32 Aura_Timer;
+ uint32 DemonicShield_Timer;
+ uint32 Shadowbolt_Timer;
+ uint32 Summon_Timer;
+ uint32 SummonedCount;
+ uint64 playerGUID;
+ bool CanPullBack;
+ bool HeroicMode;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ DoYell(SAY_WIPE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WIPE);
+
+ OrbitalStrike_Timer = 25000;
+ ShadowWhip_Timer = 2000;
+ Aura_Timer = 10000;
+ DemonicShield_Timer = 1000;
+ Shadowbolt_Timer = 2000;
+ Summon_Timer = 10000;
+ SummonedCount = 0;
+ playerGUID = 0;
+ CanPullBack = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ DoStartAttackNoMovement(who);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ DoStartAttackNoMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ DoYell(SAY_KILL_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ DoYell(SAY_SUMMON,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ if( Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ summoned->AI()->AttackStart(random);
+
+ ++SummonedCount;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DIE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //only two may be wrong, perhaps increase timer and spawn periodically instead.
+ if( SummonedCount < 2 )
+ {
+ if( Summon_Timer < diff )
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND);
+ Summon_Timer = 15000+rand()%15000;
+ }else Summon_Timer -= diff;
+ }
+
+ if( CanPullBack )
+ {
+ if( ShadowWhip_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
+ {
+ //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
+ if( temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) )
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(temp,SPELL_SHADOW_WHIP);
+ }
+ }
+ playerGUID = 0;
+ ShadowWhip_Timer = 2000;
+ CanPullBack = false;
+ }else ShadowWhip_Timer -= diff;
+ }
+ else if( OrbitalStrike_Timer < diff )
+ {
+ Unit* temp = NULL;
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
+ temp = m_creature->getVictim();
+ else temp = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if( temp && temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp,SPELL_ORBITAL_STRIKE);
+ OrbitalStrike_Timer = 14000+rand()%2000;
+ playerGUID = temp->GetGUID();
+ if( playerGUID )
+ CanPullBack = true;
+ }
+ }else OrbitalStrike_Timer -= diff;
+
+ if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20 )
+ {
+ if( DemonicShield_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_DEMONIC_SHIELD);
+ DemonicShield_Timer = 15000;
+ }else DemonicShield_Timer -= diff;
+ }
+
+ if( Aura_Timer < diff )
+ {
+ DoYell(SAY_CURSE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_CURSE);
+
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( HeroicMode ) DoCast(target,H_SPELL_BANE_OF_TREACHERY);
+ else DoCast(target,SPELL_TREACHEROUS_AURA);
+
+ Aura_Timer = 8000+rand()%8000;
+ }
+ }else Aura_Timer -= diff;
+
+ if( Shadowbolt_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( target )
+ target = m_creature->getVictim();
+
+ if( HeroicMode ) DoCast(target,H_SPELL_SHADOW_BOLT);
+ else DoCast(target,SPELL_SHADOW_BOLT);
+
+ Shadowbolt_Timer = 4000+rand()%2500;
+ }
+ }else Shadowbolt_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature *_Creature)
+{
+ return new boss_omor_the_unscarredAI (_Creature);
+}
+
+void AddSC_boss_omor_the_unscarred()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_omor_the_unscarred";
+ newscript->GetAI = GetAI_boss_omor_the_unscarredAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
index 8e85d49dd49..7b933f829be 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
@@ -1,200 +1,200 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Watchkeeper_Gargolmar
-SD%Complete: 80
-SDComment: Normal/Heroic support: both, to be tested. Missing adds to heal him. Surge should be used on target furthest away, not random.
-SDCategory: Hellfire Citadel, Hellfire Ramparts
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_HEAL "Heal me! QUICKLY!"
-#define SOUND_HEAL 10329
-
-#define SAY_SURGE "Back off, pup!"
-#define SOUND_SURGE 10330
-
-#define SAY_TAUNT "Do you smell that? Fresh meat has somehow breached our citadel. Be wary of any intruders."
-
-#define SAY_AGGRO_1 "What have we here...?"
-#define SOUND_AGGRO_1 10331
-#define SAY_AGGRO_2 "Heh... this may hurt a little."
-#define SOUND_AGGRO_2 10332
-#define SAY_AGGRO_3 "I'm gonna enjoy this."
-#define SOUND_AGGRO_3 10333
-
-#define SAY_KILL_1 "Say farewell!"
-#define SOUND_KILL_1 10334
-#define SAY_KILL_2 "Much too easy..."
-#define SOUND_KILL_2 10335
-
-#define SOUND_DIE 10336
-
-#define SPELL_MORTAL_WOUND 30641
-#define H_SPELL_MORTAL_WOUND 36814
-#define SPELL_SURGE 34645
-#define SPELL_RETALIATION 22857
-
-struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI
-{
- boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Surge_Timer;
- uint32 MortalWound_Timer;
- uint32 Retaliation_Timer;
-
- bool HasTaunted;
- bool YelledForHeal;
- bool HeroicMode;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- Surge_Timer = 5000;
- MortalWound_Timer = 4000;
- Retaliation_Timer = 0;
-
- HasTaunted = false;
- YelledForHeal = false;
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
- {
- DoYell(SAY_TAUNT, LANG_UNIVERSAL, NULL);
- HasTaunted = true;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoPlaySoundToSet(m_creature,SOUND_DIE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( MortalWound_Timer < diff )
- {
- if( HeroicMode ) DoCast(m_creature->getVictim(),H_SPELL_MORTAL_WOUND);
- else DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND);
-
- MortalWound_Timer = 5000+rand()%8000;
- }else MortalWound_Timer -= diff;
-
- if( Surge_Timer < diff )
- {
- DoYell(SAY_SURGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SURGE);
-
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SURGE);
-
- Surge_Timer = 5000+rand()%8000;
- }else Surge_Timer -= diff;
-
- if((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)
- {
- if( Retaliation_Timer < diff )
- {
- DoCast(m_creature,SPELL_RETALIATION);
- Retaliation_Timer = 30000;
- }else Retaliation_Timer -= diff;
- }
-
- if( !YelledForHeal )
- if((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40)
- {
- DoYell(SAY_HEAL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEAL);
- YelledForHeal = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature *_Creature)
-{
- return new boss_watchkeeper_gargolmarAI (_Creature);
-}
-
-void AddSC_boss_watchkeeper_gargolmar()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_watchkeeper_gargolmar";
- newscript->GetAI = GetAI_boss_watchkeeper_gargolmarAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Watchkeeper_Gargolmar
+SD%Complete: 80
+SDComment: Normal/Heroic support: both, to be tested. Missing adds to heal him. Surge should be used on target furthest away, not random.
+SDCategory: Hellfire Citadel, Hellfire Ramparts
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_HEAL "Heal me! QUICKLY!"
+#define SOUND_HEAL 10329
+
+#define SAY_SURGE "Back off, pup!"
+#define SOUND_SURGE 10330
+
+#define SAY_TAUNT "Do you smell that? Fresh meat has somehow breached our citadel. Be wary of any intruders."
+
+#define SAY_AGGRO_1 "What have we here...?"
+#define SOUND_AGGRO_1 10331
+#define SAY_AGGRO_2 "Heh... this may hurt a little."
+#define SOUND_AGGRO_2 10332
+#define SAY_AGGRO_3 "I'm gonna enjoy this."
+#define SOUND_AGGRO_3 10333
+
+#define SAY_KILL_1 "Say farewell!"
+#define SOUND_KILL_1 10334
+#define SAY_KILL_2 "Much too easy..."
+#define SOUND_KILL_2 10335
+
+#define SOUND_DIE 10336
+
+#define SPELL_MORTAL_WOUND 30641
+#define H_SPELL_MORTAL_WOUND 36814
+#define SPELL_SURGE 34645
+#define SPELL_RETALIATION 22857
+
+struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI
+{
+ boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Surge_Timer;
+ uint32 MortalWound_Timer;
+ uint32 Retaliation_Timer;
+
+ bool HasTaunted;
+ bool YelledForHeal;
+ bool HeroicMode;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ Surge_Timer = 5000;
+ MortalWound_Timer = 4000;
+ Retaliation_Timer = 0;
+
+ HasTaunted = false;
+ YelledForHeal = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
+ {
+ DoYell(SAY_TAUNT, LANG_UNIVERSAL, NULL);
+ HasTaunted = true;
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoPlaySoundToSet(m_creature,SOUND_DIE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( MortalWound_Timer < diff )
+ {
+ if( HeroicMode ) DoCast(m_creature->getVictim(),H_SPELL_MORTAL_WOUND);
+ else DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND);
+
+ MortalWound_Timer = 5000+rand()%8000;
+ }else MortalWound_Timer -= diff;
+
+ if( Surge_Timer < diff )
+ {
+ DoYell(SAY_SURGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SURGE);
+
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SURGE);
+
+ Surge_Timer = 5000+rand()%8000;
+ }else Surge_Timer -= diff;
+
+ if((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)
+ {
+ if( Retaliation_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_RETALIATION);
+ Retaliation_Timer = 30000;
+ }else Retaliation_Timer -= diff;
+ }
+
+ if( !YelledForHeal )
+ if((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40)
+ {
+ DoYell(SAY_HEAL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HEAL);
+ YelledForHeal = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature *_Creature)
+{
+ return new boss_watchkeeper_gargolmarAI (_Creature);
+}
+
+void AddSC_boss_watchkeeper_gargolmar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_watchkeeper_gargolmar";
+ newscript->GetAI = GetAI_boss_watchkeeper_gargolmarAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
index c1adb3bd3de..4052c4cfa0b 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
@@ -1,539 +1,539 @@
-/* Copyright(C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-*(at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Magtheridon
-SD%Complete: 60
-SDComment: In Development
-SDCategory: Hellfire Citadel, Magtheridon's lair
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magtheridons_lair.h"
-
-#define MOB_MAGTHERIDON 17257
-#define MOB_ROOM 17516
-#define MOB_CHANNELLER 17256
-#define MOB_ABYSSAL 17454
-
-#define SPELL_BLASTNOVA 30616
-#define SPELL_CLEAVE 30619
-#define SPELL_QUAKE_TRIGGER 30576 // must be cast with 30561 as the proc spell
-#define SPELL_QUAKE_KNOCKBACK 30571
-#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7
-#define SPELL_BLAZE_TRAP 30542
-#define SPELL_DEBRIS_KNOCKDOWN 36449
-#define SPELL_DEBRIS_VISUAL 30632
-#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8
-#define SPELL_CAMERA_SHAKE 36455
-#define SPELL_BERSERK 27680
-
-#define SPELL_SHADOW_CAGE 30168
-#define SPELL_SHADOW_GRASP 30410
-#define SPELL_SHADOW_GRASP_VISUAL 30166
-#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends
-
-#define SPELL_SHADOW_CAGE_C 30205
-#define SPELL_SHADOW_GRASP_C 30207
-
-#define SPELL_SHADOW_BOLT_VOLLEY 30510
-#define SPELL_DARK_MENDING 30528
-#define SPELL_FEAR 30530 //39176
-#define SPELL_BURNING_ABYSSAL 30511
-#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7
-
-#define SPELL_FIRE_BLAST 37110
-
-//Dialog
-#define SAY_AGGRO "Thank you for releasing me. Now...die!"
-#define SOUND_AGGRO 10254
-#define SAY_BANISH "Not again...NOT AGAIN!"
-#define SOUND_BANISH 10256
-#define SAY_FREED "I...am...UNLEASHED!!!"
-#define SOUND_FREED 10253
-#define SAY_CHAMBER_DESTROY "I will not be taken so easily. Let the walls of this prison tremble...and FALL!!!"
-#define SOUND_CHAMBER_DESTROY 10257
-#define SAY_PLAYER_KILLED "Did you think me weak? Soft? Who is the weak one now?!"
-#define SOUND_PLAYER_KILLED 10255
-#define SAY_DEATH "The Legion...will consume you...all...."
-#define SOUND_DEATH 10258
-#define EMOTE_BERSERK "becomes enraged!"
-#define EMOTE_BLASTNOVA "begins to cast Blast Nova!"
-#define EMOTE_BEGIN "%s's bonds begin to weaken!"
-
-// count of clickers needed to interrupt blast nova
-#define CLICKERS_COUNT 5
-
-// Unkown sounds
-uint32 RandomSound[] = {10247, 10248, 10249, 10250, 10251, 10252};
-
-typedef std::map<uint64, uint64> CubeMap;
-
-struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI
-{
- mob_abyssalAI(Creature *c) : ScriptedAI(c)
- {
- trigger = 0;
- Despawn_Timer = 60000;
- Reset();
- }
-
- uint32 FireBlast_Timer;
- uint32 Despawn_Timer;
- uint32 trigger;
-
- void Reset()
- {
- FireBlast_Timer = 6000;
- }
-
- void SpellHit(Unit*, const SpellEntry *spell)
- {
- if(trigger == 2 && spell->Id == SPELL_BLAZE_TARGET)
- {
- m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true);
- m_creature->SetVisibility(VISIBILITY_OFF);
- Despawn_Timer = 130000;
- }
- }
-
- void SetTrigger(uint32 _trigger)
- {
- trigger = _trigger;
- m_creature->SetDisplayId(11686);
- if(trigger == 1) //debris
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true);
- FireBlast_Timer = 5000;
- Despawn_Timer = 10000;
- }
- }
-
- void Aggro(Unit*) {DoZoneInCombat();}
- void AttackStart(Unit *who) {if(!trigger) ScriptedAI::AttackStart(who);}
- void MoveInLineOfSight(Unit *who) {if(!trigger) ScriptedAI::MoveInLineOfSight(who);}
-
- void UpdateAI(const uint32 diff)
- {
- if(trigger)
- {
- if(trigger == 1)
- {
- if(FireBlast_Timer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true);
- trigger = 3;
- }else FireBlast_Timer -= diff;
- }
- return;
- }
-
- if(Despawn_Timer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else Despawn_Timer -= diff;
-
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(FireBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST);
- FireBlast_Timer = 5000+rand()%10000;
- }else FireBlast_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
-{
- boss_magtheridonAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
- Reset();
- }
-
- CubeMap Cube;
-
- ScriptedInstance* pInstance;
-
- uint32 Berserk_Timer;
- uint32 Quake_Timer;
- uint32 Cleave_Timer;
- uint32 BlastNova_Timer;
- uint32 Blaze_Timer;
- uint32 Debris_Timer;
-
- bool Phase3;
- bool NeedCheckCube;
-
- void Reset()
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED);
- pInstance->SetData(DATA_COLLAPSE, false);
- }
-
- Berserk_Timer = 1320000;
- Quake_Timer = 40000;
- Debris_Timer = 10000;
- Blaze_Timer = 10000+rand()%20000;
- BlastNova_Timer = 60000;
- Cleave_Timer = 15000;
-
- Phase3 = false;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true);
- }
-
- void SetClicker(uint64 cubeGUID, uint64 clickerGUID)
- {
- // to avoid multiclicks from 1 cube
- if(uint64 guid = Cube[cubeGUID])
- DebuffClicker(Unit::GetUnit(*m_creature, guid));
- Cube[cubeGUID] = clickerGUID;
- NeedCheckCube = true;
- }
-
- //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT)
- void DebuffClicker(Unit *clicker)
- {
- if(!clicker || !clicker->isAlive())
- return;
-
- clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells
- clicker->InterruptNonMeleeSpells(false);
- clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true);
- }
-
- void NeedCheckCubeStatus()
- {
- uint32 ClickerNum = 0;
- // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S)
- // if not - apply mind exhaustion and delete from clicker's list
- for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i)
- {
- Unit *clicker = Unit::GetUnit(*m_creature, (*i).second);
- if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP, 1))
- {
- DebuffClicker(clicker);
- (*i).second = 0;
- }else ClickerNum++;
- }
-
- // if 5 clickers from other cubes apply shadow cage
- if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
- m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true);
- }
- else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
- m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
-
- if(!ClickerNum) NeedCheckCube = false;
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_PLAYER_KILLED, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PLAYER_KILLED);
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE);
-
- DoYell(SAY_DEATH,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void MoveInLineOfSight(Unit*) {}
-
- void AttackStart(Unit *who)
- {
- if(!m_creature->hasUnitState(UNIT_STAT_STUNNED))
- ScriptedAI::AttackStart(who);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS);
- DoZoneInCombat();
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C);
-
- DoYell(SAY_FREED, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FREED);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(NeedCheckCube) NeedCheckCubeStatus();
-
- if(Berserk_Timer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- DoTextEmote(EMOTE_BERSERK, NULL);
- Berserk_Timer = 60000;
- }else Berserk_Timer -= diff;
-
- if(Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- if(BlastNova_Timer < diff)
- {
- // to avoid earthquake interruption
- if(!m_creature->hasUnitState(UNIT_STAT_STUNNED))
- {
- DoTextEmote(EMOTE_BLASTNOVA, NULL);
- DoCast(m_creature, SPELL_BLASTNOVA);
- BlastNova_Timer = 60000;
- }
- }else BlastNova_Timer -= diff;
-
- if(Quake_Timer < diff)
- {
- // to avoid blastnova interruption
- if(!m_creature->IsNonMeleeSpellCasted(false))
- {
- int32 i = SPELL_QUAKE_KNOCKBACK;
- m_creature->CastCustomSpell(m_creature, SPELL_QUAKE_TRIGGER, &i, 0, 0, false);
- Quake_Timer = 50000;
- }
- }else Quake_Timer -= diff;
-
- if(Blaze_Timer < diff)
- {
- if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- float x, y, z;
- target->GetPosition(x, y, z);
- Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(summon)
- {
- ((mob_abyssalAI*)summon->AI())->SetTrigger(2);
- m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true);
- summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- Blaze_Timer = 20000 + rand()%20000;
- }else Blaze_Timer -= diff;
-
- if(!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3
- && !m_creature->IsNonMeleeSpellCasted(false) // blast nova
- && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
- {
- Phase3 = true;
- DoYell(SAY_CHAMBER_DESTROY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CHAMBER_DESTROY);
- m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true);
- m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true);
-
- if(pInstance)
- pInstance->SetData(DATA_COLLAPSE, true);
- }
-
- if(Phase3)
- {
- if(Debris_Timer < diff)
- {
- if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- float x, y, z;
- target->GetPosition(x, y, z);
- Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(summon) ((mob_abyssalAI*)summon->AI())->SetTrigger(1);
- }
- Debris_Timer = 10000;
- }else Debris_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI
-{
- mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 ShadowBoltVolley_Timer;
- uint32 DarkMending_Timer;
- uint32 Fear_Timer;
- uint32 Infernal_Timer;
-
- uint32 Check_Timer;
-
- void Reset()
- {
- ShadowBoltVolley_Timer = 8000 + rand()%2000;
- DarkMending_Timer = 10000;
- Fear_Timer = 15000 + rand()%5000;
- Infernal_Timer = 10000 + rand()%40000;
-
- Check_Timer = 5000;
-
- if(pInstance)
- pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED);
-
- m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS);
-
- m_creature->InterruptNonMeleeSpells(false);
- DoZoneInCombat();
- }
-
- void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());}
-
- void MoveInLineOfSight(Unit*) {}
-
- // bugged
- /*void DamageTaken(Unit*, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth())
- m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true);
- }*/
-
- void JustDied(Unit*)
- {
- if(pInstance)
- pInstance->SetData(DATA_CHANNELER_EVENT, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(ShadowBoltVolley_Timer < diff)
- {
- DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY);
- ShadowBoltVolley_Timer = 10000 + rand()%10000;
- }else ShadowBoltVolley_Timer -= diff;
-
- if(DarkMending_Timer < diff)
- {
- if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- DoCast(m_creature, SPELL_DARK_MENDING);
- DarkMending_Timer = 10000 +(rand() % 10000);
- }else DarkMending_Timer -= diff;
-
- if(Fear_Timer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1))
- DoCast(target, SPELL_FEAR);
- Fear_Timer = 25000 + rand()%15000;
- }else Fear_Timer -= diff;
-
- if(Infernal_Timer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true);
- Infernal_Timer = 30000 + rand()%10000;
- }else Infernal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Manticron Cube
-bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO)
-{
- ScriptedInstance* pInstance =(ScriptedInstance*)_GO->GetInstanceData();
- if(!pInstance) return true;
- if(pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true;
- Creature *Magtheridon =(Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_MAGTHERIDON));
- if(!Magtheridon || !Magtheridon->isAlive()) return true;
-
- // if exhausted or already channeling return
- if(player->HasAura(SPELL_MIND_EXHAUSTION, 0) || player->HasAura(SPELL_SHADOW_GRASP, 1))
- return true;
-
- player->InterruptNonMeleeSpells(false);
- player->CastSpell(player, SPELL_SHADOW_GRASP, true);
- player->CastSpell(player, SPELL_SHADOW_GRASP_VISUAL, false);
- ((boss_magtheridonAI*)Magtheridon->AI())->SetClicker(_GO->GetGUID(), player->GetGUID());
- return true;
-}
-
-CreatureAI* GetAI_boss_magtheridon(Creature *_Creature)
-{
- return new boss_magtheridonAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_hellfire_channeler(Creature *_Creature)
-{
- return new mob_hellfire_channelerAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_abyssalAI(Creature *_Creature)
-{
- return new mob_abyssalAI(_Creature);
-}
-
-void AddSC_boss_magtheridon()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_magtheridon";
- newscript->GetAI = GetAI_boss_magtheridon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_hellfire_channeler";
- newscript->GetAI = GetAI_mob_hellfire_channeler;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_manticron_cube";
- newscript->pGOHello = &GOHello_go_Manticron_Cube;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_abyssal";
- newscript->GetAI = GetAI_mob_abyssalAI;
- m_scripts[nrscripts++] = newscript;
-
+/* Copyright(C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+*(at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Magtheridon
+SD%Complete: 60
+SDComment: In Development
+SDCategory: Hellfire Citadel, Magtheridon's lair
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magtheridons_lair.h"
+
+#define MOB_MAGTHERIDON 17257
+#define MOB_ROOM 17516
+#define MOB_CHANNELLER 17256
+#define MOB_ABYSSAL 17454
+
+#define SPELL_BLASTNOVA 30616
+#define SPELL_CLEAVE 30619
+#define SPELL_QUAKE_TRIGGER 30576 // must be cast with 30561 as the proc spell
+#define SPELL_QUAKE_KNOCKBACK 30571
+#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7
+#define SPELL_BLAZE_TRAP 30542
+#define SPELL_DEBRIS_KNOCKDOWN 36449
+#define SPELL_DEBRIS_VISUAL 30632
+#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8
+#define SPELL_CAMERA_SHAKE 36455
+#define SPELL_BERSERK 27680
+
+#define SPELL_SHADOW_CAGE 30168
+#define SPELL_SHADOW_GRASP 30410
+#define SPELL_SHADOW_GRASP_VISUAL 30166
+#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends
+
+#define SPELL_SHADOW_CAGE_C 30205
+#define SPELL_SHADOW_GRASP_C 30207
+
+#define SPELL_SHADOW_BOLT_VOLLEY 30510
+#define SPELL_DARK_MENDING 30528
+#define SPELL_FEAR 30530 //39176
+#define SPELL_BURNING_ABYSSAL 30511
+#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7
+
+#define SPELL_FIRE_BLAST 37110
+
+//Dialog
+#define SAY_AGGRO "Thank you for releasing me. Now...die!"
+#define SOUND_AGGRO 10254
+#define SAY_BANISH "Not again...NOT AGAIN!"
+#define SOUND_BANISH 10256
+#define SAY_FREED "I...am...UNLEASHED!!!"
+#define SOUND_FREED 10253
+#define SAY_CHAMBER_DESTROY "I will not be taken so easily. Let the walls of this prison tremble...and FALL!!!"
+#define SOUND_CHAMBER_DESTROY 10257
+#define SAY_PLAYER_KILLED "Did you think me weak? Soft? Who is the weak one now?!"
+#define SOUND_PLAYER_KILLED 10255
+#define SAY_DEATH "The Legion...will consume you...all...."
+#define SOUND_DEATH 10258
+#define EMOTE_BERSERK "becomes enraged!"
+#define EMOTE_BLASTNOVA "begins to cast Blast Nova!"
+#define EMOTE_BEGIN "%s's bonds begin to weaken!"
+
+// count of clickers needed to interrupt blast nova
+#define CLICKERS_COUNT 5
+
+// Unkown sounds
+uint32 RandomSound[] = {10247, 10248, 10249, 10250, 10251, 10252};
+
+typedef std::map<uint64, uint64> CubeMap;
+
+struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI
+{
+ mob_abyssalAI(Creature *c) : ScriptedAI(c)
+ {
+ trigger = 0;
+ Despawn_Timer = 60000;
+ Reset();
+ }
+
+ uint32 FireBlast_Timer;
+ uint32 Despawn_Timer;
+ uint32 trigger;
+
+ void Reset()
+ {
+ FireBlast_Timer = 6000;
+ }
+
+ void SpellHit(Unit*, const SpellEntry *spell)
+ {
+ if(trigger == 2 && spell->Id == SPELL_BLAZE_TARGET)
+ {
+ m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true);
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ Despawn_Timer = 130000;
+ }
+ }
+
+ void SetTrigger(uint32 _trigger)
+ {
+ trigger = _trigger;
+ m_creature->SetDisplayId(11686);
+ if(trigger == 1) //debris
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true);
+ FireBlast_Timer = 5000;
+ Despawn_Timer = 10000;
+ }
+ }
+
+ void Aggro(Unit*) {DoZoneInCombat();}
+ void AttackStart(Unit *who) {if(!trigger) ScriptedAI::AttackStart(who);}
+ void MoveInLineOfSight(Unit *who) {if(!trigger) ScriptedAI::MoveInLineOfSight(who);}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(trigger)
+ {
+ if(trigger == 1)
+ {
+ if(FireBlast_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true);
+ trigger = 3;
+ }else FireBlast_Timer -= diff;
+ }
+ return;
+ }
+
+ if(Despawn_Timer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else Despawn_Timer -= diff;
+
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(FireBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST);
+ FireBlast_Timer = 5000+rand()%10000;
+ }else FireBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
+{
+ boss_magtheridonAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
+ m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+ Reset();
+ }
+
+ CubeMap Cube;
+
+ ScriptedInstance* pInstance;
+
+ uint32 Berserk_Timer;
+ uint32 Quake_Timer;
+ uint32 Cleave_Timer;
+ uint32 BlastNova_Timer;
+ uint32 Blaze_Timer;
+ uint32 Debris_Timer;
+
+ bool Phase3;
+ bool NeedCheckCube;
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED);
+ pInstance->SetData(DATA_COLLAPSE, false);
+ }
+
+ Berserk_Timer = 1320000;
+ Quake_Timer = 40000;
+ Debris_Timer = 10000;
+ Blaze_Timer = 10000+rand()%20000;
+ BlastNova_Timer = 60000;
+ Cleave_Timer = 15000;
+
+ Phase3 = false;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true);
+ }
+
+ void SetClicker(uint64 cubeGUID, uint64 clickerGUID)
+ {
+ // to avoid multiclicks from 1 cube
+ if(uint64 guid = Cube[cubeGUID])
+ DebuffClicker(Unit::GetUnit(*m_creature, guid));
+ Cube[cubeGUID] = clickerGUID;
+ NeedCheckCube = true;
+ }
+
+ //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT)
+ void DebuffClicker(Unit *clicker)
+ {
+ if(!clicker || !clicker->isAlive())
+ return;
+
+ clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells
+ clicker->InterruptNonMeleeSpells(false);
+ clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true);
+ }
+
+ void NeedCheckCubeStatus()
+ {
+ uint32 ClickerNum = 0;
+ // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S)
+ // if not - apply mind exhaustion and delete from clicker's list
+ for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i)
+ {
+ Unit *clicker = Unit::GetUnit(*m_creature, (*i).second);
+ if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP, 1))
+ {
+ DebuffClicker(clicker);
+ (*i).second = 0;
+ }else ClickerNum++;
+ }
+
+ // if 5 clickers from other cubes apply shadow cage
+ if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+ m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true);
+ }
+ else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
+ m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
+
+ if(!ClickerNum) NeedCheckCube = false;
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_PLAYER_KILLED, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PLAYER_KILLED);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE);
+
+ DoYell(SAY_DEATH,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void MoveInLineOfSight(Unit*) {}
+
+ void AttackStart(Unit *who)
+ {
+ if(!m_creature->hasUnitState(UNIT_STAT_STUNNED))
+ ScriptedAI::AttackStart(who);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS);
+ DoZoneInCombat();
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C);
+
+ DoYell(SAY_FREED, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FREED);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(NeedCheckCube) NeedCheckCubeStatus();
+
+ if(Berserk_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ DoTextEmote(EMOTE_BERSERK, NULL);
+ Berserk_Timer = 60000;
+ }else Berserk_Timer -= diff;
+
+ if(Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ if(BlastNova_Timer < diff)
+ {
+ // to avoid earthquake interruption
+ if(!m_creature->hasUnitState(UNIT_STAT_STUNNED))
+ {
+ DoTextEmote(EMOTE_BLASTNOVA, NULL);
+ DoCast(m_creature, SPELL_BLASTNOVA);
+ BlastNova_Timer = 60000;
+ }
+ }else BlastNova_Timer -= diff;
+
+ if(Quake_Timer < diff)
+ {
+ // to avoid blastnova interruption
+ if(!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ int32 i = SPELL_QUAKE_KNOCKBACK;
+ m_creature->CastCustomSpell(m_creature, SPELL_QUAKE_TRIGGER, &i, 0, 0, false);
+ Quake_Timer = 50000;
+ }
+ }else Quake_Timer -= diff;
+
+ if(Blaze_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(summon)
+ {
+ ((mob_abyssalAI*)summon->AI())->SetTrigger(2);
+ m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true);
+ summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ Blaze_Timer = 20000 + rand()%20000;
+ }else Blaze_Timer -= diff;
+
+ if(!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3
+ && !m_creature->IsNonMeleeSpellCasted(false) // blast nova
+ && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
+ {
+ Phase3 = true;
+ DoYell(SAY_CHAMBER_DESTROY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CHAMBER_DESTROY);
+ m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true);
+ m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true);
+
+ if(pInstance)
+ pInstance->SetData(DATA_COLLAPSE, true);
+ }
+
+ if(Phase3)
+ {
+ if(Debris_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(summon) ((mob_abyssalAI*)summon->AI())->SetTrigger(1);
+ }
+ Debris_Timer = 10000;
+ }else Debris_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI
+{
+ mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 ShadowBoltVolley_Timer;
+ uint32 DarkMending_Timer;
+ uint32 Fear_Timer;
+ uint32 Infernal_Timer;
+
+ uint32 Check_Timer;
+
+ void Reset()
+ {
+ ShadowBoltVolley_Timer = 8000 + rand()%2000;
+ DarkMending_Timer = 10000;
+ Fear_Timer = 15000 + rand()%5000;
+ Infernal_Timer = 10000 + rand()%40000;
+
+ Check_Timer = 5000;
+
+ if(pInstance)
+ pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED);
+
+ m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS);
+
+ m_creature->InterruptNonMeleeSpells(false);
+ DoZoneInCombat();
+ }
+
+ void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());}
+
+ void MoveInLineOfSight(Unit*) {}
+
+ // bugged
+ /*void DamageTaken(Unit*, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth())
+ m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true);
+ }*/
+
+ void JustDied(Unit*)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_CHANNELER_EVENT, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(ShadowBoltVolley_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY);
+ ShadowBoltVolley_Timer = 10000 + rand()%10000;
+ }else ShadowBoltVolley_Timer -= diff;
+
+ if(DarkMending_Timer < diff)
+ {
+ if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ DoCast(m_creature, SPELL_DARK_MENDING);
+ DarkMending_Timer = 10000 +(rand() % 10000);
+ }else DarkMending_Timer -= diff;
+
+ if(Fear_Timer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_FEAR);
+ Fear_Timer = 25000 + rand()%15000;
+ }else Fear_Timer -= diff;
+
+ if(Infernal_Timer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true);
+ Infernal_Timer = 30000 + rand()%10000;
+ }else Infernal_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Manticron Cube
+bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO)
+{
+ ScriptedInstance* pInstance =(ScriptedInstance*)_GO->GetInstanceData();
+ if(!pInstance) return true;
+ if(pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true;
+ Creature *Magtheridon =(Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_MAGTHERIDON));
+ if(!Magtheridon || !Magtheridon->isAlive()) return true;
+
+ // if exhausted or already channeling return
+ if(player->HasAura(SPELL_MIND_EXHAUSTION, 0) || player->HasAura(SPELL_SHADOW_GRASP, 1))
+ return true;
+
+ player->InterruptNonMeleeSpells(false);
+ player->CastSpell(player, SPELL_SHADOW_GRASP, true);
+ player->CastSpell(player, SPELL_SHADOW_GRASP_VISUAL, false);
+ ((boss_magtheridonAI*)Magtheridon->AI())->SetClicker(_GO->GetGUID(), player->GetGUID());
+ return true;
+}
+
+CreatureAI* GetAI_boss_magtheridon(Creature *_Creature)
+{
+ return new boss_magtheridonAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_hellfire_channeler(Creature *_Creature)
+{
+ return new mob_hellfire_channelerAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_abyssalAI(Creature *_Creature)
+{
+ return new mob_abyssalAI(_Creature);
+}
+
+void AddSC_boss_magtheridon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_magtheridon";
+ newscript->GetAI = GetAI_boss_magtheridon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_hellfire_channeler";
+ newscript->GetAI = GetAI_mob_hellfire_channeler;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_manticron_cube";
+ newscript->pGOHello = &GOHello_go_Manticron_Cube;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_abyssal";
+ newscript->GetAI = GetAI_mob_abyssalAI;
+ m_scripts[nrscripts++] = newscript;
+
} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
index 2314dc344f9..6469ed413c5 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
@@ -1,13 +1,13 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_MAGTHERIDONS_LAIR_H
-#define DEF_MAGTHERIDONS_LAIR_H
-
-#define DATA_MAGTHERIDON_EVENT 1
-#define DATA_MAGTHERIDON 3
-#define DATA_CHANNELER_EVENT 2
-#define DATA_COLLAPSE 6
-#define DATA_CHANNELER 9
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_MAGTHERIDONS_LAIR_H
+#define DEF_MAGTHERIDONS_LAIR_H
+
+#define DATA_MAGTHERIDON_EVENT 1
+#define DATA_MAGTHERIDON 3
+#define DATA_CHANNELER_EVENT 2
+#define DATA_COLLAPSE 6
+#define DATA_CHANNELER 9
+#endif
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
index 6c4609df4fd..798498df02f 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
@@ -1,332 +1,332 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Magtheridons_Lair
-SD%Complete: 100
-SDComment:
-SDCategory: Hellfire Citadel, Magtheridon's lair
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magtheridons_lair.h"
-
-#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7
-#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7
-#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8
-#define SPELL_DEBRIS_KNOCKDOWN 36449 // core bug, does not support target 8
-
-#define CHAMBER_CENTER_X -15.14
-#define CHAMBER_CENTER_Y 1.8
-#define CHAMBER_CENTER_Z -0.4
-
-#define ENCOUNTERS 2
-
-struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
-{
- instance_magtheridons_lair(Map *Map) : ScriptedInstance(Map)
- {
- Initialize();
- // target 7, random target with certain entry spell, need core fix
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BLAZE_TARGET);
- if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 6)
- {
- TempSpell->EffectImplicitTargetA[0] = 6;
- TempSpell->EffectImplicitTargetB[0] = 0;
- }
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SOUL_TRANSFER);
- if(TempSpell && TempSpell->EffectImplicitTargetB[0] != 30)
- {
- TempSpell->EffectImplicitTargetA[0] = 1;
- TempSpell->EffectImplicitTargetA[1] = 1;
- TempSpell->EffectImplicitTargetA[2] = 1;
- TempSpell->EffectImplicitTargetB[0] = 0;
- TempSpell->EffectImplicitTargetB[1] = 0;
- TempSpell->EffectImplicitTargetB[2] = 0;
- }
- // target 8, but core only push back the caster
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_DAMAGE);
- if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53)
- {
- TempSpell->EffectImplicitTargetA[0] = 53;
- TempSpell->EffectImplicitTargetB[0] = 16;
- }
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_KNOCKDOWN);
- if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53)
- {
- TempSpell->EffectImplicitTargetA[0] = 53;
- TempSpell->EffectImplicitTargetB[0] = 16;
- TempSpell->EffectImplicitTargetA[1] = 53;
- TempSpell->EffectImplicitTargetB[1] = 16;
- }
- }
-
- uint32 Encounters[ENCOUNTERS];
-
- uint64 MagtheridonGUID;
- std::set<uint64> ChannelerGUID;
- uint64 DoorGUID;
- std::set<uint64> ColumnGUID;
-
- uint32 CageTimer;
- uint32 RespawnTimer;
-
- void Initialize()
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = NOT_STARTED;
-
- MagtheridonGUID = 0;
- ChannelerGUID.clear();
- DoorGUID = 0;
- ColumnGUID.clear();
-
- CageTimer = 0;
- RespawnTimer = 0;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i] == IN_PROGRESS) return true;
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature->GetEntry())
- {
- case 17257:
- MagtheridonGUID = creature->GetGUID();
- break;
- case 17256:
- ChannelerGUID.insert(creature->GetGUID());
- break;
- }
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case 181713:
- go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
- break;
- case 183847:
- DoorGUID = go->GetGUID();
- break;
- case 184653: // hall
- case 184634: // six columns
- case 184635:
- case 184636:
- case 184637:
- case 184638:
- case 184639:
- ColumnGUID.insert(go->GetGUID());
- break;
- }
- }
-
- uint64 GetData64(uint32 type)
- {
- switch(type)
- {
- case DATA_MAGTHERIDON:
- return MagtheridonGUID;
- }
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- Player *player = GetPlayer();
- if(!player) return;
-
- switch(type)
- {
- case DATA_MAGTHERIDON_EVENT:
- Encounters[0] = data;
- if(data == NOT_STARTED)
- RespawnTimer = 10000;
- if(data != IN_PROGRESS)
- {
- if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
- Door->SetGoState(0);
- }
- break;
- case DATA_CHANNELER_EVENT:
- switch(data)
- {
- case NOT_STARTED: // Reset all channelers once one is reset.
- if(Encounters[1] != NOT_STARTED)
- {
- Encounters[1] = NOT_STARTED;
- for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
- {
- if(Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i))
- {
- if(Channeler->isAlive())
- Channeler->AI()->EnterEvadeMode();
- else
- Channeler->Respawn();
- }
- }
- CageTimer = 0;
- if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
- Door->SetGoState(0);
- }break;
- case IN_PROGRESS: // Event start.
- if(Encounters[1] != IN_PROGRESS)
- {
- Encounters[1] = IN_PROGRESS;
- // Let all five channelers aggro.
- for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
- {
- Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i);
- if(Channeler && Channeler->isAlive())
- {
- //if(Unit *target = Channeler->SelectNearbyTarget())
- //always return true, do not know why
- AttackNearestTarget(Channeler);
- }
- }
- // Release Magtheridon after two minutes.
- Creature *Magtheridon = (Creature*)Unit::GetUnit(*player, MagtheridonGUID);
- if(Magtheridon && Magtheridon->isAlive())
- {
- Magtheridon->TextEmote("'s bonds begin to weaken!", 0);
- CageTimer = 120000;
- }
- if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
- Door->SetGoState(1);
- }break;
- case DONE: // Add buff and check if all channelers are dead.
- for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
- {
- Unit *Channeler = Unit::GetUnit(*player, *i);
- if(Channeler && Channeler->isAlive())
- {
- Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true);
- data = IN_PROGRESS;
- }
- }break;
- }
- Encounters[1] = data;
- break;
- case DATA_COLLAPSE:
- // true - collapse / false - reset
- for(std::set<uint64>::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i)
- {
- if(GameObject *Column = GameObject::GetGameObject(*player, *i))
- Column->SetGoState(!data);
- }
- break;
- default:
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- if(type == DATA_MAGTHERIDON_EVENT)
- return Encounters[0];
- return 0;
- }
-
- Player* GetPlayer()
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- return ((InstanceMap*)instance)->GetPlayers().front();
- return NULL;
- }
-
- void AttackNearestTarget(Creature *creature)
- {
- float minRange = 999.0f;
- float range;
- Player* target = NULL;
- InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)instance)->GetPlayers();
- InstanceMap::PlayerList::const_iterator i;
- for(i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if((*i)->isTargetableForAttack())
- {
- range = (*i)->GetDistance(creature);
- if(range < minRange)
- {
- minRange = range;
- target = *i;
- }
- }
- }
- creature->AI()->AttackStart(target);
- }
-
- void Update(uint32 diff)
- {
- if(CageTimer)
- {
- if(CageTimer <= diff)
- {
- if(Player *player = GetPlayer())
- {
- Creature *Magtheridon = (Creature*)Unit::GetUnit(*player, MagtheridonGUID);
- if(Magtheridon && Magtheridon->isAlive())
- {
- Magtheridon->clearUnitState(UNIT_STAT_STUNNED);
- AttackNearestTarget(Magtheridon);
- }
- }
- CageTimer = 0;
- }else CageTimer -= diff;
- }
-
- if(RespawnTimer)
- {
- if(RespawnTimer <= diff)
- {
- if(Player *player = GetPlayer())
- {
- for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
- {
- if(Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i))
- {
- if(Channeler->isAlive())
- Channeler->AI()->EnterEvadeMode();
- else
- Channeler->Respawn();
- }
- }
- }
- RespawnTimer = 0;
- }else RespawnTimer -= diff;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_magtheridons_lair(Map* map)
-{
- return new instance_magtheridons_lair(map);
-}
-
-void AddSC_instance_magtheridons_lair()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_magtheridons_lair";
- newscript->GetInstanceData = GetInstanceData_instance_magtheridons_lair;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Magtheridons_Lair
+SD%Complete: 100
+SDComment:
+SDCategory: Hellfire Citadel, Magtheridon's lair
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magtheridons_lair.h"
+
+#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7
+#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7
+#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8
+#define SPELL_DEBRIS_KNOCKDOWN 36449 // core bug, does not support target 8
+
+#define CHAMBER_CENTER_X -15.14
+#define CHAMBER_CENTER_Y 1.8
+#define CHAMBER_CENTER_Z -0.4
+
+#define ENCOUNTERS 2
+
+struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
+{
+ instance_magtheridons_lair(Map *Map) : ScriptedInstance(Map)
+ {
+ Initialize();
+ // target 7, random target with certain entry spell, need core fix
+ SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BLAZE_TARGET);
+ if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 6)
+ {
+ TempSpell->EffectImplicitTargetA[0] = 6;
+ TempSpell->EffectImplicitTargetB[0] = 0;
+ }
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SOUL_TRANSFER);
+ if(TempSpell && TempSpell->EffectImplicitTargetB[0] != 30)
+ {
+ TempSpell->EffectImplicitTargetA[0] = 1;
+ TempSpell->EffectImplicitTargetA[1] = 1;
+ TempSpell->EffectImplicitTargetA[2] = 1;
+ TempSpell->EffectImplicitTargetB[0] = 0;
+ TempSpell->EffectImplicitTargetB[1] = 0;
+ TempSpell->EffectImplicitTargetB[2] = 0;
+ }
+ // target 8, but core only push back the caster
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_DAMAGE);
+ if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53)
+ {
+ TempSpell->EffectImplicitTargetA[0] = 53;
+ TempSpell->EffectImplicitTargetB[0] = 16;
+ }
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_KNOCKDOWN);
+ if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53)
+ {
+ TempSpell->EffectImplicitTargetA[0] = 53;
+ TempSpell->EffectImplicitTargetB[0] = 16;
+ TempSpell->EffectImplicitTargetA[1] = 53;
+ TempSpell->EffectImplicitTargetB[1] = 16;
+ }
+ }
+
+ uint32 Encounters[ENCOUNTERS];
+
+ uint64 MagtheridonGUID;
+ std::set<uint64> ChannelerGUID;
+ uint64 DoorGUID;
+ std::set<uint64> ColumnGUID;
+
+ uint32 CageTimer;
+ uint32 RespawnTimer;
+
+ void Initialize()
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = NOT_STARTED;
+
+ MagtheridonGUID = 0;
+ ChannelerGUID.clear();
+ DoorGUID = 0;
+ ColumnGUID.clear();
+
+ CageTimer = 0;
+ RespawnTimer = 0;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i] == IN_PROGRESS) return true;
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature->GetEntry())
+ {
+ case 17257:
+ MagtheridonGUID = creature->GetGUID();
+ break;
+ case 17256:
+ ChannelerGUID.insert(creature->GetGUID());
+ break;
+ }
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case 181713:
+ go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
+ break;
+ case 183847:
+ DoorGUID = go->GetGUID();
+ break;
+ case 184653: // hall
+ case 184634: // six columns
+ case 184635:
+ case 184636:
+ case 184637:
+ case 184638:
+ case 184639:
+ ColumnGUID.insert(go->GetGUID());
+ break;
+ }
+ }
+
+ uint64 GetData64(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_MAGTHERIDON:
+ return MagtheridonGUID;
+ }
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ Player *player = GetPlayer();
+ if(!player) return;
+
+ switch(type)
+ {
+ case DATA_MAGTHERIDON_EVENT:
+ Encounters[0] = data;
+ if(data == NOT_STARTED)
+ RespawnTimer = 10000;
+ if(data != IN_PROGRESS)
+ {
+ if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
+ Door->SetGoState(0);
+ }
+ break;
+ case DATA_CHANNELER_EVENT:
+ switch(data)
+ {
+ case NOT_STARTED: // Reset all channelers once one is reset.
+ if(Encounters[1] != NOT_STARTED)
+ {
+ Encounters[1] = NOT_STARTED;
+ for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
+ {
+ if(Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i))
+ {
+ if(Channeler->isAlive())
+ Channeler->AI()->EnterEvadeMode();
+ else
+ Channeler->Respawn();
+ }
+ }
+ CageTimer = 0;
+ if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
+ Door->SetGoState(0);
+ }break;
+ case IN_PROGRESS: // Event start.
+ if(Encounters[1] != IN_PROGRESS)
+ {
+ Encounters[1] = IN_PROGRESS;
+ // Let all five channelers aggro.
+ for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
+ {
+ Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i);
+ if(Channeler && Channeler->isAlive())
+ {
+ //if(Unit *target = Channeler->SelectNearbyTarget())
+ //always return true, do not know why
+ AttackNearestTarget(Channeler);
+ }
+ }
+ // Release Magtheridon after two minutes.
+ Creature *Magtheridon = (Creature*)Unit::GetUnit(*player, MagtheridonGUID);
+ if(Magtheridon && Magtheridon->isAlive())
+ {
+ Magtheridon->TextEmote("'s bonds begin to weaken!", 0);
+ CageTimer = 120000;
+ }
+ if(GameObject *Door = GameObject::GetGameObject(*player, DoorGUID))
+ Door->SetGoState(1);
+ }break;
+ case DONE: // Add buff and check if all channelers are dead.
+ for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
+ {
+ Unit *Channeler = Unit::GetUnit(*player, *i);
+ if(Channeler && Channeler->isAlive())
+ {
+ Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true);
+ data = IN_PROGRESS;
+ }
+ }break;
+ }
+ Encounters[1] = data;
+ break;
+ case DATA_COLLAPSE:
+ // true - collapse / false - reset
+ for(std::set<uint64>::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i)
+ {
+ if(GameObject *Column = GameObject::GetGameObject(*player, *i))
+ Column->SetGoState(!data);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ if(type == DATA_MAGTHERIDON_EVENT)
+ return Encounters[0];
+ return 0;
+ }
+
+ Player* GetPlayer()
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ return ((InstanceMap*)instance)->GetPlayers().front();
+ return NULL;
+ }
+
+ void AttackNearestTarget(Creature *creature)
+ {
+ float minRange = 999.0f;
+ float range;
+ Player* target = NULL;
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)instance)->GetPlayers();
+ InstanceMap::PlayerList::const_iterator i;
+ for(i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if((*i)->isTargetableForAttack())
+ {
+ range = (*i)->GetDistance(creature);
+ if(range < minRange)
+ {
+ minRange = range;
+ target = *i;
+ }
+ }
+ }
+ creature->AI()->AttackStart(target);
+ }
+
+ void Update(uint32 diff)
+ {
+ if(CageTimer)
+ {
+ if(CageTimer <= diff)
+ {
+ if(Player *player = GetPlayer())
+ {
+ Creature *Magtheridon = (Creature*)Unit::GetUnit(*player, MagtheridonGUID);
+ if(Magtheridon && Magtheridon->isAlive())
+ {
+ Magtheridon->clearUnitState(UNIT_STAT_STUNNED);
+ AttackNearestTarget(Magtheridon);
+ }
+ }
+ CageTimer = 0;
+ }else CageTimer -= diff;
+ }
+
+ if(RespawnTimer)
+ {
+ if(RespawnTimer <= diff)
+ {
+ if(Player *player = GetPlayer())
+ {
+ for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
+ {
+ if(Creature *Channeler = (Creature*)Unit::GetUnit(*player, *i))
+ {
+ if(Channeler->isAlive())
+ Channeler->AI()->EnterEvadeMode();
+ else
+ Channeler->Respawn();
+ }
+ }
+ }
+ RespawnTimer = 0;
+ }else RespawnTimer -= diff;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_magtheridons_lair(Map* map)
+{
+ return new instance_magtheridons_lair(map);
+}
+
+void AddSC_instance_magtheridons_lair()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_magtheridons_lair";
+ newscript->GetInstanceData = GetInstanceData_instance_magtheridons_lair;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
index e86d8dcf5da..ecfe09ee287 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
@@ -1,505 +1,505 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grand_Warlock_Nethekurse
-SD%Complete: 75
-SDComment: encounter not fully complete. missing part where boss kill minions.
-SDCategory: Hellfire Citadel, Shattered Halls
-EndScriptData */
-
-/* ContentData
-boss_grand_warlock_nethekurse
-mob_fel_orc_convert
-mob_lesser_shadow_fissure
-EndContentData */
-
-#include "precompiled.h"
-#include "def_shattered_halls.h"
-
-struct Say
-{
- const char* text;
- uint32 sound;
-};
-
-#define SAY_INTRO "You wish to fight us all at once? This should be amusing!"
-#define SOUND_INTRO 10262
-
-static Say PeonAttacked[]=
-{
- {"You can have that one. I no longer need him.", 10263},
- {"Yes, beat him mercilessly. His skull is a thick as an ogres.", 10264},
- {"Don't waste your time on that one. He's weak!", 10265},
- {"You want him? Very well, take him!", 10266},
-};
-static Say PeonDies[]=
-{
- {"One pitiful wretch down. Go on, take another one.", 10267},
- {"Ahh, what a waste... Next!", 10268},
- {"I was going to kill him anyway!", 10269},
- {"Thank you for saving me the trouble! Now it's my turn to have some fun...", 10270},
-};
-
-#define SAY_TAUNT_1 "Beg for your pittyfull life!"
-#define SOUND_TAUNT_1 10259
-#define SAY_TAUNT_2 "Run covad, ruun!"
-#define SOUND_TAUNT_2 10260
-#define SAY_TAUNT_3 "Your pain amuses me."
-#define SOUND_TAUNT_3 10261
-
-#define SAY_AGGRO_1 "I'm already bored."
-#define SOUND_AGGRO_1 10271
-#define SAY_AGGRO_2 "Come on! ... Show me a real fight."
-#define SOUND_AGGRO_2 10272
-#define SAY_AGGRO_3 "I had more fun torturing the peons."
-#define SOUND_AGGRO_3 10273
-
-#define SAY_SLAY_1 "You Loose."
-#define SOUND_SLAY_1 10274
-#define SAY_SLAY_2 "Ohh! Just die."
-#define SOUND_SLAY_2 10275
-
-#define SAY_DIE "What a ... a shame."
-#define SOUND_DIE 10276
-
-#define SPELL_DEATH_COIL 30500
-#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D
-#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC
-
-#define SPELL_SHADOW_CLEAVE 30495
-#define H_SPELL_SHADOW_SLAM 35953
-
-#define SPELL_HEMORRHAGE 30478
-
-#define SPELL_CONSUMPTION 30497
-#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should
-
-struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
-{
- boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- bool HeroicMode;
- bool IntroOnce;
- bool IsIntroEvent;
- bool IsMainEvent;
- bool SpinOnce;
- //bool HasTaunted;
- bool Phase;
-
- uint32 PeonEngagedCount;
- uint32 PeonKilledCount;
-
- uint32 IntroEvent_Timer;
- uint32 DeathCoil_Timer;
- uint32 ShadowFissure_Timer;
- uint32 Cleave_Timer;
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- HeroicMode = m_creature->GetMap()->IsHeroic();
- IsIntroEvent = false;
- IntroOnce = false;
- IsMainEvent = false;
- //HasTaunted = false;
- SpinOnce = false;
- Phase = false;
-
- PeonEngagedCount = 0;
- PeonKilledCount = 0;
-
- IntroEvent_Timer = 90000; //how long before getting bored and kills his minions?
- DeathCoil_Timer = 20000;
- ShadowFissure_Timer = 8000;
- Cleave_Timer = 5000;
- }
-
- void DoYellForPeonAggro()
- {
- if( PeonEngagedCount >= 4 )
- return;
-
- DoYell(PeonAttacked[PeonEngagedCount].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, PeonAttacked[PeonEngagedCount].sound);
- ++PeonEngagedCount;
- }
-
- void DoYellForPeonDeath()
- {
- if( PeonKilledCount >= 4 )
- return;
-
- DoYell(PeonDies[PeonKilledCount].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, PeonDies[PeonKilledCount].sound);
- ++PeonKilledCount;
-
- if( PeonKilledCount == 4 )
- {
- IsIntroEvent = false;
- IsMainEvent = true;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- }
-
- void DoTauntPeons()
- {
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_TAUNT_1);
- DoYell(SAY_TAUNT_1,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_TAUNT_2);
- DoYell(SAY_TAUNT_2,LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoPlaySoundToSet(m_creature,SOUND_TAUNT_3);
- DoYell(SAY_TAUNT_3,LANG_UNIVERSAL,NULL);
- break;
- }
-
- //TODO: kill the peons first
- IsIntroEvent = false;
- PeonEngagedCount = 4;
- PeonKilledCount = 4;
- IsMainEvent = true;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void AttackStart(Unit* who)
- {
- if ( IsIntroEvent || !IsMainEvent )
- return;
-
- if( who->isTargetableForAttack() )
- {
- if( Phase ) DoStartAttackNoMovement(who);
- else DoStartAttackAndMovement(who);
-
- if( !InCombat )
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if( !IntroOnce && m_creature->IsWithinDistInMap(who, 75) )
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- IntroOnce = true;
- IsIntroEvent = true;
-
- if( pInstance )
- pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
- }
-
- if(!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE )
- return;
-
- if( IsIntroEvent || !IsMainEvent )
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- if( Phase ) DoStartAttackNoMovement(who);
- else DoStartAttackAndMovement(who);
-
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if( !InCombat )
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- DoYell(SAY_AGGRO_1,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- DoYell(SAY_AGGRO_2,LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- DoYell(SAY_AGGRO_3,LANG_UNIVERSAL,NULL);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- summoned->setFaction(14);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoPlaySoundToSet(m_creature,SOUND_DIE);
- DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
-
- if( !pInstance )
- return;
-
- pInstance->SetData(TYPE_NETHEKURSE,DONE);
-
- if( pInstance->GetData64(DATA_NETHEKURSE_DOOR) )
- {
- if( GameObject *Door = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_NETHEKURSE_DOOR)) )
- Door->SetGoState(0);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( IsIntroEvent )
- {
- if( !pInstance )
- return;
-
- if( pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
- {
- if( IntroEvent_Timer < diff )
- {
- DoTauntPeons();
- }else IntroEvent_Timer -= diff;
- }
- }
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( !IsMainEvent )
- return;
-
- if( Phase )
- {
- if( !SpinOnce )
- {
- DoCast(m_creature->getVictim(),SPELL_DARK_SPIN);
- SpinOnce = true;
- }
-
- if( Cleave_Timer < diff )
- {
- DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE));
- Cleave_Timer = 6000+rand()%2500;
- }else Cleave_Timer -= diff;
- }
- else
- {
- if( ShadowFissure_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_FISSURE);
- ShadowFissure_Timer = 7500+rand()%7500;
- }else ShadowFissure_Timer -= diff;
-
- if( DeathCoil_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_DEATH_COIL);
- DeathCoil_Timer = 15000+rand()%5000;
- }else DeathCoil_Timer -= diff;
-
- if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20 )
- Phase = true;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI
-{
- mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint32 Hemorrhage_Timer;
-
- void Reset()
- {
- m_creature->SetNoCallAssistence(true); //we don't want any assistance (WE R HEROZ!)
- Hemorrhage_Timer = 3000;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- return;
- }
-
- void Aggro(Unit* who)
- {
- if( pInstance )
- {
- if( pInstance->GetData64(DATA_NETHEKURSE) )
- {
- Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
- if( pKurse )
- ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonAggro();
- }
-
- if( pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
- return;
- else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if( pInstance )
- {
- if( pInstance->GetData64(DATA_NETHEKURSE) )
- {
- Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
- if( pKurse )
- ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonDeath();
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( Hemorrhage_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE);
- Hemorrhage_Timer = 15000;
- }else Hemorrhage_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//NOTE: this creature are also summoned by other spells, for different creatures
-struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI
-{
- mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool Start;
- uint32 Stop_Timer;
-
- void Reset()
- {
- Start = false;
- Stop_Timer = 30000;
- }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit *who) { return; }
-
- void AttackStart(Unit* who) { return; }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Start )
- {
- //triggered spell of consumption does not properly show it's SpellVisual, hack it a bit
- m_creature->CastSpell(m_creature,SPELL_TEMPORARY_VISUAL,true);
- m_creature->CastSpell(m_creature,SPELL_CONSUMPTION,false);
- Start = true;
- }
-
- if( Stop_Timer < diff)
- {
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- }else Stop_Timer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature *_Creature)
-{
- return new boss_grand_warlock_nethekurseAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_fel_orc_convert(Creature *_Creature)
-{
- return new mob_fel_orc_convertAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature *_Creature)
-{
- return new mob_lesser_shadow_fissureAI (_Creature);
-}
-
-void AddSC_boss_grand_warlock_nethekurse()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_grand_warlock_nethekurse";
- newscript->GetAI = GetAI_boss_grand_warlock_nethekurse;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_fel_orc_convert";
- newscript->GetAI = GetAI_mob_fel_orc_convert;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_lesser_shadow_fissure";
- newscript->GetAI = GetAI_mob_lesser_shadow_fissure;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grand_Warlock_Nethekurse
+SD%Complete: 75
+SDComment: encounter not fully complete. missing part where boss kill minions.
+SDCategory: Hellfire Citadel, Shattered Halls
+EndScriptData */
+
+/* ContentData
+boss_grand_warlock_nethekurse
+mob_fel_orc_convert
+mob_lesser_shadow_fissure
+EndContentData */
+
+#include "precompiled.h"
+#include "def_shattered_halls.h"
+
+struct Say
+{
+ const char* text;
+ uint32 sound;
+};
+
+#define SAY_INTRO "You wish to fight us all at once? This should be amusing!"
+#define SOUND_INTRO 10262
+
+static Say PeonAttacked[]=
+{
+ {"You can have that one. I no longer need him.", 10263},
+ {"Yes, beat him mercilessly. His skull is a thick as an ogres.", 10264},
+ {"Don't waste your time on that one. He's weak!", 10265},
+ {"You want him? Very well, take him!", 10266},
+};
+static Say PeonDies[]=
+{
+ {"One pitiful wretch down. Go on, take another one.", 10267},
+ {"Ahh, what a waste... Next!", 10268},
+ {"I was going to kill him anyway!", 10269},
+ {"Thank you for saving me the trouble! Now it's my turn to have some fun...", 10270},
+};
+
+#define SAY_TAUNT_1 "Beg for your pittyfull life!"
+#define SOUND_TAUNT_1 10259
+#define SAY_TAUNT_2 "Run covad, ruun!"
+#define SOUND_TAUNT_2 10260
+#define SAY_TAUNT_3 "Your pain amuses me."
+#define SOUND_TAUNT_3 10261
+
+#define SAY_AGGRO_1 "I'm already bored."
+#define SOUND_AGGRO_1 10271
+#define SAY_AGGRO_2 "Come on! ... Show me a real fight."
+#define SOUND_AGGRO_2 10272
+#define SAY_AGGRO_3 "I had more fun torturing the peons."
+#define SOUND_AGGRO_3 10273
+
+#define SAY_SLAY_1 "You Loose."
+#define SOUND_SLAY_1 10274
+#define SAY_SLAY_2 "Ohh! Just die."
+#define SOUND_SLAY_2 10275
+
+#define SAY_DIE "What a ... a shame."
+#define SOUND_DIE 10276
+
+#define SPELL_DEATH_COIL 30500
+#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D
+#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC
+
+#define SPELL_SHADOW_CLEAVE 30495
+#define H_SPELL_SHADOW_SLAM 35953
+
+#define SPELL_HEMORRHAGE 30478
+
+#define SPELL_CONSUMPTION 30497
+#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should
+
+struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
+{
+ boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool HeroicMode;
+ bool IntroOnce;
+ bool IsIntroEvent;
+ bool IsMainEvent;
+ bool SpinOnce;
+ //bool HasTaunted;
+ bool Phase;
+
+ uint32 PeonEngagedCount;
+ uint32 PeonKilledCount;
+
+ uint32 IntroEvent_Timer;
+ uint32 DeathCoil_Timer;
+ uint32 ShadowFissure_Timer;
+ uint32 Cleave_Timer;
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ IsIntroEvent = false;
+ IntroOnce = false;
+ IsMainEvent = false;
+ //HasTaunted = false;
+ SpinOnce = false;
+ Phase = false;
+
+ PeonEngagedCount = 0;
+ PeonKilledCount = 0;
+
+ IntroEvent_Timer = 90000; //how long before getting bored and kills his minions?
+ DeathCoil_Timer = 20000;
+ ShadowFissure_Timer = 8000;
+ Cleave_Timer = 5000;
+ }
+
+ void DoYellForPeonAggro()
+ {
+ if( PeonEngagedCount >= 4 )
+ return;
+
+ DoYell(PeonAttacked[PeonEngagedCount].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, PeonAttacked[PeonEngagedCount].sound);
+ ++PeonEngagedCount;
+ }
+
+ void DoYellForPeonDeath()
+ {
+ if( PeonKilledCount >= 4 )
+ return;
+
+ DoYell(PeonDies[PeonKilledCount].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, PeonDies[PeonKilledCount].sound);
+ ++PeonKilledCount;
+
+ if( PeonKilledCount == 4 )
+ {
+ IsIntroEvent = false;
+ IsMainEvent = true;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ }
+
+ void DoTauntPeons()
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_TAUNT_1);
+ DoYell(SAY_TAUNT_1,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_TAUNT_2);
+ DoYell(SAY_TAUNT_2,LANG_UNIVERSAL,NULL);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature,SOUND_TAUNT_3);
+ DoYell(SAY_TAUNT_3,LANG_UNIVERSAL,NULL);
+ break;
+ }
+
+ //TODO: kill the peons first
+ IsIntroEvent = false;
+ PeonEngagedCount = 4;
+ PeonKilledCount = 4;
+ IsMainEvent = true;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if ( IsIntroEvent || !IsMainEvent )
+ return;
+
+ if( who->isTargetableForAttack() )
+ {
+ if( Phase ) DoStartAttackNoMovement(who);
+ else DoStartAttackAndMovement(who);
+
+ if( !InCombat )
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if( !IntroOnce && m_creature->IsWithinDistInMap(who, 75) )
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ IntroOnce = true;
+ IsIntroEvent = true;
+
+ if( pInstance )
+ pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
+ }
+
+ if(!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE )
+ return;
+
+ if( IsIntroEvent || !IsMainEvent )
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ if( Phase ) DoStartAttackNoMovement(who);
+ else DoStartAttackAndMovement(who);
+
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if( !InCombat )
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ DoYell(SAY_AGGRO_1,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ DoYell(SAY_AGGRO_2,LANG_UNIVERSAL,NULL);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ DoYell(SAY_AGGRO_3,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->setFaction(14);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoPlaySoundToSet(m_creature,SOUND_DIE);
+ DoYell(SAY_DIE,LANG_UNIVERSAL,NULL);
+
+ if( !pInstance )
+ return;
+
+ pInstance->SetData(TYPE_NETHEKURSE,DONE);
+
+ if( pInstance->GetData64(DATA_NETHEKURSE_DOOR) )
+ {
+ if( GameObject *Door = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_NETHEKURSE_DOOR)) )
+ Door->SetGoState(0);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( IsIntroEvent )
+ {
+ if( !pInstance )
+ return;
+
+ if( pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
+ {
+ if( IntroEvent_Timer < diff )
+ {
+ DoTauntPeons();
+ }else IntroEvent_Timer -= diff;
+ }
+ }
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( !IsMainEvent )
+ return;
+
+ if( Phase )
+ {
+ if( !SpinOnce )
+ {
+ DoCast(m_creature->getVictim(),SPELL_DARK_SPIN);
+ SpinOnce = true;
+ }
+
+ if( Cleave_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE));
+ Cleave_Timer = 6000+rand()%2500;
+ }else Cleave_Timer -= diff;
+ }
+ else
+ {
+ if( ShadowFissure_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_FISSURE);
+ ShadowFissure_Timer = 7500+rand()%7500;
+ }else ShadowFissure_Timer -= diff;
+
+ if( DeathCoil_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_DEATH_COIL);
+ DeathCoil_Timer = 15000+rand()%5000;
+ }else DeathCoil_Timer -= diff;
+
+ if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20 )
+ Phase = true;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI
+{
+ mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint32 Hemorrhage_Timer;
+
+ void Reset()
+ {
+ m_creature->SetNoCallAssistence(true); //we don't want any assistance (WE R HEROZ!)
+ Hemorrhage_Timer = 3000;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return;
+ }
+
+ void Aggro(Unit* who)
+ {
+ if( pInstance )
+ {
+ if( pInstance->GetData64(DATA_NETHEKURSE) )
+ {
+ Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
+ if( pKurse )
+ ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonAggro();
+ }
+
+ if( pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
+ return;
+ else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if( pInstance )
+ {
+ if( pInstance->GetData64(DATA_NETHEKURSE) )
+ {
+ Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
+ if( pKurse )
+ ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonDeath();
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( Hemorrhage_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE);
+ Hemorrhage_Timer = 15000;
+ }else Hemorrhage_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//NOTE: this creature are also summoned by other spells, for different creatures
+struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI
+{
+ mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool Start;
+ uint32 Stop_Timer;
+
+ void Reset()
+ {
+ Start = false;
+ Stop_Timer = 30000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit *who) { return; }
+
+ void AttackStart(Unit* who) { return; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Start )
+ {
+ //triggered spell of consumption does not properly show it's SpellVisual, hack it a bit
+ m_creature->CastSpell(m_creature,SPELL_TEMPORARY_VISUAL,true);
+ m_creature->CastSpell(m_creature,SPELL_CONSUMPTION,false);
+ Start = true;
+ }
+
+ if( Stop_Timer < diff)
+ {
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ }else Stop_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature *_Creature)
+{
+ return new boss_grand_warlock_nethekurseAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_fel_orc_convert(Creature *_Creature)
+{
+ return new mob_fel_orc_convertAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature *_Creature)
+{
+ return new mob_lesser_shadow_fissureAI (_Creature);
+}
+
+void AddSC_boss_grand_warlock_nethekurse()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_grand_warlock_nethekurse";
+ newscript->GetAI = GetAI_boss_grand_warlock_nethekurse;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_fel_orc_convert";
+ newscript->GetAI = GetAI_mob_fel_orc_convert;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_lesser_shadow_fissure";
+ newscript->GetAI = GetAI_mob_lesser_shadow_fissure;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
index a2a05570839..7907bf0207a 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
@@ -1,414 +1,414 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warbringer_Omrogg
-SD%Complete: 85
-SDComment: Heroic enabled. Spell timing may need additional tweaks
-SDCategory: Hellfire Citadel, Shattered Halls
-EndScriptData */
-
-/* ContentData
-mob_omrogg_heads
-boss_warbringer_omrogg
-EndContentData */
-
-#include "precompiled.h"
-#include "def_shattered_halls.h"
-
-#define ENTRY_LEFT_HEAD 19523
-#define ENTRY_RIGHT_HEAD 19524
-
-struct Yell
-{
- const char* text;
- uint32 sound;
- uint32 creature;
-};
-
-static Yell GoCombat[]=
-{
- {"Smash!", 10306, ENTRY_LEFT_HEAD},
- {"If you nice me let you live.", 10308, ENTRY_LEFT_HEAD},
- {"Me hungry!", 10309, ENTRY_LEFT_HEAD},
-};
-static Yell GoCombatDelay[]=
-{
- {"Why don't you let me do the talking?", 10317, ENTRY_RIGHT_HEAD},
- {"No, we will NOT let you live!", 10318, ENTRY_RIGHT_HEAD},
- {"You always hungry. That why we so fat!", 10319, ENTRY_RIGHT_HEAD},
-};
-
-static Yell Threat[]=
-{
- {"You stay here. Me go kill someone else!", 10303, ENTRY_LEFT_HEAD},
- {"What are you doing!", 10315, ENTRY_RIGHT_HEAD},
- {"Me kill someone else...", 10302, ENTRY_LEFT_HEAD},
- {"Me not like this one...",10300, ENTRY_LEFT_HEAD},
-};
-static Yell ThreatDelay1[]=
-{
- {"That's not funny!", 10314, ENTRY_RIGHT_HEAD},
- {"Me get bored...", 10305, ENTRY_LEFT_HEAD},
- {"I'm not done yet, idiot!", 10313, ENTRY_RIGHT_HEAD},
- {"Hey you numbskull!", 10312, ENTRY_RIGHT_HEAD},
-};
-static Yell ThreatDelay2[]=
-{
- {"Ha ha ha.", 10304, ENTRY_LEFT_HEAD},
- {"Whhy! He almost dead!", 10316, ENTRY_RIGHT_HEAD},
- {"H'ey...", 10307, ENTRY_LEFT_HEAD},
- {"We kill his friend!", 10301, ENTRY_LEFT_HEAD},
-};
-
-static Yell Killing[]=
-{
- {"This one die easy!", 10310, ENTRY_LEFT_HEAD},
- {"I'm tired. You kill next one!", 10320, ENTRY_RIGHT_HEAD},
-};
-static Yell KillingDelay[]=
-{
- {"That's because I do all the hard work!", 10321, ENTRY_RIGHT_HEAD},
- {"SD2 script error, should not see this.", 0, ENTRY_LEFT_HEAD},
-};
-
-#define EMOTE_ENRAGE "enrages"
-
-#define YELL_DIE_L "This all...your fault!"
-#define SOUND_DIE_L 10311
-#define YELL_DIE_R "I...hate...you..."
-#define SOUND_DIE_R 10322
-
-#define SPELL_BLAST_WAVE 30600
-#define SPELL_FEAR 30584
-#define SPELL_THUNDERCLAP 30633
-
-#define SPELL_BURNING_MAUL 30598
-#define H_SPELL_BURNING_MAUL 36056
-
-struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI
-{
- mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- bool DeathYell;
- uint32 Death_Timer;
-
- void Reset() {}
- void Aggro(Unit* who) { }
-
- void DoDeathYell()
- {
- Death_Timer = 4000;
- DeathYell = true;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !DeathYell )
- return;
-
- if( Death_Timer < diff )
- {
- DoYell(YELL_DIE_R,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DIE_R);
- DeathYell = false;
- }else Death_Timer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
-{
- boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 LeftHead;
- uint64 RightHead;
- int iaggro;
- int ithreat;
- int ikilling;
-
- bool HeroicMode;
- bool AggroYell;
- bool ThreatYell;
- bool ThreatYell2;
- bool KillingYell;
-
- uint32 Delay_Timer;
- uint32 BlastWave_Timer;
- uint32 BlastCount;
- uint32 Fear_Timer;
- uint32 BurningMaul_Timer;
- uint32 ThunderClap_Timer;
- uint32 ResetThreat_Timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
-
- LeftHead = 0;
- RightHead = 0;
-
- AggroYell = false;
- ThreatYell = false;
- ThreatYell2 = false;
- KillingYell = false;
-
- Delay_Timer = 4000;
- BlastWave_Timer = 0;
- BlastCount = 0;
- Fear_Timer = 8000;
- BurningMaul_Timer = 25000;
- ThunderClap_Timer = 15000;
- ResetThreat_Timer = 30000;
-
- if( pInstance )
- pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid.
- }
-
- void DoYellForThreat()
- {
- if( LeftHead && RightHead )
- {
- Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
- Unit *Right = Unit::GetUnit(*m_creature,RightHead);
-
- if( !Left && !Right )
- return;
-
- ithreat = rand()%4;
-
- Unit *source = (Left->GetEntry() == Threat[ithreat].creature ? Left : Right);
-
- source->MonsterYell(Threat[ithreat].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, Threat[ithreat].sound);
-
- Delay_Timer = 3500;
- ThreatYell = true;
- }
- }
-
- void Aggro(Unit *who)
- {
- DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
- DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
-
- if( Unit *Left = Unit::GetUnit(*m_creature,LeftHead) )
- {
- iaggro = rand()%3;
-
- Left->MonsterYell(GoCombat[iaggro].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Left, GoCombat[iaggro].sound);
-
- Delay_Timer = 3500;
- AggroYell = true;
- }
- if( pInstance )
- pInstance->SetData(TYPE_OMROGG, IN_PROGRESS);
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_LEFT_HEAD )
- LeftHead = summoned->GetGUID();
-
- if( summoned->GetEntry() == ENTRY_RIGHT_HEAD )
- RightHead = summoned->GetGUID();
-
- //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- summoned->SetVisibility(VISIBILITY_OFF);
- }
-
- void KilledUnit(Unit* victim)
- {
- if( LeftHead && RightHead )
- {
- Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
- Unit *Right = Unit::GetUnit(*m_creature,RightHead);
-
- if( !Left && !Right )
- return;
-
- ikilling = rand()%2;
-
- Unit *source = (Left->GetEntry() == Killing[ikilling].creature ? Left : Right);
-
- switch(ikilling)
- {
- case 0:
- source->MonsterYell(Killing[ikilling].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, Killing[ikilling].sound);
- Delay_Timer = 3500;
- KillingYell = true;
- break;
- case 1:
- source->MonsterYell(Killing[ikilling].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, Killing[ikilling].sound);
- KillingYell = false;
- break;
- }
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if( LeftHead && RightHead )
- {
- Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
- Unit *Right = Unit::GetUnit(*m_creature,RightHead);
-
- if( !Left && !Right )
- return;
-
- Left->MonsterYell(YELL_DIE_L, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Left,SOUND_DIE_L);
-
- ((mob_omrogg_headsAI*)((Creature*)Right)->AI())->DoDeathYell();
- }
- if( pInstance )
- pInstance->SetData(TYPE_OMROGG, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( Delay_Timer < diff )
- {
- Delay_Timer = 3500;
-
- if( !LeftHead && !RightHead )
- return;
-
- Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
- Unit *Right = Unit::GetUnit(*m_creature,RightHead);
-
- if( !Left && !Right )
- return;
-
- if( AggroYell )
- {
- Right->MonsterYell(GoCombatDelay[iaggro].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Right, GoCombatDelay[iaggro].sound);
- AggroYell = false;
- }
-
- if( ThreatYell2 )
- {
- Unit *source = (Left->GetEntry() == ThreatDelay2[ithreat].creature ? Left : Right);
-
- source->MonsterYell(ThreatDelay2[ithreat].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, ThreatDelay2[ithreat].sound);
- ThreatYell2 = false;
- }
-
- if( ThreatYell )
- {
- Unit *source = (Left->GetEntry() == ThreatDelay1[ithreat].creature ? Left : Right);
-
- source->MonsterYell(ThreatDelay1[ithreat].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, ThreatDelay1[ithreat].sound);
- ThreatYell = false;
- ThreatYell2 = true;
- }
-
- if( KillingYell )
- {
- Unit *source = (Left->GetEntry() == KillingDelay[ikilling].creature ? Left : Right);
-
- source->MonsterYell(KillingDelay[ikilling].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(source, KillingDelay[ikilling].sound);
- KillingYell = false;
- }
- }else Delay_Timer -= diff;
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( BlastCount && BlastWave_Timer <= diff )
- {
- DoCast(m_creature,SPELL_BLAST_WAVE);
- BlastWave_Timer = 5000;
- ++BlastCount;
- if( BlastCount == 3 )
- BlastCount = 0;
- }else BlastWave_Timer -= diff;
-
- if( BurningMaul_Timer < diff )
- {
- DoTextEmote(EMOTE_ENRAGE,NULL);
- DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL);
- BurningMaul_Timer = 40000;
- BlastWave_Timer = 16000;
- BlastCount = 1;
- }else BurningMaul_Timer -= diff;
-
- if( ResetThreat_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- DoYellForThreat();
- DoResetThreat();
- m_creature->AddThreat(target, 0.0f);
- }
- ResetThreat_Timer = 35000+rand()%10000;
- }else ResetThreat_Timer -= diff;
-
- if( Fear_Timer < diff )
- {
- DoCast(m_creature,SPELL_FEAR);
- Fear_Timer = 15000+rand()%25000;
- }else Fear_Timer -= diff;
-
- if( ThunderClap_Timer < diff )
- {
- DoCast(m_creature,SPELL_THUNDERCLAP);
- ThunderClap_Timer = 25000+rand()%15000;
- }else ThunderClap_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_warbringer_omrogg(Creature *_Creature)
-{
- return new boss_warbringer_omroggAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_omrogg_heads(Creature *_Creature)
-{
- return new mob_omrogg_headsAI (_Creature);
-}
-
-void AddSC_boss_warbringer_omrogg()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_warbringer_omrogg";
- newscript->GetAI = GetAI_boss_warbringer_omrogg;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_omrogg_heads";
- newscript->GetAI = GetAI_mob_omrogg_heads;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warbringer_Omrogg
+SD%Complete: 85
+SDComment: Heroic enabled. Spell timing may need additional tweaks
+SDCategory: Hellfire Citadel, Shattered Halls
+EndScriptData */
+
+/* ContentData
+mob_omrogg_heads
+boss_warbringer_omrogg
+EndContentData */
+
+#include "precompiled.h"
+#include "def_shattered_halls.h"
+
+#define ENTRY_LEFT_HEAD 19523
+#define ENTRY_RIGHT_HEAD 19524
+
+struct Yell
+{
+ const char* text;
+ uint32 sound;
+ uint32 creature;
+};
+
+static Yell GoCombat[]=
+{
+ {"Smash!", 10306, ENTRY_LEFT_HEAD},
+ {"If you nice me let you live.", 10308, ENTRY_LEFT_HEAD},
+ {"Me hungry!", 10309, ENTRY_LEFT_HEAD},
+};
+static Yell GoCombatDelay[]=
+{
+ {"Why don't you let me do the talking?", 10317, ENTRY_RIGHT_HEAD},
+ {"No, we will NOT let you live!", 10318, ENTRY_RIGHT_HEAD},
+ {"You always hungry. That why we so fat!", 10319, ENTRY_RIGHT_HEAD},
+};
+
+static Yell Threat[]=
+{
+ {"You stay here. Me go kill someone else!", 10303, ENTRY_LEFT_HEAD},
+ {"What are you doing!", 10315, ENTRY_RIGHT_HEAD},
+ {"Me kill someone else...", 10302, ENTRY_LEFT_HEAD},
+ {"Me not like this one...",10300, ENTRY_LEFT_HEAD},
+};
+static Yell ThreatDelay1[]=
+{
+ {"That's not funny!", 10314, ENTRY_RIGHT_HEAD},
+ {"Me get bored...", 10305, ENTRY_LEFT_HEAD},
+ {"I'm not done yet, idiot!", 10313, ENTRY_RIGHT_HEAD},
+ {"Hey you numbskull!", 10312, ENTRY_RIGHT_HEAD},
+};
+static Yell ThreatDelay2[]=
+{
+ {"Ha ha ha.", 10304, ENTRY_LEFT_HEAD},
+ {"Whhy! He almost dead!", 10316, ENTRY_RIGHT_HEAD},
+ {"H'ey...", 10307, ENTRY_LEFT_HEAD},
+ {"We kill his friend!", 10301, ENTRY_LEFT_HEAD},
+};
+
+static Yell Killing[]=
+{
+ {"This one die easy!", 10310, ENTRY_LEFT_HEAD},
+ {"I'm tired. You kill next one!", 10320, ENTRY_RIGHT_HEAD},
+};
+static Yell KillingDelay[]=
+{
+ {"That's because I do all the hard work!", 10321, ENTRY_RIGHT_HEAD},
+ {"SD2 script error, should not see this.", 0, ENTRY_LEFT_HEAD},
+};
+
+#define EMOTE_ENRAGE "enrages"
+
+#define YELL_DIE_L "This all...your fault!"
+#define SOUND_DIE_L 10311
+#define YELL_DIE_R "I...hate...you..."
+#define SOUND_DIE_R 10322
+
+#define SPELL_BLAST_WAVE 30600
+#define SPELL_FEAR 30584
+#define SPELL_THUNDERCLAP 30633
+
+#define SPELL_BURNING_MAUL 30598
+#define H_SPELL_BURNING_MAUL 36056
+
+struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI
+{
+ mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ bool DeathYell;
+ uint32 Death_Timer;
+
+ void Reset() {}
+ void Aggro(Unit* who) { }
+
+ void DoDeathYell()
+ {
+ Death_Timer = 4000;
+ DeathYell = true;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !DeathYell )
+ return;
+
+ if( Death_Timer < diff )
+ {
+ DoYell(YELL_DIE_R,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DIE_R);
+ DeathYell = false;
+ }else Death_Timer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
+{
+ boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 LeftHead;
+ uint64 RightHead;
+ int iaggro;
+ int ithreat;
+ int ikilling;
+
+ bool HeroicMode;
+ bool AggroYell;
+ bool ThreatYell;
+ bool ThreatYell2;
+ bool KillingYell;
+
+ uint32 Delay_Timer;
+ uint32 BlastWave_Timer;
+ uint32 BlastCount;
+ uint32 Fear_Timer;
+ uint32 BurningMaul_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 ResetThreat_Timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+
+ LeftHead = 0;
+ RightHead = 0;
+
+ AggroYell = false;
+ ThreatYell = false;
+ ThreatYell2 = false;
+ KillingYell = false;
+
+ Delay_Timer = 4000;
+ BlastWave_Timer = 0;
+ BlastCount = 0;
+ Fear_Timer = 8000;
+ BurningMaul_Timer = 25000;
+ ThunderClap_Timer = 15000;
+ ResetThreat_Timer = 30000;
+
+ if( pInstance )
+ pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid.
+ }
+
+ void DoYellForThreat()
+ {
+ if( LeftHead && RightHead )
+ {
+ Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
+ Unit *Right = Unit::GetUnit(*m_creature,RightHead);
+
+ if( !Left && !Right )
+ return;
+
+ ithreat = rand()%4;
+
+ Unit *source = (Left->GetEntry() == Threat[ithreat].creature ? Left : Right);
+
+ source->MonsterYell(Threat[ithreat].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, Threat[ithreat].sound);
+
+ Delay_Timer = 3500;
+ ThreatYell = true;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
+ DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
+
+ if( Unit *Left = Unit::GetUnit(*m_creature,LeftHead) )
+ {
+ iaggro = rand()%3;
+
+ Left->MonsterYell(GoCombat[iaggro].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Left, GoCombat[iaggro].sound);
+
+ Delay_Timer = 3500;
+ AggroYell = true;
+ }
+ if( pInstance )
+ pInstance->SetData(TYPE_OMROGG, IN_PROGRESS);
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_LEFT_HEAD )
+ LeftHead = summoned->GetGUID();
+
+ if( summoned->GetEntry() == ENTRY_RIGHT_HEAD )
+ RightHead = summoned->GetGUID();
+
+ //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ summoned->SetVisibility(VISIBILITY_OFF);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if( LeftHead && RightHead )
+ {
+ Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
+ Unit *Right = Unit::GetUnit(*m_creature,RightHead);
+
+ if( !Left && !Right )
+ return;
+
+ ikilling = rand()%2;
+
+ Unit *source = (Left->GetEntry() == Killing[ikilling].creature ? Left : Right);
+
+ switch(ikilling)
+ {
+ case 0:
+ source->MonsterYell(Killing[ikilling].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, Killing[ikilling].sound);
+ Delay_Timer = 3500;
+ KillingYell = true;
+ break;
+ case 1:
+ source->MonsterYell(Killing[ikilling].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, Killing[ikilling].sound);
+ KillingYell = false;
+ break;
+ }
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if( LeftHead && RightHead )
+ {
+ Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
+ Unit *Right = Unit::GetUnit(*m_creature,RightHead);
+
+ if( !Left && !Right )
+ return;
+
+ Left->MonsterYell(YELL_DIE_L, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Left,SOUND_DIE_L);
+
+ ((mob_omrogg_headsAI*)((Creature*)Right)->AI())->DoDeathYell();
+ }
+ if( pInstance )
+ pInstance->SetData(TYPE_OMROGG, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( Delay_Timer < diff )
+ {
+ Delay_Timer = 3500;
+
+ if( !LeftHead && !RightHead )
+ return;
+
+ Unit *Left = Unit::GetUnit(*m_creature,LeftHead);
+ Unit *Right = Unit::GetUnit(*m_creature,RightHead);
+
+ if( !Left && !Right )
+ return;
+
+ if( AggroYell )
+ {
+ Right->MonsterYell(GoCombatDelay[iaggro].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Right, GoCombatDelay[iaggro].sound);
+ AggroYell = false;
+ }
+
+ if( ThreatYell2 )
+ {
+ Unit *source = (Left->GetEntry() == ThreatDelay2[ithreat].creature ? Left : Right);
+
+ source->MonsterYell(ThreatDelay2[ithreat].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, ThreatDelay2[ithreat].sound);
+ ThreatYell2 = false;
+ }
+
+ if( ThreatYell )
+ {
+ Unit *source = (Left->GetEntry() == ThreatDelay1[ithreat].creature ? Left : Right);
+
+ source->MonsterYell(ThreatDelay1[ithreat].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, ThreatDelay1[ithreat].sound);
+ ThreatYell = false;
+ ThreatYell2 = true;
+ }
+
+ if( KillingYell )
+ {
+ Unit *source = (Left->GetEntry() == KillingDelay[ikilling].creature ? Left : Right);
+
+ source->MonsterYell(KillingDelay[ikilling].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(source, KillingDelay[ikilling].sound);
+ KillingYell = false;
+ }
+ }else Delay_Timer -= diff;
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( BlastCount && BlastWave_Timer <= diff )
+ {
+ DoCast(m_creature,SPELL_BLAST_WAVE);
+ BlastWave_Timer = 5000;
+ ++BlastCount;
+ if( BlastCount == 3 )
+ BlastCount = 0;
+ }else BlastWave_Timer -= diff;
+
+ if( BurningMaul_Timer < diff )
+ {
+ DoTextEmote(EMOTE_ENRAGE,NULL);
+ DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL);
+ BurningMaul_Timer = 40000;
+ BlastWave_Timer = 16000;
+ BlastCount = 1;
+ }else BurningMaul_Timer -= diff;
+
+ if( ResetThreat_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ DoYellForThreat();
+ DoResetThreat();
+ m_creature->AddThreat(target, 0.0f);
+ }
+ ResetThreat_Timer = 35000+rand()%10000;
+ }else ResetThreat_Timer -= diff;
+
+ if( Fear_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_FEAR);
+ Fear_Timer = 15000+rand()%25000;
+ }else Fear_Timer -= diff;
+
+ if( ThunderClap_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 25000+rand()%15000;
+ }else ThunderClap_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_warbringer_omrogg(Creature *_Creature)
+{
+ return new boss_warbringer_omroggAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_omrogg_heads(Creature *_Creature)
+{
+ return new mob_omrogg_headsAI (_Creature);
+}
+
+void AddSC_boss_warbringer_omrogg()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_warbringer_omrogg";
+ newscript->GetAI = GetAI_boss_warbringer_omrogg;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_omrogg_heads";
+ newscript->GetAI = GetAI_mob_omrogg_heads;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
index e7eef878481..602564d32f0 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
@@ -1,13 +1,13 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SHATTERED_H
-#define DEF_SHATTERED_H
-
-#define TYPE_NETHEKURSE 1
-#define DATA_NETHEKURSE 2
-#define DATA_NETHEKURSE_DOOR 3
-
-#define TYPE_OMROGG 4
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SHATTERED_H
+#define DEF_SHATTERED_H
+
+#define TYPE_NETHEKURSE 1
+#define DATA_NETHEKURSE 2
+#define DATA_NETHEKURSE_DOOR 3
+
+#define TYPE_OMROGG 4
+#endif
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
index f9ffe23592f..9dc78cb82cb 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
@@ -1,114 +1,114 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Shattered_Halls
-SD%Complete: 50
-SDComment: currently missing info about door. instance not complete
-SDCategory: Hellfire Citadel, Shattered Halls
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shattered_halls.h"
-
-#define ENCOUNTERS 2
-
-#define DOOR_NETHEKURSE 1
-
-struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
-{
- instance_shattered_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
- uint64 nethekurseGUID;
- uint64 nethekurseDoorGUID;
-
- void Initialize()
- {
- nethekurseGUID = 0;
- nethekurseDoorGUID = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = NOT_STARTED;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch( go->GetEntry() )
- {
- case DOOR_NETHEKURSE: nethekurseDoorGUID = go->GetGUID(); break;
- }
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch( creature_entry )
- {
- case 16807: nethekurseGUID = creature->GetGUID(); break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch( type )
- {
- case TYPE_NETHEKURSE:
- Encounter[0] = data;
- break;
- case TYPE_OMROGG:
- Encounter[1] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch( type )
- {
- case TYPE_NETHEKURSE:
- return Encounter[0];
- case TYPE_OMROGG:
- return Encounter[1];
- }
- return 0;
- }
-
- uint64 GetData64(uint32 data)
- {
- switch(data)
- {
- case DATA_NETHEKURSE:
- return nethekurseGUID;
- case DATA_NETHEKURSE_DOOR:
- return nethekurseDoorGUID;
- }
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_shattered_halls(Map* map)
-{
- return new instance_shattered_halls(map);
-}
-
-void AddSC_instance_shattered_halls()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_shattered_halls";
- newscript->GetInstanceData = GetInstanceData_instance_shattered_halls;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Shattered_Halls
+SD%Complete: 50
+SDComment: currently missing info about door. instance not complete
+SDCategory: Hellfire Citadel, Shattered Halls
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shattered_halls.h"
+
+#define ENCOUNTERS 2
+
+#define DOOR_NETHEKURSE 1
+
+struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
+{
+ instance_shattered_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+ uint64 nethekurseGUID;
+ uint64 nethekurseDoorGUID;
+
+ void Initialize()
+ {
+ nethekurseGUID = 0;
+ nethekurseDoorGUID = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = NOT_STARTED;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch( go->GetEntry() )
+ {
+ case DOOR_NETHEKURSE: nethekurseDoorGUID = go->GetGUID(); break;
+ }
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch( creature_entry )
+ {
+ case 16807: nethekurseGUID = creature->GetGUID(); break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch( type )
+ {
+ case TYPE_NETHEKURSE:
+ Encounter[0] = data;
+ break;
+ case TYPE_OMROGG:
+ Encounter[1] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch( type )
+ {
+ case TYPE_NETHEKURSE:
+ return Encounter[0];
+ case TYPE_OMROGG:
+ return Encounter[1];
+ }
+ return 0;
+ }
+
+ uint64 GetData64(uint32 data)
+ {
+ switch(data)
+ {
+ case DATA_NETHEKURSE:
+ return nethekurseGUID;
+ case DATA_NETHEKURSE_DOOR:
+ return nethekurseDoorGUID;
+ }
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_shattered_halls(Map* map)
+{
+ return new instance_shattered_halls(map);
+}
+
+void AddSC_instance_shattered_halls()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_shattered_halls";
+ newscript->GetInstanceData = GetInstanceData_instance_shattered_halls;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
index bc2cd48ee73..51b4017b707 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
@@ -1,141 +1,141 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doomlord_Kazzak
-SD%Complete: 70
-SDComment: Using incorrect spell for Mark of Kazzak
-SDCategory: Hellfire Peninsula
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWVOLLEY 32963
-#define SPELL_CLEAVE 31779
-#define SPELL_THUNDERCLAP 36706
-#define SPELL_VOIDBOLT 39329
-#define SPELL_MARKOFKAZZAK 32960
-#define SPELL_ENRAGE 32964
-#define SPELL_CAPTURESOUL 32966
-#define SPELL_TWISTEDREFLECTION 21063
-
-struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI
-{
- boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 Cleave_Timer;
- uint32 ThunderClap_Timer;
- uint32 VoidBolt_Timer;
- uint32 MarkOfKazzak_Timer;
- uint32 Enrage_Timer;
- uint32 Twisted_Reflection_Timer;
-
- void Reset()
- {
- ShadowVolley_Timer = 8000 + rand()%4000;
- Cleave_Timer = 7000;
- ThunderClap_Timer = 16000 + rand()%4000;
- VoidBolt_Timer = 30000;
- MarkOfKazzak_Timer = 25000;
- Enrage_Timer = 60000;
- Twisted_Reflection_Timer = 33000; // Timer may be incorrect
- }
-
- void Aggro(Unit *who) {}
-
- void KilledUnit(Unit* victim)
- {
- // When Kazzak kills a player (not pets/totems), he regens some health
- if(victim->GetTypeId() == TYPEID_PLAYER)
- DoCast(m_creature,SPELL_CAPTURESOUL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY);
- ShadowVolley_Timer = 4000 + rand()%2000;
- }else ShadowVolley_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000 + rand()%4000;
- }else Cleave_Timer -= diff;
-
- //ThunderClap_Timer
- if (ThunderClap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- ThunderClap_Timer = 10000 + rand()%4000;
- }else ThunderClap_Timer -= diff;
-
- //VoidBolt_Timer
- if (VoidBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
- VoidBolt_Timer = 15000 + rand()%3000;
- }else VoidBolt_Timer -= diff;
-
- //MarkOfKazzak_Timer
- if (MarkOfKazzak_Timer < diff)
- {
- Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(victim->GetPower(POWER_MANA))
- {
- DoCast(victim, SPELL_MARKOFKAZZAK);
- MarkOfKazzak_Timer = 20000;
- }
- }else MarkOfKazzak_Timer -= diff;
-
- //Enrage_Timer
- if (Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 30000;
- }else Enrage_Timer -= diff;
-
- if(Twisted_Reflection_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION);
- Twisted_Reflection_Timer = 15000;
- }else Twisted_Reflection_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
-};
-CreatureAI* GetAI_boss_doomlordkazzak(Creature *_Creature)
-{
- return new boss_doomlordkazzakAI (_Creature);
-}
-
-void AddSC_boss_doomlordkazzak()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doomlord_kazzak";
- newscript->GetAI = GetAI_boss_doomlordkazzak;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doomlord_Kazzak
+SD%Complete: 70
+SDComment: Using incorrect spell for Mark of Kazzak
+SDCategory: Hellfire Peninsula
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWVOLLEY 32963
+#define SPELL_CLEAVE 31779
+#define SPELL_THUNDERCLAP 36706
+#define SPELL_VOIDBOLT 39329
+#define SPELL_MARKOFKAZZAK 32960
+#define SPELL_ENRAGE 32964
+#define SPELL_CAPTURESOUL 32966
+#define SPELL_TWISTEDREFLECTION 21063
+
+struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI
+{
+ boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 Cleave_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 VoidBolt_Timer;
+ uint32 MarkOfKazzak_Timer;
+ uint32 Enrage_Timer;
+ uint32 Twisted_Reflection_Timer;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 8000 + rand()%4000;
+ Cleave_Timer = 7000;
+ ThunderClap_Timer = 16000 + rand()%4000;
+ VoidBolt_Timer = 30000;
+ MarkOfKazzak_Timer = 25000;
+ Enrage_Timer = 60000;
+ Twisted_Reflection_Timer = 33000; // Timer may be incorrect
+ }
+
+ void Aggro(Unit *who) {}
+
+ void KilledUnit(Unit* victim)
+ {
+ // When Kazzak kills a player (not pets/totems), he regens some health
+ if(victim->GetTypeId() == TYPEID_PLAYER)
+ DoCast(m_creature,SPELL_CAPTURESOUL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY);
+ ShadowVolley_Timer = 4000 + rand()%2000;
+ }else ShadowVolley_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000 + rand()%4000;
+ }else Cleave_Timer -= diff;
+
+ //ThunderClap_Timer
+ if (ThunderClap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 10000 + rand()%4000;
+ }else ThunderClap_Timer -= diff;
+
+ //VoidBolt_Timer
+ if (VoidBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
+ VoidBolt_Timer = 15000 + rand()%3000;
+ }else VoidBolt_Timer -= diff;
+
+ //MarkOfKazzak_Timer
+ if (MarkOfKazzak_Timer < diff)
+ {
+ Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(victim->GetPower(POWER_MANA))
+ {
+ DoCast(victim, SPELL_MARKOFKAZZAK);
+ MarkOfKazzak_Timer = 20000;
+ }
+ }else MarkOfKazzak_Timer -= diff;
+
+ //Enrage_Timer
+ if (Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 30000;
+ }else Enrage_Timer -= diff;
+
+ if(Twisted_Reflection_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION);
+ Twisted_Reflection_Timer = 15000;
+ }else Twisted_Reflection_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+CreatureAI* GetAI_boss_doomlordkazzak(Creature *_Creature)
+{
+ return new boss_doomlordkazzakAI (_Creature);
+}
+
+void AddSC_boss_doomlordkazzak()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doomlord_kazzak";
+ newscript->GetAI = GetAI_boss_doomlordkazzak;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
index 308a98d774a..1c3a4c71725 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
@@ -1,187 +1,187 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Hellfire_Peninsula
-SD%Complete: 100
-SDComment: Quest support: 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
-SDCategory: Hellfire Peninsula
-EndScriptData */
-
-/* ContentData
-npc_wing_commander_dabiree
-npc_gryphoneer_windbellow
-npc_wing_commander_brack
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_wing_commander_dabiree
-######*/
-
-#define GOSSIP_ITEM1_DAB "Fly me to Murketh and Shaadraz Gateways"
-#define GOSSIP_ITEM2_DAB "Fly me to Shatter Point"
-
-bool GossipHello_npc_wing_commander_dabiree(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- //Mission: The Murketh and Shaadraz Gateways
- if (player->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- //Shatter Point
- if (!player->GetQuestRewardStatus(10340))
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_wing_commander_dabiree(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz)
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
- }
- return true;
-}
-
-/*######
-## npc_gryphoneer_windbellow
-######*/
-
-#define GOSSIP_ITEM1_WIN "Fly me to The Abyssal Shelf"
-#define GOSSIP_ITEM2_WIN "Fly me to Honor Point"
-
-bool GossipHello_npc_gryphoneer_windbellow(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- //Mission: The Abyssal Shelf || Return to the Abyssal Shelf
- if (player->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- //Go to the Front
- if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player->GetQuestRewardStatus(10382))
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_gryphoneer_windbellow(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
- }
- return true;
-}
-
-/*######
-## npc_wing_commander_brack
-######*/
-
-#define GOSSIP_ITEM1_BRA "Fly me to Murketh and Shaadraz Gateways"
-#define GOSSIP_ITEM2_BRA "Fly me to The Abyssal Shelf"
-#define GOSSIP_ITEM3_BRA "Fly me to Spinebreaker Post"
-
-bool GossipHello_npc_wing_commander_brack(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- //Mission: The Murketh and Shaadraz Gateways
- if (player->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- //Mission: The Abyssal Shelf || Return to the Abyssal Shelf
- if (player->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- //Spinebreaker Post
- if (player->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(10242))
- player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM3_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz)
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde))
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 3)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_hellfire_peninsula()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_wing_commander_dabiree";
- newscript->pGossipHello = &GossipHello_npc_wing_commander_dabiree;
- newscript->pGossipSelect = &GossipSelect_npc_wing_commander_dabiree;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_gryphoneer_windbellow";
- newscript->pGossipHello = &GossipHello_npc_gryphoneer_windbellow;
- newscript->pGossipSelect = &GossipSelect_npc_gryphoneer_windbellow;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_wing_commander_brack";
- newscript->pGossipHello = &GossipHello_npc_wing_commander_brack;
- newscript->pGossipSelect = &GossipSelect_npc_wing_commander_brack;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Hellfire_Peninsula
+SD%Complete: 100
+SDComment: Quest support: 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
+SDCategory: Hellfire Peninsula
+EndScriptData */
+
+/* ContentData
+npc_wing_commander_dabiree
+npc_gryphoneer_windbellow
+npc_wing_commander_brack
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_wing_commander_dabiree
+######*/
+
+#define GOSSIP_ITEM1_DAB "Fly me to Murketh and Shaadraz Gateways"
+#define GOSSIP_ITEM2_DAB "Fly me to Shatter Point"
+
+bool GossipHello_npc_wing_commander_dabiree(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ //Mission: The Murketh and Shaadraz Gateways
+ if (player->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ //Shatter Point
+ if (!player->GetQuestRewardStatus(10340))
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_wing_commander_dabiree(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz)
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
+ }
+ return true;
+}
+
+/*######
+## npc_gryphoneer_windbellow
+######*/
+
+#define GOSSIP_ITEM1_WIN "Fly me to The Abyssal Shelf"
+#define GOSSIP_ITEM2_WIN "Fly me to Honor Point"
+
+bool GossipHello_npc_gryphoneer_windbellow(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ //Mission: The Abyssal Shelf || Return to the Abyssal Shelf
+ if (player->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ //Go to the Front
+ if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player->GetQuestRewardStatus(10382))
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_gryphoneer_windbellow(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
+ }
+ return true;
+}
+
+/*######
+## npc_wing_commander_brack
+######*/
+
+#define GOSSIP_ITEM1_BRA "Fly me to Murketh and Shaadraz Gateways"
+#define GOSSIP_ITEM2_BRA "Fly me to The Abyssal Shelf"
+#define GOSSIP_ITEM3_BRA "Fly me to Spinebreaker Post"
+
+bool GossipHello_npc_wing_commander_brack(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ //Mission: The Murketh and Shaadraz Gateways
+ if (player->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ //Mission: The Abyssal Shelf || Return to the Abyssal Shelf
+ if (player->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ //Spinebreaker Post
+ if (player->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(10242))
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM3_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz)
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde))
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 3)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_hellfire_peninsula()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_wing_commander_dabiree";
+ newscript->pGossipHello = &GossipHello_npc_wing_commander_dabiree;
+ newscript->pGossipSelect = &GossipSelect_npc_wing_commander_dabiree;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_gryphoneer_windbellow";
+ newscript->pGossipHello = &GossipHello_npc_gryphoneer_windbellow;
+ newscript->pGossipSelect = &GossipSelect_npc_gryphoneer_windbellow;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_wing_commander_brack";
+ newscript->pGossipHello = &GossipHello_npc_wing_commander_brack;
+ newscript->pGossipSelect = &GossipSelect_npc_wing_commander_brack;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
index 74e4dc73ff4..7bb51ad499c 100644
--- a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
+++ b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Ironforge
-SD%Complete: 100
-SDComment: Quest support: 3702
-SDCategory: Ironforge
-EndScriptData */
-
-/* ContentData
-npc_royal_historian_archesonus
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_royal_historian_archesonus
-######*/
-
-#define GOSSIP_ITEM_ROYAL "I am ready to listen"
-#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?"
-#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please."
-#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??"
-#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!"
-
-bool GossipHello_npc_royal_historian_archesonus(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(2235, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_royal_historian_archesonus(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2236, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2237, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2238, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2239, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3702);
- break;
- }
- return true;
-}
-
-void AddSC_ironforge()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_royal_historian_archesonus";
- newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus;
- newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Ironforge
+SD%Complete: 100
+SDComment: Quest support: 3702
+SDCategory: Ironforge
+EndScriptData */
+
+/* ContentData
+npc_royal_historian_archesonus
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_royal_historian_archesonus
+######*/
+
+#define GOSSIP_ITEM_ROYAL "I am ready to listen"
+#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?"
+#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please."
+#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??"
+#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!"
+
+bool GossipHello_npc_royal_historian_archesonus(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(2235, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_royal_historian_archesonus(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(2236, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(2237, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2238, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(2239, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(3702);
+ break;
+ }
+ return true;
+}
+
+void AddSC_ironforge()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_royal_historian_archesonus";
+ newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus;
+ newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
index 5b130ad667c..9b2c1cda518 100644
--- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
+++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
@@ -1,155 +1,155 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Isle_of_Queldanas
-SD%Complete: 100
-SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543
-SDCategory: Isle Of Quel'Danas
-EndScriptData */
-
-/* ContentData
-npc_ayren_cloudbreaker
-npc_converted_sentry
-npc_unrestrained_dragonhawk
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_ayren_cloudbreaker
-######*/
-
-bool GossipHello_npc_ayren_cloudbreaker(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0,"Speaking of action, I've been ordered to undertake an air strike.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
-
- if( player->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0,"I need to intercept the Dawnblade reinforcements.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_ayren_cloudbreaker(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,45071,true); //TaxiPath 779
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,45113,true); //TaxiPath 784
- }
- return true;
-}
-
-/*######
-## npc_converted_sentry
-######*/
-
-#define SAY_CONVERTED_1 "Deployment sucessful. Trespassers will be neutralized."
-#define SAY_CONVERTED_2 "Objective acquired. Initiating security routines."
-
-#define SPELL_CONVERT_CREDIT 45009
-
-struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
-{
- npc_converted_sentryAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- bool Credit;
- uint32 Timer;
-
- void Reset()
- {
- Credit = false;
- Timer = 2500;
- }
-
- void MoveInLineOfSight(Unit *who)
- { return; }
- void Aggro(Unit* who)
- { }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Credit )
- {
- if( Timer <= diff )
- {
- uint32 i = urand(1,2);
- if( i=1 ) DoSay(SAY_CONVERTED_1,LANG_UNIVERSAL,NULL);
- else DoSay(SAY_CONVERTED_2,LANG_UNIVERSAL,NULL);
-
- DoCast(m_creature,SPELL_CONVERT_CREDIT);
- ((Pet*)m_creature)->SetDuration(7500);
- Credit = true;
- }else Timer -= diff;
- }
- }
-};
-CreatureAI* GetAI_npc_converted_sentry(Creature *_Creature)
-{
- return new npc_converted_sentryAI (_Creature);
-}
-
-/*######
-## npc_unrestrained_dragonhawk
-######*/
-
-bool GossipHello_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE )
- player->ADD_GOSSIP_ITEM(0,"<Ride the dragonhawk to Sun's Reach>",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,45353,true); //TaxiPath 788
- }
- return true;
-}
-
-void AddSC_isle_of_queldanas()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_ayren_cloudbreaker";
- newscript->pGossipHello = &GossipHello_npc_ayren_cloudbreaker;
- newscript->pGossipSelect = &GossipSelect_npc_ayren_cloudbreaker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_converted_sentry";
- newscript->GetAI = GetAI_npc_converted_sentry;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_unrestrained_dragonhawk";
- newscript->pGossipHello = &GossipHello_npc_unrestrained_dragonhawk;
- newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Isle_of_Queldanas
+SD%Complete: 100
+SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543
+SDCategory: Isle Of Quel'Danas
+EndScriptData */
+
+/* ContentData
+npc_ayren_cloudbreaker
+npc_converted_sentry
+npc_unrestrained_dragonhawk
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_ayren_cloudbreaker
+######*/
+
+bool GossipHello_npc_ayren_cloudbreaker(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"Speaking of action, I've been ordered to undertake an air strike.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
+
+ if( player->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"I need to intercept the Dawnblade reinforcements.",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_ayren_cloudbreaker(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,45071,true); //TaxiPath 779
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,45113,true); //TaxiPath 784
+ }
+ return true;
+}
+
+/*######
+## npc_converted_sentry
+######*/
+
+#define SAY_CONVERTED_1 "Deployment sucessful. Trespassers will be neutralized."
+#define SAY_CONVERTED_2 "Objective acquired. Initiating security routines."
+
+#define SPELL_CONVERT_CREDIT 45009
+
+struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
+{
+ npc_converted_sentryAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ bool Credit;
+ uint32 Timer;
+
+ void Reset()
+ {
+ Credit = false;
+ Timer = 2500;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ { return; }
+ void Aggro(Unit* who)
+ { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Credit )
+ {
+ if( Timer <= diff )
+ {
+ uint32 i = urand(1,2);
+ if( i=1 ) DoSay(SAY_CONVERTED_1,LANG_UNIVERSAL,NULL);
+ else DoSay(SAY_CONVERTED_2,LANG_UNIVERSAL,NULL);
+
+ DoCast(m_creature,SPELL_CONVERT_CREDIT);
+ ((Pet*)m_creature)->SetDuration(7500);
+ Credit = true;
+ }else Timer -= diff;
+ }
+ }
+};
+CreatureAI* GetAI_npc_converted_sentry(Creature *_Creature)
+{
+ return new npc_converted_sentryAI (_Creature);
+}
+
+/*######
+## npc_unrestrained_dragonhawk
+######*/
+
+bool GossipHello_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE )
+ player->ADD_GOSSIP_ITEM(0,"<Ride the dragonhawk to Sun's Reach>",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,45353,true); //TaxiPath 788
+ }
+ return true;
+}
+
+void AddSC_isle_of_queldanas()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_ayren_cloudbreaker";
+ newscript->pGossipHello = &GossipHello_npc_ayren_cloudbreaker;
+ newscript->pGossipSelect = &GossipSelect_npc_ayren_cloudbreaker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_converted_sentry";
+ newscript->GetAI = GetAI_npc_converted_sentry;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_unrestrained_dragonhawk";
+ newscript->pGossipHello = &GossipHello_npc_unrestrained_dragonhawk;
+ newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
index 1cb3ce88776..b560caad0d1 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
@@ -1,200 +1,200 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Curator
-SD%Complete: 100
-SDComment: Evocation may cause client crash (Core related)
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO "The Menagerie is for guests only."
-#define SOUND_AGGRO 9183
-
-#define SAY_SUMMON1 "Gallery rules will be strictly enforced."
-#define SOUND_SUMMON1 9188
-
-#define SAY_SUMMON2 "This curator is equipped for gallery protection."
-#define SOUND_SUMMON2 9309
-
-#define SAY_EVOCATE "Your request cannot be processed."
-#define SOUND_EVOCATE 9186
-
-#define SAY_ENRAGE "Failure to comply will result in offensive action."
-#define SOUND_ENRAGE 9185
-
-#define SAY_KILL1 "Do not touch the displays."
-#define SOUND_KILL1 9187
-
-#define SAY_KILL2 "You are not a guest."
-#define SOUND_KILL2 9308
-
-#define SAY_DEATH "This Curator is no longer op... er... ation... al."
-#define SOUND_DEATH 9184
-
-//Flare spell info
-#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
-#define SPELL_ASTRAL_FLARE_NE 30236
-#define SPELL_ASTRAL_FLARE_NW 30239
-#define SPELL_ASTRAL_FLARE_SE 30240
-#define SPELL_ASTRAL_FLARE_SW 30241
-
-//Curator spell info
-#define SPELL_HATEFUL_BOLT 30383
-#define SPELL_EVOCATION 30254
-#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
-#define SPELL_BERSERK 26662
-
-struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
-{
- boss_curatorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 AddTimer;
- uint32 HatefulBoltTimer;
- uint32 BerserkTimer;
-
- bool Enraged;
- bool Evocating;
-
- void Reset()
- {
- AddTimer = 10000;
- HatefulBoltTimer = 15000; //This time may be wrong
- BerserkTimer = 720000; //12 minutes
- Enraged = false;
- Evocating = false;
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_KILL1);
- break;
- case 1:
- DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_KILL2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (Evocating && !m_creature->HasAura(SPELL_EVOCATION, 0))
- Evocating = false;
-
- if (m_creature->GetPower(POWER_MANA) <= 1000 && !Evocating)
- {
- DoYell(SAY_EVOCATE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EVOCATE);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_EVOCATION);
- Evocating = true;
- }
-
- if (!Enraged && !Evocating)
- {
- if (AddTimer < diff)
- {
- //Summon Astral Flare
- Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if (AstralFlare && target)
- {
- AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
- AstralFlare->AI()->AttackStart(target);
- }
-
- //Reduce Mana by 10%
- int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA)));
- m_creature->ModifyPower(POWER_MANA, -mana);
- switch(rand()%4)
- {
- case 0:
- DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
- break;
- case 1:
- DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
- break;
- }
- AddTimer = 10000;
- }else AddTimer -= diff;
-
- if (HatefulBoltTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
- DoCast(target, SPELL_HATEFUL_BOLT);
-
- HatefulBoltTimer = 15000;
- }else HatefulBoltTimer -= diff;
-
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15)
- {
- Enraged = true;
- DoCast(m_creature, SPELL_ENRAGE);
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
- }
-
- if (BerserkTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else BerserkTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_curator(Creature *_Creature)
-{
- return new boss_curatorAI (_Creature);
-}
-
-void AddSC_boss_curator()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_curator";
- newscript->GetAI = GetAI_boss_curator;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Curator
+SD%Complete: 100
+SDComment: Evocation may cause client crash (Core related)
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO "The Menagerie is for guests only."
+#define SOUND_AGGRO 9183
+
+#define SAY_SUMMON1 "Gallery rules will be strictly enforced."
+#define SOUND_SUMMON1 9188
+
+#define SAY_SUMMON2 "This curator is equipped for gallery protection."
+#define SOUND_SUMMON2 9309
+
+#define SAY_EVOCATE "Your request cannot be processed."
+#define SOUND_EVOCATE 9186
+
+#define SAY_ENRAGE "Failure to comply will result in offensive action."
+#define SOUND_ENRAGE 9185
+
+#define SAY_KILL1 "Do not touch the displays."
+#define SOUND_KILL1 9187
+
+#define SAY_KILL2 "You are not a guest."
+#define SOUND_KILL2 9308
+
+#define SAY_DEATH "This Curator is no longer op... er... ation... al."
+#define SOUND_DEATH 9184
+
+//Flare spell info
+#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
+#define SPELL_ASTRAL_FLARE_NE 30236
+#define SPELL_ASTRAL_FLARE_NW 30239
+#define SPELL_ASTRAL_FLARE_SE 30240
+#define SPELL_ASTRAL_FLARE_SW 30241
+
+//Curator spell info
+#define SPELL_HATEFUL_BOLT 30383
+#define SPELL_EVOCATION 30254
+#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
+#define SPELL_BERSERK 26662
+
+struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
+{
+ boss_curatorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 AddTimer;
+ uint32 HatefulBoltTimer;
+ uint32 BerserkTimer;
+
+ bool Enraged;
+ bool Evocating;
+
+ void Reset()
+ {
+ AddTimer = 10000;
+ HatefulBoltTimer = 15000; //This time may be wrong
+ BerserkTimer = 720000; //12 minutes
+ Enraged = false;
+ Evocating = false;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_KILL2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (Evocating && !m_creature->HasAura(SPELL_EVOCATION, 0))
+ Evocating = false;
+
+ if (m_creature->GetPower(POWER_MANA) <= 1000 && !Evocating)
+ {
+ DoYell(SAY_EVOCATE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EVOCATE);
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_EVOCATION);
+ Evocating = true;
+ }
+
+ if (!Enraged && !Evocating)
+ {
+ if (AddTimer < diff)
+ {
+ //Summon Astral Flare
+ Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if (AstralFlare && target)
+ {
+ AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
+ AstralFlare->AI()->AttackStart(target);
+ }
+
+ //Reduce Mana by 10%
+ int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA)));
+ m_creature->ModifyPower(POWER_MANA, -mana);
+ switch(rand()%4)
+ {
+ case 0:
+ DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
+ break;
+ case 1:
+ DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
+ break;
+ }
+ AddTimer = 10000;
+ }else AddTimer -= diff;
+
+ if (HatefulBoltTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+ DoCast(target, SPELL_HATEFUL_BOLT);
+
+ HatefulBoltTimer = 15000;
+ }else HatefulBoltTimer -= diff;
+
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15)
+ {
+ Enraged = true;
+ DoCast(m_creature, SPELL_ENRAGE);
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+ }
+
+ if (BerserkTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else BerserkTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_curator(Creature *_Creature)
+{
+ return new boss_curatorAI (_Creature);
+}
+
+void AddSC_boss_curator()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_curator";
+ newscript->GetAI = GetAI_boss_curator;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
index 51600364139..e0bbadf5650 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
@@ -1,183 +1,183 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Maiden_of_Virtue
-SD%Complete: 100
-SDComment:
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_REPENTANCE 29511
-#define SPELL_HOLYFIRE 29522
-#define SPELL_HOLYWRATH 32445
-#define SPELL_HOLYGROUND 29512
-#define SPELL_BERSERK 26662
-
-#define SAY_AGGRO "Your behavior will not be tolerated!"
-#define SAY_SLAY1 "Ah ah ah..."
-#define SAY_SLAY2 "This is for the best."
-#define SAY_SLAY3 "Impure thoughts lead to profane actions."
-#define SAY_REPENTANCE1 "Cast out your corrupt thoughts."
-#define SAY_REPENTANCE2 "Your impurity must be cleansed."
-#define SAY_DEATH "Death comes. Will your conscience be clear?"
-
-#define SOUND_AGGRO 9204
-#define SOUND_SLAY1 9207
-#define SOUND_SLAY2 9312
-#define SOUND_SLAY3 9311
-#define SOUND_REPENTANCE1 9313
-#define SOUND_REPENTANCE2 9208
-#define SOUND_DEATH 9206
-
-struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
-{
- boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Repentance_Timer;
- uint32 Holyfire_Timer;
- uint32 Holywrath_Timer;
- uint32 Holyground_Timer;
- uint32 Enrage_Timer;
-
- bool Enraged;
-
- void Reset()
- {
- Repentance_Timer = 30000+(rand()%15000);
- Holyfire_Timer = 8000+(rand()%17000);
- Holywrath_Timer = 20000+(rand()%10000);
- Holyground_Timer = 3000;
- Enrage_Timer = 600000;
-
- Enraged = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void KilledUnit(Unit* Victim)
- {
- if(rand()%2) return;
-
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,Victim);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,Victim);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3,LANG_UNIVERSAL,Victim);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (Enrage_Timer < diff && !Enraged)
- {
- DoCast(m_creature, 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
- Holyground_Timer = 3000;
- }else Holyground_Timer -= diff;
-
- if (Repentance_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REPENTANCE);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_REPENTANCE1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_REPENTANCE1);
- break;
- case 1:
- DoYell(SAY_REPENTANCE2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_REPENTANCE2);
- break;
- }
- Repentance_Timer = 30000 + rand()%15000; //A little randomness on that spell
- }else Repentance_Timer -= diff;
-
- if (Holyfire_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if(target)
- {
- DoCast(target,SPELL_HOLYFIRE);
- Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row!
- }
- }else Holyfire_Timer -= diff;
-
- if (Holywrath_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if (target)
- {
- DoCast(target,SPELL_HOLYWRATH);
- Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice
- }
- }else Holywrath_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
-};
-
-CreatureAI* GetAI_boss_maiden_of_virtue(Creature *_Creature)
-{
- return new boss_maiden_of_virtueAI (_Creature);
-}
-
-void AddSC_boss_maiden_of_virtue()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_maiden_of_virtue";
- newscript->GetAI = GetAI_boss_maiden_of_virtue;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Maiden_of_Virtue
+SD%Complete: 100
+SDComment:
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_REPENTANCE 29511
+#define SPELL_HOLYFIRE 29522
+#define SPELL_HOLYWRATH 32445
+#define SPELL_HOLYGROUND 29512
+#define SPELL_BERSERK 26662
+
+#define SAY_AGGRO "Your behavior will not be tolerated!"
+#define SAY_SLAY1 "Ah ah ah..."
+#define SAY_SLAY2 "This is for the best."
+#define SAY_SLAY3 "Impure thoughts lead to profane actions."
+#define SAY_REPENTANCE1 "Cast out your corrupt thoughts."
+#define SAY_REPENTANCE2 "Your impurity must be cleansed."
+#define SAY_DEATH "Death comes. Will your conscience be clear?"
+
+#define SOUND_AGGRO 9204
+#define SOUND_SLAY1 9207
+#define SOUND_SLAY2 9312
+#define SOUND_SLAY3 9311
+#define SOUND_REPENTANCE1 9313
+#define SOUND_REPENTANCE2 9208
+#define SOUND_DEATH 9206
+
+struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
+{
+ boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Repentance_Timer;
+ uint32 Holyfire_Timer;
+ uint32 Holywrath_Timer;
+ uint32 Holyground_Timer;
+ uint32 Enrage_Timer;
+
+ bool Enraged;
+
+ void Reset()
+ {
+ Repentance_Timer = 30000+(rand()%15000);
+ Holyfire_Timer = 8000+(rand()%17000);
+ Holywrath_Timer = 20000+(rand()%10000);
+ Holyground_Timer = 3000;
+ Enrage_Timer = 600000;
+
+ Enraged = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if(rand()%2) return;
+
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,Victim);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,Victim);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3,LANG_UNIVERSAL,Victim);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (Enrage_Timer < diff && !Enraged)
+ {
+ DoCast(m_creature, 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
+ Holyground_Timer = 3000;
+ }else Holyground_Timer -= diff;
+
+ if (Repentance_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REPENTANCE);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_REPENTANCE1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_REPENTANCE1);
+ break;
+ case 1:
+ DoYell(SAY_REPENTANCE2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_REPENTANCE2);
+ break;
+ }
+ Repentance_Timer = 30000 + rand()%15000; //A little randomness on that spell
+ }else Repentance_Timer -= diff;
+
+ if (Holyfire_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if(target)
+ {
+ DoCast(target,SPELL_HOLYFIRE);
+ Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row!
+ }
+ }else Holyfire_Timer -= diff;
+
+ if (Holywrath_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if (target)
+ {
+ DoCast(target,SPELL_HOLYWRATH);
+ Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice
+ }
+ }else Holywrath_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+
+CreatureAI* GetAI_boss_maiden_of_virtue(Creature *_Creature)
+{
+ return new boss_maiden_of_virtueAI (_Creature);
+}
+
+void AddSC_boss_maiden_of_virtue()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_maiden_of_virtue";
+ newscript->GetAI = GetAI_boss_maiden_of_virtue;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
index de1bf00ff8e..1be1a2df16f 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
@@ -1,371 +1,371 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Midnight
-SD%Complete: 100
-SDComment:
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_MIDNIGHT_KILL "Well done Midnight!"
-#define SOUND_MIDNIGHT_KILL 9173
-
-#define SAY_APPEAR1 "Cowards! Wretches!"
-#define SOUND_APPEAR1 9167
-#define SAY_APPEAR2 "Who dares attack the steed of the Huntsman?"
-#define SOUND_APPEAR2 9298
-#define SAY_APPEAR3 "Perhaps you would rather test yourselves against a more formidable opponent?! "
-#define SOUND_APPEAR3 9299
-
-#define SAY_MOUNT "Come, Midnight, let\'s disperse this petty rabble! "
-#define SOUND_MOUNT 9168
-
-#define SAY_KILL1 "It was... inevitable."
-#define SOUND_KILL1 9169
-#define SAY_KILL2 "Another trophy to add to my collection!"
-#define SOUND_KILL2 9300
-
-#define SAY_DISARMED "Weapons are merely a convenience for a warrior of my skill!"
-#define SOUND_DISARMED 9166
-
-#define SAY_DEATH "I always knew... someday I would become... the hunted."
-#define SOUND_DEATH 9165
-
-#define SAY_RANDOM1 "Such easy sport."
-#define SOUND_RANDOM1 9170
-#define SAY_RANDOM2 "Amateurs! Do not think you can best me! I kill for a living."
-#define SOUND_RANDOM2 9304
-
-#define SPELL_SHADOWCLEAVE 29832
-#define SPELL_INTANGIBLE_PRESENCE 29833
-#define SPELL_BERSERKER_CHARGE 26561 //Only when mounted
-
-#define MOUNTED_DISPLAYID 16040
-
-//Attumen (TODO: Use the summoning spell instead of creature id. It works , but is not convenient for us)
-#define SUMMON_ATTUMEN 15550
-
-struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
-{
- boss_midnightAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 Attumen;
- uint8 Phase;
- uint32 Mount_Timer;
-
- void Reset()
- {
- Phase = 1;
- Attumen = 0;
- Mount_Timer = 0;
-
- m_creature->SetVisibility(VISIBILITY_ON);
- }
-
- void Aggro(Unit* who) {}
-
- void KilledUnit(Unit *victim)
- {
- if(Phase == 2)
- {
- Unit *pUnit = Unit::GetUnit(*m_creature, Attumen);
- if(pUnit)
- {
- pUnit->MonsterYell(SAY_MIDNIGHT_KILL, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(pUnit, SOUND_MIDNIGHT_KILL);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
- {
- Phase = 2;
- Creature *pAttumen = DoSpawnCreature(SUMMON_ATTUMEN, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
- if(pAttumen)
- {
- Attumen = pAttumen->GetGUID();
- pAttumen->AI()->AttackStart(m_creature->getVictim());
- SetMidnight(pAttumen, m_creature->GetGUID());
- switch(rand()%3)
- {
- case 0:
- pAttumen->Yell(SAY_APPEAR1, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_APPEAR1);
- break;
- case 1:
- pAttumen->Yell(SAY_APPEAR2, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_APPEAR2);
- break;
- case 2:
- pAttumen->Yell(SAY_APPEAR3, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SOUND_APPEAR3);
- break;
- }
- }
- }
- else if(Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
- {
- Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen);
- if(pAttumen)
- Mount(pAttumen);
- }
- else if(Phase ==3)
- {
- if(Mount_Timer)
- if(Mount_Timer <= diff)
- {
- Mount_Timer = 0;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->GetMotionMaster()->MoveIdle();
- Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen);
- if(pAttumen)
- {
- pAttumen->SetUInt32Value(UNIT_FIELD_DISPLAYID, MOUNTED_DISPLAYID);
- pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if(pAttumen->getVictim())
- {
- pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim());
- pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID());
- }
- pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1);
- }
- } else Mount_Timer -= diff;
- }
-
- if(Phase != 3)
- DoMeleeAttackIfReady();
- }
-
- void Mount(Unit *pAttumen)
- {
- DoPlaySoundToSet(pAttumen, SOUND_MOUNT);
- pAttumen->MonsterYell(SAY_MOUNT, LANG_UNIVERSAL, 0);
- Phase = 3;
- m_creature->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 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);
- distance += 10;
- newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
- newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
- pAttumen->GetMotionMaster()->Clear();
- pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
- //pAttumen->Relocate(newX,newY,newZ,-angle);
- //pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
- Mount_Timer = 1000;
- }
-
- void SetMidnight(Creature *, uint64); //Below ..
-};
-
-CreatureAI* GetAI_boss_midnight(Creature *_Creature)
-{
- return new boss_midnightAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
-{
- boss_attumenAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- Phase = 1;
-
- CleaveTimer = 10000 + (rand()%6)*1000;
- CurseTimer = 30000;
- RandomYellTimer = 30000 + (rand()%31)*1000; //Occasionally yell
- ChargeTimer = 20000;
- ResetTimer = 0;
- }
-
- uint64 Midnight;
- uint8 Phase;
- uint32 CleaveTimer;
- uint32 CurseTimer;
- uint32 RandomYellTimer;
- uint32 ChargeTimer; //only when mounted
- uint32 ResetTimer;
-
- void Reset()
- {
- ResetTimer = 2000;
- }
-
- void Aggro(Unit* who) {}
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- case 1:
- DoYell(SAY_KILL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight);
- if(pMidnight)
- {
- pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(ResetTimer)
- if(ResetTimer <= diff)
- {
- ResetTimer = 0;
- Unit *pMidnight = Unit::GetUnit(*m_creature, 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->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else ResetTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE ))
- return;
-
- if(CleaveTimer < diff)
- {
- Unit *target = m_creature->getVictim();
- DoCast(target, SPELL_SHADOWCLEAVE);
- CleaveTimer = 10000 + (rand()%6)*1000;
- } else CleaveTimer -= diff;
-
- if(CurseTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
- CurseTimer = 30000;
- } else CurseTimer -= diff;
-
- if(RandomYellTimer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_RANDOM1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_RANDOM1);
- break;
- case 1:
- DoYell(SAY_RANDOM2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_RANDOM2);
- break;
- }
- RandomYellTimer = 30000 + (rand()%31)*1000;
- } else RandomYellTimer -= diff;
-
- if(m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
- {
- if(ChargeTimer < diff)
- {
- Unit *target;
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- std::vector<Unit *> target_list;
- for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if(target && target->GetDistance2d(m_creature) > 5)
- target_list.push_back(target);
- target = NULL;
- }
- if(target_list.size())
- target = *(target_list.begin()+rand()%target_list.size());
-
- DoCast(target, SPELL_BERSERKER_CHARGE);
- ChargeTimer = 20000;
- } else ChargeTimer -= diff;
- }
- else
- {
- if( (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
- {
- Creature *pMidnight = (Creature*)Unit::GetUnit(*m_creature, Midnight);
- if(pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
- {
- ((boss_midnightAI*)(pMidnight->AI()))->Mount(m_creature);
- m_creature->SetHealth(pMidnight->GetHealth());
- }
- }
- }
-
- DoMeleeAttackIfReady();
- }
-
- void SpellHit(Unit *source, const SpellEntry *spell)
- {
- if(spell->Mechanic == MECHANIC_DISARM)
- {
- DoYell(SAY_DISARMED, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DISARMED);
- }
- }
-};
-
-void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value)
-{
- ((boss_attumenAI*)pAttumen->AI())->Midnight = value;
-}
-
-CreatureAI* GetAI_boss_attumen(Creature *_Creature)
-{
- return new boss_attumenAI (_Creature);
-}
-
-void AddSC_boss_attumen()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_attumen";
- newscript->GetAI = GetAI_boss_attumen;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_midnight";
- newscript->GetAI = GetAI_boss_midnight;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Midnight
+SD%Complete: 100
+SDComment:
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_MIDNIGHT_KILL "Well done Midnight!"
+#define SOUND_MIDNIGHT_KILL 9173
+
+#define SAY_APPEAR1 "Cowards! Wretches!"
+#define SOUND_APPEAR1 9167
+#define SAY_APPEAR2 "Who dares attack the steed of the Huntsman?"
+#define SOUND_APPEAR2 9298
+#define SAY_APPEAR3 "Perhaps you would rather test yourselves against a more formidable opponent?! "
+#define SOUND_APPEAR3 9299
+
+#define SAY_MOUNT "Come, Midnight, let\'s disperse this petty rabble! "
+#define SOUND_MOUNT 9168
+
+#define SAY_KILL1 "It was... inevitable."
+#define SOUND_KILL1 9169
+#define SAY_KILL2 "Another trophy to add to my collection!"
+#define SOUND_KILL2 9300
+
+#define SAY_DISARMED "Weapons are merely a convenience for a warrior of my skill!"
+#define SOUND_DISARMED 9166
+
+#define SAY_DEATH "I always knew... someday I would become... the hunted."
+#define SOUND_DEATH 9165
+
+#define SAY_RANDOM1 "Such easy sport."
+#define SOUND_RANDOM1 9170
+#define SAY_RANDOM2 "Amateurs! Do not think you can best me! I kill for a living."
+#define SOUND_RANDOM2 9304
+
+#define SPELL_SHADOWCLEAVE 29832
+#define SPELL_INTANGIBLE_PRESENCE 29833
+#define SPELL_BERSERKER_CHARGE 26561 //Only when mounted
+
+#define MOUNTED_DISPLAYID 16040
+
+//Attumen (TODO: Use the summoning spell instead of creature id. It works , but is not convenient for us)
+#define SUMMON_ATTUMEN 15550
+
+struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
+{
+ boss_midnightAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 Attumen;
+ uint8 Phase;
+ uint32 Mount_Timer;
+
+ void Reset()
+ {
+ Phase = 1;
+ Attumen = 0;
+ Mount_Timer = 0;
+
+ m_creature->SetVisibility(VISIBILITY_ON);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void KilledUnit(Unit *victim)
+ {
+ if(Phase == 2)
+ {
+ Unit *pUnit = Unit::GetUnit(*m_creature, Attumen);
+ if(pUnit)
+ {
+ pUnit->MonsterYell(SAY_MIDNIGHT_KILL, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(pUnit, SOUND_MIDNIGHT_KILL);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
+ {
+ Phase = 2;
+ Creature *pAttumen = DoSpawnCreature(SUMMON_ATTUMEN, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
+ if(pAttumen)
+ {
+ Attumen = pAttumen->GetGUID();
+ pAttumen->AI()->AttackStart(m_creature->getVictim());
+ SetMidnight(pAttumen, m_creature->GetGUID());
+ switch(rand()%3)
+ {
+ case 0:
+ pAttumen->Yell(SAY_APPEAR1, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, SOUND_APPEAR1);
+ break;
+ case 1:
+ pAttumen->Yell(SAY_APPEAR2, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, SOUND_APPEAR2);
+ break;
+ case 2:
+ pAttumen->Yell(SAY_APPEAR3, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, SOUND_APPEAR3);
+ break;
+ }
+ }
+ }
+ else if(Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
+ {
+ Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen);
+ if(pAttumen)
+ Mount(pAttumen);
+ }
+ else if(Phase ==3)
+ {
+ if(Mount_Timer)
+ if(Mount_Timer <= diff)
+ {
+ Mount_Timer = 0;
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->GetMotionMaster()->MoveIdle();
+ Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen);
+ if(pAttumen)
+ {
+ pAttumen->SetUInt32Value(UNIT_FIELD_DISPLAYID, MOUNTED_DISPLAYID);
+ pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if(pAttumen->getVictim())
+ {
+ pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim());
+ pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID());
+ }
+ pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1);
+ }
+ } else Mount_Timer -= diff;
+ }
+
+ if(Phase != 3)
+ DoMeleeAttackIfReady();
+ }
+
+ void Mount(Unit *pAttumen)
+ {
+ DoPlaySoundToSet(pAttumen, SOUND_MOUNT);
+ pAttumen->MonsterYell(SAY_MOUNT, LANG_UNIVERSAL, 0);
+ Phase = 3;
+ m_creature->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 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);
+ distance += 10;
+ newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
+ newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
+ pAttumen->GetMotionMaster()->Clear();
+ pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
+ //pAttumen->Relocate(newX,newY,newZ,-angle);
+ //pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
+ Mount_Timer = 1000;
+ }
+
+ void SetMidnight(Creature *, uint64); //Below ..
+};
+
+CreatureAI* GetAI_boss_midnight(Creature *_Creature)
+{
+ return new boss_midnightAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
+{
+ boss_attumenAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ Phase = 1;
+
+ CleaveTimer = 10000 + (rand()%6)*1000;
+ CurseTimer = 30000;
+ RandomYellTimer = 30000 + (rand()%31)*1000; //Occasionally yell
+ ChargeTimer = 20000;
+ ResetTimer = 0;
+ }
+
+ uint64 Midnight;
+ uint8 Phase;
+ uint32 CleaveTimer;
+ uint32 CurseTimer;
+ uint32 RandomYellTimer;
+ uint32 ChargeTimer; //only when mounted
+ uint32 ResetTimer;
+
+ void Reset()
+ {
+ ResetTimer = 2000;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ case 1:
+ DoYell(SAY_KILL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight);
+ if(pMidnight)
+ {
+ pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(ResetTimer)
+ if(ResetTimer <= diff)
+ {
+ ResetTimer = 0;
+ Unit *pMidnight = Unit::GetUnit(*m_creature, 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->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else ResetTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE ))
+ return;
+
+ if(CleaveTimer < diff)
+ {
+ Unit *target = m_creature->getVictim();
+ DoCast(target, SPELL_SHADOWCLEAVE);
+ CleaveTimer = 10000 + (rand()%6)*1000;
+ } else CleaveTimer -= diff;
+
+ if(CurseTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
+ CurseTimer = 30000;
+ } else CurseTimer -= diff;
+
+ if(RandomYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_RANDOM1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_RANDOM1);
+ break;
+ case 1:
+ DoYell(SAY_RANDOM2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_RANDOM2);
+ break;
+ }
+ RandomYellTimer = 30000 + (rand()%31)*1000;
+ } else RandomYellTimer -= diff;
+
+ if(m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
+ {
+ if(ChargeTimer < diff)
+ {
+ Unit *target;
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::vector<Unit *> target_list;
+ for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if(target && target->GetDistance2d(m_creature) > 5)
+ target_list.push_back(target);
+ target = NULL;
+ }
+ if(target_list.size())
+ target = *(target_list.begin()+rand()%target_list.size());
+
+ DoCast(target, SPELL_BERSERKER_CHARGE);
+ ChargeTimer = 20000;
+ } else ChargeTimer -= diff;
+ }
+ else
+ {
+ if( (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
+ {
+ Creature *pMidnight = (Creature*)Unit::GetUnit(*m_creature, Midnight);
+ if(pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
+ {
+ ((boss_midnightAI*)(pMidnight->AI()))->Mount(m_creature);
+ m_creature->SetHealth(pMidnight->GetHealth());
+ }
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void SpellHit(Unit *source, const SpellEntry *spell)
+ {
+ if(spell->Mechanic == MECHANIC_DISARM)
+ {
+ DoYell(SAY_DISARMED, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DISARMED);
+ }
+ }
+};
+
+void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value)
+{
+ ((boss_attumenAI*)pAttumen->AI())->Midnight = value;
+}
+
+CreatureAI* GetAI_boss_attumen(Creature *_Creature)
+{
+ return new boss_attumenAI (_Creature);
+}
+
+void AddSC_boss_attumen()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_attumen";
+ newscript->GetAI = GetAI_boss_attumen;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_midnight";
+ newscript->GetAI = GetAI_boss_midnight;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
index 0f87b73ee90..d293ba7141c 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
@@ -1,868 +1,868 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Moroes
-SD%Complete: 100
-SDComment:
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_karazhan.h"
-
-#define SAY_AGGRO "Hmm, unannounced visitors? Preparations must be made."
-#define SOUND_AGGRO 9211
-
-#define SAY_SPECIAL_1 "Now, where was I? Oh yes..."
-#define SOUND_SPECIAL_1 9215
-
-#define SAY_SPECIAL_2 "You rang?"
-#define SOUND_SPECIAL_2 9316
-
-#define SAY_KILL_1 "One more for dinner this evening"
-#define SOUND_KILL_1 9214
-
-#define SAY_KILL_2 "Time... Never enough time."
-#define SOUND_KILL_2 9314
-
-#define SAY_KILL_3 "I've gone and made a mess."
-#define SOUND_KILL_3 9315
-
-#define SAY_DEATH "How terribly clumsy of me..."
-#define SOUND_DEATH 9213
-
-#define SPELL_VANISH 24699
-#define SPELL_GARROTE 37066
-#define SPELL_BLIND 34654
-#define SPELL_GOUGE 28456
-#define SPELL_ENRAGE 37023
-
-#define ORIENT 4.5784
-#define POS_Z 81.73
-
-float Locations[4][2]=
-{
- {-10976.2793, -1878.1736},
- {-10979.7587, -1877.8706},
- {-10985.6650, -1877.2458},
- {-10989.1367, -1876.8309},
-};
-
-const uint32 Adds[6]=
-{
- 17007,
- 19872,
- 19873,
- 19874,
- 19875,
- 19876,
-};
-
-struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
-{
- boss_moroesAI(Creature *c) : ScriptedAI(c)
- {
- FirstTime = true;
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint64 AddGUID[4];
-
- uint32 Vanish_Timer;
- uint32 Blind_Timer;
- uint32 Gouge_Timer;
- uint32 Wait_Timer;
- uint32 CheckAdds_Timer;
- uint32 AddId[4];
-
- bool FirstTime;
- bool InVanish;
- bool Enrage;
-
- void Reset()
- {
- Vanish_Timer = 30000;
- Blind_Timer = 35000;
- Gouge_Timer = 23000;
- Wait_Timer = 0;
- CheckAdds_Timer = 5000;
-
- Enrage = false;
- InVanish = false;
-
- SpawnAdds();
-
- m_creature->setFaction(16);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- if(pInstance)
- pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
- }
-
- void StartEvent()
- {
- if(!pInstance)
- return;
-
- if(pInstance)
- pInstance->SetData(DATA_MOROES_EVENT, IN_PROGRESS);
- }
-
- void Aggro(Unit* who)
- {
- StartEvent();
-
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- AddsAttack();
- }
-
- void KilledUnit(Unit* victim)
- {
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_2);
- break;
- case 2:
- DoYell(SAY_KILL_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_3);
- break;
- }
- }
-
- void JustDied(Unit* victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_MOROES_EVENT, DONE);
-
- DeSpawnAdds();
- }
-
- uint8 CheckAdd(uint64 guid)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), guid);
- if(pUnit)
- {
- if(!pUnit->isAlive())
- return 1; // Exists but is dead
- else
- return 2; // Exists and is alive
- }
-
- return 0; // Does not exist
- }
-
- void SpawnAdds()
- {
- Creature *pCreature = NULL;
-
- if(FirstTime)
- {
- std::vector<uint32> AddList;
-
- for(uint8 i = 0; i < 6; ++i)
- AddList.push_back(Adds[i]);
-
- while(AddList.size() > 4)
- AddList.erase((AddList.begin())+(rand()%AddList.size()));
-
- uint8 i = 0;
- for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
- {
- uint32 entry = *itr;
-
- pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, ORIENT, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- if(pCreature)
- {
- AddGUID[i] = pCreature->GetGUID();
- AddId[i] = entry;
- }
- ++i;
- }
-
- FirstTime = false;
- }
- else
- {
- for(uint8 i = 0; i < 5; ++i)
- {
- switch(CheckAdd(AddGUID[i]))
- {
- case 0:
- pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, ORIENT, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- if(pCreature)
- AddGUID[i] = pCreature->GetGUID();
- break;
- case 1:
- pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
- if(pCreature)
- {
- pCreature->Respawn();
- pCreature->AI()->EnterEvadeMode();
- }
- break;
- case 2:
- pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
- if(!pCreature->IsInEvadeMode())
- pCreature->AI()->EnterEvadeMode();
- break;
- }
- }
- }
- }
-
- void DeSpawnAdds()
- {
- for(uint8 i = 0; i < 4 ; ++i)
- {
- Unit* Temp = NULL;
- if(AddGUID[i])
- {
- Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive())
- Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
- }
-
- void AddsAttack()
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Temp = NULL;
- if(AddGUID[i])
- {
- Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive())
- ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
- else
- EnterEvadeMode();
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(pInstance && !pInstance->GetData(DATA_MOROES_EVENT))
- EnterEvadeMode();
-
- if(!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enrage = true;
- }
-
- if(CheckAdds_Timer < diff)
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Temp = NULL;
- if(AddGUID[i])
- {
- Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive())
- if(!Temp->SelectHostilTarget() || !Temp->getVictim() )
- ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
- }
- }
- CheckAdds_Timer = 5000;
- }else CheckAdds_Timer -= diff;
-
- //Cast Vanish, then Garrote random victim
- if(Vanish_Timer < diff)
- {
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature, SPELL_VANISH);
- InVanish = true;
- Vanish_Timer = 30000;
- Wait_Timer = 5000;
- }else Vanish_Timer -= diff;
-
- if(InVanish)
- {
- if(Wait_Timer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPECIAL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL_1);
- break;
- case 1:
- DoYell(SAY_SPECIAL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL_2);
- break;
- }
-
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- target->CastSpell(target, SPELL_GARROTE,true);
-
- m_creature->setFaction(16);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AI()->AttackStart(m_creature->getVictim());
- InVanish = false;
- }else Wait_Timer -= diff;
- }
-
- //Blind highest aggro, and attack second highest
- if(Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
- Gouge_Timer = 40000;
- }else Gouge_Timer -= diff;
-
- if(Blind_Timer < diff)
- {
- Unit* target = NULL;
- std::list<HostilReference*> t_list = m_creature->getThreatManager().getThreatList();
-
- if(t_list.empty())
- return;
-
- std::vector<Unit*> target_list;
- for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if(target && target->GetDistance2d(m_creature) < 5)
- target_list.push_back(target);
- }
- if(target_list.size())
- target = *(target_list.begin()+rand()%target_list.size());
-
- if(target)
- DoCast(target, SPELL_BLIND);
-
- Blind_Timer = 40000;
- }else Blind_Timer -= diff;
-
- if(!InVanish)
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
-{
- ScriptedInstance* pInstance;
-
- uint64 GuestGUID[4];
-
- boss_moroes_guestAI(Creature* c) : ScriptedAI(c)
- {
- for(uint8 i = 0; i < 4; ++i)
- GuestGUID[i] = 0;
-
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
- }
-
- void Aggro(Unit* who) {}
-
- void AcquireGUID()
- {
- if(!pInstance)
- return;
-
- GuestGUID[0] = pInstance->GetData64(DATA_MOROES);
- Creature* Moroes = ((Creature*)Unit::GetUnit((*m_creature), GuestGUID[0]));
- if(Moroes)
- {
- for(uint8 i = 0; i < 3; ++i)
- {
- uint64 GUID = ((boss_moroesAI*)Moroes->AI())->AddGUID[i];
- if(GUID && GUID != m_creature->GetGUID())
- GuestGUID[i+1] = GUID;
- }
- }
- }
-
- Unit* SelectTarget()
- {
- uint64 TempGUID = GuestGUID[rand()%5];
- if(TempGUID)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID);
- if(pUnit && pUnit->isAlive())
- return pUnit;
- }
-
- return m_creature;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(pInstance && !pInstance->GetData(DATA_MOROES_EVENT))
- EnterEvadeMode();
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_MANABURN 29405
-#define SPELL_MINDFLY 29570
-#define SPELL_SWPAIN 34441
-#define SPELL_SHADOWFORM 29406
-
-struct TRINITY_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
-{
- //Shadow Priest
- boss_baroness_dorothea_millstipeAI(Creature *c) : boss_moroes_guestAI(c) {}
-
- uint32 ManaBurn_Timer;
- uint32 MindFlay_Timer;
- uint32 ShadowWordPain_Timer;
-
- void Reset()
- {
- ManaBurn_Timer = 7000;
- MindFlay_Timer = 1000;
- ShadowWordPain_Timer = 6000;
-
- DoCast(m_creature,SPELL_SHADOWFORM, true);
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(MindFlay_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDFLY);
- MindFlay_Timer = 12000; //3sec channeled
- }else MindFlay_Timer -= diff;
-
- if(ManaBurn_Timer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && (target->getPowerType() == POWER_MANA))
- DoCast(target,SPELL_MANABURN);
- ManaBurn_Timer = 5000; //3 sec cast
- }else ManaBurn_Timer -= diff;
-
- if(ShadowWordPain_Timer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoCast(target,SPELL_SWPAIN);
- ShadowWordPain_Timer = 7000;
- }
- }else ShadowWordPain_Timer -= diff;
- }
-};
-
-#define SPELL_HAMMEROFJUSTICE 13005
-#define SPELL_JUDGEMENTOFCOMMAND 29386
-#define SPELL_SEALOFCOMMAND 29385
-
-struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
-{
- //Retr Pally
- boss_baron_rafe_dreugerAI(Creature *c) : boss_moroes_guestAI(c){}
-
- uint32 HammerOfJustice_Timer;
- uint32 SealOfCommand_Timer;
- uint32 JudgementOfCommand_Timer;
-
- void Reset()
- {
- HammerOfJustice_Timer = 1000;
- SealOfCommand_Timer = 7000;
- JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(SealOfCommand_Timer < diff)
- {
- DoCast(m_creature,SPELL_SEALOFCOMMAND);
- SealOfCommand_Timer = 32000;
- JudgementOfCommand_Timer = 29000;
- }else SealOfCommand_Timer -= diff;
-
- if(JudgementOfCommand_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_JUDGEMENTOFCOMMAND);
- JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
- }else JudgementOfCommand_Timer -= diff;
-
- if(HammerOfJustice_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE);
- HammerOfJustice_Timer = 12000;
- }else HammerOfJustice_Timer -= diff;
- }
-};
-
-#define SPELL_DISPELMAGIC 15090 //Self or other guest+Moroes
-#define SPELL_GREATERHEAL 29564 //Self or other guest+Moroes
-#define SPELL_HOLYFIRE 29563
-#define SPELL_PWSHIELD 29408
-
-struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
-{
- //Holy Priest
- boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {}
-
- uint32 DispelMagic_Timer;
- uint32 GreaterHeal_Timer;
- uint32 HolyFire_Timer;
- uint32 PowerWordShield_Timer;
-
- void Reset()
- {
- DispelMagic_Timer = 11000;
- GreaterHeal_Timer = 1500;
- HolyFire_Timer = 5000;
- PowerWordShield_Timer = 1000;
-
- AcquireGUID();
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(PowerWordShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_PWSHIELD);
- PowerWordShield_Timer = 15000;
- }else PowerWordShield_Timer -= diff;
-
- if(GreaterHeal_Timer < diff)
- {
- Unit* target = SelectTarget();
-
- DoCast(target, SPELL_GREATERHEAL);
- GreaterHeal_Timer = 17000;
- }else GreaterHeal_Timer -= diff;
-
- if(HolyFire_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HOLYFIRE);
- HolyFire_Timer = 22000;
- }else HolyFire_Timer -= diff;
-
- if(DispelMagic_Timer < diff)
- {
- if(rand()%2)
- {
- Unit* target = SelectTarget();
-
- DoCast(target, SPELL_DISPELMAGIC);
- }
- else
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPELMAGIC);
-
- DispelMagic_Timer = 25000;
- }else DispelMagic_Timer -= diff;
- }
-};
-
-#define SPELL_CLEANSE 29380 //Self or other guest+Moroes
-#define SPELL_GREATERBLESSOFMIGHT 29381 //Self or other guest+Moroes
-#define SPELL_HOLYLIGHT 29562 //Self or other guest+Moroes
-#define SPELL_DIVINESHIELD 41367
-
-struct TRINITY_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
-{
- //Holy Pally
- boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {}
-
- uint32 Cleanse_Timer;
- uint32 GreaterBless_Timer;
- uint32 HolyLight_Timer;
- uint32 DivineShield_Timer;
-
- void Reset()
- {
- Cleanse_Timer = 13000;
- GreaterBless_Timer = 1000;
- HolyLight_Timer = 7000;
- DivineShield_Timer = 31000;
-
- AcquireGUID();
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(DivineShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_DIVINESHIELD);
- DivineShield_Timer = 31000;
- }else DivineShield_Timer -= diff;
-
- if(HolyLight_Timer < diff)
- {
- Unit* target = SelectTarget();
-
- DoCast(target, SPELL_HOLYLIGHT);
- HolyLight_Timer = 10000;
- }else HolyLight_Timer -= diff;
-
- if(GreaterBless_Timer < diff)
- {
- Unit* target = SelectTarget();
-
- DoCast(target, SPELL_GREATERBLESSOFMIGHT);
-
- GreaterBless_Timer = 50000;
- }else GreaterBless_Timer -= diff;
-
- if(Cleanse_Timer < diff)
- {
- Unit* target = SelectTarget();
-
- DoCast(target, SPELL_CLEANSE);
-
- Cleanse_Timer = 10000;
- }else Cleanse_Timer -= diff;
- }
-};
-
-#define SPELL_HAMSTRING 9080
-#define SPELL_MORTALSTRIKE 29572
-#define SPELL_WHIRLWIND 29573
-
-struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI
-{
- //Arms Warr
- boss_lord_robin_darisAI(Creature *c) : boss_moroes_guestAI(c) {}
-
- uint32 Hamstring_Timer;
- uint32 MortalStrike_Timer;
- uint32 WhirlWind_Timer;
-
- void Reset()
- {
- Hamstring_Timer = 7000;
- MortalStrike_Timer = 10000;
- WhirlWind_Timer = 21000;
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(Hamstring_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- Hamstring_Timer = 12000;
- }else Hamstring_Timer -= diff;
-
- if(MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 18000;
- }else MortalStrike_Timer -= diff;
-
- if(WhirlWind_Timer < diff)
- {
- DoCast(m_creature,SPELL_WHIRLWIND);
- WhirlWind_Timer = 21000;
- }else WhirlWind_Timer -= diff;
- }
-};
-
-#define SPELL_DISARM 8379
-#define SPELL_HEROICSTRIKE 29567
-#define SPELL_SHIELDBASH 11972
-#define SPELL_SHIELDWALL 29390
-
-struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
-{
- //Arms Warr
- boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {}
-
- uint32 Disarm_Timer;
- uint32 HeroicStrike_Timer;
- uint32 ShieldBash_Timer;
- uint32 ShieldWall_Timer;
-
- void Reset()
- {
- Disarm_Timer = 6000;
- HeroicStrike_Timer = 10000;
- ShieldBash_Timer = 8000;
- ShieldWall_Timer = 4000;
-
- boss_moroes_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_moroes_guestAI::UpdateAI(diff);
-
- if(Disarm_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DISARM);
- Disarm_Timer = 12000;
- }else Disarm_Timer -= diff;
-
- if(HeroicStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HEROICSTRIKE);
- HeroicStrike_Timer = 10000;
- }else HeroicStrike_Timer -= diff;
-
- if(ShieldBash_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHIELDBASH);
- ShieldBash_Timer = 13000;
- }else ShieldBash_Timer -= diff;
-
- if(ShieldWall_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall_Timer = 21000;
- }else ShieldWall_Timer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_moroes(Creature *_Creature)
-{
- return new boss_moroesAI (_Creature);
-}
-
-CreatureAI* GetAI_baroness_dorothea_millstipe(Creature *_Creature)
-{
- return new boss_baroness_dorothea_millstipeAI (_Creature);
-}
-
-CreatureAI* GetAI_baron_rafe_dreuger(Creature *_Creature)
-{
- return new boss_baron_rafe_dreugerAI (_Creature);
-}
-
-CreatureAI* GetAI_lady_catriona_von_indi(Creature *_Creature)
-{
- return new boss_lady_catriona_von_indiAI (_Creature);
-}
-
-CreatureAI* GetAI_lady_keira_berrybuck(Creature *_Creature)
-{
- return new boss_lady_keira_berrybuckAI (_Creature);
-}
-
-CreatureAI* GetAI_lord_robin_daris(Creature *_Creature)
-{
- return new boss_lord_robin_darisAI (_Creature);
-}
-
-CreatureAI* GetAI_lord_crispin_ference(Creature *_Creature)
-{
- return new boss_lord_crispin_ferenceAI (_Creature);
-}
-
-void AddSC_boss_moroes()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_moroes";
- newscript->GetAI = GetAI_boss_moroes;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_baroness_dorothea_millstipe";
- newscript->GetAI = GetAI_baroness_dorothea_millstipe;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_baron_rafe_dreuger";
- newscript->GetAI = GetAI_baron_rafe_dreuger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lady_catriona_von_indi";
- newscript->GetAI = GetAI_lady_catriona_von_indi;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lady_keira_berrybuck";
- newscript->GetAI = GetAI_lady_keira_berrybuck;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lord_robin_daris";
- newscript->GetAI = GetAI_lord_robin_daris;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lord_crispin_ference";
- newscript->GetAI = GetAI_lord_crispin_ference;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Moroes
+SD%Complete: 100
+SDComment:
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_karazhan.h"
+
+#define SAY_AGGRO "Hmm, unannounced visitors? Preparations must be made."
+#define SOUND_AGGRO 9211
+
+#define SAY_SPECIAL_1 "Now, where was I? Oh yes..."
+#define SOUND_SPECIAL_1 9215
+
+#define SAY_SPECIAL_2 "You rang?"
+#define SOUND_SPECIAL_2 9316
+
+#define SAY_KILL_1 "One more for dinner this evening"
+#define SOUND_KILL_1 9214
+
+#define SAY_KILL_2 "Time... Never enough time."
+#define SOUND_KILL_2 9314
+
+#define SAY_KILL_3 "I've gone and made a mess."
+#define SOUND_KILL_3 9315
+
+#define SAY_DEATH "How terribly clumsy of me..."
+#define SOUND_DEATH 9213
+
+#define SPELL_VANISH 24699
+#define SPELL_GARROTE 37066
+#define SPELL_BLIND 34654
+#define SPELL_GOUGE 28456
+#define SPELL_ENRAGE 37023
+
+#define ORIENT 4.5784
+#define POS_Z 81.73
+
+float Locations[4][2]=
+{
+ {-10976.2793, -1878.1736},
+ {-10979.7587, -1877.8706},
+ {-10985.6650, -1877.2458},
+ {-10989.1367, -1876.8309},
+};
+
+const uint32 Adds[6]=
+{
+ 17007,
+ 19872,
+ 19873,
+ 19874,
+ 19875,
+ 19876,
+};
+
+struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
+{
+ boss_moroesAI(Creature *c) : ScriptedAI(c)
+ {
+ FirstTime = true;
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint64 AddGUID[4];
+
+ uint32 Vanish_Timer;
+ uint32 Blind_Timer;
+ uint32 Gouge_Timer;
+ uint32 Wait_Timer;
+ uint32 CheckAdds_Timer;
+ uint32 AddId[4];
+
+ bool FirstTime;
+ bool InVanish;
+ bool Enrage;
+
+ void Reset()
+ {
+ Vanish_Timer = 30000;
+ Blind_Timer = 35000;
+ Gouge_Timer = 23000;
+ Wait_Timer = 0;
+ CheckAdds_Timer = 5000;
+
+ Enrage = false;
+ InVanish = false;
+
+ SpawnAdds();
+
+ m_creature->setFaction(16);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
+ }
+
+ void StartEvent()
+ {
+ if(!pInstance)
+ return;
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROES_EVENT, IN_PROGRESS);
+ }
+
+ void Aggro(Unit* who)
+ {
+ StartEvent();
+
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ AddsAttack();
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_2);
+ break;
+ case 2:
+ DoYell(SAY_KILL_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_MOROES_EVENT, DONE);
+
+ DeSpawnAdds();
+ }
+
+ uint8 CheckAdd(uint64 guid)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), guid);
+ if(pUnit)
+ {
+ if(!pUnit->isAlive())
+ return 1; // Exists but is dead
+ else
+ return 2; // Exists and is alive
+ }
+
+ return 0; // Does not exist
+ }
+
+ void SpawnAdds()
+ {
+ Creature *pCreature = NULL;
+
+ if(FirstTime)
+ {
+ std::vector<uint32> AddList;
+
+ for(uint8 i = 0; i < 6; ++i)
+ AddList.push_back(Adds[i]);
+
+ while(AddList.size() > 4)
+ AddList.erase((AddList.begin())+(rand()%AddList.size()));
+
+ uint8 i = 0;
+ for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
+ {
+ uint32 entry = *itr;
+
+ pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, ORIENT, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ if(pCreature)
+ {
+ AddGUID[i] = pCreature->GetGUID();
+ AddId[i] = entry;
+ }
+ ++i;
+ }
+
+ FirstTime = false;
+ }
+ else
+ {
+ for(uint8 i = 0; i < 5; ++i)
+ {
+ switch(CheckAdd(AddGUID[i]))
+ {
+ case 0:
+ pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, ORIENT, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
+ if(pCreature)
+ AddGUID[i] = pCreature->GetGUID();
+ break;
+ case 1:
+ pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
+ if(pCreature)
+ {
+ pCreature->Respawn();
+ pCreature->AI()->EnterEvadeMode();
+ }
+ break;
+ case 2:
+ pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
+ if(!pCreature->IsInEvadeMode())
+ pCreature->AI()->EnterEvadeMode();
+ break;
+ }
+ }
+ }
+ }
+
+ void DeSpawnAdds()
+ {
+ for(uint8 i = 0; i < 4 ; ++i)
+ {
+ Unit* Temp = NULL;
+ if(AddGUID[i])
+ {
+ Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive())
+ Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+ }
+
+ void AddsAttack()
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Temp = NULL;
+ if(AddGUID[i])
+ {
+ Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive())
+ ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
+ else
+ EnterEvadeMode();
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(pInstance && !pInstance->GetData(DATA_MOROES_EVENT))
+ EnterEvadeMode();
+
+ if(!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enrage = true;
+ }
+
+ if(CheckAdds_Timer < diff)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Temp = NULL;
+ if(AddGUID[i])
+ {
+ Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive())
+ if(!Temp->SelectHostilTarget() || !Temp->getVictim() )
+ ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
+ }
+ }
+ CheckAdds_Timer = 5000;
+ }else CheckAdds_Timer -= diff;
+
+ //Cast Vanish, then Garrote random victim
+ if(Vanish_Timer < diff)
+ {
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(m_creature, SPELL_VANISH);
+ InVanish = true;
+ Vanish_Timer = 30000;
+ Wait_Timer = 5000;
+ }else Vanish_Timer -= diff;
+
+ if(InVanish)
+ {
+ if(Wait_Timer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPECIAL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL_1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL_2);
+ break;
+ }
+
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ target->CastSpell(target, SPELL_GARROTE,true);
+
+ m_creature->setFaction(16);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->AI()->AttackStart(m_creature->getVictim());
+ InVanish = false;
+ }else Wait_Timer -= diff;
+ }
+
+ //Blind highest aggro, and attack second highest
+ if(Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
+ Gouge_Timer = 40000;
+ }else Gouge_Timer -= diff;
+
+ if(Blind_Timer < diff)
+ {
+ Unit* target = NULL;
+ std::list<HostilReference*> t_list = m_creature->getThreatManager().getThreatList();
+
+ if(t_list.empty())
+ return;
+
+ std::vector<Unit*> target_list;
+ for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if(target && target->GetDistance2d(m_creature) < 5)
+ target_list.push_back(target);
+ }
+ if(target_list.size())
+ target = *(target_list.begin()+rand()%target_list.size());
+
+ if(target)
+ DoCast(target, SPELL_BLIND);
+
+ Blind_Timer = 40000;
+ }else Blind_Timer -= diff;
+
+ if(!InVanish)
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
+{
+ ScriptedInstance* pInstance;
+
+ uint64 GuestGUID[4];
+
+ boss_moroes_guestAI(Creature* c) : ScriptedAI(c)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ GuestGUID[i] = 0;
+
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void AcquireGUID()
+ {
+ if(!pInstance)
+ return;
+
+ GuestGUID[0] = pInstance->GetData64(DATA_MOROES);
+ Creature* Moroes = ((Creature*)Unit::GetUnit((*m_creature), GuestGUID[0]));
+ if(Moroes)
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ uint64 GUID = ((boss_moroesAI*)Moroes->AI())->AddGUID[i];
+ if(GUID && GUID != m_creature->GetGUID())
+ GuestGUID[i+1] = GUID;
+ }
+ }
+ }
+
+ Unit* SelectTarget()
+ {
+ uint64 TempGUID = GuestGUID[rand()%5];
+ if(TempGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID);
+ if(pUnit && pUnit->isAlive())
+ return pUnit;
+ }
+
+ return m_creature;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(pInstance && !pInstance->GetData(DATA_MOROES_EVENT))
+ EnterEvadeMode();
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_MANABURN 29405
+#define SPELL_MINDFLY 29570
+#define SPELL_SWPAIN 34441
+#define SPELL_SHADOWFORM 29406
+
+struct TRINITY_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
+{
+ //Shadow Priest
+ boss_baroness_dorothea_millstipeAI(Creature *c) : boss_moroes_guestAI(c) {}
+
+ uint32 ManaBurn_Timer;
+ uint32 MindFlay_Timer;
+ uint32 ShadowWordPain_Timer;
+
+ void Reset()
+ {
+ ManaBurn_Timer = 7000;
+ MindFlay_Timer = 1000;
+ ShadowWordPain_Timer = 6000;
+
+ DoCast(m_creature,SPELL_SHADOWFORM, true);
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(MindFlay_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDFLY);
+ MindFlay_Timer = 12000; //3sec channeled
+ }else MindFlay_Timer -= diff;
+
+ if(ManaBurn_Timer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && (target->getPowerType() == POWER_MANA))
+ DoCast(target,SPELL_MANABURN);
+ ManaBurn_Timer = 5000; //3 sec cast
+ }else ManaBurn_Timer -= diff;
+
+ if(ShadowWordPain_Timer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoCast(target,SPELL_SWPAIN);
+ ShadowWordPain_Timer = 7000;
+ }
+ }else ShadowWordPain_Timer -= diff;
+ }
+};
+
+#define SPELL_HAMMEROFJUSTICE 13005
+#define SPELL_JUDGEMENTOFCOMMAND 29386
+#define SPELL_SEALOFCOMMAND 29385
+
+struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
+{
+ //Retr Pally
+ boss_baron_rafe_dreugerAI(Creature *c) : boss_moroes_guestAI(c){}
+
+ uint32 HammerOfJustice_Timer;
+ uint32 SealOfCommand_Timer;
+ uint32 JudgementOfCommand_Timer;
+
+ void Reset()
+ {
+ HammerOfJustice_Timer = 1000;
+ SealOfCommand_Timer = 7000;
+ JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(SealOfCommand_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SEALOFCOMMAND);
+ SealOfCommand_Timer = 32000;
+ JudgementOfCommand_Timer = 29000;
+ }else SealOfCommand_Timer -= diff;
+
+ if(JudgementOfCommand_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_JUDGEMENTOFCOMMAND);
+ JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
+ }else JudgementOfCommand_Timer -= diff;
+
+ if(HammerOfJustice_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE);
+ HammerOfJustice_Timer = 12000;
+ }else HammerOfJustice_Timer -= diff;
+ }
+};
+
+#define SPELL_DISPELMAGIC 15090 //Self or other guest+Moroes
+#define SPELL_GREATERHEAL 29564 //Self or other guest+Moroes
+#define SPELL_HOLYFIRE 29563
+#define SPELL_PWSHIELD 29408
+
+struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
+{
+ //Holy Priest
+ boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {}
+
+ uint32 DispelMagic_Timer;
+ uint32 GreaterHeal_Timer;
+ uint32 HolyFire_Timer;
+ uint32 PowerWordShield_Timer;
+
+ void Reset()
+ {
+ DispelMagic_Timer = 11000;
+ GreaterHeal_Timer = 1500;
+ HolyFire_Timer = 5000;
+ PowerWordShield_Timer = 1000;
+
+ AcquireGUID();
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(PowerWordShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_PWSHIELD);
+ PowerWordShield_Timer = 15000;
+ }else PowerWordShield_Timer -= diff;
+
+ if(GreaterHeal_Timer < diff)
+ {
+ Unit* target = SelectTarget();
+
+ DoCast(target, SPELL_GREATERHEAL);
+ GreaterHeal_Timer = 17000;
+ }else GreaterHeal_Timer -= diff;
+
+ if(HolyFire_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLYFIRE);
+ HolyFire_Timer = 22000;
+ }else HolyFire_Timer -= diff;
+
+ if(DispelMagic_Timer < diff)
+ {
+ if(rand()%2)
+ {
+ Unit* target = SelectTarget();
+
+ DoCast(target, SPELL_DISPELMAGIC);
+ }
+ else
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPELMAGIC);
+
+ DispelMagic_Timer = 25000;
+ }else DispelMagic_Timer -= diff;
+ }
+};
+
+#define SPELL_CLEANSE 29380 //Self or other guest+Moroes
+#define SPELL_GREATERBLESSOFMIGHT 29381 //Self or other guest+Moroes
+#define SPELL_HOLYLIGHT 29562 //Self or other guest+Moroes
+#define SPELL_DIVINESHIELD 41367
+
+struct TRINITY_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
+{
+ //Holy Pally
+ boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {}
+
+ uint32 Cleanse_Timer;
+ uint32 GreaterBless_Timer;
+ uint32 HolyLight_Timer;
+ uint32 DivineShield_Timer;
+
+ void Reset()
+ {
+ Cleanse_Timer = 13000;
+ GreaterBless_Timer = 1000;
+ HolyLight_Timer = 7000;
+ DivineShield_Timer = 31000;
+
+ AcquireGUID();
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(DivineShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DIVINESHIELD);
+ DivineShield_Timer = 31000;
+ }else DivineShield_Timer -= diff;
+
+ if(HolyLight_Timer < diff)
+ {
+ Unit* target = SelectTarget();
+
+ DoCast(target, SPELL_HOLYLIGHT);
+ HolyLight_Timer = 10000;
+ }else HolyLight_Timer -= diff;
+
+ if(GreaterBless_Timer < diff)
+ {
+ Unit* target = SelectTarget();
+
+ DoCast(target, SPELL_GREATERBLESSOFMIGHT);
+
+ GreaterBless_Timer = 50000;
+ }else GreaterBless_Timer -= diff;
+
+ if(Cleanse_Timer < diff)
+ {
+ Unit* target = SelectTarget();
+
+ DoCast(target, SPELL_CLEANSE);
+
+ Cleanse_Timer = 10000;
+ }else Cleanse_Timer -= diff;
+ }
+};
+
+#define SPELL_HAMSTRING 9080
+#define SPELL_MORTALSTRIKE 29572
+#define SPELL_WHIRLWIND 29573
+
+struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI
+{
+ //Arms Warr
+ boss_lord_robin_darisAI(Creature *c) : boss_moroes_guestAI(c) {}
+
+ uint32 Hamstring_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 WhirlWind_Timer;
+
+ void Reset()
+ {
+ Hamstring_Timer = 7000;
+ MortalStrike_Timer = 10000;
+ WhirlWind_Timer = 21000;
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(Hamstring_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ Hamstring_Timer = 12000;
+ }else Hamstring_Timer -= diff;
+
+ if(MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 18000;
+ }else MortalStrike_Timer -= diff;
+
+ if(WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_WHIRLWIND);
+ WhirlWind_Timer = 21000;
+ }else WhirlWind_Timer -= diff;
+ }
+};
+
+#define SPELL_DISARM 8379
+#define SPELL_HEROICSTRIKE 29567
+#define SPELL_SHIELDBASH 11972
+#define SPELL_SHIELDWALL 29390
+
+struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
+{
+ //Arms Warr
+ boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {}
+
+ uint32 Disarm_Timer;
+ uint32 HeroicStrike_Timer;
+ uint32 ShieldBash_Timer;
+ uint32 ShieldWall_Timer;
+
+ void Reset()
+ {
+ Disarm_Timer = 6000;
+ HeroicStrike_Timer = 10000;
+ ShieldBash_Timer = 8000;
+ ShieldWall_Timer = 4000;
+
+ boss_moroes_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_moroes_guestAI::UpdateAI(diff);
+
+ if(Disarm_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DISARM);
+ Disarm_Timer = 12000;
+ }else Disarm_Timer -= diff;
+
+ if(HeroicStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HEROICSTRIKE);
+ HeroicStrike_Timer = 10000;
+ }else HeroicStrike_Timer -= diff;
+
+ if(ShieldBash_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHIELDBASH);
+ ShieldBash_Timer = 13000;
+ }else ShieldBash_Timer -= diff;
+
+ if(ShieldWall_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall_Timer = 21000;
+ }else ShieldWall_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_moroes(Creature *_Creature)
+{
+ return new boss_moroesAI (_Creature);
+}
+
+CreatureAI* GetAI_baroness_dorothea_millstipe(Creature *_Creature)
+{
+ return new boss_baroness_dorothea_millstipeAI (_Creature);
+}
+
+CreatureAI* GetAI_baron_rafe_dreuger(Creature *_Creature)
+{
+ return new boss_baron_rafe_dreugerAI (_Creature);
+}
+
+CreatureAI* GetAI_lady_catriona_von_indi(Creature *_Creature)
+{
+ return new boss_lady_catriona_von_indiAI (_Creature);
+}
+
+CreatureAI* GetAI_lady_keira_berrybuck(Creature *_Creature)
+{
+ return new boss_lady_keira_berrybuckAI (_Creature);
+}
+
+CreatureAI* GetAI_lord_robin_daris(Creature *_Creature)
+{
+ return new boss_lord_robin_darisAI (_Creature);
+}
+
+CreatureAI* GetAI_lord_crispin_ference(Creature *_Creature)
+{
+ return new boss_lord_crispin_ferenceAI (_Creature);
+}
+
+void AddSC_boss_moroes()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_moroes";
+ newscript->GetAI = GetAI_boss_moroes;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_baroness_dorothea_millstipe";
+ newscript->GetAI = GetAI_baroness_dorothea_millstipe;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_baron_rafe_dreuger";
+ newscript->GetAI = GetAI_baron_rafe_dreuger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lady_catriona_von_indi";
+ newscript->GetAI = GetAI_lady_catriona_von_indi;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lady_keira_berrybuck";
+ newscript->GetAI = GetAI_lady_keira_berrybuck;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lord_robin_daris";
+ newscript->GetAI = GetAI_lord_robin_daris;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lord_crispin_ference";
+ newscript->GetAI = GetAI_lord_crispin_ference;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
index 8feb60f0fa1..f3787814af9 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
@@ -1,37 +1,37 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Netherspite
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_NETHERBURN_AURA 30522
-#define SPELL_VOIDZONE 37014 //Probably won't work
-#define SPELL_BERSERK 26662
-#define SPELL_NETHERBREATH 36631
-
-//Beams (no idea how these are going to work in Trinity)
-#define SPELL_DOMINANCE_ENEMY 30423
-#define SPELL_DOMINANCE_SELF 30468
-#define SPELL_PERSEVERANCE_ENEMY 30421
-#define SPELL_PERSEVERANCE_SELF 30466
-#define SPELL_SERENITY_ENEMY 30422
-#define SPELL_SERENITY_SELF 30467
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Netherspite
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_NETHERBURN_AURA 30522
+#define SPELL_VOIDZONE 37014 //Probably won't work
+#define SPELL_BERSERK 26662
+#define SPELL_NETHERBREATH 36631
+
+//Beams (no idea how these are going to work in Trinity)
+#define SPELL_DOMINANCE_ENEMY 30423
+#define SPELL_DOMINANCE_SELF 30468
+#define SPELL_PERSEVERANCE_ENEMY 30421
+#define SPELL_PERSEVERANCE_SELF 30466
+#define SPELL_SERENITY_ENEMY 30422
+#define SPELL_SERENITY_SELF 30467
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
index 4db1a31e317..bffb418980a 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
@@ -1,33 +1,33 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Nightbane
-SD%Complete: 0
-SDComment: Place holder
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_BELLOWING_ROAR 39427
-#define SPELL_CHARRED_EARTH 30129 //Also 30209 (Target Charred Earth) triggers this
-#define SPELL_DISTRACTING_ASH 30130
-#define SPELL_SMOLDERING_BREATH 30210
-#define SPELL_TAIL_SWEEP 25653
-#define SPELL_RAIN_OF_BONES 37098
-#define SPELL_SMOKING_BLAST 37057
-#define SPELL_FIREBALL_BARRAGE 30282
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Nightbane
+SD%Complete: 0
+SDComment: Place holder
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_BELLOWING_ROAR 39427
+#define SPELL_CHARRED_EARTH 30129 //Also 30209 (Target Charred Earth) triggers this
+#define SPELL_DISTRACTING_ASH 30130
+#define SPELL_SMOLDERING_BREATH 30210
+#define SPELL_TAIL_SWEEP 25653
+#define SPELL_RAIN_OF_BONES 37098
+#define SPELL_SMOKING_BLAST 37057
+#define SPELL_FIREBALL_BARRAGE 30282
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
index a76b72f933d..6b23c365a2e 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
@@ -1,646 +1,646 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Prince_Malchezzar
-SD%Complete: 100
-SDComment:
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO "Madness has brought you here to me. I shall be your undoing!"
-#define SOUND_AGGRO 9218
-#define SAY_SUMMON1 "You face not Malchezaar alone, but the legions I command!"
-#define SOUND_SUMMON1 9322
-#define SAY_SUMMON2 "All realities, all dimensions are open to me!"
-#define SOUND_SUMMON2 9224
-#define SAY_PHASE2 "Simple fools! Time is the fire in which you'll burn!"
-#define SOUND_PHASE2 9220
-#define SAY_PHASE3 "How can you hope to withstand against such overwhelming power?"
-#define SOUND_PHASE3 9321
-#define SAY_PDEATH1 "You are, but a plaything, unfit even to amuse."
-#define SOUND_PDEATH1 9319
-#define SAY_PDEATH2 "Your greed, your foolishness has brought you to this end."
-#define SOUND_PDEATH2 9318
-#define SAY_PDEATH3 "Surely you did not think you could win."
-#define SOUND_PDEATH3 9222
-#define SAY_DEATH "I refuse to concede defeat. I am a prince of the Eredar! I am..."
-#define SOUND_DEATH 9221
-
-// 19 Coordinates for Infernal spawns
-struct InfernalPoint
-{
- float x,y;
-};
-
-#define INFERNAL_Z 275.5
-
-static InfernalPoint InfernalPoints[] =
-{
- {-10922.8, -1985.2},
- {-10916.2, -1996.2},
- {-10932.2, -2008.1},
- {-10948.8, -2022.1},
- {-10958.7, -1997.7},
- {-10971.5, -1997.5},
- {-10990.8, -1995.1},
- {-10989.8, -1976.5},
- {-10971.6, -1973.0},
- {-10955.5, -1974.0},
- {-10939.6, -1969.8},
- {-10958.0, -1952.2},
- {-10941.7, -1954.8},
- {-10943.1, -1988.5},
- {-10948.8, -2005.1},
- {-10984.0, -2019.3},
- {-10932.8, -1979.6},
- {-10932.8, -1979.6},
- {-10935.7, -1996.0}
-};
-
-#define TOTAL_INFERNAL_POINTS 19
-
-//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends
-//Along with reducing healing and regen while enfeebled to 0%
-//This spell effect will only reduce healing
-
-#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2
-#define SPELL_ENFEEBLE_EFFECT 41624
-
-#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases
-#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though)
-#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2
-#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2
-#define SPELL_THRASH_AURA 3417 //Passive proc chance for thrash
-#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping
-#define SPELL_AMPLIFY_DAMAGE 12738 //Amplifiy during phase 3
-#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura
-#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature
-#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3
-
-#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects
-#define SPELL_INFERNAL_RELAY 30834
-
-#define AXE_EQUIP_MODEL 40066 //Axes info
-#define AXE_EQUIP_INFO 33448898
-
-//---------Infernal code first
-struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
-{
- netherspite_infernalAI(Creature *c) : ScriptedAI(c) ,
- malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {Reset();}
-
- uint32 HellfireTimer;
- uint32 CleanupTimer;
- uint32 malchezaar;
- InfernalPoint *point;
-
- void Reset() {}
- void Aggro(Unit *who) {}
- void MoveInLineOfSight(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(HellfireTimer)
- if(HellfireTimer <= diff)
- {
- DoCast(m_creature, SPELL_HELLFIRE);
- HellfireTimer = 0;
- }
- else HellfireTimer -= diff;
-
- if(CleanupTimer)
- if(CleanupTimer <= diff)
- {
- Cleanup();
- CleanupTimer = 0;
- } else CleanupTimer -= diff;
- }
-
- void KilledUnit(Unit *who)
- {
- Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
- if(pMalchezaar)
- ((Creature*)pMalchezaar)->AI()->KilledUnit(who);
- }
-
- void SpellHit(Unit *who, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_INFERNAL_RELAY)
- {
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- HellfireTimer = 4000;
- CleanupTimer = 170000;
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(done_by->GetGUID() != malchezaar)
- damage = 0;
- }
-
- void Cleanup(); //below ...
-};
-
-struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
-{
- boss_malchezaarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 EnfeebleTimer;
- uint32 EnfeebleResetTimer;
- uint32 ShadowNovaTimer;
- uint32 SWPainTimer;
- uint32 SunderArmorTimer;
- uint32 AmplifyDamageTimer;
- uint32 InfernalTimer;
- uint32 AxesTargetSwitchTimer;
- uint32 InfernalCleanupTimer;
-
- std::vector<uint64> infernals;
- std::vector<InfernalPoint*> positions;
-
- uint64 axes[2];
- uint64 enfeeble_targets[5];
- uint64 enfeeble_health[5];
-
- uint32 phase;
-
- void Reset()
- {
- AxesCleanup();
- ClearWeapons();
- InfernalCleanup();
- positions.clear();
-
- for(int i =0; i < 5; ++i)
- enfeeble_targets[i] = 0;
-
- for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
- positions.push_back(&InfernalPoints[i]);
-
- EnfeebleTimer = 30000;
- EnfeebleResetTimer = 38000;
- ShadowNovaTimer = 35000;
- SWPainTimer = 20000;
- AmplifyDamageTimer = 10000;
- InfernalTimer = 45000;
- InfernalCleanupTimer = 47000;
- AxesTargetSwitchTimer = 7500 + rand()%12500;
- phase = 1;
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_PDEATH1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_PDEATH1);
- break;
- case 1:
- DoYell(SAY_PDEATH2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_PDEATH2);
- break;
- case 2:
- DoYell(SAY_PDEATH3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_PDEATH3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- AxesCleanup();
- ClearWeapons();
- InfernalCleanup();
- positions.clear();
-
- for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
- positions.push_back(&InfernalPoints[i]);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void InfernalCleanup()
- {
- //Infernal Cleanup
- for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
- {
- Unit *pInfernal = Unit::GetUnit(*m_creature, *itr);
- if(pInfernal && pInfernal->isAlive())
- {
- pInfernal->SetVisibility(VISIBILITY_OFF);
- pInfernal->setDeathState(JUST_DIED);
- }
- }
- infernals.clear();
- }
-
- void AxesCleanup()
- {
- for(int i=0; i<2;++i)
- {
- Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
- if(axe && axe->isAlive())
- axe->DealDamage(axe, axe->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- axes[i] = 0;
- }
- }
-
- void ClearWeapons()
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
-
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
-
- //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);
- }
-
- void EnfeebleHealthEffect()
- {
- const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
- if(!info)
- return;
-
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- std::vector<Unit *> targets;
-
- if(!t_list.size())
- return;
-
- //begin + 1 , so we don't target the one with the highest threat
- std::list<HostilReference *>::iterator itr = t_list.begin();
- std::advance(itr, 1);
- for( ; itr!= t_list.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //only on alive players
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
- targets.push_back( target);
- }
-
- //cut down to size if we have more than 5 targets
- while(targets.size() > 5)
- targets.erase(targets.begin()+rand()%targets.size());
-
- int i = 0;
- for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i)
- {
- Unit *target = *itr;
- if(target)
- {
- enfeeble_targets[i] = target->GetGUID();
- enfeeble_health[i] = target->GetHealth();
-
- target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
- target->SetHealth(1);
- }
- }
-
- }
-
- void EnfeebleResetHealth()
- {
- for(int i = 0; i < 5; ++i)
- {
- Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
- if(target && target->isAlive())
- target->SetHealth(enfeeble_health[i]);
- enfeeble_targets[i] = 0;
- enfeeble_health[i] = 0;
- }
- }
-
- void SummonInfernal(const uint32 diff)
- {
- InfernalPoint *point = NULL;
- float posX,posY,posZ;
- if( (m_creature->GetMapId() != 532) || positions.empty())
- {
- m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ);
- }
- else
- {
- std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
- point = *itr;
- positions.erase(itr);
-
- posX = point->x;
- posY = point->y;
- posZ = INFERNAL_Z;
- }
-
- Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
-
- if (Infernal)
- {
- Infernal->SetUInt32Value(UNIT_FIELD_DISPLAYID, INFERNAL_MODEL_INVISIBLE);
- Infernal->setFaction(m_creature->getFaction());
- if(point)
- ((netherspite_infernalAI*)Infernal->AI())->point=point;
- ((netherspite_infernalAI*)Infernal->AI())->malchezaar=m_creature->GetGUID();
-
- infernals.push_back(Infernal->GetGUID());
- DoCast(Infernal, SPELL_INFERNAL_RELAY);
- }
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
- break;
- case 1:
- DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(EnfeebleResetTimer)
- if(EnfeebleResetTimer <= diff) //Let's not forget to reset that
- {
- EnfeebleResetHealth();
- EnfeebleResetTimer=0;
- }else EnfeebleResetTimer -= diff;
-
- if(m_creature->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(phase == 1)
- {
- if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60)
- {
- m_creature->InterruptNonMeleeSpells(false);
-
- phase = 2;
-
- //animation
- DoCast(m_creature, SPELL_EQUIP_AXES);
-
- //text
- DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE2);
-
- //passive thrash aura
- m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true);
-
- //models
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
-
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, AXE_EQUIP_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO);
-
- //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);
-
- m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
- m_creature->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);
-
- m_creature->SetAttackTime(OFF_ATTACK, (((uint32)m_creature->GetAttackTime(BASE_ATTACK)/1.5)));
- }
- }
- else if(phase == 2)
- {
- if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
- {
- InfernalTimer = 15000;
-
- phase = 3;
-
- ClearWeapons();
-
- //remove thrash
- m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
-
- DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE3);
-
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- for(uint32 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);
- if(axe)
- {
- axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
- axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
-
- axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- axe->setFaction(m_creature->getFaction());
- axes[i] = axe->GetGUID();
- if(target)
- {
- axe->AI()->AttackStart(target);
- // axe->getThreatManager().tauntApply(target); //Taunt Apply and fade out does not work properly
- // So we'll use a hack to add a lot of threat to our target
- axe->AddThreat(target, 10000000.0f);
- }
- }
- }
-
- if(ShadowNovaTimer > 35000)
- ShadowNovaTimer = EnfeebleTimer + 5000;
-
- return;
- }
-
- if(SunderArmorTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
- SunderArmorTimer = 15000;
-
- }else SunderArmorTimer -= diff;
- }
- else
- {
- if(AxesTargetSwitchTimer < diff)
- {
- AxesTargetSwitchTimer = 7500 + rand()%12500 ;
-
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- for(int i = 0; i < 2; ++i)
- {
- Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
- if(axe)
- {
- float threat = 1000000.0f;
- if(axe->getVictim() && m_creature->getThreatManager().getThreat(axe->getVictim()))
- {
- threat = axe->getThreatManager().getThreat(axe->getVictim());
- axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100);
- }
- if(target)
- axe->AddThreat(target, threat);
- //axe->getThreatManager().tauntFadeOut(axe->getVictim());
- //axe->getThreatManager().tauntApply(target);
- }
- }
- }
- } else AxesTargetSwitchTimer -= diff;
-
- if(AmplifyDamageTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AMPLIFY_DAMAGE);
- AmplifyDamageTimer = 20000 + rand()%10000;
- }else AmplifyDamageTimer -= diff;
- }
-
- //Time for global and double timers
- if(InfernalTimer < diff)
- {
- SummonInfernal(diff);
- InfernalTimer = phase == 3 ? 15000 : 45000; //15 secs in phase 3, 45 otherwise
- }else InfernalTimer -= diff;
-
- if(ShadowNovaTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
- ShadowNovaTimer = phase == 3 ? 35000 : -1;
- }else ShadowNovaTimer -= diff;
-
- if(phase != 2)
- {
- if(SWPainTimer < diff)
- {
- Unit *target;
- if(phase == 1)
- target = m_creature->getVictim(); // the tank
- else //anyone but the tank
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- DoCast(target, SPELL_SW_PAIN);
- SWPainTimer = 20000;
- }else SWPainTimer -= diff;
- }
-
- if(phase != 3)
- {
- if(EnfeebleTimer < diff)
- {
- EnfeebleHealthEffect();
- EnfeebleTimer = 30000;
- ShadowNovaTimer = 5000;
- EnfeebleResetTimer = 9000;
- }else EnfeebleTimer -= diff;
- }
-
- if(phase==2)
- DoMeleeAttacksIfReady();
- else
- DoMeleeAttackIfReady();
- }
-
- void DoMeleeAttacksIfReady()
- {
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Check for base attack
- if( m_creature->isAttackReady() && m_creature->getVictim() )
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- //Check for offhand attack
- if( m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim() )
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
- m_creature->resetAttackTimer(OFF_ATTACK);
- }
- }
- }
-
- void Cleanup(Creature *infernal, InfernalPoint *point)
- {
- for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
- if(*itr == infernal->GetGUID())
- {
- infernals.erase(itr);
- break;
- }
-
- positions.push_back(point);
- }
-};
-
-void netherspite_infernalAI::Cleanup()
-{
- Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
-
- if(pMalchezaar && pMalchezaar->isAlive())
- ((boss_malchezaarAI*)((Creature*)pMalchezaar)->AI())->Cleanup(m_creature, point);
-}
-
-CreatureAI* GetAI_netherspite_infernal(Creature *_Creature)
-{
- return new netherspite_infernalAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_malchezaar(Creature *_Creature)
-{
- return new boss_malchezaarAI (_Creature);
-}
-
-void AddSC_netherspite_infernal()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="netherspite_infernal";
- newscript->GetAI = GetAI_netherspite_infernal;
- m_scripts[nrscripts++] = newscript;
-}
-
-void AddSC_boss_malchezaar()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_malchezaar";
- newscript->GetAI = GetAI_boss_malchezaar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Prince_Malchezzar
+SD%Complete: 100
+SDComment:
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO "Madness has brought you here to me. I shall be your undoing!"
+#define SOUND_AGGRO 9218
+#define SAY_SUMMON1 "You face not Malchezaar alone, but the legions I command!"
+#define SOUND_SUMMON1 9322
+#define SAY_SUMMON2 "All realities, all dimensions are open to me!"
+#define SOUND_SUMMON2 9224
+#define SAY_PHASE2 "Simple fools! Time is the fire in which you'll burn!"
+#define SOUND_PHASE2 9220
+#define SAY_PHASE3 "How can you hope to withstand against such overwhelming power?"
+#define SOUND_PHASE3 9321
+#define SAY_PDEATH1 "You are, but a plaything, unfit even to amuse."
+#define SOUND_PDEATH1 9319
+#define SAY_PDEATH2 "Your greed, your foolishness has brought you to this end."
+#define SOUND_PDEATH2 9318
+#define SAY_PDEATH3 "Surely you did not think you could win."
+#define SOUND_PDEATH3 9222
+#define SAY_DEATH "I refuse to concede defeat. I am a prince of the Eredar! I am..."
+#define SOUND_DEATH 9221
+
+// 19 Coordinates for Infernal spawns
+struct InfernalPoint
+{
+ float x,y;
+};
+
+#define INFERNAL_Z 275.5
+
+static InfernalPoint InfernalPoints[] =
+{
+ {-10922.8, -1985.2},
+ {-10916.2, -1996.2},
+ {-10932.2, -2008.1},
+ {-10948.8, -2022.1},
+ {-10958.7, -1997.7},
+ {-10971.5, -1997.5},
+ {-10990.8, -1995.1},
+ {-10989.8, -1976.5},
+ {-10971.6, -1973.0},
+ {-10955.5, -1974.0},
+ {-10939.6, -1969.8},
+ {-10958.0, -1952.2},
+ {-10941.7, -1954.8},
+ {-10943.1, -1988.5},
+ {-10948.8, -2005.1},
+ {-10984.0, -2019.3},
+ {-10932.8, -1979.6},
+ {-10932.8, -1979.6},
+ {-10935.7, -1996.0}
+};
+
+#define TOTAL_INFERNAL_POINTS 19
+
+//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends
+//Along with reducing healing and regen while enfeebled to 0%
+//This spell effect will only reduce healing
+
+#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2
+#define SPELL_ENFEEBLE_EFFECT 41624
+
+#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases
+#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though)
+#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2
+#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2
+#define SPELL_THRASH_AURA 3417 //Passive proc chance for thrash
+#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping
+#define SPELL_AMPLIFY_DAMAGE 12738 //Amplifiy during phase 3
+#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura
+#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature
+#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3
+
+#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects
+#define SPELL_INFERNAL_RELAY 30834
+
+#define AXE_EQUIP_MODEL 40066 //Axes info
+#define AXE_EQUIP_INFO 33448898
+
+//---------Infernal code first
+struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
+{
+ netherspite_infernalAI(Creature *c) : ScriptedAI(c) ,
+ malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {Reset();}
+
+ uint32 HellfireTimer;
+ uint32 CleanupTimer;
+ uint32 malchezaar;
+ InfernalPoint *point;
+
+ void Reset() {}
+ void Aggro(Unit *who) {}
+ void MoveInLineOfSight(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(HellfireTimer)
+ if(HellfireTimer <= diff)
+ {
+ DoCast(m_creature, SPELL_HELLFIRE);
+ HellfireTimer = 0;
+ }
+ else HellfireTimer -= diff;
+
+ if(CleanupTimer)
+ if(CleanupTimer <= diff)
+ {
+ Cleanup();
+ CleanupTimer = 0;
+ } else CleanupTimer -= diff;
+ }
+
+ void KilledUnit(Unit *who)
+ {
+ Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
+ if(pMalchezaar)
+ ((Creature*)pMalchezaar)->AI()->KilledUnit(who);
+ }
+
+ void SpellHit(Unit *who, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_INFERNAL_RELAY)
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ HellfireTimer = 4000;
+ CleanupTimer = 170000;
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() != malchezaar)
+ damage = 0;
+ }
+
+ void Cleanup(); //below ...
+};
+
+struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
+{
+ boss_malchezaarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 EnfeebleTimer;
+ uint32 EnfeebleResetTimer;
+ uint32 ShadowNovaTimer;
+ uint32 SWPainTimer;
+ uint32 SunderArmorTimer;
+ uint32 AmplifyDamageTimer;
+ uint32 InfernalTimer;
+ uint32 AxesTargetSwitchTimer;
+ uint32 InfernalCleanupTimer;
+
+ std::vector<uint64> infernals;
+ std::vector<InfernalPoint*> positions;
+
+ uint64 axes[2];
+ uint64 enfeeble_targets[5];
+ uint64 enfeeble_health[5];
+
+ uint32 phase;
+
+ void Reset()
+ {
+ AxesCleanup();
+ ClearWeapons();
+ InfernalCleanup();
+ positions.clear();
+
+ for(int i =0; i < 5; ++i)
+ enfeeble_targets[i] = 0;
+
+ for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
+ positions.push_back(&InfernalPoints[i]);
+
+ EnfeebleTimer = 30000;
+ EnfeebleResetTimer = 38000;
+ ShadowNovaTimer = 35000;
+ SWPainTimer = 20000;
+ AmplifyDamageTimer = 10000;
+ InfernalTimer = 45000;
+ InfernalCleanupTimer = 47000;
+ AxesTargetSwitchTimer = 7500 + rand()%12500;
+ phase = 1;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_PDEATH1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_PDEATH1);
+ break;
+ case 1:
+ DoYell(SAY_PDEATH2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_PDEATH2);
+ break;
+ case 2:
+ DoYell(SAY_PDEATH3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_PDEATH3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ AxesCleanup();
+ ClearWeapons();
+ InfernalCleanup();
+ positions.clear();
+
+ for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
+ positions.push_back(&InfernalPoints[i]);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void InfernalCleanup()
+ {
+ //Infernal Cleanup
+ for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
+ {
+ Unit *pInfernal = Unit::GetUnit(*m_creature, *itr);
+ if(pInfernal && pInfernal->isAlive())
+ {
+ pInfernal->SetVisibility(VISIBILITY_OFF);
+ pInfernal->setDeathState(JUST_DIED);
+ }
+ }
+ infernals.clear();
+ }
+
+ void AxesCleanup()
+ {
+ for(int i=0; i<2;++i)
+ {
+ Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
+ if(axe && axe->isAlive())
+ axe->DealDamage(axe, axe->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ axes[i] = 0;
+ }
+ }
+
+ void ClearWeapons()
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
+
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
+
+ //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);
+ }
+
+ void EnfeebleHealthEffect()
+ {
+ const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
+ if(!info)
+ return;
+
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::vector<Unit *> targets;
+
+ if(!t_list.size())
+ return;
+
+ //begin + 1 , so we don't target the one with the highest threat
+ std::list<HostilReference *>::iterator itr = t_list.begin();
+ std::advance(itr, 1);
+ for( ; itr!= t_list.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //only on alive players
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
+ targets.push_back( target);
+ }
+
+ //cut down to size if we have more than 5 targets
+ while(targets.size() > 5)
+ targets.erase(targets.begin()+rand()%targets.size());
+
+ int i = 0;
+ for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i)
+ {
+ Unit *target = *itr;
+ if(target)
+ {
+ enfeeble_targets[i] = target->GetGUID();
+ enfeeble_health[i] = target->GetHealth();
+
+ target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
+ target->SetHealth(1);
+ }
+ }
+
+ }
+
+ void EnfeebleResetHealth()
+ {
+ for(int i = 0; i < 5; ++i)
+ {
+ Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
+ if(target && target->isAlive())
+ target->SetHealth(enfeeble_health[i]);
+ enfeeble_targets[i] = 0;
+ enfeeble_health[i] = 0;
+ }
+ }
+
+ void SummonInfernal(const uint32 diff)
+ {
+ InfernalPoint *point = NULL;
+ float posX,posY,posZ;
+ if( (m_creature->GetMapId() != 532) || positions.empty())
+ {
+ m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ);
+ }
+ else
+ {
+ std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
+ point = *itr;
+ positions.erase(itr);
+
+ posX = point->x;
+ posY = point->y;
+ posZ = INFERNAL_Z;
+ }
+
+ Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
+
+ if (Infernal)
+ {
+ Infernal->SetUInt32Value(UNIT_FIELD_DISPLAYID, INFERNAL_MODEL_INVISIBLE);
+ Infernal->setFaction(m_creature->getFaction());
+ if(point)
+ ((netherspite_infernalAI*)Infernal->AI())->point=point;
+ ((netherspite_infernalAI*)Infernal->AI())->malchezaar=m_creature->GetGUID();
+
+ infernals.push_back(Infernal->GetGUID());
+ DoCast(Infernal, SPELL_INFERNAL_RELAY);
+ }
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
+ break;
+ case 1:
+ DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(EnfeebleResetTimer)
+ if(EnfeebleResetTimer <= diff) //Let's not forget to reset that
+ {
+ EnfeebleResetHealth();
+ EnfeebleResetTimer=0;
+ }else EnfeebleResetTimer -= diff;
+
+ if(m_creature->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(phase == 1)
+ {
+ if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+
+ phase = 2;
+
+ //animation
+ DoCast(m_creature, SPELL_EQUIP_AXES);
+
+ //text
+ DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE2);
+
+ //passive thrash aura
+ m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true);
+
+ //models
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
+
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, AXE_EQUIP_MODEL);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO);
+
+ //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);
+
+ m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
+ m_creature->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);
+
+ m_creature->SetAttackTime(OFF_ATTACK, (((uint32)m_creature->GetAttackTime(BASE_ATTACK)/1.5)));
+ }
+ }
+ else if(phase == 2)
+ {
+ if( (m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
+ {
+ InfernalTimer = 15000;
+
+ phase = 3;
+
+ ClearWeapons();
+
+ //remove thrash
+ m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
+
+ DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE3);
+
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ for(uint32 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);
+ if(axe)
+ {
+ axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
+ axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
+
+ axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ axe->setFaction(m_creature->getFaction());
+ axes[i] = axe->GetGUID();
+ if(target)
+ {
+ axe->AI()->AttackStart(target);
+ // axe->getThreatManager().tauntApply(target); //Taunt Apply and fade out does not work properly
+ // So we'll use a hack to add a lot of threat to our target
+ axe->AddThreat(target, 10000000.0f);
+ }
+ }
+ }
+
+ if(ShadowNovaTimer > 35000)
+ ShadowNovaTimer = EnfeebleTimer + 5000;
+
+ return;
+ }
+
+ if(SunderArmorTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
+ SunderArmorTimer = 15000;
+
+ }else SunderArmorTimer -= diff;
+ }
+ else
+ {
+ if(AxesTargetSwitchTimer < diff)
+ {
+ AxesTargetSwitchTimer = 7500 + rand()%12500 ;
+
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ for(int i = 0; i < 2; ++i)
+ {
+ Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
+ if(axe)
+ {
+ float threat = 1000000.0f;
+ if(axe->getVictim() && m_creature->getThreatManager().getThreat(axe->getVictim()))
+ {
+ threat = axe->getThreatManager().getThreat(axe->getVictim());
+ axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100);
+ }
+ if(target)
+ axe->AddThreat(target, threat);
+ //axe->getThreatManager().tauntFadeOut(axe->getVictim());
+ //axe->getThreatManager().tauntApply(target);
+ }
+ }
+ }
+ } else AxesTargetSwitchTimer -= diff;
+
+ if(AmplifyDamageTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AMPLIFY_DAMAGE);
+ AmplifyDamageTimer = 20000 + rand()%10000;
+ }else AmplifyDamageTimer -= diff;
+ }
+
+ //Time for global and double timers
+ if(InfernalTimer < diff)
+ {
+ SummonInfernal(diff);
+ InfernalTimer = phase == 3 ? 15000 : 45000; //15 secs in phase 3, 45 otherwise
+ }else InfernalTimer -= diff;
+
+ if(ShadowNovaTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
+ ShadowNovaTimer = phase == 3 ? 35000 : -1;
+ }else ShadowNovaTimer -= diff;
+
+ if(phase != 2)
+ {
+ if(SWPainTimer < diff)
+ {
+ Unit *target;
+ if(phase == 1)
+ target = m_creature->getVictim(); // the tank
+ else //anyone but the tank
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ DoCast(target, SPELL_SW_PAIN);
+ SWPainTimer = 20000;
+ }else SWPainTimer -= diff;
+ }
+
+ if(phase != 3)
+ {
+ if(EnfeebleTimer < diff)
+ {
+ EnfeebleHealthEffect();
+ EnfeebleTimer = 30000;
+ ShadowNovaTimer = 5000;
+ EnfeebleResetTimer = 9000;
+ }else EnfeebleTimer -= diff;
+ }
+
+ if(phase==2)
+ DoMeleeAttacksIfReady();
+ else
+ DoMeleeAttackIfReady();
+ }
+
+ void DoMeleeAttacksIfReady()
+ {
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Check for base attack
+ if( m_creature->isAttackReady() && m_creature->getVictim() )
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ //Check for offhand attack
+ if( m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim() )
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
+ m_creature->resetAttackTimer(OFF_ATTACK);
+ }
+ }
+ }
+
+ void Cleanup(Creature *infernal, InfernalPoint *point)
+ {
+ for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
+ if(*itr == infernal->GetGUID())
+ {
+ infernals.erase(itr);
+ break;
+ }
+
+ positions.push_back(point);
+ }
+};
+
+void netherspite_infernalAI::Cleanup()
+{
+ Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
+
+ if(pMalchezaar && pMalchezaar->isAlive())
+ ((boss_malchezaarAI*)((Creature*)pMalchezaar)->AI())->Cleanup(m_creature, point);
+}
+
+CreatureAI* GetAI_netherspite_infernal(Creature *_Creature)
+{
+ return new netherspite_infernalAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_malchezaar(Creature *_Creature)
+{
+ return new boss_malchezaarAI (_Creature);
+}
+
+void AddSC_netherspite_infernal()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="netherspite_infernal";
+ newscript->GetAI = GetAI_netherspite_infernal;
+ m_scripts[nrscripts++] = newscript;
+}
+
+void AddSC_boss_malchezaar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_malchezaar";
+ newscript->GetAI = GetAI_boss_malchezaar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
index bcef28e9fa0..20cdb5b2d7d 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
@@ -1,673 +1,673 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shade_of_Aran
-SD%Complete: 95
-SDComment: Flame wreath missing cast animation, mods won't triggere. Drinking may cause client crash (core related)
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-#include "../../creature/simple_ai.h"
-#include "def_karazhan.h"
-#include "GameObject.h"
-
-//Aggro
-#define SAY_AGGRO1 "Please, no more. My son... he's gone mad!"
-#define SOUND_AGGRO1 9241
-
-#define SAY_AGGRO2 "I'll not be tortured again!"
-#define SOUND_AGGRO2 9323
-
-#define SAY_AGGRO3 "Who are you? What do you want? Stay away from me!"
-#define SOUND_AGGRO3 9324
-
-//Flame Wreath
-#define SAY_FLAMEWREATH1 "I'll show you this beaten dog still has some teeth!"
-#define SOUND_FLAMEWREATH1 9245
-#define SAY_FLAMEWREATH2 "Burn you hellish fiends!"
-#define SOUND_FLAMEWREATH2 9326
-
-//Blizzard
-#define SAY_BLIZZARD1 "I'll freeze you all!"
-#define SOUND_BLIZZARD1 9246
-#define SAY_BLIZZARD2 "Back to the cold dark with you!"
-#define SOUND_BLIZZARD2 9327
-
-//Arcane Explosion
-#define SAY_EXPLOSION1 "Yes, yes, my son is quite powerful... but I have powers of my own!"
-#define SOUND_EXPLOSION1 9242
-#define SAY_EXPLOSION2 "I am not some simple jester! I am Nielas Aran!"
-#define SOUND_EXPLOSION2 9325
-
-//Low Mana / AoE Pyroblast
-#define SAY_DRINK "Surely you would not deny an old man a replenishing drink? No, no I thought not."
-#define SOUND_DRINK 9248
-
-//Summon Water Elementals
-#define SAY_ELEMENTALS "I'm not finished yet! No, I have a few more tricks up me sleeve."
-#define SOUND_ELEMENTALS 9251
-
-//Player Death
-#define SAY_KILL1 "I want this nightmare to be over!"
-#define SOUND_KILL1 9250
-
-#define SAY_KILL2 "Torment me no more!"
-#define SOUND_KILL2 9328
-
-//Time over
-#define SAY_TIMEOVER "You've wasted enough of my time. Let these games be finished!"
-#define SOUND_TIMEOVER 9247
-
-//Aran's death
-#define SAY_DEATH "At last... The nightmare is.. over..."
-#define SOUND_DEATH 9244
-
-//Atiesh is equipped by a raid member
-#define SAY_ATIESH "Where did you get that?! Did HE send you?!"
-#define SOUND_ATIESH 9249
-
-//Spells
-#define SPELL_FROSTBOLT 29954
-#define SPELL_FIREBALL 29953
-#define SPELL_ARCMISSLE 29955
-#define SPELL_CHAINSOFICE 29991
-#define SPELL_DRAGONSBREATH 29964
-#define SPELL_MASSSLOW 30035
-#define SPELL_FLAME_WREATH 29946
-#define SPELL_AOE_CS 29961
-#define SPELL_PLAYERPULL 32265
-#define SPELL_AEXPLOSION 29973
-#define SPELL_MASS_POLY 29963
-#define SPELL_BLINK_CENTER 29967
-#define SPELL_ELEMENTALS 29962
-#define SPELL_CONJURE 29975
-#define SPELL_DRINK 30024
-#define SPELL_POTION 32453
-#define SPELL_AOE_PYROBLAST 29978
-
-//Creature Spells
-#define SPELL_CIRCULAR_BLIZZARD 29951 //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds
-#define SPELL_WATERBOLT 31012
-#define SPELL_SHADOW_PYRO 29978
-
-//Creatures
-#define CREATURE_WATER_ELEMENTAL 17167
-#define CREATURE_SHADOW_OF_ARAN 18254
-#define CREATURE_ARAN_BLIZZARD 17161
-
-enum SuperSpell
-{
- SUPER_FLAME = 0,
- SUPER_BLIZZARD,
- SUPER_AE,
-};
-
-struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
-{
- boss_aranAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 SecondarySpellTimer;
- uint32 NormalCastTimer;
- uint32 SuperCastTimer;
- uint32 BerserkTimer;
- uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
-
- uint8 LastSuperSpell;
-
- uint32 FlameWreathTimer;
- uint32 FlameWreathCheckTime;
- uint64 FlameWreathTarget[3];
- float FWTargPosX[3];
- float FWTargPosY[3];
-
- uint32 CurrentNormalSpell;
- uint32 ArcaneCooldown;
- uint32 FireCooldown;
- uint32 FrostCooldown;
-
- uint32 DrinkInturruptTimer;
-
- bool ElementalsSpawned;
- bool Drinking;
- bool DrinkInturrupted;
-
- void Reset()
- {
- SecondarySpellTimer = 5000;
- NormalCastTimer = 0;
- SuperCastTimer = 35000;
- BerserkTimer = 720000;
- CloseDoorTimer = 15000;
-
- LastSuperSpell = rand()%3;
-
- FlameWreathTimer = 0;
- FlameWreathCheckTime = 0;
-
- CurrentNormalSpell = 0;
- ArcaneCooldown = 0;
- FireCooldown = 0;
- FrostCooldown = 0;
-
- DrinkInturruptTimer = 10000;
-
- ElementalsSpawned = false;
- Drinking = false;
- DrinkInturrupted = false;
-
- if(pInstance)
- {
- // Not in progress
- pInstance->SetData(DATA_SHADEOFARAN_EVENT, NOT_STARTED);
-
- if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
- Door->SetGoState(0);
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_KILL1);
- break;
- case 1:
- DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_KILL2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(NULL, SOUND_DEATH);
-
- if(pInstance)
- {
- pInstance->SetData(DATA_SHADEOFARAN_EVENT, DONE);
- if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
- Door->SetGoState(0);
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
-
- if(pInstance)
- pInstance->SetData(DATA_SHADEOFARAN_EVENT, IN_PROGRESS);
- }
-
- void FlameWreathEffect()
- {
- std::vector<Unit*> targets;
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
-
- if(!t_list.size())
- return;
-
- //store the threat list in a different container
- for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //only on alive players
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
- targets.push_back( target);
- }
-
- //cut down to size if we have more than 3 targets
- while(targets.size() > 3)
- targets.erase(targets.begin()+rand()%targets.size());
-
- uint32 i = 0;
- for(std::vector<Unit*>::iterator itr = targets.begin(); itr!= targets.end(); ++itr)
- {
- if(*itr)
- {
- FlameWreathTarget[i] = (*itr)->GetGUID();
- FWTargPosX[i] = (*itr)->GetPositionX();
- FWTargPosY[i] = (*itr)->GetPositionY();
- m_creature->CastSpell((*itr), SPELL_FLAME_WREATH, true);
- i++;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(CloseDoorTimer)
- if(CloseDoorTimer <= diff)
- {
- if(pInstance)
- if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
- Door->SetGoState(1);
- CloseDoorTimer = 0;
- }
- else CloseDoorTimer -= diff;
-
- //Cooldowns for casts
- if (ArcaneCooldown)
- if (ArcaneCooldown >= diff)
- ArcaneCooldown -= diff;
- else ArcaneCooldown = 0;
-
- if (FireCooldown)
- if (FireCooldown >= diff)
- FireCooldown -= diff;
- else FireCooldown = 0;
-
- if (FrostCooldown)
- if (FrostCooldown >= diff)
- FrostCooldown -= diff;
- else FrostCooldown = 0;
-
- if(!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20)
- {
- Drinking = true;
- m_creature->InterruptNonMeleeSpells(false);
-
- DoYell(SAY_DRINK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DRINK);
-
- if (!DrinkInturrupted)
- {
- m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true);
- m_creature->CastSpell(m_creature, SPELL_CONJURE, false);
- m_creature->CastSpell(m_creature, SPELL_DRINK, false);
- //Sitting down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1);
- DrinkInturruptTimer = 10000;
- }
- }
-
- //Drink Inturrupt
- if (Drinking && DrinkInturrupted)
- {
- Drinking = false;
- m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
- m_creature->CastSpell(m_creature, SPELL_POTION, false);
- }
-
- //Drink Inturrupt Timer
- if (Drinking && !DrinkInturrupted)
- if (DrinkInturruptTimer >= diff)
- DrinkInturruptTimer -= diff;
- else
- {
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->CastSpell(m_creature, SPELL_POTION, true);
- m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false);
- DrinkInturrupted = true;
- Drinking = false;
- }
-
- //Don't execute any more code if we are drinking
- if (Drinking)
- return;
-
- //Normal casts
- if(NormalCastTimer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!target)
- return;
-
- uint32 Spells[3];
- uint8 AvailableSpells = 0;
-
- //Check for what spells are not on cooldown
- if (!ArcaneCooldown)
- {
- Spells[AvailableSpells] = SPELL_ARCMISSLE;
- AvailableSpells++;
- }
- if (!FireCooldown)
- {
- Spells[AvailableSpells] = SPELL_FIREBALL;
- AvailableSpells++;
- }
- if (!FrostCooldown)
- {
- Spells[AvailableSpells] = SPELL_FROSTBOLT;
- AvailableSpells++;
- }
-
- //If no available spells wait 1 second and try again
- if (AvailableSpells)
- {
- CurrentNormalSpell = Spells[rand() % AvailableSpells];
- DoCast(target, CurrentNormalSpell);
- }
- }
- NormalCastTimer = 1000;
- }else NormalCastTimer -= diff;
-
- if(SecondarySpellTimer < diff)
- {
- switch (rand()%2)
- {
-
- case 0:
- DoCast(m_creature, SPELL_AOE_CS);
- break;
- case 1:
- Unit* pUnit;
- pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pUnit)
- DoCast(pUnit, SPELL_CHAINSOFICE);
- break;
- }
- SecondarySpellTimer = 5000 + (rand()%15000);
- }else SecondarySpellTimer -= diff;
-
- if(SuperCastTimer < diff)
- {
- uint8 Available[2];
-
- switch (LastSuperSpell)
- {
- case SUPER_AE:
- Available[0] = SUPER_FLAME;
- Available[1] = SUPER_BLIZZARD;
- break;
- case SUPER_FLAME:
- Available[0] = SUPER_AE;
- Available[1] = SUPER_BLIZZARD;
- break;
- case SUPER_BLIZZARD:
- Available[0] = SUPER_FLAME;
- Available[1] = SUPER_AE;
- break;
- }
-
- LastSuperSpell = Available[rand()%2];
-
- switch (LastSuperSpell)
- {
- case SUPER_AE:
-
- if (rand()%2)
- {
- DoYell(SAY_EXPLOSION1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EXPLOSION1);
- }else
- {
- DoYell(SAY_EXPLOSION2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EXPLOSION2);
- }
-
- m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true);
- m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true);
- m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true);
- m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false);
- break;
-
- case SUPER_FLAME:
- if (rand()%2)
- {
- DoYell(SAY_FLAMEWREATH1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FLAMEWREATH1);
- }else
- {
- DoYell(SAY_FLAMEWREATH2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FLAMEWREATH2);
- }
-
- FlameWreathTimer = 20000;
- FlameWreathCheckTime = 500;
-
- FlameWreathTarget[0] = 0;
- FlameWreathTarget[1] = 0;
- FlameWreathTarget[2] = 0;
-
- FlameWreathEffect();
- break;
-
- case SUPER_BLIZZARD:
-
- if (rand()%2)
- {
- DoYell(SAY_BLIZZARD1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BLIZZARD1);
- }else
- {
- DoYell(SAY_BLIZZARD2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BLIZZARD2);
- }
-
- Creature* Spawn = NULL;
- Spawn = DoSpawnCreature(CREATURE_ARAN_BLIZZARD, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 25000);
- if (Spawn)
- {
- Spawn->setFaction(m_creature->getFaction());
- Spawn->CastSpell(Spawn, SPELL_CIRCULAR_BLIZZARD, false);
- }
- break;
- }
-
- SuperCastTimer = 35000 + (rand()%5000);
- }else SuperCastTimer -= diff;
-
- if(!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
- {
- ElementalsSpawned = true;
-
- for (uint32 i = 0; i < 4; i++)
- {
- Creature* pUnit = DoSpawnCreature(CREATURE_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 90000);
- if (pUnit)
- {
- pUnit->Attack(m_creature->getVictim(), true);
- pUnit->setFaction(m_creature->getFaction());
- }
- }
-
- DoYell(SAY_ELEMENTALS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ELEMENTALS);
- }
-
- if(BerserkTimer < diff)
- {
- for (uint32 i = 0; i < 5; i++)
- {
- Creature* pUnit = DoSpawnCreature(CREATURE_SHADOW_OF_ARAN, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (pUnit)
- {
- pUnit->Attack(m_creature->getVictim(), true);
- pUnit->setFaction(m_creature->getFaction());
- }
- }
-
- DoYell(SAY_TIMEOVER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TIMEOVER);
-
- BerserkTimer = 60000;
- }else BerserkTimer -= diff;
-
- //Flame Wreath check
- if (FlameWreathTimer)
- {
- if (FlameWreathTimer >= diff)
- FlameWreathTimer -= diff;
- else FlameWreathTimer = 0;
-
- if (FlameWreathCheckTime < diff)
- {
- for (uint32 i = 0; i < 3; i++)
- {
- if (!FlameWreathTarget[i])
- continue;
-
- Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]);
- if (pUnit && pUnit->GetDistance2d(FWTargPosX[i], FWTargPosY[i]) > 3)
- {
- pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->GetGUID());
- pUnit->CastSpell(pUnit, 11027, true);
- FlameWreathTarget[i] = 0;
- }
- }
- FlameWreathCheckTime = 500;
- }else FlameWreathCheckTime -= diff;
- }
-
- if (ArcaneCooldown && FireCooldown && FrostCooldown)
- DoMeleeAttackIfReady();
- }
-
- void DamageTaken(Unit* pAttacker, uint32 &damage)
- {
- if (!DrinkInturrupted && Drinking && damage)
- DrinkInturrupted = true;
- }
-
- void SpellHit(Unit* pAttacker, const SpellEntry* Spell)
- {
- //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))
- return;
-
- //Inturrupt effect
- m_creature->InterruptNonMeleeSpells(false);
-
- //Normally we would set the cooldown equal to the spell duration
- //but we do not have access to the DurationStore
-
- switch (CurrentNormalSpell)
- {
- case SPELL_ARCMISSLE:
- ArcaneCooldown = 5000;
- break;
- case SPELL_FIREBALL:
- FireCooldown = 5000;
- break;
- case SPELL_FROSTBOLT:
- FrostCooldown = 5000;
- break;
- }
- }
-};
-
-struct TRINITY_DLL_DECL water_elementalAI : public ScriptedAI
-{
- water_elementalAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CastTimer;
-
- void Reset()
- {
- CastTimer = 2000 + (rand()%3000);
- }
-
- void Aggro(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(CastTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
- CastTimer = 2000 + (rand()%3000);
- }else CastTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_aran(Creature *_Creature)
-{
- return new boss_aranAI (_Creature);
-}
-
-CreatureAI* GetAI_water_elemental(Creature *_Creature)
-{
- return new water_elementalAI (_Creature);
-}
-
-// CONVERT TO ACID
-CreatureAI* GetAI_shadow_of_aran(Creature *_Creature)
-{
- outstring_log("SD2: Convert simpleAI script for Creature Entry %u to ACID", _Creature->GetEntry());
- SimpleAI* ai = new SimpleAI (_Creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
- ai->Spell[0].Cooldown = 5000;
- ai->Spell[0].First_Cast = 1000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-void AddSC_boss_shade_of_aran()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_shade_of_aran";
- newscript->GetAI = GetAI_boss_aran;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_shadow_of_aran";
- newscript->GetAI = GetAI_shadow_of_aran;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_aran_elemental";
- newscript->GetAI = GetAI_water_elemental;
- m_scripts[nrscripts++] = newscript;
-
- //newscript = new Script;
- //newscript->Name="mob_aran_blizzard";
- //newscript->GetAI = GetAI_boss_aran;
- //m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shade_of_Aran
+SD%Complete: 95
+SDComment: Flame wreath missing cast animation, mods won't triggere. Drinking may cause client crash (core related)
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+#include "../../creature/simple_ai.h"
+#include "def_karazhan.h"
+#include "GameObject.h"
+
+//Aggro
+#define SAY_AGGRO1 "Please, no more. My son... he's gone mad!"
+#define SOUND_AGGRO1 9241
+
+#define SAY_AGGRO2 "I'll not be tortured again!"
+#define SOUND_AGGRO2 9323
+
+#define SAY_AGGRO3 "Who are you? What do you want? Stay away from me!"
+#define SOUND_AGGRO3 9324
+
+//Flame Wreath
+#define SAY_FLAMEWREATH1 "I'll show you this beaten dog still has some teeth!"
+#define SOUND_FLAMEWREATH1 9245
+#define SAY_FLAMEWREATH2 "Burn you hellish fiends!"
+#define SOUND_FLAMEWREATH2 9326
+
+//Blizzard
+#define SAY_BLIZZARD1 "I'll freeze you all!"
+#define SOUND_BLIZZARD1 9246
+#define SAY_BLIZZARD2 "Back to the cold dark with you!"
+#define SOUND_BLIZZARD2 9327
+
+//Arcane Explosion
+#define SAY_EXPLOSION1 "Yes, yes, my son is quite powerful... but I have powers of my own!"
+#define SOUND_EXPLOSION1 9242
+#define SAY_EXPLOSION2 "I am not some simple jester! I am Nielas Aran!"
+#define SOUND_EXPLOSION2 9325
+
+//Low Mana / AoE Pyroblast
+#define SAY_DRINK "Surely you would not deny an old man a replenishing drink? No, no I thought not."
+#define SOUND_DRINK 9248
+
+//Summon Water Elementals
+#define SAY_ELEMENTALS "I'm not finished yet! No, I have a few more tricks up me sleeve."
+#define SOUND_ELEMENTALS 9251
+
+//Player Death
+#define SAY_KILL1 "I want this nightmare to be over!"
+#define SOUND_KILL1 9250
+
+#define SAY_KILL2 "Torment me no more!"
+#define SOUND_KILL2 9328
+
+//Time over
+#define SAY_TIMEOVER "You've wasted enough of my time. Let these games be finished!"
+#define SOUND_TIMEOVER 9247
+
+//Aran's death
+#define SAY_DEATH "At last... The nightmare is.. over..."
+#define SOUND_DEATH 9244
+
+//Atiesh is equipped by a raid member
+#define SAY_ATIESH "Where did you get that?! Did HE send you?!"
+#define SOUND_ATIESH 9249
+
+//Spells
+#define SPELL_FROSTBOLT 29954
+#define SPELL_FIREBALL 29953
+#define SPELL_ARCMISSLE 29955
+#define SPELL_CHAINSOFICE 29991
+#define SPELL_DRAGONSBREATH 29964
+#define SPELL_MASSSLOW 30035
+#define SPELL_FLAME_WREATH 29946
+#define SPELL_AOE_CS 29961
+#define SPELL_PLAYERPULL 32265
+#define SPELL_AEXPLOSION 29973
+#define SPELL_MASS_POLY 29963
+#define SPELL_BLINK_CENTER 29967
+#define SPELL_ELEMENTALS 29962
+#define SPELL_CONJURE 29975
+#define SPELL_DRINK 30024
+#define SPELL_POTION 32453
+#define SPELL_AOE_PYROBLAST 29978
+
+//Creature Spells
+#define SPELL_CIRCULAR_BLIZZARD 29951 //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds
+#define SPELL_WATERBOLT 31012
+#define SPELL_SHADOW_PYRO 29978
+
+//Creatures
+#define CREATURE_WATER_ELEMENTAL 17167
+#define CREATURE_SHADOW_OF_ARAN 18254
+#define CREATURE_ARAN_BLIZZARD 17161
+
+enum SuperSpell
+{
+ SUPER_FLAME = 0,
+ SUPER_BLIZZARD,
+ SUPER_AE,
+};
+
+struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
+{
+ boss_aranAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 SecondarySpellTimer;
+ uint32 NormalCastTimer;
+ uint32 SuperCastTimer;
+ uint32 BerserkTimer;
+ uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
+
+ uint8 LastSuperSpell;
+
+ uint32 FlameWreathTimer;
+ uint32 FlameWreathCheckTime;
+ uint64 FlameWreathTarget[3];
+ float FWTargPosX[3];
+ float FWTargPosY[3];
+
+ uint32 CurrentNormalSpell;
+ uint32 ArcaneCooldown;
+ uint32 FireCooldown;
+ uint32 FrostCooldown;
+
+ uint32 DrinkInturruptTimer;
+
+ bool ElementalsSpawned;
+ bool Drinking;
+ bool DrinkInturrupted;
+
+ void Reset()
+ {
+ SecondarySpellTimer = 5000;
+ NormalCastTimer = 0;
+ SuperCastTimer = 35000;
+ BerserkTimer = 720000;
+ CloseDoorTimer = 15000;
+
+ LastSuperSpell = rand()%3;
+
+ FlameWreathTimer = 0;
+ FlameWreathCheckTime = 0;
+
+ CurrentNormalSpell = 0;
+ ArcaneCooldown = 0;
+ FireCooldown = 0;
+ FrostCooldown = 0;
+
+ DrinkInturruptTimer = 10000;
+
+ ElementalsSpawned = false;
+ Drinking = false;
+ DrinkInturrupted = false;
+
+ if(pInstance)
+ {
+ // Not in progress
+ pInstance->SetData(DATA_SHADEOFARAN_EVENT, NOT_STARTED);
+
+ if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
+ Door->SetGoState(0);
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_KILL2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(NULL, SOUND_DEATH);
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_SHADEOFARAN_EVENT, DONE);
+ if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
+ Door->SetGoState(0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+
+ if(pInstance)
+ pInstance->SetData(DATA_SHADEOFARAN_EVENT, IN_PROGRESS);
+ }
+
+ void FlameWreathEffect()
+ {
+ std::vector<Unit*> targets;
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+
+ if(!t_list.size())
+ return;
+
+ //store the threat list in a different container
+ for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //only on alive players
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
+ targets.push_back( target);
+ }
+
+ //cut down to size if we have more than 3 targets
+ while(targets.size() > 3)
+ targets.erase(targets.begin()+rand()%targets.size());
+
+ uint32 i = 0;
+ for(std::vector<Unit*>::iterator itr = targets.begin(); itr!= targets.end(); ++itr)
+ {
+ if(*itr)
+ {
+ FlameWreathTarget[i] = (*itr)->GetGUID();
+ FWTargPosX[i] = (*itr)->GetPositionX();
+ FWTargPosY[i] = (*itr)->GetPositionY();
+ m_creature->CastSpell((*itr), SPELL_FLAME_WREATH, true);
+ i++;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(CloseDoorTimer)
+ if(CloseDoorTimer <= diff)
+ {
+ if(pInstance)
+ if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR)))
+ Door->SetGoState(1);
+ CloseDoorTimer = 0;
+ }
+ else CloseDoorTimer -= diff;
+
+ //Cooldowns for casts
+ if (ArcaneCooldown)
+ if (ArcaneCooldown >= diff)
+ ArcaneCooldown -= diff;
+ else ArcaneCooldown = 0;
+
+ if (FireCooldown)
+ if (FireCooldown >= diff)
+ FireCooldown -= diff;
+ else FireCooldown = 0;
+
+ if (FrostCooldown)
+ if (FrostCooldown >= diff)
+ FrostCooldown -= diff;
+ else FrostCooldown = 0;
+
+ if(!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20)
+ {
+ Drinking = true;
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoYell(SAY_DRINK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DRINK);
+
+ if (!DrinkInturrupted)
+ {
+ m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true);
+ m_creature->CastSpell(m_creature, SPELL_CONJURE, false);
+ m_creature->CastSpell(m_creature, SPELL_DRINK, false);
+ //Sitting down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1);
+ DrinkInturruptTimer = 10000;
+ }
+ }
+
+ //Drink Inturrupt
+ if (Drinking && DrinkInturrupted)
+ {
+ Drinking = false;
+ m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
+ m_creature->CastSpell(m_creature, SPELL_POTION, false);
+ }
+
+ //Drink Inturrupt Timer
+ if (Drinking && !DrinkInturrupted)
+ if (DrinkInturruptTimer >= diff)
+ DrinkInturruptTimer -= diff;
+ else
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->CastSpell(m_creature, SPELL_POTION, true);
+ m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false);
+ DrinkInturrupted = true;
+ Drinking = false;
+ }
+
+ //Don't execute any more code if we are drinking
+ if (Drinking)
+ return;
+
+ //Normal casts
+ if(NormalCastTimer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (!target)
+ return;
+
+ uint32 Spells[3];
+ uint8 AvailableSpells = 0;
+
+ //Check for what spells are not on cooldown
+ if (!ArcaneCooldown)
+ {
+ Spells[AvailableSpells] = SPELL_ARCMISSLE;
+ AvailableSpells++;
+ }
+ if (!FireCooldown)
+ {
+ Spells[AvailableSpells] = SPELL_FIREBALL;
+ AvailableSpells++;
+ }
+ if (!FrostCooldown)
+ {
+ Spells[AvailableSpells] = SPELL_FROSTBOLT;
+ AvailableSpells++;
+ }
+
+ //If no available spells wait 1 second and try again
+ if (AvailableSpells)
+ {
+ CurrentNormalSpell = Spells[rand() % AvailableSpells];
+ DoCast(target, CurrentNormalSpell);
+ }
+ }
+ NormalCastTimer = 1000;
+ }else NormalCastTimer -= diff;
+
+ if(SecondarySpellTimer < diff)
+ {
+ switch (rand()%2)
+ {
+
+ case 0:
+ DoCast(m_creature, SPELL_AOE_CS);
+ break;
+ case 1:
+ Unit* pUnit;
+ pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pUnit)
+ DoCast(pUnit, SPELL_CHAINSOFICE);
+ break;
+ }
+ SecondarySpellTimer = 5000 + (rand()%15000);
+ }else SecondarySpellTimer -= diff;
+
+ if(SuperCastTimer < diff)
+ {
+ uint8 Available[2];
+
+ switch (LastSuperSpell)
+ {
+ case SUPER_AE:
+ Available[0] = SUPER_FLAME;
+ Available[1] = SUPER_BLIZZARD;
+ break;
+ case SUPER_FLAME:
+ Available[0] = SUPER_AE;
+ Available[1] = SUPER_BLIZZARD;
+ break;
+ case SUPER_BLIZZARD:
+ Available[0] = SUPER_FLAME;
+ Available[1] = SUPER_AE;
+ break;
+ }
+
+ LastSuperSpell = Available[rand()%2];
+
+ switch (LastSuperSpell)
+ {
+ case SUPER_AE:
+
+ if (rand()%2)
+ {
+ DoYell(SAY_EXPLOSION1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EXPLOSION1);
+ }else
+ {
+ DoYell(SAY_EXPLOSION2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EXPLOSION2);
+ }
+
+ m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true);
+ m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true);
+ m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true);
+ m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false);
+ break;
+
+ case SUPER_FLAME:
+ if (rand()%2)
+ {
+ DoYell(SAY_FLAMEWREATH1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FLAMEWREATH1);
+ }else
+ {
+ DoYell(SAY_FLAMEWREATH2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FLAMEWREATH2);
+ }
+
+ FlameWreathTimer = 20000;
+ FlameWreathCheckTime = 500;
+
+ FlameWreathTarget[0] = 0;
+ FlameWreathTarget[1] = 0;
+ FlameWreathTarget[2] = 0;
+
+ FlameWreathEffect();
+ break;
+
+ case SUPER_BLIZZARD:
+
+ if (rand()%2)
+ {
+ DoYell(SAY_BLIZZARD1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BLIZZARD1);
+ }else
+ {
+ DoYell(SAY_BLIZZARD2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BLIZZARD2);
+ }
+
+ Creature* Spawn = NULL;
+ Spawn = DoSpawnCreature(CREATURE_ARAN_BLIZZARD, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 25000);
+ if (Spawn)
+ {
+ Spawn->setFaction(m_creature->getFaction());
+ Spawn->CastSpell(Spawn, SPELL_CIRCULAR_BLIZZARD, false);
+ }
+ break;
+ }
+
+ SuperCastTimer = 35000 + (rand()%5000);
+ }else SuperCastTimer -= diff;
+
+ if(!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
+ {
+ ElementalsSpawned = true;
+
+ for (uint32 i = 0; i < 4; i++)
+ {
+ Creature* pUnit = DoSpawnCreature(CREATURE_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 90000);
+ if (pUnit)
+ {
+ pUnit->Attack(m_creature->getVictim(), true);
+ pUnit->setFaction(m_creature->getFaction());
+ }
+ }
+
+ DoYell(SAY_ELEMENTALS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ELEMENTALS);
+ }
+
+ if(BerserkTimer < diff)
+ {
+ for (uint32 i = 0; i < 5; i++)
+ {
+ Creature* pUnit = DoSpawnCreature(CREATURE_SHADOW_OF_ARAN, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if (pUnit)
+ {
+ pUnit->Attack(m_creature->getVictim(), true);
+ pUnit->setFaction(m_creature->getFaction());
+ }
+ }
+
+ DoYell(SAY_TIMEOVER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TIMEOVER);
+
+ BerserkTimer = 60000;
+ }else BerserkTimer -= diff;
+
+ //Flame Wreath check
+ if (FlameWreathTimer)
+ {
+ if (FlameWreathTimer >= diff)
+ FlameWreathTimer -= diff;
+ else FlameWreathTimer = 0;
+
+ if (FlameWreathCheckTime < diff)
+ {
+ for (uint32 i = 0; i < 3; i++)
+ {
+ if (!FlameWreathTarget[i])
+ continue;
+
+ Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]);
+ if (pUnit && pUnit->GetDistance2d(FWTargPosX[i], FWTargPosY[i]) > 3)
+ {
+ pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, 11027, true);
+ FlameWreathTarget[i] = 0;
+ }
+ }
+ FlameWreathCheckTime = 500;
+ }else FlameWreathCheckTime -= diff;
+ }
+
+ if (ArcaneCooldown && FireCooldown && FrostCooldown)
+ DoMeleeAttackIfReady();
+ }
+
+ void DamageTaken(Unit* pAttacker, uint32 &damage)
+ {
+ if (!DrinkInturrupted && Drinking && damage)
+ DrinkInturrupted = true;
+ }
+
+ void SpellHit(Unit* pAttacker, const SpellEntry* Spell)
+ {
+ //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))
+ return;
+
+ //Inturrupt effect
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Normally we would set the cooldown equal to the spell duration
+ //but we do not have access to the DurationStore
+
+ switch (CurrentNormalSpell)
+ {
+ case SPELL_ARCMISSLE:
+ ArcaneCooldown = 5000;
+ break;
+ case SPELL_FIREBALL:
+ FireCooldown = 5000;
+ break;
+ case SPELL_FROSTBOLT:
+ FrostCooldown = 5000;
+ break;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL water_elementalAI : public ScriptedAI
+{
+ water_elementalAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CastTimer;
+
+ void Reset()
+ {
+ CastTimer = 2000 + (rand()%3000);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(CastTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
+ CastTimer = 2000 + (rand()%3000);
+ }else CastTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_aran(Creature *_Creature)
+{
+ return new boss_aranAI (_Creature);
+}
+
+CreatureAI* GetAI_water_elemental(Creature *_Creature)
+{
+ return new water_elementalAI (_Creature);
+}
+
+// CONVERT TO ACID
+CreatureAI* GetAI_shadow_of_aran(Creature *_Creature)
+{
+ outstring_log("SD2: Convert simpleAI script for Creature Entry %u to ACID", _Creature->GetEntry());
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
+ ai->Spell[0].Cooldown = 5000;
+ ai->Spell[0].First_Cast = 1000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+void AddSC_boss_shade_of_aran()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shade_of_aran";
+ newscript->GetAI = GetAI_boss_aran;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shadow_of_aran";
+ newscript->GetAI = GetAI_shadow_of_aran;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_aran_elemental";
+ newscript->GetAI = GetAI_water_elemental;
+ m_scripts[nrscripts++] = newscript;
+
+ //newscript = new Script;
+ //newscript->Name="mob_aran_blizzard";
+ //newscript->GetAI = GetAI_boss_aran;
+ //m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
index a353d7ae088..9f6341462a2 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
@@ -1,454 +1,454 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Terestian_Illhoof
-SD%Complete: 100
-SDComment: Complete!
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_karazhan.h"
-
-#define SPELL_SUMMON_DEMONCHAINS 30120 // Summons demonic chains that maintain the ritual of sacrifice.
-#define SPELL_DEMON_CHAINS 30206 // Instant - Visual Effect
-#define SPELL_ENRAGE 23537 // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min.
-#define SPELL_SHADOW_BOLT 30055 // Hurls a bolt of dark magic at an enemy, inflicting Shadow damage.
-#define SPELL_SACRIFICE 30115 // Teleports and adds the debuff
-#define SPELL_BERSERK 32965 // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley.
-
-#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
-
-#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%.
-#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec.
-#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
-
-#define SAY_SLAY1 "Your blood will anoint my circle."
-#define SOUND_SLAY1 9264
-#define SAY_SLAY2 "The great one will be pleased."
-#define SOUND_SLAY2 9329
-
-#define SAY_DEATH "My life, is yours. Oh great one."
-#define SOUND_DEATH 9262
-
-#define SAY_AGGRO "Ah, you're just in time. The rituals are about to begin."
-#define SOUND_AGGRO 9260
-
-#define SAY_SACRIFICE1 "Please, accept this humble offering, oh great one."
-#define SOUND_SACRIFICE1 9263
-#define SAY_SACRIFICE2 "Let the sacrifice serve his testament to my fealty."
-#define SOUND_SACRIFICE2 9330
-
-#define SAY_SUMMON1 "Come, you dwellers in the dark. Rally to my call!"
-#define SOUND_SUMMON1 9265
-#define SAY_SUMMON2 "Gather, my pets. There is plenty for all."
-#define SOUND_SUMMON2 9331
-
-#define CREATURE_DEMONCHAINS 17248
-#define CREATURE_FIENDISHIMP 17267
-#define CREATURE_PORTAL 17265
-
-#define SACRIFICE_X -11240.599
-#define SACRIFICE_Y -1694.2700
-#define SACRIFICE_Z 179.720007
-
-#define PORTAL_Z 179.434
-
-float PortalLocations[2][2]=
-{
- {-11249.6933, -1704.61023},
- {-11242.1160, -1713.33325},
-};
-
-struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
-{
- mob_kilrekAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 TerestianGUID;
-
- uint32 AmplifyTimer;
-
- void Reset()
- {
- TerestianGUID = 0;
-
- AmplifyTimer = 0;
- }
-
- void Aggro(Unit *who)
- {
- if(!pInstance)
- {
- ERROR_INST_DATA(m_creature);
- return;
- }
-
- Creature* Terestian = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_TERESTIAN)));
- if(Terestian && (!Terestian->SelectHostilTarget() && !Terestian->getVictim()))
- Terestian->AddThreat(who, 1.0f);
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- {
- uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
- if(TerestianGUID)
- {
- Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID);
- if(Terestian && Terestian->isAlive())
- DoCast(Terestian, SPELL_BROKEN_PACT, true);
- }
- }else ERROR_INST_DATA(m_creature);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (AmplifyTimer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES);
-
- AmplifyTimer = 20000;
- }else AmplifyTimer -= diff;
-
- //Chain cast
- if (!m_creature->IsNonMeleeSpellCasted(false) && m_creature->IsWithinDistInMap(m_creature->getVictim(), 30))
- DoCast(m_creature->getVictim(),SPELL_FIREBOLT);
- else DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_demon_chainAI : public ScriptedAI
-{
- mob_demon_chainAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 SacrificeGUID;
-
- void Reset()
- {
- SacrificeGUID = 0;
- }
-
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void JustDied(Unit *killer)
- {
- if(SacrificeGUID)
- {
- Unit* Sacrifice = Unit::GetUnit((*m_creature),SacrificeGUID);
- if(Sacrifice)
- Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
- }
- }
-};
-
-struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
-{
- boss_terestianAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint64 KilrekGUID;
- uint64 PortalGUID[2];
-
- uint32 CheckKilrekTimer;
- uint32 SacrificeTimer;
- uint32 ShadowboltTimer;
- uint32 SummonTimer;
- uint32 BerserkTimer;
-
- bool SummonKilrek;
- bool SummonedPortals;
- bool Berserk;
-
- void Reset()
- {
- for(uint8 i = 0; i < 2; ++i)
- {
- if(PortalGUID[i])
- {
- Unit* Portal = Unit::GetUnit((*m_creature), PortalGUID[i]);
- if(Portal)
- Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- PortalGUID[i] = 0;
- }
- }
-
- CheckKilrekTimer = 5000;
- SacrificeTimer = 30000;
- ShadowboltTimer = 5000;
- SummonTimer = 10000;
- BerserkTimer = 600000;
-
- SummonedPortals = false;
- Berserk = false;
-
- if(pInstance)
- pInstance->SetData(DATA_TERESTIAN_EVENT, NOT_STARTED);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- if(pInstance)
- {
- // Put Kil'rek in combat against our target so players don't skip him
- Creature* Kilrek = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILREK)));
- if(Kilrek && (!Kilrek->SelectHostilTarget() && !Kilrek->getVictim()))
- Kilrek->AddThreat(who, 1.0f);
-
- pInstance->SetData(DATA_TERESTIAN_EVENT, IN_PROGRESS);
- }else ERROR_INST_DATA(m_creature);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *killer)
- {
- for(uint8 i = 0; i < 2; ++i)
- {
- if(PortalGUID[i])
- {
- Unit* Portal = Unit::GetUnit((*m_creature), PortalGUID[i]);
- if(Portal)
- Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- PortalGUID[i] = 0;
- }
- }
-
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_TERESTIAN_EVENT, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() && !m_creature->SelectHostilTarget())
- return;
-
- if(CheckKilrekTimer < diff)
- {
- CheckKilrekTimer = 5000;
-
- if(pInstance)
- uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK);
- else ERROR_INST_DATA(m_creature);
-
- Creature* Kilrek = ((Creature*)Unit::GetUnit((*m_creature), KilrekGUID));
- if(SummonKilrek && Kilrek)
- {
- Kilrek->Respawn();
- Kilrek->AI()->AttackStart(m_creature->getVictim());
-
- SummonKilrek = false;
- }
-
- if(!Kilrek || !Kilrek->isAlive())
- {
- SummonKilrek = true;
- CheckKilrekTimer = 45000;
- }
- }else CheckKilrekTimer -= diff;
-
- if(SacrificeTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoCast(target, SPELL_SACRIFICE, true);
- Creature* Chains = m_creature->SummonCreature(CREATURE_DEMONCHAINS, SACRIFICE_X, SACRIFICE_Y, SACRIFICE_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000);
- if(Chains)
- {
- ((mob_demon_chainAI*)Chains->AI())->SacrificeGUID = target->GetGUID();
- Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SACRIFICE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SACRIFICE1);
- break;
- case 1:
- DoYell(SAY_SACRIFICE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SACRIFICE2);
- break;
- }
- SacrificeTimer = 30000;
- }
- }
- }else SacrificeTimer -= diff;
-
- if(ShadowboltTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
- ShadowboltTimer = 10000;
- }else ShadowboltTimer -= diff;
-
- if(SummonTimer < diff)
- {
- if(!SummonedPortals)
- {
- for(uint8 i = 0; i < 2; ++i)
- {
- Creature* Portal = m_creature->SummonCreature(CREATURE_PORTAL, PortalLocations[i][0], PortalLocations[i][1], PORTAL_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Portal)
- PortalGUID[i] = Portal->GetGUID();
- }
- SummonedPortals = true;
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
- break;
- case 1:
- DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
- break;
- }
- }
- uint32 random = rand()%2;
- Creature* Imp = m_creature->SummonCreature(CREATURE_FIENDISHIMP, PortalLocations[random][0], PortalLocations[random][1], PORTAL_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 15000);
- if(Imp)
- {
- Imp->AddThreat(m_creature->getVictim(), 1.0f);
- Imp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 1));
- }
- SummonTimer = 5000;
- }else SummonTimer -= diff;
-
- if(!Berserk)
- if(BerserkTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- Berserk = true;
- }else BerserkTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_karazhan_impAI : public ScriptedAI
-{
- mob_karazhan_impAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireboltTimer;
-
- void Reset()
- {
- FireboltTimer = 3000;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(FireboltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
- FireboltTimer = 1500;
- }else FireboltTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_kilrek(Creature *_Creature)
-{
- return new mob_kilrekAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_karazhan_imp(Creature *_Creature)
-{
- return new mob_karazhan_impAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_demon_chain(Creature *_Creature)
-{
- return new mob_demon_chainAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_terestian_illhoof(Creature *_Creature)
-{
- return new boss_terestianAI (_Creature);
-}
-
-void AddSC_boss_terestian_illhoof()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_terestian_illhoof";
- newscript->GetAI = GetAI_boss_terestian_illhoof;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_karazhan_imp";
- newscript->GetAI = GetAI_mob_karazhan_imp;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_kilrek";
- newscript->GetAI = GetAI_mob_kilrek;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_demon_chain";
- newscript->GetAI = GetAI_mob_demon_chain;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Terestian_Illhoof
+SD%Complete: 100
+SDComment: Complete!
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_karazhan.h"
+
+#define SPELL_SUMMON_DEMONCHAINS 30120 // Summons demonic chains that maintain the ritual of sacrifice.
+#define SPELL_DEMON_CHAINS 30206 // Instant - Visual Effect
+#define SPELL_ENRAGE 23537 // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min.
+#define SPELL_SHADOW_BOLT 30055 // Hurls a bolt of dark magic at an enemy, inflicting Shadow damage.
+#define SPELL_SACRIFICE 30115 // Teleports and adds the debuff
+#define SPELL_BERSERK 32965 // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley.
+
+#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
+
+#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%.
+#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec.
+#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
+
+#define SAY_SLAY1 "Your blood will anoint my circle."
+#define SOUND_SLAY1 9264
+#define SAY_SLAY2 "The great one will be pleased."
+#define SOUND_SLAY2 9329
+
+#define SAY_DEATH "My life, is yours. Oh great one."
+#define SOUND_DEATH 9262
+
+#define SAY_AGGRO "Ah, you're just in time. The rituals are about to begin."
+#define SOUND_AGGRO 9260
+
+#define SAY_SACRIFICE1 "Please, accept this humble offering, oh great one."
+#define SOUND_SACRIFICE1 9263
+#define SAY_SACRIFICE2 "Let the sacrifice serve his testament to my fealty."
+#define SOUND_SACRIFICE2 9330
+
+#define SAY_SUMMON1 "Come, you dwellers in the dark. Rally to my call!"
+#define SOUND_SUMMON1 9265
+#define SAY_SUMMON2 "Gather, my pets. There is plenty for all."
+#define SOUND_SUMMON2 9331
+
+#define CREATURE_DEMONCHAINS 17248
+#define CREATURE_FIENDISHIMP 17267
+#define CREATURE_PORTAL 17265
+
+#define SACRIFICE_X -11240.599
+#define SACRIFICE_Y -1694.2700
+#define SACRIFICE_Z 179.720007
+
+#define PORTAL_Z 179.434
+
+float PortalLocations[2][2]=
+{
+ {-11249.6933, -1704.61023},
+ {-11242.1160, -1713.33325},
+};
+
+struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
+{
+ mob_kilrekAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 TerestianGUID;
+
+ uint32 AmplifyTimer;
+
+ void Reset()
+ {
+ TerestianGUID = 0;
+
+ AmplifyTimer = 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(!pInstance)
+ {
+ ERROR_INST_DATA(m_creature);
+ return;
+ }
+
+ Creature* Terestian = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_TERESTIAN)));
+ if(Terestian && (!Terestian->SelectHostilTarget() && !Terestian->getVictim()))
+ Terestian->AddThreat(who, 1.0f);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ {
+ uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
+ if(TerestianGUID)
+ {
+ Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID);
+ if(Terestian && Terestian->isAlive())
+ DoCast(Terestian, SPELL_BROKEN_PACT, true);
+ }
+ }else ERROR_INST_DATA(m_creature);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (AmplifyTimer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES);
+
+ AmplifyTimer = 20000;
+ }else AmplifyTimer -= diff;
+
+ //Chain cast
+ if (!m_creature->IsNonMeleeSpellCasted(false) && m_creature->IsWithinDistInMap(m_creature->getVictim(), 30))
+ DoCast(m_creature->getVictim(),SPELL_FIREBOLT);
+ else DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_demon_chainAI : public ScriptedAI
+{
+ mob_demon_chainAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 SacrificeGUID;
+
+ void Reset()
+ {
+ SacrificeGUID = 0;
+ }
+
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void JustDied(Unit *killer)
+ {
+ if(SacrificeGUID)
+ {
+ Unit* Sacrifice = Unit::GetUnit((*m_creature),SacrificeGUID);
+ if(Sacrifice)
+ Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
+{
+ boss_terestianAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint64 KilrekGUID;
+ uint64 PortalGUID[2];
+
+ uint32 CheckKilrekTimer;
+ uint32 SacrificeTimer;
+ uint32 ShadowboltTimer;
+ uint32 SummonTimer;
+ uint32 BerserkTimer;
+
+ bool SummonKilrek;
+ bool SummonedPortals;
+ bool Berserk;
+
+ void Reset()
+ {
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ if(PortalGUID[i])
+ {
+ Unit* Portal = Unit::GetUnit((*m_creature), PortalGUID[i]);
+ if(Portal)
+ Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ PortalGUID[i] = 0;
+ }
+ }
+
+ CheckKilrekTimer = 5000;
+ SacrificeTimer = 30000;
+ ShadowboltTimer = 5000;
+ SummonTimer = 10000;
+ BerserkTimer = 600000;
+
+ SummonedPortals = false;
+ Berserk = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_TERESTIAN_EVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ if(pInstance)
+ {
+ // Put Kil'rek in combat against our target so players don't skip him
+ Creature* Kilrek = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILREK)));
+ if(Kilrek && (!Kilrek->SelectHostilTarget() && !Kilrek->getVictim()))
+ Kilrek->AddThreat(who, 1.0f);
+
+ pInstance->SetData(DATA_TERESTIAN_EVENT, IN_PROGRESS);
+ }else ERROR_INST_DATA(m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *killer)
+ {
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ if(PortalGUID[i])
+ {
+ Unit* Portal = Unit::GetUnit((*m_creature), PortalGUID[i]);
+ if(Portal)
+ Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ PortalGUID[i] = 0;
+ }
+ }
+
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_TERESTIAN_EVENT, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() && !m_creature->SelectHostilTarget())
+ return;
+
+ if(CheckKilrekTimer < diff)
+ {
+ CheckKilrekTimer = 5000;
+
+ if(pInstance)
+ uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK);
+ else ERROR_INST_DATA(m_creature);
+
+ Creature* Kilrek = ((Creature*)Unit::GetUnit((*m_creature), KilrekGUID));
+ if(SummonKilrek && Kilrek)
+ {
+ Kilrek->Respawn();
+ Kilrek->AI()->AttackStart(m_creature->getVictim());
+
+ SummonKilrek = false;
+ }
+
+ if(!Kilrek || !Kilrek->isAlive())
+ {
+ SummonKilrek = true;
+ CheckKilrekTimer = 45000;
+ }
+ }else CheckKilrekTimer -= diff;
+
+ if(SacrificeTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(target, SPELL_SACRIFICE, true);
+ Creature* Chains = m_creature->SummonCreature(CREATURE_DEMONCHAINS, SACRIFICE_X, SACRIFICE_Y, SACRIFICE_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000);
+ if(Chains)
+ {
+ ((mob_demon_chainAI*)Chains->AI())->SacrificeGUID = target->GetGUID();
+ Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SACRIFICE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SACRIFICE1);
+ break;
+ case 1:
+ DoYell(SAY_SACRIFICE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SACRIFICE2);
+ break;
+ }
+ SacrificeTimer = 30000;
+ }
+ }
+ }else SacrificeTimer -= diff;
+
+ if(ShadowboltTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
+ ShadowboltTimer = 10000;
+ }else ShadowboltTimer -= diff;
+
+ if(SummonTimer < diff)
+ {
+ if(!SummonedPortals)
+ {
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ Creature* Portal = m_creature->SummonCreature(CREATURE_PORTAL, PortalLocations[i][0], PortalLocations[i][1], PORTAL_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Portal)
+ PortalGUID[i] = Portal->GetGUID();
+ }
+ SummonedPortals = true;
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SUMMON1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON1);
+ break;
+ case 1:
+ DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
+ break;
+ }
+ }
+ uint32 random = rand()%2;
+ Creature* Imp = m_creature->SummonCreature(CREATURE_FIENDISHIMP, PortalLocations[random][0], PortalLocations[random][1], PORTAL_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 15000);
+ if(Imp)
+ {
+ Imp->AddThreat(m_creature->getVictim(), 1.0f);
+ Imp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 1));
+ }
+ SummonTimer = 5000;
+ }else SummonTimer -= diff;
+
+ if(!Berserk)
+ if(BerserkTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ Berserk = true;
+ }else BerserkTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_karazhan_impAI : public ScriptedAI
+{
+ mob_karazhan_impAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireboltTimer;
+
+ void Reset()
+ {
+ FireboltTimer = 3000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(FireboltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
+ FireboltTimer = 1500;
+ }else FireboltTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_kilrek(Creature *_Creature)
+{
+ return new mob_kilrekAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_karazhan_imp(Creature *_Creature)
+{
+ return new mob_karazhan_impAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_demon_chain(Creature *_Creature)
+{
+ return new mob_demon_chainAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_terestian_illhoof(Creature *_Creature)
+{
+ return new boss_terestianAI (_Creature);
+}
+
+void AddSC_boss_terestian_illhoof()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_terestian_illhoof";
+ newscript->GetAI = GetAI_boss_terestian_illhoof;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_karazhan_imp";
+ newscript->GetAI = GetAI_mob_karazhan_imp;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_kilrek";
+ newscript->GetAI = GetAI_mob_kilrek;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_demon_chain";
+ newscript->GetAI = GetAI_mob_demon_chain;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
index 065f359bfc1..f99170d5ada 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
@@ -1,1471 +1,1471 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Bosses_Opera
-SD%Complete: 90
-SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing.
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_karazhan.h"
-
-/***********************************/
-/*** OPERA WIZARD OF OZ EVENT *****/
-/*********************************/
-
-/**** Spells ****/
-// Dorothee
-#define SPELL_WATERBOLT 31012
-#define SPELL_SCREAM 31013
-#define SPELL_SUMMONTITO 31014
-
-// Tito
-#define SPELL_YIPPING 31015
-
-// Strawman
-#define SPELL_BRAIN_BASH 31046
-#define SPELL_BRAIN_WIPE 31069
-#define SPELL_BURNING_STRAW 31075
-
-// Tinhead
-#define SPELL_CLEAVE 31043
-#define SPELL_RUST 31086
-
-// Roar
-#define SPELL_MANGLE 31041
-#define SPELL_SHRED 31042
-#define SPELL_FRIGHTENED_SCREAM 31013
-
-// Crone
-#define SPELL_CHAIN_LIGHTNING 32337
-
-// Cyclone
-#define SPELL_KNOCKBACK 32334
-#define SPELL_CYCLONE_VISUAL 32332
-
-/** Creature Entries **/
-#define CREATURE_TITO 17548
-#define CREATURE_CYCLONE 18412
-#define CREATURE_CRONE 18168
-
-/***** Speech and Sound *****/
-#define SAY_DOROTHEE_DEATH "Oh at last, at last. I can go home."
-#define SOUND_DOROTHEE_DEATH 9190
-#define SAY_DOROTHEE_SUMMON "Don't let them hurt us, Tito! Oh, you won't, will you?"
-#define SOUND_DOROTHEE_SUMMON 9191
-#define SAY_DOROTHEE_TITO_DEATH "Tito, oh Tito, no!"
-#define SOUND_DOROTHEE_TITO_DEATH 9192
-#define SAY_DOROTHEE_AGGRO "Oh dear, we simply must find a way home! The old wizard could be our only hope! Strawman, Roar, Tinhead, will you... wait! Oh golly, look! We have visitors!"
-#define SOUND_DOROTHEE_AGGRO 9195
-
-#define SAY_ROAR_AGGRO "Wanna fight? Huh? Do ya? C'mon, I'll fight you with both claws behind my back!"
-#define SOUND_ROAR_AGGRO 9227
-#define SAY_ROAR_DEATH "You didn't have to go and do that."
-#define SOUND_ROAR_DEATH 9229
-#define SAY_ROAR_SLAY "I think I'm going to go take fourty winks"
-#define SOUND_ROAR_SLAY 9230
-
-#define SAY_STRAWMAN_AGGRO "Now what should I do with you? I simply can't make up my mind."
-#define SOUND_STRAWMAN_AGGRO 9254
-#define SAY_STRAWMAN_DEATH "Don't let them make a mattress... out of me."
-#define SOUND_STRAWMAN_DEATH 9256
-#define SAY_STRAWMAN_SLAY "I guess I'm not a failure after all."
-#define SOUND_STRAWMAN_SLAY 9257
-
-#define SAY_TINHEAD_AGGRO "I could really use a heart. Say, can I have yours?"
-#define SOUND_TINHEAD_AGGRO 9268
-#define SAY_TINHEAD_DEATH "Back to being an old rustbucket."
-#define SOUND_TINHEAD_DEATH 9270
-#define SAY_TINHEAD_SLAY "Guess I'm not so rusty, after all."
-#define SOUND_TINHEAD_SLAY 9271
-
-#define SAY_CRONE_AGGRO "Woe to each and every one of you my pretties!"
-#define SOUND_CRONE_AGGRO 9179
-#define SAY_CRONE_AGGRO2 "It will all be over soon!"
-#define SOUND_CRONE_AGGRO2 9307
-#define SAY_CRONE_DEATH "How could you? What a cruel, cruel world!"
-#define SOUND_CRONE_DEATH 9178
-#define SAY_CRONE_SLAY "Fixed you, didn't I?"
-#define SOUND_CRONE_SLAY 9180
-
-void SummonCroneIfReady(ScriptedInstance* pInstance, Creature *_Creature)
-{
- pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, 0); // Increment DeathCount
- if(pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4)
- {
- Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- if(Crone)
- {
- if(_Creature->getVictim())
- Crone->AI()->AttackStart(_Creature->getVictim());
-
- Crone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- }
-};
-
-struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
-{
- boss_dorotheeAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 AggroTimer;
-
- uint32 WaterBoltTimer;
- uint32 FearTimer;
- uint32 SummonTitoTimer;
-
- bool SummonedTito;
- bool TitoDied;
- bool InCombat;
-
- void Reset()
- {
- AggroTimer = 500;
-
- WaterBoltTimer = 5000;
- FearTimer = 15000;
- SummonTitoTimer = 47500;
-
- SummonedTito = false;
- TitoDied = false;
- InCombat = false;
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_DOROTHEE_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_AGGRO);
- }
-
- void SummonTito(); // See below
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_DOROTHEE_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_DEATH);
-
- if(pInstance)
- SummonCroneIfReady(pInstance, m_creature);
- }
-
- void AttackStart(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(AggroTimer)
- if(AggroTimer <= diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- AggroTimer = 0;
- }else AggroTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(WaterBoltTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT);
- WaterBoltTimer = TitoDied ? 1500 : 5000;
- }else WaterBoltTimer -= diff;
-
- if(FearTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SCREAM);
- FearTimer = 30000;
- }else FearTimer -= diff;
-
- if(!SummonedTito)
- {
- if(SummonTitoTimer < diff)
- SummonTito();
- else SummonTitoTimer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
-{
- mob_titoAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 DorotheeGUID;
-
- uint32 YipTimer;
-
- void Reset()
- {
- DorotheeGUID = 0;
-
- YipTimer = 10000;
- }
-
- void Aggro(Unit* who) {}
-
- void JustDied(Unit* killer)
- {
- if(DorotheeGUID)
- {
- Creature* Dorothee = ((Creature*)Unit::GetUnit((*m_creature), DorotheeGUID));
- if(Dorothee && Dorothee->isAlive())
- {
- ((boss_dorotheeAI*)Dorothee->AI())->TitoDied = true;
- Dorothee->MonsterYell(SAY_DOROTHEE_TITO_DEATH, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Dorothee, SOUND_DOROTHEE_TITO_DEATH);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(YipTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_YIPPING);
- YipTimer = 10000;
- }else YipTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-void boss_dorotheeAI::SummonTito()
-{
- Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
- if(Tito)
- {
- DoYell(SAY_DOROTHEE_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_SUMMON);
- ((mob_titoAI*)Tito->AI())->DorotheeGUID = m_creature->GetGUID();
- Tito->AI()->AttackStart(m_creature->getVictim());
- SummonedTito = true;
- TitoDied = false;
- }
-}
-
-struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI
-{
- boss_strawmanAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 AggroTimer;
- uint32 BrainBashTimer;
- uint32 BrainWipeTimer;
-
- void Reset()
- {
- AggroTimer = 13000;
- BrainBashTimer = 5000;
- BrainWipeTimer = 7000;
- }
-
- void AttackStart(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_STRAWMAN_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_AGGRO);
- }
-
- void SpellHit(Unit* caster, const SpellEntry *Spell)
- {
- if((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
- DoCast(m_creature, SPELL_BURNING_STRAW, true);
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_STRAWMAN_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_DEATH);
-
- if(pInstance)
- SummonCroneIfReady(pInstance, m_creature);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_STRAWMAN_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_SLAY);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(AggroTimer)
- if(AggroTimer <= diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- AggroTimer = 0;
- }else AggroTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(BrainBashTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH);
- BrainBashTimer = 15000;
- }else BrainBashTimer -= diff;
-
- if(BrainWipeTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BRAIN_WIPE);
- BrainWipeTimer = 20000;
- }else BrainWipeTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI
-{
- boss_tinheadAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 AggroTimer;
- uint32 CleaveTimer;
- uint32 RustTimer;
-
- uint8 RustCount;
-
- void Reset()
- {
- AggroTimer = 15000;
- CleaveTimer = 5000;
- RustTimer = 30000;
-
- RustCount = 0;
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_TINHEAD_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TINHEAD_AGGRO);
- }
-
- void AttackStart(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_TINHEAD_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TINHEAD_DEATH);
-
- if(pInstance)
- SummonCroneIfReady(pInstance, m_creature);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_TINHEAD_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TINHEAD_SLAY);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(AggroTimer)
- if(AggroTimer < diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- AggroTimer = 0;
- }else AggroTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(CleaveTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
- CleaveTimer = 5000;
- }else CleaveTimer -= diff;
-
- if(RustCount < 8)
- {
- if(RustTimer < diff)
- {
- RustCount++;
- DoTextEmote("begins to rust", NULL);
- DoCast(m_creature, SPELL_RUST);
- RustTimer = 6000;
- }else RustTimer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI
-{
- boss_roarAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 AggroTimer;
- uint32 MangleTimer;
- uint32 ShredTimer;
- uint32 ScreamTimer;
-
- void Reset()
- {
- AggroTimer = 20000;
- MangleTimer = 5000;
- ShredTimer = 10000;
- ScreamTimer = 15000;
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void AttackStart(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_ROAR_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROAR_AGGRO);
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_ROAR_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROAR_DEATH);
-
- if(pInstance)
- SummonCroneIfReady(pInstance, m_creature);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_ROAR_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROAR_SLAY);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(AggroTimer)
- if(AggroTimer <= diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- AggroTimer = 0;
- }else AggroTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(MangleTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MANGLE);
- MangleTimer = 5000 + rand()%3000;
- }else MangleTimer -= diff;
-
- if(ShredTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHRED);
- ShredTimer = 10000 + rand()%5000;
- }else ShredTimer -= diff;
-
- if(ScreamTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM);
- ScreamTimer = 20000 + rand()%10000;
- }else ScreamTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI
-{
- boss_croneAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 CycloneTimer;
- uint32 ChainLightningTimer;
-
- void Reset()
- {
- CycloneTimer = 30000;
- ChainLightningTimer = 10000;
- }
-
- void Aggro(Unit* who)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_CRONE_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CRONE_AGGRO);
- break;
- case 1:
- DoYell(SAY_CRONE_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CRONE_AGGRO2);
- break;
- }
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_CRONE_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CRONE_DEATH);
-
- if(pInstance)
- {
- pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- if(CycloneTimer < diff)
- {
- Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, rand()%10, rand()%10, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
- if(Cyclone)
- Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true);
- CycloneTimer = 30000;
- }else CycloneTimer -= diff;
-
- if(ChainLightningTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
- ChainLightningTimer = 15000;
- }else ChainLightningTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI
-{
- mob_cycloneAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 MoveTimer;
-
- void Reset()
- {
- MoveTimer = 1000;
- }
-
- void Aggro(Unit* who) {}
-
- void MoveInLineOfSight(Unit* who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->HasAura(SPELL_KNOCKBACK, 0))
- DoCast(m_creature, SPELL_KNOCKBACK, true);
-
- if(MoveTimer < diff)
- {
- float x,y,z;
- m_creature->GetPosition(x,y,z);
- float PosX, PosY, PosZ;
- m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ);
- m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ);
- MoveTimer = 5000 + rand()%3000;
- }else MoveTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_dorothee(Creature* _Creature)
-{
- return new boss_dorotheeAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_strawman(Creature* _Creature)
-{
- return new boss_strawmanAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_tinhead(Creature* _Creature)
-{
- return new boss_tinheadAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_roar(Creature* _Creature)
-{
- return new boss_roarAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_crone(Creature* _Creature)
-{
- return new boss_croneAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_tito(Creature* _Creature)
-{
- return new mob_titoAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_cyclone(Creature* _Creature)
-{
- return new mob_cycloneAI(_Creature);
-}
-
-/**************************************/
-/**** Opera Red Riding Hood Event ****/
-/************************************/
-
-#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?"
-
-/**** Spells For The Wolf ****/
-#define SPELL_LITTLE_RED_RIDING_HOOD 30768
-#define SPELL_TERRIFYING_HOWL 30752
-#define SPELL_WIDE_SWIPE 30761
-
-/**** Yells for the Wolf ****/
-#define SAY_WOLF_AGGRO "All the better to own you with!"
-#define SOUND_WOLF_AGGRO 9276
-#define SOUND_WOLF_DEATH 9275 // No speech
-#define SAY_WOLF_SLAY "Mmmm... delicious."
-#define SOUND_WOLF_SLAY 9277
-#define SAY_WOLF_HOOD "Run away little girl, run away!"
-#define SOUND_WOLF_HOOD 9278
-
-/**** The Wolf's Entry ****/
-#define CREATURE_BIG_BAD_WOLF 17521
-
-bool GossipHello_npc_grandmother(Player* player, Creature* _Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(8990, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_grandmother(Player* player, Creature* _Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF)
- {
- _Creature->SetVisibility(VISIBILITY_OFF);
- float x,y,z;
- _Creature->GetPosition(x,y,z);
- Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- if(BigBadWolf)
- {
- BigBadWolf->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- BigBadWolf->AI()->AttackStart(player);
- }
-
- _Creature->setDeathState(JUST_DIED);
- }
-
- return true;
-}
-
-struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
-{
- boss_bigbadwolfAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 ChaseTimer;
- uint32 FearTimer;
- uint32 SwipeTimer;
-
- uint64 HoodGUID;
- float TempThreat;
-
- bool IsChasing;
-
- void Reset()
- {
- ChaseTimer = 30000;
- FearTimer = 25000 + rand()%10000;
- SwipeTimer = 5000;
-
- HoodGUID = 0;
- TempThreat = 0;
-
- IsChasing = false;
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_WOLF_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_WOLF_AGGRO);
- }
-
- void JustDied(Unit* killer)
- {
- DoPlaySoundToSet(m_creature, SOUND_WOLF_DEATH);
-
- if(pInstance)
- {
- pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
-
- if(ChaseTimer < diff)
- {
- if(!IsChasing)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoYell(SAY_WOLF_HOOD, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_WOLF_HOOD);
-
- DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
- TempThreat = m_creature->getThreatManager().getThreat(target);
- if(TempThreat)
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
- HoodGUID = target->GetGUID();
- m_creature->AddThreat(target, 1000000.0f);
- ChaseTimer = 20000;
- IsChasing = true;
- }
- }
- else
- {
- IsChasing = false;
- Unit* target = Unit::GetUnit((*m_creature), HoodGUID);
- if(target)
- {
- HoodGUID = 0;
- if(m_creature->getThreatManager().getThreat(target))
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
- m_creature->AddThreat(target, TempThreat);
- TempThreat = 0;
- }
-
- ChaseTimer = 40000;
- }
- }else ChaseTimer -= diff;
-
- if(IsChasing)
- return;
-
- if(FearTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL);
- FearTimer = 25000 + rand()%35000;
- }else FearTimer -= diff;
-
- if(SwipeTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE);
- SwipeTimer = 25000 + rand()%5000;
- }else SwipeTimer -= diff;
-
- }
-};
-
-CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature)
-{
- return new boss_bigbadwolfAI(_Creature);
-}
-
-/**********************************************/
-/******** Opera Romeo and Juliet Event *******/
-/********************************************/
-
-/***** Spells For Julianne *****/
-#define SPELL_BLINDING_PASSION 30890
-#define SPELL_DEVOTION 30887
-#define SPELL_ETERNAL_AFFECTION 30878
-#define SPELL_POWERFUL_ATTRACTION 30889
-#define SPELL_DRINK_POISON 30907
-
-/***** Spells For Romulo ****/
-#define SPELL_BACKWARD_LUNGE 30815
-#define SPELL_DARING 30841
-#define SPELL_DEADLY_SWATHE 30817
-#define SPELL_POISON_THRUST 30822
-
-/**** Other Misc. Spells ****/
-#define SPELL_UNDYING_LOVE 30951
-#define SPELL_RES_VISUAL 24171
-
-/**** Speech and Text *****/
-/****** Julianne *******/
-#define SAY_JULIANNE_AGGRO "What devil art thou, that dost torment me thus?"
-#define SOUND_JULIANNE_AGGRO 9196
-#define SAY_JULIANNE_ENTER "Where is my lord? Where is my Romulo?"
-#define SOUND_JULIANNE_ENTER 9199
-#define SAY_JULIANNE_DEATH01 "Romulo, I come! Oh... this do I drink to thee!"
-#define SOUND_JULIANNE_DEATH01 9198
-#define SAY_JULIANNE_DEATH02 "Where is my Lord? Where is my Romulo? Ohh, happy dagger! This is thy sheath! There rust, and let me die!"
-#define SOUND_JULIANNE_DEATH02 9310
-#define SAY_JULIANNE_RESURRECT "Come, gentle night; and give me back my Romulo!"
-#define SOUND_JULIANNE_RESURRECT 9200
-#define SAY_JULIANNE_SLAY "Parting is such sweet sorrow."
-#define SOUND_JULIANNE_SLAY 9201
-
-/****** Romulo *******/
-#define SAY_ROMULO_AGGRO "Wilt thou provoke me? Then have at thee, boy!"
-#define SOUND_ROMULO_AGGRO 9233
-#define SAY_ROMULO_DEATH "Thou smilest... upon the stroke that... murders me."
-#define SOUND_ROMULO_DEATH 9235
-#define SAY_ROMULO_ENTER "This day's black fate on more days doth depend. This but begins the woe. Others must end."
-#define SOUND_ROMULO_ENTER 9236
-#define SAY_ROMULO_RESURRECT "Thou detestable maw, thou womb of death; I enforce thy rotten jaws to open!"
-#define SOUND_ROMULO_RESURRECT 9237
-#define SAY_ROMULO_SLAY "How well my comfort is revived by this!"
-#define SOUND_ROMULO_SLAY 9238
-
-/*** Misc. Information ****/
-#define CREATURE_ROMULO 17533
-#define ROMULO_X -10900
-#define ROMULO_Y -1758
-
-enum RAJPhase
-{
- PHASE_JULIANNE = 0,
- PHASE_ROMULO = 1,
- PHASE_BOTH = 2,
-};
-
-void PretendToDie(Creature* _Creature)
-{
- _Creature->InterruptNonMeleeSpells(false);
- _Creature->SetHealth(0);
- _Creature->StopMoving();
- _Creature->ClearComboPointHolders();
- _Creature->RemoveAllAurasOnDeath();
- _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
- _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
- _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- _Creature->ClearAllReactives();
- _Creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
- _Creature->GetMotionMaster()->Clear();
- _Creature->GetMotionMaster()->MoveIdle();
- _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
-};
-
-void Resurrect(Creature* target)
-{
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- target->SetHealth(target->GetMaxHealth());
- target->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- target->CastSpell(target, SPELL_RES_VISUAL, true);
- if(target->getVictim())
- {
- target->SetUInt64Value(UNIT_FIELD_TARGET, target->getVictim()->GetGUID());
- target->GetMotionMaster()->MoveChase(target->getVictim());
- target->AI()->AttackStart(target->getVictim());
- }
-};
-
-struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
-{
- boss_julianneAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- EntryYellTimer = 1000;
- AggroYellTimer = 10000;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 RomuloGUID;
-
- uint32 Phase;
-
- uint32 EntryYellTimer;
- uint32 AggroYellTimer;
- uint32 BlindingPassionTimer;
- uint32 DevotionTimer;
- uint32 EternalAffectionTimer;
- uint32 PowerfulAttractionTimer;
- uint32 SummonRomuloTimer;
- uint32 ResurrectTimer;
-
- bool IsFakingDeath;
- bool SummonedRomulo;
- bool RomuloDead;
-
- void Reset()
- {
- if(RomuloGUID)
- {
- if(Unit* Romulo = Unit::GetUnit(*m_creature, RomuloGUID))
- {
- Romulo->SetVisibility(VISIBILITY_OFF);
- Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- RomuloGUID = 0;
- }
-
- Phase = PHASE_JULIANNE;
-
- BlindingPassionTimer = 30000;
- DevotionTimer = 15000;
- EternalAffectionTimer = 25000;
- PowerfulAttractionTimer = 5000;
-
- if(IsFakingDeath)
- Resurrect(m_creature);
-
- IsFakingDeath = false;
- SummonedRomulo = false;
- RomuloDead = false;
- }
-
- void Aggro(Unit* who) {}
-
- void AttackStart(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage);
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_JULIANNE_DEATH02, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_DEATH02);
-
- if(pInstance)
- {
- pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_JULIANNE_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_SLAY);
- }
-
- void UpdateAI(const uint32 diff);
-};
-
-struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
-{
- boss_romuloAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- EntryYellTimer = 8000;
- AggroYellTimer = 15000;
- }
-
- uint64 JulianneGUID;
-
- uint32 Phase;
-
- uint32 EntryYellTimer;
- uint32 AggroYellTimer;
- uint32 BackwardLungeTimer;
- uint32 DaringTimer;
- uint32 DeadlySwatheTimer;
- uint32 PoisonThrustTimer;
- uint32 ResurrectTimer;
-
- bool JulianneDead;
- bool IsFakingDeath;
-
- void Reset()
- {
- JulianneGUID = 0;
-
- Phase = PHASE_ROMULO;
-
- BackwardLungeTimer = 15000;
- DaringTimer = 20000;
- DeadlySwatheTimer = 25000;
- PoisonThrustTimer = 10000;
-
- if(IsFakingDeath)
- Resurrect(m_creature);
-
- IsFakingDeath = false;
- JulianneDead = false;
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage);
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_ROMULO_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROMULO_AGGRO);
- if(JulianneGUID)
- {
- Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
- if(Julianne && Julianne->getVictim())
- {
- m_creature->AddThreat(Julianne->getVictim(), 1.0f);
- DoStartAttackAndMovement(Julianne->getVictim());
- }
- }
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_ROMULO_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROMULO_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_ROMULO_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROMULO_SLAY);
- }
-
- void UpdateAI(const uint32 diff);
-};
-
-void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
-{
- if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == RomuloGUID)
- return;
-
- if(Phase == PHASE_JULIANNE)
- {
- DoYell(SAY_JULIANNE_DEATH01, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_DEATH01);
- m_creature->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_DRINK_POISON);
- PretendToDie(m_creature);
- Phase = PHASE_ROMULO;
- damage = 0;
- IsFakingDeath = true;
- SummonRomuloTimer = 10000;
- return;
- }
-
- if(!IsFakingDeath)
- {
- Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
- if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
- {
- ((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
- ((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
- }
- else
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(Romulo)
- {
- Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- JustDied(done_by);
- }
-
- IsFakingDeath = true;
- PretendToDie(m_creature);
- damage = 0;
- }
- else
- damage = 0;
-}
-
-void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
-{
- if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == JulianneGUID)
- return;
-
- if(!IsFakingDeath)
- {
- IsFakingDeath = true;
- PretendToDie(m_creature);
-
- if(Phase == PHASE_BOTH)
- {
- Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
- if(Julianne && Julianne->isAlive() && !((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
- {
- ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
- ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
- }
- else
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(Julianne)
- {
- Julianne->DealDamage(Julianne, Julianne->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- JustDied(done_by);
- }
- }
- else
- {
- Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
- if(Julianne)
- {
- Resurrect(Julianne);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 4000;
- ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
- ((boss_julianneAI*)Julianne->AI())->Phase = PHASE_BOTH;
- ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
- }
- Phase = PHASE_BOTH;
- }
-
- damage = 0;
- }
-
- if(IsFakingDeath) damage = 0;
-}
-
-void boss_julianneAI::UpdateAI(const uint32 diff)
-{
- if(EntryYellTimer)
- if(EntryYellTimer < diff)
- {
- DoYell(SAY_JULIANNE_ENTER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_ENTER);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- EntryYellTimer = 0;
- }else EntryYellTimer -= diff;
-
- if(AggroYellTimer)
- if(AggroYellTimer < diff)
- {
- DoYell(SAY_JULIANNE_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_AGGRO);
- AggroYellTimer = 0;
- }else AggroYellTimer -= diff;
-
- if(Phase == PHASE_ROMULO && !SummonedRomulo)
- {
- if(SummonRomuloTimer < diff)
- {
- Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
- if(Romulo)
- {
- RomuloGUID = Romulo->GetGUID();
- ((boss_romuloAI*)Romulo->AI())->JulianneGUID = m_creature->GetGUID();
- ((boss_romuloAI*)Romulo->AI())->Phase = PHASE_ROMULO;
- if(m_creature->getVictim())
- {
- Romulo->AI()->AttackStart(m_creature->getVictim());
- Romulo->AddThreat(m_creature->getVictim(), 50.0f);
- }
- DoZoneInCombat(Romulo);
- }
- SummonedRomulo = true;
- }else SummonRomuloTimer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ||IsFakingDeath)
- return;
-
- if(RomuloDead)
- if(ResurrectTimer < diff)
- {
- Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
- if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
- {
- DoYell(SAY_JULIANNE_RESURRECT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_JULIANNE_RESURRECT);
- Resurrect(Romulo);
- ((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false;
- ResurrectTimer = 10000;
- }
- RomuloDead = false;
- }else ResurrectTimer -= diff;
-
- if(BlindingPassionTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLINDING_PASSION);
- BlindingPassionTimer = 30000 + rand()%15000;
- }else BlindingPassionTimer -= diff;
-
- if(DevotionTimer < diff)
- {
- DoCast(m_creature, SPELL_DEVOTION);
- DevotionTimer = 15000 + rand()%30000;
- }else DevotionTimer -= diff;
-
- if(PowerfulAttractionTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION);
- PowerfulAttractionTimer = 5000 + rand()%25000;
- }else PowerfulAttractionTimer -= diff;
-
- if(EternalAffectionTimer < diff)
- {
- if(rand()%2 == 1 && SummonedRomulo)
- {
- Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
- if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
- DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
- else
- return;
- }
- else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
-
- EternalAffectionTimer = 45000 + rand()%15000;
- }else EternalAffectionTimer -= diff;
-
- DoMeleeAttackIfReady();
-}
-
-void boss_romuloAI::UpdateAI(const uint32 diff)
-{
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || IsFakingDeath)
- return;
-
- if(JulianneDead)
- if(ResurrectTimer < diff)
- {
- Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
- if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
- {
- DoYell(SAY_ROMULO_RESURRECT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ROMULO_RESURRECT);
- Resurrect(Julianne);
- ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
- ResurrectTimer = 10000;
- }
- JulianneDead = false;
- }else ResurrectTimer -= diff;
-
- if(BackwardLungeTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && !m_creature->HasInArc(M_PI, target))
- {
- DoCast(target, SPELL_BACKWARD_LUNGE);
- BackwardLungeTimer = 15000 + rand()%15000;
- }
- }else BackwardLungeTimer -= diff;
-
- if(DaringTimer < diff)
- {
- DoCast(m_creature, SPELL_DARING);
- DaringTimer = 20000 + rand()%20000;
- }else DaringTimer -= diff;
-
- if(DeadlySwatheTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEADLY_SWATHE);
- DeadlySwatheTimer = 15000 + rand()%10000;
- }else DeadlySwatheTimer -= diff;
-
- if(PoisonThrustTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_POISON_THRUST);
- PoisonThrustTimer = 10000 + rand()%10000;
- }else PoisonThrustTimer -= diff;
-
- DoMeleeAttackIfReady();
-}
-
-CreatureAI* GetAI_boss_julianne(Creature* _Creature)
-{
- return new boss_julianneAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_romulo(Creature* _Creature)
-{
- return new boss_romuloAI(_Creature);
-}
-
-void AddSC_bosses_opera()
-{
- Script* newscript;
-
- // Oz
- newscript = new Script;
- newscript->GetAI = GetAI_boss_dorothee;
- newscript->Name = "boss_dorothee";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_strawman;
- newscript->Name = "boss_strawman";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_tinhead;
- newscript->Name = "boss_tinhead";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_roar;
- newscript->Name = "boss_roar";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_crone;
- newscript->Name = "boss_crone";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_mob_tito;
- newscript->Name = "mob_tito";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_mob_cyclone;
- newscript->Name = "mob_cyclone";
- m_scripts[nrscripts++] = newscript;
-
- // Hood
- newscript = new Script;
- newscript->pGossipHello = GossipHello_npc_grandmother;
- newscript->pGossipSelect = GossipSelect_npc_grandmother;
- newscript->Name = "npc_grandmother";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_bigbadwolf;
- newscript->Name = "boss_bigbadwolf";
- m_scripts[nrscripts++] = newscript;
-
- // Romeo And Juliet
- newscript = new Script;
- newscript->GetAI = GetAI_boss_julianne;
- newscript->Name = "boss_julianne";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_romulo;
- newscript->Name = "boss_romulo";
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Bosses_Opera
+SD%Complete: 90
+SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing.
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_karazhan.h"
+
+/***********************************/
+/*** OPERA WIZARD OF OZ EVENT *****/
+/*********************************/
+
+/**** Spells ****/
+// Dorothee
+#define SPELL_WATERBOLT 31012
+#define SPELL_SCREAM 31013
+#define SPELL_SUMMONTITO 31014
+
+// Tito
+#define SPELL_YIPPING 31015
+
+// Strawman
+#define SPELL_BRAIN_BASH 31046
+#define SPELL_BRAIN_WIPE 31069
+#define SPELL_BURNING_STRAW 31075
+
+// Tinhead
+#define SPELL_CLEAVE 31043
+#define SPELL_RUST 31086
+
+// Roar
+#define SPELL_MANGLE 31041
+#define SPELL_SHRED 31042
+#define SPELL_FRIGHTENED_SCREAM 31013
+
+// Crone
+#define SPELL_CHAIN_LIGHTNING 32337
+
+// Cyclone
+#define SPELL_KNOCKBACK 32334
+#define SPELL_CYCLONE_VISUAL 32332
+
+/** Creature Entries **/
+#define CREATURE_TITO 17548
+#define CREATURE_CYCLONE 18412
+#define CREATURE_CRONE 18168
+
+/***** Speech and Sound *****/
+#define SAY_DOROTHEE_DEATH "Oh at last, at last. I can go home."
+#define SOUND_DOROTHEE_DEATH 9190
+#define SAY_DOROTHEE_SUMMON "Don't let them hurt us, Tito! Oh, you won't, will you?"
+#define SOUND_DOROTHEE_SUMMON 9191
+#define SAY_DOROTHEE_TITO_DEATH "Tito, oh Tito, no!"
+#define SOUND_DOROTHEE_TITO_DEATH 9192
+#define SAY_DOROTHEE_AGGRO "Oh dear, we simply must find a way home! The old wizard could be our only hope! Strawman, Roar, Tinhead, will you... wait! Oh golly, look! We have visitors!"
+#define SOUND_DOROTHEE_AGGRO 9195
+
+#define SAY_ROAR_AGGRO "Wanna fight? Huh? Do ya? C'mon, I'll fight you with both claws behind my back!"
+#define SOUND_ROAR_AGGRO 9227
+#define SAY_ROAR_DEATH "You didn't have to go and do that."
+#define SOUND_ROAR_DEATH 9229
+#define SAY_ROAR_SLAY "I think I'm going to go take fourty winks"
+#define SOUND_ROAR_SLAY 9230
+
+#define SAY_STRAWMAN_AGGRO "Now what should I do with you? I simply can't make up my mind."
+#define SOUND_STRAWMAN_AGGRO 9254
+#define SAY_STRAWMAN_DEATH "Don't let them make a mattress... out of me."
+#define SOUND_STRAWMAN_DEATH 9256
+#define SAY_STRAWMAN_SLAY "I guess I'm not a failure after all."
+#define SOUND_STRAWMAN_SLAY 9257
+
+#define SAY_TINHEAD_AGGRO "I could really use a heart. Say, can I have yours?"
+#define SOUND_TINHEAD_AGGRO 9268
+#define SAY_TINHEAD_DEATH "Back to being an old rustbucket."
+#define SOUND_TINHEAD_DEATH 9270
+#define SAY_TINHEAD_SLAY "Guess I'm not so rusty, after all."
+#define SOUND_TINHEAD_SLAY 9271
+
+#define SAY_CRONE_AGGRO "Woe to each and every one of you my pretties!"
+#define SOUND_CRONE_AGGRO 9179
+#define SAY_CRONE_AGGRO2 "It will all be over soon!"
+#define SOUND_CRONE_AGGRO2 9307
+#define SAY_CRONE_DEATH "How could you? What a cruel, cruel world!"
+#define SOUND_CRONE_DEATH 9178
+#define SAY_CRONE_SLAY "Fixed you, didn't I?"
+#define SOUND_CRONE_SLAY 9180
+
+void SummonCroneIfReady(ScriptedInstance* pInstance, Creature *_Creature)
+{
+ pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, 0); // Increment DeathCount
+ if(pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4)
+ {
+ Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ if(Crone)
+ {
+ if(_Creature->getVictim())
+ Crone->AI()->AttackStart(_Creature->getVictim());
+
+ Crone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
+{
+ boss_dorotheeAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 AggroTimer;
+
+ uint32 WaterBoltTimer;
+ uint32 FearTimer;
+ uint32 SummonTitoTimer;
+
+ bool SummonedTito;
+ bool TitoDied;
+ bool InCombat;
+
+ void Reset()
+ {
+ AggroTimer = 500;
+
+ WaterBoltTimer = 5000;
+ FearTimer = 15000;
+ SummonTitoTimer = 47500;
+
+ SummonedTito = false;
+ TitoDied = false;
+ InCombat = false;
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_DOROTHEE_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_AGGRO);
+ }
+
+ void SummonTito(); // See below
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_DOROTHEE_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_DEATH);
+
+ if(pInstance)
+ SummonCroneIfReady(pInstance, m_creature);
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::AttackStart(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(AggroTimer)
+ if(AggroTimer <= diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ AggroTimer = 0;
+ }else AggroTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(WaterBoltTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT);
+ WaterBoltTimer = TitoDied ? 1500 : 5000;
+ }else WaterBoltTimer -= diff;
+
+ if(FearTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SCREAM);
+ FearTimer = 30000;
+ }else FearTimer -= diff;
+
+ if(!SummonedTito)
+ {
+ if(SummonTitoTimer < diff)
+ SummonTito();
+ else SummonTitoTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
+{
+ mob_titoAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 DorotheeGUID;
+
+ uint32 YipTimer;
+
+ void Reset()
+ {
+ DorotheeGUID = 0;
+
+ YipTimer = 10000;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void JustDied(Unit* killer)
+ {
+ if(DorotheeGUID)
+ {
+ Creature* Dorothee = ((Creature*)Unit::GetUnit((*m_creature), DorotheeGUID));
+ if(Dorothee && Dorothee->isAlive())
+ {
+ ((boss_dorotheeAI*)Dorothee->AI())->TitoDied = true;
+ Dorothee->MonsterYell(SAY_DOROTHEE_TITO_DEATH, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Dorothee, SOUND_DOROTHEE_TITO_DEATH);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(YipTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_YIPPING);
+ YipTimer = 10000;
+ }else YipTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+void boss_dorotheeAI::SummonTito()
+{
+ Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ if(Tito)
+ {
+ DoYell(SAY_DOROTHEE_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DOROTHEE_SUMMON);
+ ((mob_titoAI*)Tito->AI())->DorotheeGUID = m_creature->GetGUID();
+ Tito->AI()->AttackStart(m_creature->getVictim());
+ SummonedTito = true;
+ TitoDied = false;
+ }
+}
+
+struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI
+{
+ boss_strawmanAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 AggroTimer;
+ uint32 BrainBashTimer;
+ uint32 BrainWipeTimer;
+
+ void Reset()
+ {
+ AggroTimer = 13000;
+ BrainBashTimer = 5000;
+ BrainWipeTimer = 7000;
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::AttackStart(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_STRAWMAN_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_AGGRO);
+ }
+
+ void SpellHit(Unit* caster, const SpellEntry *Spell)
+ {
+ if((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
+ DoCast(m_creature, SPELL_BURNING_STRAW, true);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_STRAWMAN_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_DEATH);
+
+ if(pInstance)
+ SummonCroneIfReady(pInstance, m_creature);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_STRAWMAN_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_STRAWMAN_SLAY);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(AggroTimer)
+ if(AggroTimer <= diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ AggroTimer = 0;
+ }else AggroTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(BrainBashTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH);
+ BrainBashTimer = 15000;
+ }else BrainBashTimer -= diff;
+
+ if(BrainWipeTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BRAIN_WIPE);
+ BrainWipeTimer = 20000;
+ }else BrainWipeTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI
+{
+ boss_tinheadAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 AggroTimer;
+ uint32 CleaveTimer;
+ uint32 RustTimer;
+
+ uint8 RustCount;
+
+ void Reset()
+ {
+ AggroTimer = 15000;
+ CleaveTimer = 5000;
+ RustTimer = 30000;
+
+ RustCount = 0;
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_TINHEAD_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TINHEAD_AGGRO);
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::AttackStart(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_TINHEAD_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TINHEAD_DEATH);
+
+ if(pInstance)
+ SummonCroneIfReady(pInstance, m_creature);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_TINHEAD_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TINHEAD_SLAY);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(AggroTimer)
+ if(AggroTimer < diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ AggroTimer = 0;
+ }else AggroTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(CleaveTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ CleaveTimer = 5000;
+ }else CleaveTimer -= diff;
+
+ if(RustCount < 8)
+ {
+ if(RustTimer < diff)
+ {
+ RustCount++;
+ DoTextEmote("begins to rust", NULL);
+ DoCast(m_creature, SPELL_RUST);
+ RustTimer = 6000;
+ }else RustTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI
+{
+ boss_roarAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 AggroTimer;
+ uint32 MangleTimer;
+ uint32 ShredTimer;
+ uint32 ScreamTimer;
+
+ void Reset()
+ {
+ AggroTimer = 20000;
+ MangleTimer = 5000;
+ ShredTimer = 10000;
+ ScreamTimer = 15000;
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::AttackStart(who);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_ROAR_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROAR_AGGRO);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_ROAR_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROAR_DEATH);
+
+ if(pInstance)
+ SummonCroneIfReady(pInstance, m_creature);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_ROAR_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROAR_SLAY);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(AggroTimer)
+ if(AggroTimer <= diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ AggroTimer = 0;
+ }else AggroTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(MangleTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MANGLE);
+ MangleTimer = 5000 + rand()%3000;
+ }else MangleTimer -= diff;
+
+ if(ShredTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHRED);
+ ShredTimer = 10000 + rand()%5000;
+ }else ShredTimer -= diff;
+
+ if(ScreamTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM);
+ ScreamTimer = 20000 + rand()%10000;
+ }else ScreamTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI
+{
+ boss_croneAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 CycloneTimer;
+ uint32 ChainLightningTimer;
+
+ void Reset()
+ {
+ CycloneTimer = 30000;
+ ChainLightningTimer = 10000;
+ }
+
+ void Aggro(Unit* who)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_CRONE_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CRONE_AGGRO);
+ break;
+ case 1:
+ DoYell(SAY_CRONE_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CRONE_AGGRO2);
+ break;
+ }
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_CRONE_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CRONE_DEATH);
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_OPERA_EVENT, DONE);
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
+ if(Door)
+ Door->UseDoorOrButton();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ if(CycloneTimer < diff)
+ {
+ Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, rand()%10, rand()%10, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
+ if(Cyclone)
+ Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true);
+ CycloneTimer = 30000;
+ }else CycloneTimer -= diff;
+
+ if(ChainLightningTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ ChainLightningTimer = 15000;
+ }else ChainLightningTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI
+{
+ mob_cycloneAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 MoveTimer;
+
+ void Reset()
+ {
+ MoveTimer = 1000;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->HasAura(SPELL_KNOCKBACK, 0))
+ DoCast(m_creature, SPELL_KNOCKBACK, true);
+
+ if(MoveTimer < diff)
+ {
+ float x,y,z;
+ m_creature->GetPosition(x,y,z);
+ float PosX, PosY, PosZ;
+ m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ);
+ m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ);
+ MoveTimer = 5000 + rand()%3000;
+ }else MoveTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_dorothee(Creature* _Creature)
+{
+ return new boss_dorotheeAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_strawman(Creature* _Creature)
+{
+ return new boss_strawmanAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_tinhead(Creature* _Creature)
+{
+ return new boss_tinheadAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_roar(Creature* _Creature)
+{
+ return new boss_roarAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_crone(Creature* _Creature)
+{
+ return new boss_croneAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_tito(Creature* _Creature)
+{
+ return new mob_titoAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_cyclone(Creature* _Creature)
+{
+ return new mob_cycloneAI(_Creature);
+}
+
+/**************************************/
+/**** Opera Red Riding Hood Event ****/
+/************************************/
+
+#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?"
+
+/**** Spells For The Wolf ****/
+#define SPELL_LITTLE_RED_RIDING_HOOD 30768
+#define SPELL_TERRIFYING_HOWL 30752
+#define SPELL_WIDE_SWIPE 30761
+
+/**** Yells for the Wolf ****/
+#define SAY_WOLF_AGGRO "All the better to own you with!"
+#define SOUND_WOLF_AGGRO 9276
+#define SOUND_WOLF_DEATH 9275 // No speech
+#define SAY_WOLF_SLAY "Mmmm... delicious."
+#define SOUND_WOLF_SLAY 9277
+#define SAY_WOLF_HOOD "Run away little girl, run away!"
+#define SOUND_WOLF_HOOD 9278
+
+/**** The Wolf's Entry ****/
+#define CREATURE_BIG_BAD_WOLF 17521
+
+bool GossipHello_npc_grandmother(Player* player, Creature* _Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(8990, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_grandmother(Player* player, Creature* _Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF)
+ {
+ _Creature->SetVisibility(VISIBILITY_OFF);
+ float x,y,z;
+ _Creature->GetPosition(x,y,z);
+ Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ if(BigBadWolf)
+ {
+ BigBadWolf->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ BigBadWolf->AI()->AttackStart(player);
+ }
+
+ _Creature->setDeathState(JUST_DIED);
+ }
+
+ return true;
+}
+
+struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
+{
+ boss_bigbadwolfAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 ChaseTimer;
+ uint32 FearTimer;
+ uint32 SwipeTimer;
+
+ uint64 HoodGUID;
+ float TempThreat;
+
+ bool IsChasing;
+
+ void Reset()
+ {
+ ChaseTimer = 30000;
+ FearTimer = 25000 + rand()%10000;
+ SwipeTimer = 5000;
+
+ HoodGUID = 0;
+ TempThreat = 0;
+
+ IsChasing = false;
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_WOLF_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_WOLF_AGGRO);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_WOLF_DEATH);
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_OPERA_EVENT, DONE);
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
+ if(Door)
+ Door->UseDoorOrButton();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+
+ if(ChaseTimer < diff)
+ {
+ if(!IsChasing)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoYell(SAY_WOLF_HOOD, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_WOLF_HOOD);
+
+ DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
+ TempThreat = m_creature->getThreatManager().getThreat(target);
+ if(TempThreat)
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+ HoodGUID = target->GetGUID();
+ m_creature->AddThreat(target, 1000000.0f);
+ ChaseTimer = 20000;
+ IsChasing = true;
+ }
+ }
+ else
+ {
+ IsChasing = false;
+ Unit* target = Unit::GetUnit((*m_creature), HoodGUID);
+ if(target)
+ {
+ HoodGUID = 0;
+ if(m_creature->getThreatManager().getThreat(target))
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+ m_creature->AddThreat(target, TempThreat);
+ TempThreat = 0;
+ }
+
+ ChaseTimer = 40000;
+ }
+ }else ChaseTimer -= diff;
+
+ if(IsChasing)
+ return;
+
+ if(FearTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL);
+ FearTimer = 25000 + rand()%35000;
+ }else FearTimer -= diff;
+
+ if(SwipeTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE);
+ SwipeTimer = 25000 + rand()%5000;
+ }else SwipeTimer -= diff;
+
+ }
+};
+
+CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature)
+{
+ return new boss_bigbadwolfAI(_Creature);
+}
+
+/**********************************************/
+/******** Opera Romeo and Juliet Event *******/
+/********************************************/
+
+/***** Spells For Julianne *****/
+#define SPELL_BLINDING_PASSION 30890
+#define SPELL_DEVOTION 30887
+#define SPELL_ETERNAL_AFFECTION 30878
+#define SPELL_POWERFUL_ATTRACTION 30889
+#define SPELL_DRINK_POISON 30907
+
+/***** Spells For Romulo ****/
+#define SPELL_BACKWARD_LUNGE 30815
+#define SPELL_DARING 30841
+#define SPELL_DEADLY_SWATHE 30817
+#define SPELL_POISON_THRUST 30822
+
+/**** Other Misc. Spells ****/
+#define SPELL_UNDYING_LOVE 30951
+#define SPELL_RES_VISUAL 24171
+
+/**** Speech and Text *****/
+/****** Julianne *******/
+#define SAY_JULIANNE_AGGRO "What devil art thou, that dost torment me thus?"
+#define SOUND_JULIANNE_AGGRO 9196
+#define SAY_JULIANNE_ENTER "Where is my lord? Where is my Romulo?"
+#define SOUND_JULIANNE_ENTER 9199
+#define SAY_JULIANNE_DEATH01 "Romulo, I come! Oh... this do I drink to thee!"
+#define SOUND_JULIANNE_DEATH01 9198
+#define SAY_JULIANNE_DEATH02 "Where is my Lord? Where is my Romulo? Ohh, happy dagger! This is thy sheath! There rust, and let me die!"
+#define SOUND_JULIANNE_DEATH02 9310
+#define SAY_JULIANNE_RESURRECT "Come, gentle night; and give me back my Romulo!"
+#define SOUND_JULIANNE_RESURRECT 9200
+#define SAY_JULIANNE_SLAY "Parting is such sweet sorrow."
+#define SOUND_JULIANNE_SLAY 9201
+
+/****** Romulo *******/
+#define SAY_ROMULO_AGGRO "Wilt thou provoke me? Then have at thee, boy!"
+#define SOUND_ROMULO_AGGRO 9233
+#define SAY_ROMULO_DEATH "Thou smilest... upon the stroke that... murders me."
+#define SOUND_ROMULO_DEATH 9235
+#define SAY_ROMULO_ENTER "This day's black fate on more days doth depend. This but begins the woe. Others must end."
+#define SOUND_ROMULO_ENTER 9236
+#define SAY_ROMULO_RESURRECT "Thou detestable maw, thou womb of death; I enforce thy rotten jaws to open!"
+#define SOUND_ROMULO_RESURRECT 9237
+#define SAY_ROMULO_SLAY "How well my comfort is revived by this!"
+#define SOUND_ROMULO_SLAY 9238
+
+/*** Misc. Information ****/
+#define CREATURE_ROMULO 17533
+#define ROMULO_X -10900
+#define ROMULO_Y -1758
+
+enum RAJPhase
+{
+ PHASE_JULIANNE = 0,
+ PHASE_ROMULO = 1,
+ PHASE_BOTH = 2,
+};
+
+void PretendToDie(Creature* _Creature)
+{
+ _Creature->InterruptNonMeleeSpells(false);
+ _Creature->SetHealth(0);
+ _Creature->StopMoving();
+ _Creature->ClearComboPointHolders();
+ _Creature->RemoveAllAurasOnDeath();
+ _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
+ _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
+ _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ _Creature->ClearAllReactives();
+ _Creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
+ _Creature->GetMotionMaster()->Clear();
+ _Creature->GetMotionMaster()->MoveIdle();
+ _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+};
+
+void Resurrect(Creature* target)
+{
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ target->SetHealth(target->GetMaxHealth());
+ target->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ target->CastSpell(target, SPELL_RES_VISUAL, true);
+ if(target->getVictim())
+ {
+ target->SetUInt64Value(UNIT_FIELD_TARGET, target->getVictim()->GetGUID());
+ target->GetMotionMaster()->MoveChase(target->getVictim());
+ target->AI()->AttackStart(target->getVictim());
+ }
+};
+
+struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
+{
+ boss_julianneAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ EntryYellTimer = 1000;
+ AggroYellTimer = 10000;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 RomuloGUID;
+
+ uint32 Phase;
+
+ uint32 EntryYellTimer;
+ uint32 AggroYellTimer;
+ uint32 BlindingPassionTimer;
+ uint32 DevotionTimer;
+ uint32 EternalAffectionTimer;
+ uint32 PowerfulAttractionTimer;
+ uint32 SummonRomuloTimer;
+ uint32 ResurrectTimer;
+
+ bool IsFakingDeath;
+ bool SummonedRomulo;
+ bool RomuloDead;
+
+ void Reset()
+ {
+ if(RomuloGUID)
+ {
+ if(Unit* Romulo = Unit::GetUnit(*m_creature, RomuloGUID))
+ {
+ Romulo->SetVisibility(VISIBILITY_OFF);
+ Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ RomuloGUID = 0;
+ }
+
+ Phase = PHASE_JULIANNE;
+
+ BlindingPassionTimer = 30000;
+ DevotionTimer = 15000;
+ EternalAffectionTimer = 25000;
+ PowerfulAttractionTimer = 5000;
+
+ if(IsFakingDeath)
+ Resurrect(m_creature);
+
+ IsFakingDeath = false;
+ SummonedRomulo = false;
+ RomuloDead = false;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void AttackStart(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::AttackStart(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage);
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_JULIANNE_DEATH02, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_DEATH02);
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_OPERA_EVENT, DONE);
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
+ if(Door)
+ Door->UseDoorOrButton();
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_JULIANNE_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_SLAY);
+ }
+
+ void UpdateAI(const uint32 diff);
+};
+
+struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
+{
+ boss_romuloAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ EntryYellTimer = 8000;
+ AggroYellTimer = 15000;
+ }
+
+ uint64 JulianneGUID;
+
+ uint32 Phase;
+
+ uint32 EntryYellTimer;
+ uint32 AggroYellTimer;
+ uint32 BackwardLungeTimer;
+ uint32 DaringTimer;
+ uint32 DeadlySwatheTimer;
+ uint32 PoisonThrustTimer;
+ uint32 ResurrectTimer;
+
+ bool JulianneDead;
+ bool IsFakingDeath;
+
+ void Reset()
+ {
+ JulianneGUID = 0;
+
+ Phase = PHASE_ROMULO;
+
+ BackwardLungeTimer = 15000;
+ DaringTimer = 20000;
+ DeadlySwatheTimer = 25000;
+ PoisonThrustTimer = 10000;
+
+ if(IsFakingDeath)
+ Resurrect(m_creature);
+
+ IsFakingDeath = false;
+ JulianneDead = false;
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage);
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_ROMULO_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROMULO_AGGRO);
+ if(JulianneGUID)
+ {
+ Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
+ if(Julianne && Julianne->getVictim())
+ {
+ m_creature->AddThreat(Julianne->getVictim(), 1.0f);
+ DoStartAttackAndMovement(Julianne->getVictim());
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_ROMULO_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROMULO_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_ROMULO_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROMULO_SLAY);
+ }
+
+ void UpdateAI(const uint32 diff);
+};
+
+void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
+{
+ if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == RomuloGUID)
+ return;
+
+ if(Phase == PHASE_JULIANNE)
+ {
+ DoYell(SAY_JULIANNE_DEATH01, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_DEATH01);
+ m_creature->InterruptNonMeleeSpells(true);
+ DoCast(m_creature, SPELL_DRINK_POISON);
+ PretendToDie(m_creature);
+ Phase = PHASE_ROMULO;
+ damage = 0;
+ IsFakingDeath = true;
+ SummonRomuloTimer = 10000;
+ return;
+ }
+
+ if(!IsFakingDeath)
+ {
+ Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
+ if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
+ {
+ ((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
+ ((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
+ }
+ else
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if(Romulo)
+ {
+ Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ JustDied(done_by);
+ }
+
+ IsFakingDeath = true;
+ PretendToDie(m_creature);
+ damage = 0;
+ }
+ else
+ damage = 0;
+}
+
+void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
+{
+ if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == JulianneGUID)
+ return;
+
+ if(!IsFakingDeath)
+ {
+ IsFakingDeath = true;
+ PretendToDie(m_creature);
+
+ if(Phase == PHASE_BOTH)
+ {
+ Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
+ if(Julianne && Julianne->isAlive() && !((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
+ {
+ ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
+ ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
+ }
+ else
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if(Julianne)
+ {
+ Julianne->DealDamage(Julianne, Julianne->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ JustDied(done_by);
+ }
+ }
+ else
+ {
+ Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
+ if(Julianne)
+ {
+ Resurrect(Julianne);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 4000;
+ ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
+ ((boss_julianneAI*)Julianne->AI())->Phase = PHASE_BOTH;
+ ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
+ }
+ Phase = PHASE_BOTH;
+ }
+
+ damage = 0;
+ }
+
+ if(IsFakingDeath) damage = 0;
+}
+
+void boss_julianneAI::UpdateAI(const uint32 diff)
+{
+ if(EntryYellTimer)
+ if(EntryYellTimer < diff)
+ {
+ DoYell(SAY_JULIANNE_ENTER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_ENTER);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ EntryYellTimer = 0;
+ }else EntryYellTimer -= diff;
+
+ if(AggroYellTimer)
+ if(AggroYellTimer < diff)
+ {
+ DoYell(SAY_JULIANNE_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_AGGRO);
+ AggroYellTimer = 0;
+ }else AggroYellTimer -= diff;
+
+ if(Phase == PHASE_ROMULO && !SummonedRomulo)
+ {
+ if(SummonRomuloTimer < diff)
+ {
+ Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
+ if(Romulo)
+ {
+ RomuloGUID = Romulo->GetGUID();
+ ((boss_romuloAI*)Romulo->AI())->JulianneGUID = m_creature->GetGUID();
+ ((boss_romuloAI*)Romulo->AI())->Phase = PHASE_ROMULO;
+ if(m_creature->getVictim())
+ {
+ Romulo->AI()->AttackStart(m_creature->getVictim());
+ Romulo->AddThreat(m_creature->getVictim(), 50.0f);
+ }
+ DoZoneInCombat(Romulo);
+ }
+ SummonedRomulo = true;
+ }else SummonRomuloTimer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ||IsFakingDeath)
+ return;
+
+ if(RomuloDead)
+ if(ResurrectTimer < diff)
+ {
+ Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
+ if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
+ {
+ DoYell(SAY_JULIANNE_RESURRECT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_JULIANNE_RESURRECT);
+ Resurrect(Romulo);
+ ((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false;
+ ResurrectTimer = 10000;
+ }
+ RomuloDead = false;
+ }else ResurrectTimer -= diff;
+
+ if(BlindingPassionTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLINDING_PASSION);
+ BlindingPassionTimer = 30000 + rand()%15000;
+ }else BlindingPassionTimer -= diff;
+
+ if(DevotionTimer < diff)
+ {
+ DoCast(m_creature, SPELL_DEVOTION);
+ DevotionTimer = 15000 + rand()%30000;
+ }else DevotionTimer -= diff;
+
+ if(PowerfulAttractionTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION);
+ PowerfulAttractionTimer = 5000 + rand()%25000;
+ }else PowerfulAttractionTimer -= diff;
+
+ if(EternalAffectionTimer < diff)
+ {
+ if(rand()%2 == 1 && SummonedRomulo)
+ {
+ Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
+ if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
+ DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
+ else
+ return;
+ }
+ else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
+
+ EternalAffectionTimer = 45000 + rand()%15000;
+ }else EternalAffectionTimer -= diff;
+
+ DoMeleeAttackIfReady();
+}
+
+void boss_romuloAI::UpdateAI(const uint32 diff)
+{
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || IsFakingDeath)
+ return;
+
+ if(JulianneDead)
+ if(ResurrectTimer < diff)
+ {
+ Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
+ if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
+ {
+ DoYell(SAY_ROMULO_RESURRECT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ROMULO_RESURRECT);
+ Resurrect(Julianne);
+ ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
+ ResurrectTimer = 10000;
+ }
+ JulianneDead = false;
+ }else ResurrectTimer -= diff;
+
+ if(BackwardLungeTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && !m_creature->HasInArc(M_PI, target))
+ {
+ DoCast(target, SPELL_BACKWARD_LUNGE);
+ BackwardLungeTimer = 15000 + rand()%15000;
+ }
+ }else BackwardLungeTimer -= diff;
+
+ if(DaringTimer < diff)
+ {
+ DoCast(m_creature, SPELL_DARING);
+ DaringTimer = 20000 + rand()%20000;
+ }else DaringTimer -= diff;
+
+ if(DeadlySwatheTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEADLY_SWATHE);
+ DeadlySwatheTimer = 15000 + rand()%10000;
+ }else DeadlySwatheTimer -= diff;
+
+ if(PoisonThrustTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_POISON_THRUST);
+ PoisonThrustTimer = 10000 + rand()%10000;
+ }else PoisonThrustTimer -= diff;
+
+ DoMeleeAttackIfReady();
+}
+
+CreatureAI* GetAI_boss_julianne(Creature* _Creature)
+{
+ return new boss_julianneAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_romulo(Creature* _Creature)
+{
+ return new boss_romuloAI(_Creature);
+}
+
+void AddSC_bosses_opera()
+{
+ Script* newscript;
+
+ // Oz
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_dorothee;
+ newscript->Name = "boss_dorothee";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_strawman;
+ newscript->Name = "boss_strawman";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_tinhead;
+ newscript->Name = "boss_tinhead";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_roar;
+ newscript->Name = "boss_roar";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_crone;
+ newscript->Name = "boss_crone";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_mob_tito;
+ newscript->Name = "mob_tito";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_mob_cyclone;
+ newscript->Name = "mob_cyclone";
+ m_scripts[nrscripts++] = newscript;
+
+ // Hood
+ newscript = new Script;
+ newscript->pGossipHello = GossipHello_npc_grandmother;
+ newscript->pGossipSelect = GossipSelect_npc_grandmother;
+ newscript->Name = "npc_grandmother";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_bigbadwolf;
+ newscript->Name = "boss_bigbadwolf";
+ m_scripts[nrscripts++] = newscript;
+
+ // Romeo And Juliet
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_julianne;
+ newscript->Name = "boss_julianne";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_romulo;
+ newscript->Name = "boss_romulo";
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
index 86db3e86f6d..938c0131b9c 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
+++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
@@ -1,40 +1,40 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_KARAZHAN_H
-#define DEF_KARAZHAN_H
-
-#define DATA_ATTUMEN_EVENT 1
-#define DATA_MOROES_EVENT 2
-#define DATA_MAIDENOFVIRTUE_EVENT 3
-#define DATA_OPTIONAL_BOSS_EVENT 4
-#define DATA_OPERA_EVENT 5
-#define DATA_CURATOR_EVENT 6
-#define DATA_SHADEOFARAN_EVENT 7
-#define DATA_TERESTIAN_EVENT 8
-#define DATA_NETHERSPITE_EVENT 9
-#define DATA_CHESS_EVENT 10
-#define DATA_MALCHEZZAR_EVENT 11
-#define DATA_NETHERBANE_EVENT 12
-#define DATA_OPERA_PERFORMANCE 13
-#define DATA_OPERA_OZ_DEATHCOUNT 14
-#define DATA_KILREK 15
-#define DATA_TERESTIAN 16
-#define DATA_MOROES 17
-#define DATA_GAMEOBJECT_CURTAINS 18
-#define DATA_GAMEOBJECT_STAGEDOORLEFT 19
-#define DATA_GAMEOBJECT_STAGEDOORRIGHT 20
-#define DATA_GAMEOBJECT_LIBRARY_DOOR 21
-#define DATA_GAMEOBJECT_MASSIVE_DOOR 22
-#define DATA_GAMEOBJECT_NETHER_DOOR 23
-#define DATA_GAMEOBJECT_GAME_DOOR 24
-#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25
-
-// Opera Performances
-#define EVENT_OZ 1
-#define EVENT_HOOD 2
-#define EVENT_RAJ 3
-
-#define ERROR_INST_DATA(a) error_log("SD2: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_KARAZHAN_H
+#define DEF_KARAZHAN_H
+
+#define DATA_ATTUMEN_EVENT 1
+#define DATA_MOROES_EVENT 2
+#define DATA_MAIDENOFVIRTUE_EVENT 3
+#define DATA_OPTIONAL_BOSS_EVENT 4
+#define DATA_OPERA_EVENT 5
+#define DATA_CURATOR_EVENT 6
+#define DATA_SHADEOFARAN_EVENT 7
+#define DATA_TERESTIAN_EVENT 8
+#define DATA_NETHERSPITE_EVENT 9
+#define DATA_CHESS_EVENT 10
+#define DATA_MALCHEZZAR_EVENT 11
+#define DATA_NETHERBANE_EVENT 12
+#define DATA_OPERA_PERFORMANCE 13
+#define DATA_OPERA_OZ_DEATHCOUNT 14
+#define DATA_KILREK 15
+#define DATA_TERESTIAN 16
+#define DATA_MOROES 17
+#define DATA_GAMEOBJECT_CURTAINS 18
+#define DATA_GAMEOBJECT_STAGEDOORLEFT 19
+#define DATA_GAMEOBJECT_STAGEDOORRIGHT 20
+#define DATA_GAMEOBJECT_LIBRARY_DOOR 21
+#define DATA_GAMEOBJECT_MASSIVE_DOOR 22
+#define DATA_GAMEOBJECT_NETHER_DOOR 23
+#define DATA_GAMEOBJECT_GAME_DOOR 24
+#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25
+
+// Opera Performances
+#define EVENT_OZ 1
+#define EVENT_HOOD 2
+#define EVENT_RAJ 3
+
+#define ERROR_INST_DATA(a) error_log("SD2: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
+#endif
diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
index 4ecffecc3bf..f683eea5336 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
@@ -1,253 +1,253 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Karazhan
-SD%Complete: 70
-SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event.
-SDCategory: Karazhan
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_karazhan.h"
-
-#define ENCOUNTERS 11
-
-/*
-0 - Attumen + Midnight (optional)
-1 - Moroes
-2 - Maiden of Virtue (optional)
-3 - Hyakiss the Lurker / Rokad the Ravager / Shadikith the Glider
-4 - Opera Event
-5 - Curator
-6 - Shade of Aran (optional)
-7 - Terestian Illhoof (optional)
-8 - Netherspite (optional)
-9 - Chess Event
-10 - Prince Malchezzar
-11 - Netherbane
-*/
-struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
-{
- instance_karazhan(Map* map) : ScriptedInstance(map)
- {
- Initialize();
- }
-
- uint32 Encounters[ENCOUNTERS];
-
- uint32 OperaEvent; // 0 - OZ, 1 - HOOD, 2 - RAJ
- uint32 OzDeathCount;
-
- uint64 CurtainGUID;
- uint64 StageDoorLeftGUID;
- uint64 StageDoorRightGUID;
- uint64 KilrekGUID;
- uint64 TerestianGUID;
- uint64 MoroesGUID;
- uint64 LibraryDoor; // Door at Shade of Aran
- uint64 MassiveDoor; // Door at Netherspite
- uint64 GamesmansDoor; // Door before Chess
- uint64 GamesmansExitDoor; // Door after Chess
- uint64 NetherspaceDoor; // Door at Malchezaar
-
- void Initialize()
- {
- for (uint8 i = 0; i < ENCOUNTERS; ++i)
- Encounters[i] = NOT_STARTED;
-
- OperaEvent = rand()%3; // This never gets altered.
- OzDeathCount = 0;
-
- CurtainGUID = 0;
- StageDoorLeftGUID = 0;
- StageDoorRightGUID = 0;
-
- KilrekGUID = 0;
- TerestianGUID = 0;
- MoroesGUID = 0;
-
- LibraryDoor = 0;
- MassiveDoor = 0;
- GamesmansDoor = 0;
- GamesmansExitDoor = 0;
- NetherspaceDoor = 0;
- }
-
- bool IsEncounterInProgress() const
- {
- for (uint8 i = 0; i < ENCOUNTERS; ++i)
- if (Encounters[i] == IN_PROGRESS) return true;
-
- return false;
- }
-
- uint32 GetData(uint32 identifier)
- {
- switch (identifier)
- {
- case DATA_ATTUMEN_EVENT: return Encounters[0];
- case DATA_MOROES_EVENT: return Encounters[1];
- case DATA_MAIDENOFVIRTUE_EVENT: return Encounters[2];
- case DATA_OPTIONAL_BOSS_EVENT: return Encounters[3];
- case DATA_OPERA_EVENT: return Encounters[4];
- case DATA_CURATOR_EVENT: return Encounters[5];
- case DATA_SHADEOFARAN_EVENT: return Encounters[6];
- case DATA_TERESTIAN_EVENT: return Encounters[7];
- case DATA_NETHERSPITE_EVENT: return Encounters[8];
- case DATA_CHESS_EVENT: return Encounters[9];
- case DATA_MALCHEZZAR_EVENT: return Encounters[10];
- case DATA_NETHERBANE_EVENT: return Encounters[11];
- case DATA_OPERA_PERFORMANCE: return OperaEvent;
- case DATA_OPERA_OZ_DEATHCOUNT: return OzDeathCount;
- }
-
- return 0;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 entry)
- {
- switch (entry)
- {
- case 17229: KilrekGUID = creature->GetGUID(); break;
- case 15688: TerestianGUID = creature->GetGUID(); break;
- case 15687: MoroesGUID = creature->GetGUID(); break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch (identifier)
- {
- case DATA_KILREK: return KilrekGUID;
- case DATA_TERESTIAN: return TerestianGUID;
- case DATA_MOROES: return MoroesGUID;
- case DATA_GAMEOBJECT_STAGEDOORLEFT: return StageDoorLeftGUID;
- case DATA_GAMEOBJECT_STAGEDOORRIGHT: return StageDoorRightGUID;
- case DATA_GAMEOBJECT_CURTAINS: return CurtainGUID;
- case DATA_GAMEOBJECT_LIBRARY_DOOR: return LibraryDoor;
- case DATA_GAMEOBJECT_MASSIVE_DOOR: return MassiveDoor;
- case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor;
- case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor;
- case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor;
- }
-
- return 0;
- }
-
- void SetData(uint32 identifier, uint32 data)
- {
- switch (identifier)
- {
- case DATA_ATTUMEN_EVENT: Encounters[0] = data; break;
- case DATA_MOROES_EVENT: Encounters[1] = data; break;
- case DATA_MAIDENOFVIRTUE_EVENT: Encounters[2] = data; break;
- case DATA_OPTIONAL_BOSS_EVENT: Encounters[3] = data; break;
- case DATA_OPERA_EVENT: Encounters[4] = data; break;
- case DATA_CURATOR_EVENT: Encounters[5] = data; break;
- case DATA_SHADEOFARAN_EVENT: Encounters[6] = data; break;
- case DATA_TERESTIAN_EVENT: Encounters[7] = data; break;
- case DATA_NETHERSPITE_EVENT: Encounters[8] = data; break;
- case DATA_CHESS_EVENT: Encounters[9] = data; break;
- case DATA_MALCHEZZAR_EVENT: Encounters[10] = data; break;
- case DATA_NETHERBANE_EVENT: Encounters[11] = data; break;
-
- case DATA_OPERA_OZ_DEATHCOUNT: ++OzDeathCount; break;
- }
-
- if(data == DONE)
- SaveToDB();
- }
-
- void OnObjectCreate(GameObject* go)
- {
- switch(go->GetEntry())
- {
- case 183932: CurtainGUID = go->GetGUID(); break;
- case 184278: StageDoorLeftGUID = go->GetGUID(); break;
- case 184279: StageDoorRightGUID = go->GetGUID(); break;
- case 184517: LibraryDoor = go->GetGUID(); break;
- case 185521: MassiveDoor = go->GetGUID(); break;
- case 184276: GamesmansDoor = go->GetGUID(); break;
- case 184277: GamesmansExitDoor = go->GetGUID(); break;
- case 185134: NetherspaceDoor = go->GetGUID(); break;
- }
-
- switch(OperaEvent)
- {
- //TODO: Set Object visibilities for Opera based on performance
- case EVENT_OZ:
- break;
-
- case EVENT_HOOD:
- break;
-
- case EVENT_RAJ:
- break;
- }
- }
-
- const char* Save()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " "
- << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] << " "
- << Encounters[8] << " " << Encounters[9] << " " << Encounters[10];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if(out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
-
- return NULL;
- }
-
- void Load(const char* in)
- {
- if(!in)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
- >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
- >> Encounters[8] >> Encounters[9] >> Encounters[10];
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- Encounters[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
-};
-
-InstanceData* GetInstanceData_instance_karazhan(Map* map)
-{
- return new instance_karazhan(map);
-}
-
-void AddSC_instance_karazhan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_karazhan";
- newscript->GetInstanceData = GetInstanceData_instance_karazhan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Karazhan
+SD%Complete: 70
+SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event.
+SDCategory: Karazhan
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_karazhan.h"
+
+#define ENCOUNTERS 11
+
+/*
+0 - Attumen + Midnight (optional)
+1 - Moroes
+2 - Maiden of Virtue (optional)
+3 - Hyakiss the Lurker / Rokad the Ravager / Shadikith the Glider
+4 - Opera Event
+5 - Curator
+6 - Shade of Aran (optional)
+7 - Terestian Illhoof (optional)
+8 - Netherspite (optional)
+9 - Chess Event
+10 - Prince Malchezzar
+11 - Netherbane
+*/
+struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
+{
+ instance_karazhan(Map* map) : ScriptedInstance(map)
+ {
+ Initialize();
+ }
+
+ uint32 Encounters[ENCOUNTERS];
+
+ uint32 OperaEvent; // 0 - OZ, 1 - HOOD, 2 - RAJ
+ uint32 OzDeathCount;
+
+ uint64 CurtainGUID;
+ uint64 StageDoorLeftGUID;
+ uint64 StageDoorRightGUID;
+ uint64 KilrekGUID;
+ uint64 TerestianGUID;
+ uint64 MoroesGUID;
+ uint64 LibraryDoor; // Door at Shade of Aran
+ uint64 MassiveDoor; // Door at Netherspite
+ uint64 GamesmansDoor; // Door before Chess
+ uint64 GamesmansExitDoor; // Door after Chess
+ uint64 NetherspaceDoor; // Door at Malchezaar
+
+ void Initialize()
+ {
+ for (uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+
+ OperaEvent = rand()%3; // This never gets altered.
+ OzDeathCount = 0;
+
+ CurtainGUID = 0;
+ StageDoorLeftGUID = 0;
+ StageDoorRightGUID = 0;
+
+ KilrekGUID = 0;
+ TerestianGUID = 0;
+ MoroesGUID = 0;
+
+ LibraryDoor = 0;
+ MassiveDoor = 0;
+ GamesmansDoor = 0;
+ GamesmansExitDoor = 0;
+ NetherspaceDoor = 0;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for (uint8 i = 0; i < ENCOUNTERS; ++i)
+ if (Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ uint32 GetData(uint32 identifier)
+ {
+ switch (identifier)
+ {
+ case DATA_ATTUMEN_EVENT: return Encounters[0];
+ case DATA_MOROES_EVENT: return Encounters[1];
+ case DATA_MAIDENOFVIRTUE_EVENT: return Encounters[2];
+ case DATA_OPTIONAL_BOSS_EVENT: return Encounters[3];
+ case DATA_OPERA_EVENT: return Encounters[4];
+ case DATA_CURATOR_EVENT: return Encounters[5];
+ case DATA_SHADEOFARAN_EVENT: return Encounters[6];
+ case DATA_TERESTIAN_EVENT: return Encounters[7];
+ case DATA_NETHERSPITE_EVENT: return Encounters[8];
+ case DATA_CHESS_EVENT: return Encounters[9];
+ case DATA_MALCHEZZAR_EVENT: return Encounters[10];
+ case DATA_NETHERBANE_EVENT: return Encounters[11];
+ case DATA_OPERA_PERFORMANCE: return OperaEvent;
+ case DATA_OPERA_OZ_DEATHCOUNT: return OzDeathCount;
+ }
+
+ return 0;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 entry)
+ {
+ switch (entry)
+ {
+ case 17229: KilrekGUID = creature->GetGUID(); break;
+ case 15688: TerestianGUID = creature->GetGUID(); break;
+ case 15687: MoroesGUID = creature->GetGUID(); break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch (identifier)
+ {
+ case DATA_KILREK: return KilrekGUID;
+ case DATA_TERESTIAN: return TerestianGUID;
+ case DATA_MOROES: return MoroesGUID;
+ case DATA_GAMEOBJECT_STAGEDOORLEFT: return StageDoorLeftGUID;
+ case DATA_GAMEOBJECT_STAGEDOORRIGHT: return StageDoorRightGUID;
+ case DATA_GAMEOBJECT_CURTAINS: return CurtainGUID;
+ case DATA_GAMEOBJECT_LIBRARY_DOOR: return LibraryDoor;
+ case DATA_GAMEOBJECT_MASSIVE_DOOR: return MassiveDoor;
+ case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor;
+ case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor;
+ case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 identifier, uint32 data)
+ {
+ switch (identifier)
+ {
+ case DATA_ATTUMEN_EVENT: Encounters[0] = data; break;
+ case DATA_MOROES_EVENT: Encounters[1] = data; break;
+ case DATA_MAIDENOFVIRTUE_EVENT: Encounters[2] = data; break;
+ case DATA_OPTIONAL_BOSS_EVENT: Encounters[3] = data; break;
+ case DATA_OPERA_EVENT: Encounters[4] = data; break;
+ case DATA_CURATOR_EVENT: Encounters[5] = data; break;
+ case DATA_SHADEOFARAN_EVENT: Encounters[6] = data; break;
+ case DATA_TERESTIAN_EVENT: Encounters[7] = data; break;
+ case DATA_NETHERSPITE_EVENT: Encounters[8] = data; break;
+ case DATA_CHESS_EVENT: Encounters[9] = data; break;
+ case DATA_MALCHEZZAR_EVENT: Encounters[10] = data; break;
+ case DATA_NETHERBANE_EVENT: Encounters[11] = data; break;
+
+ case DATA_OPERA_OZ_DEATHCOUNT: ++OzDeathCount; break;
+ }
+
+ if(data == DONE)
+ SaveToDB();
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ switch(go->GetEntry())
+ {
+ case 183932: CurtainGUID = go->GetGUID(); break;
+ case 184278: StageDoorLeftGUID = go->GetGUID(); break;
+ case 184279: StageDoorRightGUID = go->GetGUID(); break;
+ case 184517: LibraryDoor = go->GetGUID(); break;
+ case 185521: MassiveDoor = go->GetGUID(); break;
+ case 184276: GamesmansDoor = go->GetGUID(); break;
+ case 184277: GamesmansExitDoor = go->GetGUID(); break;
+ case 185134: NetherspaceDoor = go->GetGUID(); break;
+ }
+
+ switch(OperaEvent)
+ {
+ //TODO: Set Object visibilities for Opera based on performance
+ case EVENT_OZ:
+ break;
+
+ case EVENT_HOOD:
+ break;
+
+ case EVENT_RAJ:
+ break;
+ }
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " "
+ << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] << " "
+ << Encounters[8] << " " << Encounters[9] << " " << Encounters[10];
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if(out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+
+ return NULL;
+ }
+
+ void Load(const char* in)
+ {
+ if(!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
+ >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
+ >> Encounters[8] >> Encounters[9] >> Encounters[10];
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
+ Encounters[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_karazhan(Map* map)
+{
+ return new instance_karazhan(map);
+}
+
+void AddSC_instance_karazhan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_karazhan";
+ newscript->GetInstanceData = GetInstanceData_instance_karazhan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
index b6d5648f9b9..b0ab0d86db5 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
@@ -1,470 +1,470 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Karazhan
-SD%Complete: 100
-SDComment: Support for Barnes (Opera controller) and Berthold (Doorman).
-SDCategory: Karazhan
-EndScriptData */
-
-/* ContentData
-npc_barnes
-npc_berthold
-EndContentData */
-
-#include "precompiled.h"
-#include "def_karazhan.h"
-#include "../../npc/npc_escortAI.h"
-
-/*######
-# npc_barnesAI
-######*/
-
-#define GOSSIP_READY "I'm not an actor."
-
-#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!"
-#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?"
-#define OZ_GOSSIP1 "I'm not an actor."
-#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!"
-#define OZ_GOSSIP2 "Ok, I'll give it a try, then."
-
-#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?"
-#define RAJ_GOSSIP1 "I've never been more ready."
-
-struct Dialogue
-{
- char* text;
- uint32 soundid, timer;
-};
-
-static Dialogue OzDialogue[]=
-{
- {"Welcome Ladies and Gentlemen, to this evening's presentation!", 9174, 6000},
- {"Tonight we plumb the depths of the human soul as we join a lost, lonely girl trying desperately -- with the help of her loyal companions -- to find her way home!", 9338, 18000},
- {"But she is pursued... by a wicked malevolent crone!", 9339, 9000},
- {"Will she survive? Will she prevail? Only time will tell. And now ... on with the show!", 9340, 15000}
-};
-
-static Dialogue HoodDialogue[]=
-{
- {"Good evening, Ladies and Gentlemen! Welcome to this evening's presentation!", 9175, 6000},
- {"Tonight, things are not what they seem. For tonight, your eyes may not be trusted", 9335, 10000},
- {"Take for instance, this quiet, elderly woman, waiting for a visit from her granddaughter. Surely there is nothing to fear from this sweet, grey-haired, old lady.", 9336, 14000},
- {"But don't let me pull the wool over your eyes. See for yourself what lies beneath those covers! And now... on with the show!", 9337, 15000}
-};
-
-static Dialogue RAJDialogue[]=
-{
- {"Welcome, Ladies and Gentlemen, to this evening's presentation!", 9176, 5000},
- {"Tonight, we explore a tale of forbidden love!", 9341, 7000},
- {"But beware, for not all love stories end happily, as you may find out. Sometimes, love pricks like a thorn.", 9342, 14000},
- {"But don't take it from me, see for yourself what tragedy lies ahead when the paths of star-crossed lovers meet. And now...on with the show!", 9343, 14000}
-};
-
-// Entries and spawn locations for creatures in Oz event
-float Spawns[6][2]=
-{
- {17535, -10896}, // Dorothee
- {17546, -10891}, // Roar
- {17547, -10884}, // Tinhead
- {17543, -10902}, // Strawman
- {17603, -10892}, // Grandmother
- {17534, -10900}, // Julianne
-};
-
-float StageLocations[6][2]=
-{
- {-10866.711, -1779.816}, // Open door, begin walking (0)
- {-10894.917, -1775.467}, // (1)
- {-10896.044, -1782.619}, // Begin Speech after this (2)
- {-10894.917, -1775.467}, // Resume walking (back to spawn point now) after speech (3)
- {-10866.711, -1779.816}, // (4)
- {-10866.700, -1781.030} // Summon mobs, open curtains, close door (5)
-};
-
-#define CREATURE_SPOTLIGHT 19525
-
-#define SPELL_SPOTLIGHT 25824
-#define SPELL_TUXEDO 32616
-
-#define SPAWN_Z 90.5
-#define SPAWN_Y -1758
-#define SPAWN_O 4.738
-
-struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
-{
- npc_barnesAI(Creature* c) : npc_escortAI(c)
- {
- RaidWiped = false;
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 SpotlightGUID;
-
- uint32 TalkCount;
- uint32 TalkTimer;
- uint32 CurtainTimer;
- uint32 WipeTimer;
- uint32 Event;
-
- bool PerformanceReady;
- bool RaidWiped;
- bool IsTalking;
-
- void Reset()
- {
- TalkCount = 0;
- TalkTimer = 2000;
- CurtainTimer = 5000;
- WipeTimer = 5000;
-
- PerformanceReady = false;
- IsTalking = false;
-
- if(pInstance)
- {
- pInstance->SetData(DATA_OPERA_EVENT, NOT_STARTED);
-
- Event = pInstance->GetData(DATA_OPERA_PERFORMANCE);
-
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
- if(Door)
- Door->SetGoState(1);
-
- GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS));
- if(Curtain)
- Curtain->SetGoState(1);
- }
- }
-
- void Aggro(Unit* who) {}
-
- void WaypointReached(uint32 i)
- {
- switch(i)
- {
- case 2:
- IsBeingEscorted = false;
- TalkCount = 0;
- IsTalking = true;
-
- float x,y,z;
- m_creature->GetPosition(x, y, z);
- Creature* Spotlight;
- Spotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 50000);
- if(Spotlight)
- {
- Spotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Spotlight->CastSpell(Spotlight, SPELL_SPOTLIGHT, false);
- SpotlightGUID = Spotlight->GetGUID();
- }
- break;
-
- case 5:
- if(pInstance)
- {
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
- if(Door)
- Door->SetGoState(1);
- }
- IsBeingEscorted = false;
- PerformanceReady = true;
- break;
- }
- }
-
- void Talk(uint32 count)
- {
- char* text = NULL;
- uint32 sound = 0;
-
- switch(Event)
- {
- case EVENT_OZ:
- if(OzDialogue[count].text)
- text = OzDialogue[count].text;
- if(OzDialogue[count].soundid)
- sound = OzDialogue[count].soundid;
- if(OzDialogue[count].timer)
- TalkTimer = OzDialogue[count].timer;
- break;
-
- case EVENT_HOOD:
- if(HoodDialogue[count].text)
- text = HoodDialogue[count].text;
- if(HoodDialogue[count].soundid)
- sound = HoodDialogue[count].soundid;
- if(HoodDialogue[count].timer)
- TalkTimer = HoodDialogue[count].timer;
- break;
-
- case EVENT_RAJ:
- if(RAJDialogue[count].text)
- text = RAJDialogue[count].text;
- if(RAJDialogue[count].soundid)
- sound = RAJDialogue[count].soundid;
- if(RAJDialogue[count].timer)
- TalkTimer = RAJDialogue[count].timer;
- break;
- }
-
- if(text)
- DoYell(text, LANG_UNIVERSAL, 0);
- if(sound)
- DoPlaySoundToSet(m_creature, sound);
- }
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
-
- if(IsTalking)
- {
- if(TalkTimer < diff)
- {
- if(TalkCount > 3)
- {
- Unit* Spotlight = Unit::GetUnit((*m_creature), SpotlightGUID);
- if(Spotlight)
- {
- Spotlight->RemoveAllAuras();
- Spotlight->SetVisibility(VISIBILITY_OFF);
- }
-
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
- IsTalking = false;
- IsBeingEscorted = true;
- return;
- }
-
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
- Talk(TalkCount);
- ++TalkCount;
- }
- else TalkTimer -= diff;
- }
-
- if(PerformanceReady)
- {
- if(CurtainTimer)
- if(CurtainTimer <= diff)
- {
- PrepareEncounter();
-
- if(!pInstance)
- return;
-
- GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS));
- if(Curtain)
- Curtain->SetGoState(0);
-
- CurtainTimer = 0;
- }else CurtainTimer -= diff;
-
- if(!RaidWiped)
- {
- if(WipeTimer < diff)
- {
- Map *map = m_creature->GetMap();
- if(!map->IsDungeon()) return;
-
- InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
- if(PlayerList.empty())
- return;
-
- RaidWiped = true;
- for(InstanceMap::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i)
- {
- if((*i)->isAlive() && !(*i)->isGameMaster())
- {
- RaidWiped = false;
- break;
- }
- }
-
- if(RaidWiped)
- {
- RaidWiped = true;
- EnterEvadeMode();
- }
-
- WipeTimer = 15000;
- }else WipeTimer -= diff;
- }
-
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-
- void StartEvent()
- {
- if(!pInstance)
- return;
-
- pInstance->SetData(DATA_OPERA_EVENT, IN_PROGRESS);
-
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
- if(Door)
- Door->SetGoState(0);
-
- m_creature->CastSpell(m_creature, SPELL_TUXEDO, true);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- Start(false, false, false);
- }
-
- void PrepareEncounter()
- {
- debug_log("SD2: Barnes Opera Event - Introduction complete - preparing encounter %d", Event);
- uint8 index = 0;
- uint8 count = 0;
- switch(Event)
- {
- case EVENT_OZ:
- index = 0;
- count = 4;
- break;
-
- case EVENT_HOOD:
- index = 4;
- count = index+1;
- break;
-
- case EVENT_RAJ:
- index = 5;
- count = index+1;
- break;
- }
-
- for( ; index < count; ++index)
- {
- uint32 entry = ((uint32)Spawns[index][0]);
- float PosX = Spawns[index][1];
- Creature* pCreature = m_creature->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- if(pCreature)
- {
- // In case database has bad flags
- pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- }
-
- CurtainTimer = 10000;
- PerformanceReady = true;
- RaidWiped = false;
- }
-};
-
-CreatureAI* GetAI_npc_barnesAI(Creature* _Creature)
-{
- npc_barnesAI* Barnes_AI = new npc_barnesAI(_Creature);
-
- for(uint8 i = 0; i < 6; ++i)
- Barnes_AI->AddWaypoint(i, StageLocations[i][0], StageLocations[i][1], 90.465);
-
- return ((CreatureAI*)Barnes_AI);
-}
-
-bool GossipHello_npc_barnes(Player* player, Creature* _Creature)
-{
- // Check for death of Moroes.
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if(pInstance && (pInstance->GetData(DATA_MOROES_EVENT) >= DONE))
- {
- player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if(!((npc_barnesAI*)_Creature->AI())->RaidWiped)
- player->SEND_GOSSIP_MENU(8970, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(8975, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(8978, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(8971, _Creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- ((npc_barnesAI*)_Creature->AI())->StartEvent();
- break;
- }
-
- return true;
-}
-
-/*###
-# npc_berthold
-####*/
-
-#define SPELL_TELEPORT 39567
-
-#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library"
-
-bool GossipHello_npc_berthold(Player* player, Creature* _Creature)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- // Check if Shade of Aran is dead or not
- if(pInstance && (pInstance->GetData(DATA_SHADEOFARAN_EVENT) >= DONE))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_berthold(Player* player, Creature* _Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF + 1)
- player->CastSpell(player, SPELL_TELEPORT, true);
-
- player->CLOSE_GOSSIP_MENU();
- return true;
-}
-
-void AddSC_karazhan()
-{
- Script* newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_npc_barnesAI;
- newscript->Name = "npc_barnes";
- newscript->pGossipHello = GossipHello_npc_barnes;
- newscript->pGossipSelect = GossipSelect_npc_barnes;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_berthold";
- newscript->pGossipHello = GossipHello_npc_berthold;
- newscript->pGossipSelect = GossipSelect_npc_berthold;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Karazhan
+SD%Complete: 100
+SDComment: Support for Barnes (Opera controller) and Berthold (Doorman).
+SDCategory: Karazhan
+EndScriptData */
+
+/* ContentData
+npc_barnes
+npc_berthold
+EndContentData */
+
+#include "precompiled.h"
+#include "def_karazhan.h"
+#include "../../npc/npc_escortAI.h"
+
+/*######
+# npc_barnesAI
+######*/
+
+#define GOSSIP_READY "I'm not an actor."
+
+#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!"
+#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?"
+#define OZ_GOSSIP1 "I'm not an actor."
+#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!"
+#define OZ_GOSSIP2 "Ok, I'll give it a try, then."
+
+#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?"
+#define RAJ_GOSSIP1 "I've never been more ready."
+
+struct Dialogue
+{
+ char* text;
+ uint32 soundid, timer;
+};
+
+static Dialogue OzDialogue[]=
+{
+ {"Welcome Ladies and Gentlemen, to this evening's presentation!", 9174, 6000},
+ {"Tonight we plumb the depths of the human soul as we join a lost, lonely girl trying desperately -- with the help of her loyal companions -- to find her way home!", 9338, 18000},
+ {"But she is pursued... by a wicked malevolent crone!", 9339, 9000},
+ {"Will she survive? Will she prevail? Only time will tell. And now ... on with the show!", 9340, 15000}
+};
+
+static Dialogue HoodDialogue[]=
+{
+ {"Good evening, Ladies and Gentlemen! Welcome to this evening's presentation!", 9175, 6000},
+ {"Tonight, things are not what they seem. For tonight, your eyes may not be trusted", 9335, 10000},
+ {"Take for instance, this quiet, elderly woman, waiting for a visit from her granddaughter. Surely there is nothing to fear from this sweet, grey-haired, old lady.", 9336, 14000},
+ {"But don't let me pull the wool over your eyes. See for yourself what lies beneath those covers! And now... on with the show!", 9337, 15000}
+};
+
+static Dialogue RAJDialogue[]=
+{
+ {"Welcome, Ladies and Gentlemen, to this evening's presentation!", 9176, 5000},
+ {"Tonight, we explore a tale of forbidden love!", 9341, 7000},
+ {"But beware, for not all love stories end happily, as you may find out. Sometimes, love pricks like a thorn.", 9342, 14000},
+ {"But don't take it from me, see for yourself what tragedy lies ahead when the paths of star-crossed lovers meet. And now...on with the show!", 9343, 14000}
+};
+
+// Entries and spawn locations for creatures in Oz event
+float Spawns[6][2]=
+{
+ {17535, -10896}, // Dorothee
+ {17546, -10891}, // Roar
+ {17547, -10884}, // Tinhead
+ {17543, -10902}, // Strawman
+ {17603, -10892}, // Grandmother
+ {17534, -10900}, // Julianne
+};
+
+float StageLocations[6][2]=
+{
+ {-10866.711, -1779.816}, // Open door, begin walking (0)
+ {-10894.917, -1775.467}, // (1)
+ {-10896.044, -1782.619}, // Begin Speech after this (2)
+ {-10894.917, -1775.467}, // Resume walking (back to spawn point now) after speech (3)
+ {-10866.711, -1779.816}, // (4)
+ {-10866.700, -1781.030} // Summon mobs, open curtains, close door (5)
+};
+
+#define CREATURE_SPOTLIGHT 19525
+
+#define SPELL_SPOTLIGHT 25824
+#define SPELL_TUXEDO 32616
+
+#define SPAWN_Z 90.5
+#define SPAWN_Y -1758
+#define SPAWN_O 4.738
+
+struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
+{
+ npc_barnesAI(Creature* c) : npc_escortAI(c)
+ {
+ RaidWiped = false;
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 SpotlightGUID;
+
+ uint32 TalkCount;
+ uint32 TalkTimer;
+ uint32 CurtainTimer;
+ uint32 WipeTimer;
+ uint32 Event;
+
+ bool PerformanceReady;
+ bool RaidWiped;
+ bool IsTalking;
+
+ void Reset()
+ {
+ TalkCount = 0;
+ TalkTimer = 2000;
+ CurtainTimer = 5000;
+ WipeTimer = 5000;
+
+ PerformanceReady = false;
+ IsTalking = false;
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_OPERA_EVENT, NOT_STARTED);
+
+ Event = pInstance->GetData(DATA_OPERA_PERFORMANCE);
+
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
+ if(Door)
+ Door->SetGoState(1);
+
+ GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS));
+ if(Curtain)
+ Curtain->SetGoState(1);
+ }
+ }
+
+ void Aggro(Unit* who) {}
+
+ void WaypointReached(uint32 i)
+ {
+ switch(i)
+ {
+ case 2:
+ IsBeingEscorted = false;
+ TalkCount = 0;
+ IsTalking = true;
+
+ float x,y,z;
+ m_creature->GetPosition(x, y, z);
+ Creature* Spotlight;
+ Spotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 50000);
+ if(Spotlight)
+ {
+ Spotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Spotlight->CastSpell(Spotlight, SPELL_SPOTLIGHT, false);
+ SpotlightGUID = Spotlight->GetGUID();
+ }
+ break;
+
+ case 5:
+ if(pInstance)
+ {
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
+ if(Door)
+ Door->SetGoState(1);
+ }
+ IsBeingEscorted = false;
+ PerformanceReady = true;
+ break;
+ }
+ }
+
+ void Talk(uint32 count)
+ {
+ char* text = NULL;
+ uint32 sound = 0;
+
+ switch(Event)
+ {
+ case EVENT_OZ:
+ if(OzDialogue[count].text)
+ text = OzDialogue[count].text;
+ if(OzDialogue[count].soundid)
+ sound = OzDialogue[count].soundid;
+ if(OzDialogue[count].timer)
+ TalkTimer = OzDialogue[count].timer;
+ break;
+
+ case EVENT_HOOD:
+ if(HoodDialogue[count].text)
+ text = HoodDialogue[count].text;
+ if(HoodDialogue[count].soundid)
+ sound = HoodDialogue[count].soundid;
+ if(HoodDialogue[count].timer)
+ TalkTimer = HoodDialogue[count].timer;
+ break;
+
+ case EVENT_RAJ:
+ if(RAJDialogue[count].text)
+ text = RAJDialogue[count].text;
+ if(RAJDialogue[count].soundid)
+ sound = RAJDialogue[count].soundid;
+ if(RAJDialogue[count].timer)
+ TalkTimer = RAJDialogue[count].timer;
+ break;
+ }
+
+ if(text)
+ DoYell(text, LANG_UNIVERSAL, 0);
+ if(sound)
+ DoPlaySoundToSet(m_creature, sound);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+
+ if(IsTalking)
+ {
+ if(TalkTimer < diff)
+ {
+ if(TalkCount > 3)
+ {
+ Unit* Spotlight = Unit::GetUnit((*m_creature), SpotlightGUID);
+ if(Spotlight)
+ {
+ Spotlight->RemoveAllAuras();
+ Spotlight->SetVisibility(VISIBILITY_OFF);
+ }
+
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
+ IsTalking = false;
+ IsBeingEscorted = true;
+ return;
+ }
+
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ Talk(TalkCount);
+ ++TalkCount;
+ }
+ else TalkTimer -= diff;
+ }
+
+ if(PerformanceReady)
+ {
+ if(CurtainTimer)
+ if(CurtainTimer <= diff)
+ {
+ PrepareEncounter();
+
+ if(!pInstance)
+ return;
+
+ GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS));
+ if(Curtain)
+ Curtain->SetGoState(0);
+
+ CurtainTimer = 0;
+ }else CurtainTimer -= diff;
+
+ if(!RaidWiped)
+ {
+ if(WipeTimer < diff)
+ {
+ Map *map = m_creature->GetMap();
+ if(!map->IsDungeon()) return;
+
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
+ if(PlayerList.empty())
+ return;
+
+ RaidWiped = true;
+ for(InstanceMap::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i)
+ {
+ if((*i)->isAlive() && !(*i)->isGameMaster())
+ {
+ RaidWiped = false;
+ break;
+ }
+ }
+
+ if(RaidWiped)
+ {
+ RaidWiped = true;
+ EnterEvadeMode();
+ }
+
+ WipeTimer = 15000;
+ }else WipeTimer -= diff;
+ }
+
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void StartEvent()
+ {
+ if(!pInstance)
+ return;
+
+ pInstance->SetData(DATA_OPERA_EVENT, IN_PROGRESS);
+
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT));
+ if(Door)
+ Door->SetGoState(0);
+
+ m_creature->CastSpell(m_creature, SPELL_TUXEDO, true);
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ Start(false, false, false);
+ }
+
+ void PrepareEncounter()
+ {
+ debug_log("SD2: Barnes Opera Event - Introduction complete - preparing encounter %d", Event);
+ uint8 index = 0;
+ uint8 count = 0;
+ switch(Event)
+ {
+ case EVENT_OZ:
+ index = 0;
+ count = 4;
+ break;
+
+ case EVENT_HOOD:
+ index = 4;
+ count = index+1;
+ break;
+
+ case EVENT_RAJ:
+ index = 5;
+ count = index+1;
+ break;
+ }
+
+ for( ; index < count; ++index)
+ {
+ uint32 entry = ((uint32)Spawns[index][0]);
+ float PosX = Spawns[index][1];
+ Creature* pCreature = m_creature->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ if(pCreature)
+ {
+ // In case database has bad flags
+ pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ }
+
+ CurtainTimer = 10000;
+ PerformanceReady = true;
+ RaidWiped = false;
+ }
+};
+
+CreatureAI* GetAI_npc_barnesAI(Creature* _Creature)
+{
+ npc_barnesAI* Barnes_AI = new npc_barnesAI(_Creature);
+
+ for(uint8 i = 0; i < 6; ++i)
+ Barnes_AI->AddWaypoint(i, StageLocations[i][0], StageLocations[i][1], 90.465);
+
+ return ((CreatureAI*)Barnes_AI);
+}
+
+bool GossipHello_npc_barnes(Player* player, Creature* _Creature)
+{
+ // Check for death of Moroes.
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if(pInstance && (pInstance->GetData(DATA_MOROES_EVENT) >= DONE))
+ {
+ player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if(!((npc_barnesAI*)_Creature->AI())->RaidWiped)
+ player->SEND_GOSSIP_MENU(8970, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(8975, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(8978, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(8971, _Creature->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_barnesAI*)_Creature->AI())->StartEvent();
+ break;
+ }
+
+ return true;
+}
+
+/*###
+# npc_berthold
+####*/
+
+#define SPELL_TELEPORT 39567
+
+#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library"
+
+bool GossipHello_npc_berthold(Player* player, Creature* _Creature)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ // Check if Shade of Aran is dead or not
+ if(pInstance && (pInstance->GetData(DATA_SHADEOFARAN_EVENT) >= DONE))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_berthold(Player* player, Creature* _Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF + 1)
+ player->CastSpell(player, SPELL_TELEPORT, true);
+
+ player->CLOSE_GOSSIP_MENU();
+ return true;
+}
+
+void AddSC_karazhan()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_npc_barnesAI;
+ newscript->Name = "npc_barnes";
+ newscript->pGossipHello = GossipHello_npc_barnes;
+ newscript->pGossipSelect = GossipSelect_npc_barnes;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_berthold";
+ newscript->pGossipHello = GossipHello_npc_berthold;
+ newscript->pGossipSelect = GossipSelect_npc_berthold;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
index 5b2e94e8159..966bf7c40a3 100644
--- a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
+++ b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Loch_Modan
-SD%Complete: 100
-SDComment: Quest support: 3181 (only to argue with pebblebitty to get to searing gorge, before quest rewarded)
-SDCategory: Loch Modan
-EndScriptData */
-
-/* ContentData
-npc_mountaineer_pebblebitty
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_mountaineer_pebblebitty
-######*/
-
-bool GossipHello_npc_mountaineer_pebblebitty(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (!player->GetQuestRewardStatus(3181) == 1)
- player->ADD_GOSSIP_ITEM( 0, "Open the gate please, i need to get to Searing Gorge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_mountaineer_pebblebitty(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "But i need to get there, now open the gate!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1833, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Ok, so what is this other way?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(1834, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "Doesn't matter, i'm invulnerable.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(1835, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "Yes...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(1836, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "Ok, i'll try to remember that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(1837, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM( 0, "A key? Ok!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(1838, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- return true;
-}
-
-void AddSC_loch_modan()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_mountaineer_pebblebitty";
- newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty;
- newscript->pGossipSelect = &GossipSelect_npc_mountaineer_pebblebitty;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Loch_Modan
+SD%Complete: 100
+SDComment: Quest support: 3181 (only to argue with pebblebitty to get to searing gorge, before quest rewarded)
+SDCategory: Loch Modan
+EndScriptData */
+
+/* ContentData
+npc_mountaineer_pebblebitty
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_mountaineer_pebblebitty
+######*/
+
+bool GossipHello_npc_mountaineer_pebblebitty(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (!player->GetQuestRewardStatus(3181) == 1)
+ player->ADD_GOSSIP_ITEM( 0, "Open the gate please, i need to get to Searing Gorge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_mountaineer_pebblebitty(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "But i need to get there, now open the gate!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(1833, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Ok, so what is this other way?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(1834, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "Doesn't matter, i'm invulnerable.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(1835, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "Yes...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(1836, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "Ok, i'll try to remember that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(1837, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM( 0, "A key? Ok!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(1838, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ return true;
+}
+
+void AddSC_loch_modan()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_mountaineer_pebblebitty";
+ newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty;
+ newscript->pGossipSelect = &GossipSelect_npc_mountaineer_pebblebitty;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
index 4985d0fae1d..e4efafe4c18 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
@@ -1,591 +1,591 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_felblood_kaelthas
-SD%Complete: 80
-SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. TODO: Convert Phoenix to ACID.
-SDCategory: Magisters' Terrace
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magisters_terrace.h"
-#include "WorldPacket.h"
-
-/*** Spells ***/
-
-// Phase 1 spells
-
-#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target
-#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050
-
-#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?)
-#define SPELL_PHOENIX_BURN 44198 // A spell Phoenix uses to damage everything around
-
-#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part
-#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part
-#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage
-#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile)
-
-#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast
-#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage
-
-// Phase 2 spells
-
-#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse
-#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range
-#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position.
-#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226.
-#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT.
-#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres
-#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse
-
-/*** Creatures ***/
-#define CREATURE_PHOENIX 24674
-#define CREATURE_PHOENIX_EGG 24675
-#define CREATURE_ARCANE_SPHERE 24708
-
-/*** Dialogues ***/
-#define SAY_AGGRO "Don't look so smug! I know what you're thinking, but Tempest Keep was merely a set back. Did you honestly believe I would trust the future to some blind, half-night elf mongrel? Oh no, he was merely an instrument, a stepping stone to a much larger plan! It has all led to this, and this time, you will not interfere!"
-#define SOUND_AGGRO 12413 // This yell should be done when the room is cleared. For now, set it as aggro yell.
-
-#define SAY_PHOENIX "Vengeance burns!"
-#define SOUND_PHOENIX 12415
-
-#define SAY_FLAMESTRIKE "Felomin ashal!"
-#define SOUND_FLAMESTRIKE 12417
-
-#define SAY_GRAVITY_LAPSE "I'll turn your world... upside... down..."
-#define SOUND_GRAVITY_LAPSE 12418
-
-#define SAY_TIRED "Master... grant me strength."
-#define SOUND_TIRED 12419
-
-#define SAY_RECAST_GRAVITY "Do not... get too comfortable."
-#define SOUND_RECAST_GRAVITY 12420
-
-#define SAY_DEATH "My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!"
-#define SOUND_DEATH 12421
-
-/** Locations **/
-float KaelLocations[3][2]=
-{
- {148.744659, 181.377426},
- {140.823883, 195.403046},
- {156.574188, 195.650482},
-};
-#define LOCATION_Z -16.727455
-
-struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
-{
- boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- Heroic = c->GetMap()->IsHeroic() ? true : false;
- }
-
- ScriptedInstance* pInstance;
-
- uint32 FireballTimer;
- uint32 PhoenixTimer;
- uint32 FlameStrikeTimer;
- uint32 CombatPulseTimer;
-
- //Heroic only
- uint32 PyroblastTimer;
-
- uint32 GravityLapseTimer;
- uint32 GravityLapsePhase;
- // 0 = No Gravity Lapse
- // 1 = Casting Gravity Lapse visual
- // 2 = Teleported people to self
- // 3 = Knocked people up in the air
- // 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs.
-
- bool FirstGravityLapse;
- bool Heroic;
-
- uint8 Phase;
- // 0 = Not started
- // 1 = Fireball; Summon Phoenix; Flamestrike
- // 2 = Gravity Lapses
-
- void Reset()
- {
- // TODO: Timers
- FireballTimer = 0;
- PhoenixTimer = 30000;
- FlameStrikeTimer = 25000;
- CombatPulseTimer = 0;
-
- PyroblastTimer = 60000;
-
- GravityLapseTimer = 0;
- GravityLapsePhase = 0;
-
- FirstGravityLapse = true;
-
- Phase = 0;
-
- if(pInstance)
- pInstance->SetData(DATA_KAELTHAS_EVENT, 0);
- }
-
- void JustDied(Unit *killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth())
- RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void SetThreatList(Creature* SummonedUnit)
- {
- if(!SummonedUnit) return;
-
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list<HostilReference*>::iterator i = m_threatlist.begin();
- for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- {
- float threat = m_creature->getThreatManager().getThreat(pUnit);
- SummonedUnit->AddThreat(pUnit, threat);
- }
- }
- }
-
- void TeleportPlayersToSelf()
- {
- float x = KaelLocations[0][0];
- float y = KaelLocations[0][1];
- m_creature->Relocate(x, y, LOCATION_Z, 0);
- //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
- }
- DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
- }
-
- void CastGravityLapseKnockUp()
- {
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- // Knockback into the air
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
- }
- }
-
- void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
- {
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- // Also needs an exception in spell system.
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
- // Use packet hack
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
- data.append(pUnit->GetPackGUID());
- data << uint32(0);
- pUnit->SendMessageToSet(&data, true);
- }
- }
- }
-
- void RemoveGravityLapse()
- {
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
- pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
- data.append(pUnit->GetPackGUID());
- data << uint32(0);
- pUnit->SendMessageToSet(&data, true);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() && !m_creature->SelectHostilTarget())
- return;
-
- switch(Phase)
- {
- case 0:
- {
- // *Heroic mode only:
- if(Heroic)
- if(PyroblastTimer < diff)
- {
- DoCast(m_creature, SPELL_SHOCK_BARRIER, true);
- DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
- PyroblastTimer = 60000;
- }else PyroblastTimer -= diff;
-
- if(FireballTimer < diff)
- {
- // *Normal/Heroic mode support
- if(Heroic) DoCast(m_creature->getVictim(), SPELL_FIREBALL_HEROIC);
- else DoCast(m_creature->getVictim(), SPELL_FIREBALL_NORMAL);
- FireballTimer = 2000 + rand()%4000;
- }else FireballTimer -= diff;
-
- if(PhoenixTimer < diff)
- {
- uint32 random = rand()%2 + 1;
- float x = KaelLocations[random][0];
- float y = KaelLocations[random][1];
- Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Phoenix)
- {
- Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
- SetThreatList(Phoenix);
- }
-
- DoYell(SAY_PHOENIX, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_PHOENIX);
-
- PhoenixTimer = 40000;
- }else PhoenixTimer -= diff;
-
- if(FlameStrikeTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoCast(target, SPELL_FLAMESTRIKE3, true);
- FlameStrikeTimer = 20000 + rand()%5000;
-
- DoYell(SAY_FLAMESTRIKE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FLAMESTRIKE);
- }
- }else FlameStrikeTimer -= diff;
-
- // Below 50%
- if(m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- GravityLapseTimer = 0;
- GravityLapsePhase = 0;
- Phase = 1;
- }
- DoMeleeAttackIfReady();
- }
- break;
-
- case 1:
- {
- if(GravityLapseTimer < diff)
- {
- switch(GravityLapsePhase)
- {
- case 0:
- if(FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
- {
- DoYell(SAY_GRAVITY_LAPSE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_GRAVITY_LAPSE);
- FirstGravityLapse = false;
- if(pInstance)
- {
- GameObject* KaelLeft = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_LEFT));
- if(KaelLeft) KaelLeft->SetGoState(0);
- GameObject* KaelRight = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_RIGHT));
- if(KaelRight) KaelRight->SetGoState(0);
- }
- }else
- {
- DoYell(SAY_RECAST_GRAVITY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RECAST_GRAVITY);
- }
- DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
- GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
- GravityLapsePhase = 1;
- break;
-
- case 1:
- TeleportPlayersToSelf();
- GravityLapseTimer = 1000;
- GravityLapsePhase = 2;
- break;
-
- case 2:
- CastGravityLapseKnockUp();
- GravityLapseTimer = 1000;
- GravityLapsePhase = 3;
- break;
-
- case 3:
- CastGravityLapseFly();
- GravityLapseTimer = 30000;
- GravityLapsePhase = 4;
- for(uint8 i = 0; i < 3; ++i)
- {
- Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if(Orb) SetThreatList(Orb);
- }
- DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
- break;
-
- case 4:
- m_creature->InterruptNonMeleeSpells(false);
- DoYell(SAY_TIRED,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_TIRED);
- DoCast(m_creature, SPELL_POWER_FEEDBACK);
- RemoveGravityLapse();
- GravityLapseTimer = 10000;
- GravityLapsePhase = 0;
- break;
- }
- }else GravityLapseTimer -= diff;
- }
- break;
- }
- }
-};
-
-struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
-{
- mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- Heroic = c->GetMap()->IsHeroic() ? true : false;
- }
-
- uint32 FlameStrikeTimer;
- bool Heroic;
-
- void Reset()
- {
- FlameStrikeTimer = 5000;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
-
- DoCast(m_creature, SPELL_FLAMESTRIKE2, true);
- }
-
- void Aggro(Unit *who) {}
- void MoveInLineOfSight(Unit *who) {}
- void UpdateAI(const uint32 diff)
- {
- if(FlameStrikeTimer < diff)
- {
- // *Normal/Heroic mode support
- if(Heroic) DoCast(m_creature, SPELL_FLAMESTRIKE1_HEROIC, true);
- else DoCast(m_creature, SPELL_FLAMESTRIKE1_NORMAL, true);
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else FlameStrikeTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
-{
- mob_felkael_phoenixAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BurnTimer;
-
- void Reset()
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
- BurnTimer = 2000;
- }
-
- void Aggro(Unit* who) {}
-
- void JustDied(Unit* slayer)
- {
- DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (BurnTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_PHOENIX_BURN);
- BurnTimer = 2000;
- }else BurnTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
-{
- mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HatchTimer;
-
- void Reset() { HatchTimer = 15000; }
-
- void Aggro(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(HatchTimer < diff)
- {
- DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else HatchTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI
-{
- mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 DespawnTimer;
- uint32 ChangeTargetTimer;
-
- bool TargetLocked;
-
- void Reset()
- {
- DespawnTimer = 30000;
- ChangeTargetTimer = 5000;
- TargetLocked = false;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
- DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(TargetLocked)
- return;
- if(who && who->IsHostileTo(m_creature) && (m_creature->IsWithinDistInMap(who, 25)))
- StalkTarget(who);
- }
-
- void Aggro(Unit* who) {}
-
- void StalkTarget(Unit* target)
- {
- if(!target)
- return;
-
- m_creature->GetMotionMaster()->MoveChase(target);
- TargetLocked = true;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(DespawnTimer < diff)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- else DespawnTimer -= diff;
-
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(ChangeTargetTimer < diff)
- {
- TargetLocked = false;
- ChangeTargetTimer = 10000;
- }else ChangeTargetTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c)
-{
- return new boss_felblood_kaelthasAI(c);
-}
-
-CreatureAI* GetAI_mob_arcane_sphere(Creature* c)
-{
- return new mob_arcane_sphereAI(c);
-}
-
-CreatureAI* GetAI_mob_felkael_phoenix(Creature* c)
-{
- return new mob_felkael_phoenixAI(c);
-}
-
-CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* c)
-{
- return new mob_felkael_phoenix_eggAI(c);
-}
-
-CreatureAI* GetAI_mob_felkael_flamestrike(Creature* c)
-{
- return new mob_felkael_flamestrikeAI(c);
-}
-
-void AddSC_boss_felblood_kaelthas()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_felblood_kaelthas";
- newscript->GetAI = GetAI_boss_felblood_kaelthas;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_arcane_sphere";
- newscript->GetAI = GetAI_mob_arcane_sphere;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_felkael_phoenix";
- newscript->GetAI = GetAI_mob_felkael_phoenix;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_felkael_phoenix_egg";
- newscript->GetAI = GetAI_mob_felkael_phoenix_egg;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_felkael_flamestrike";
- newscript->GetAI = GetAI_mob_felkael_flamestrike;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_felblood_kaelthas
+SD%Complete: 80
+SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. TODO: Convert Phoenix to ACID.
+SDCategory: Magisters' Terrace
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magisters_terrace.h"
+#include "WorldPacket.h"
+
+/*** Spells ***/
+
+// Phase 1 spells
+
+#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target
+#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050
+
+#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?)
+#define SPELL_PHOENIX_BURN 44198 // A spell Phoenix uses to damage everything around
+
+#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part
+#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part
+#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage
+#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile)
+
+#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast
+#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage
+
+// Phase 2 spells
+
+#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse
+#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range
+#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position.
+#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226.
+#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT.
+#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres
+#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse
+
+/*** Creatures ***/
+#define CREATURE_PHOENIX 24674
+#define CREATURE_PHOENIX_EGG 24675
+#define CREATURE_ARCANE_SPHERE 24708
+
+/*** Dialogues ***/
+#define SAY_AGGRO "Don't look so smug! I know what you're thinking, but Tempest Keep was merely a set back. Did you honestly believe I would trust the future to some blind, half-night elf mongrel? Oh no, he was merely an instrument, a stepping stone to a much larger plan! It has all led to this, and this time, you will not interfere!"
+#define SOUND_AGGRO 12413 // This yell should be done when the room is cleared. For now, set it as aggro yell.
+
+#define SAY_PHOENIX "Vengeance burns!"
+#define SOUND_PHOENIX 12415
+
+#define SAY_FLAMESTRIKE "Felomin ashal!"
+#define SOUND_FLAMESTRIKE 12417
+
+#define SAY_GRAVITY_LAPSE "I'll turn your world... upside... down..."
+#define SOUND_GRAVITY_LAPSE 12418
+
+#define SAY_TIRED "Master... grant me strength."
+#define SOUND_TIRED 12419
+
+#define SAY_RECAST_GRAVITY "Do not... get too comfortable."
+#define SOUND_RECAST_GRAVITY 12420
+
+#define SAY_DEATH "My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!"
+#define SOUND_DEATH 12421
+
+/** Locations **/
+float KaelLocations[3][2]=
+{
+ {148.744659, 181.377426},
+ {140.823883, 195.403046},
+ {156.574188, 195.650482},
+};
+#define LOCATION_Z -16.727455
+
+struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
+{
+ boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ Heroic = c->GetMap()->IsHeroic() ? true : false;
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 FireballTimer;
+ uint32 PhoenixTimer;
+ uint32 FlameStrikeTimer;
+ uint32 CombatPulseTimer;
+
+ //Heroic only
+ uint32 PyroblastTimer;
+
+ uint32 GravityLapseTimer;
+ uint32 GravityLapsePhase;
+ // 0 = No Gravity Lapse
+ // 1 = Casting Gravity Lapse visual
+ // 2 = Teleported people to self
+ // 3 = Knocked people up in the air
+ // 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs.
+
+ bool FirstGravityLapse;
+ bool Heroic;
+
+ uint8 Phase;
+ // 0 = Not started
+ // 1 = Fireball; Summon Phoenix; Flamestrike
+ // 2 = Gravity Lapses
+
+ void Reset()
+ {
+ // TODO: Timers
+ FireballTimer = 0;
+ PhoenixTimer = 30000;
+ FlameStrikeTimer = 25000;
+ CombatPulseTimer = 0;
+
+ PyroblastTimer = 60000;
+
+ GravityLapseTimer = 0;
+ GravityLapsePhase = 0;
+
+ FirstGravityLapse = true;
+
+ Phase = 0;
+
+ if(pInstance)
+ pInstance->SetData(DATA_KAELTHAS_EVENT, 0);
+ }
+
+ void JustDied(Unit *killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth())
+ RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void SetThreatList(Creature* SummonedUnit)
+ {
+ if(!SummonedUnit) return;
+
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ {
+ float threat = m_creature->getThreatManager().getThreat(pUnit);
+ SummonedUnit->AddThreat(pUnit, threat);
+ }
+ }
+ }
+
+ void TeleportPlayersToSelf()
+ {
+ float x = KaelLocations[0][0];
+ float y = KaelLocations[0][1];
+ m_creature->Relocate(x, y, LOCATION_Z, 0);
+ //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
+ }
+ DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
+ }
+
+ void CastGravityLapseKnockUp()
+ {
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ // Knockback into the air
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
+ }
+ }
+
+ void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
+ {
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ // Also needs an exception in spell system.
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
+ // Use packet hack
+ WorldPacket data(12);
+ data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ data.append(pUnit->GetPackGUID());
+ data << uint32(0);
+ pUnit->SendMessageToSet(&data, true);
+ }
+ }
+ }
+
+ void RemoveGravityLapse()
+ {
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
+ pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
+ WorldPacket data(12);
+ data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ data.append(pUnit->GetPackGUID());
+ data << uint32(0);
+ pUnit->SendMessageToSet(&data, true);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() && !m_creature->SelectHostilTarget())
+ return;
+
+ switch(Phase)
+ {
+ case 0:
+ {
+ // *Heroic mode only:
+ if(Heroic)
+ if(PyroblastTimer < diff)
+ {
+ DoCast(m_creature, SPELL_SHOCK_BARRIER, true);
+ DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
+ PyroblastTimer = 60000;
+ }else PyroblastTimer -= diff;
+
+ if(FireballTimer < diff)
+ {
+ // *Normal/Heroic mode support
+ if(Heroic) DoCast(m_creature->getVictim(), SPELL_FIREBALL_HEROIC);
+ else DoCast(m_creature->getVictim(), SPELL_FIREBALL_NORMAL);
+ FireballTimer = 2000 + rand()%4000;
+ }else FireballTimer -= diff;
+
+ if(PhoenixTimer < diff)
+ {
+ uint32 random = rand()%2 + 1;
+ float x = KaelLocations[random][0];
+ float y = KaelLocations[random][1];
+ Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Phoenix)
+ {
+ Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ SetThreatList(Phoenix);
+ }
+
+ DoYell(SAY_PHOENIX, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_PHOENIX);
+
+ PhoenixTimer = 40000;
+ }else PhoenixTimer -= diff;
+
+ if(FlameStrikeTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoCast(target, SPELL_FLAMESTRIKE3, true);
+ FlameStrikeTimer = 20000 + rand()%5000;
+
+ DoYell(SAY_FLAMESTRIKE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FLAMESTRIKE);
+ }
+ }else FlameStrikeTimer -= diff;
+
+ // Below 50%
+ if(m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
+ m_creature->StopMoving();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ GravityLapseTimer = 0;
+ GravityLapsePhase = 0;
+ Phase = 1;
+ }
+ DoMeleeAttackIfReady();
+ }
+ break;
+
+ case 1:
+ {
+ if(GravityLapseTimer < diff)
+ {
+ switch(GravityLapsePhase)
+ {
+ case 0:
+ if(FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
+ {
+ DoYell(SAY_GRAVITY_LAPSE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GRAVITY_LAPSE);
+ FirstGravityLapse = false;
+ if(pInstance)
+ {
+ GameObject* KaelLeft = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_LEFT));
+ if(KaelLeft) KaelLeft->SetGoState(0);
+ GameObject* KaelRight = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_RIGHT));
+ if(KaelRight) KaelRight->SetGoState(0);
+ }
+ }else
+ {
+ DoYell(SAY_RECAST_GRAVITY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RECAST_GRAVITY);
+ }
+ DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
+ GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
+ GravityLapsePhase = 1;
+ break;
+
+ case 1:
+ TeleportPlayersToSelf();
+ GravityLapseTimer = 1000;
+ GravityLapsePhase = 2;
+ break;
+
+ case 2:
+ CastGravityLapseKnockUp();
+ GravityLapseTimer = 1000;
+ GravityLapsePhase = 3;
+ break;
+
+ case 3:
+ CastGravityLapseFly();
+ GravityLapseTimer = 30000;
+ GravityLapsePhase = 4;
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ if(Orb) SetThreatList(Orb);
+ }
+ DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
+ break;
+
+ case 4:
+ m_creature->InterruptNonMeleeSpells(false);
+ DoYell(SAY_TIRED,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_TIRED);
+ DoCast(m_creature, SPELL_POWER_FEEDBACK);
+ RemoveGravityLapse();
+ GravityLapseTimer = 10000;
+ GravityLapsePhase = 0;
+ break;
+ }
+ }else GravityLapseTimer -= diff;
+ }
+ break;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
+{
+ mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ Heroic = c->GetMap()->IsHeroic() ? true : false;
+ }
+
+ uint32 FlameStrikeTimer;
+ bool Heroic;
+
+ void Reset()
+ {
+ FlameStrikeTimer = 5000;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(14);
+
+ DoCast(m_creature, SPELL_FLAMESTRIKE2, true);
+ }
+
+ void Aggro(Unit *who) {}
+ void MoveInLineOfSight(Unit *who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if(FlameStrikeTimer < diff)
+ {
+ // *Normal/Heroic mode support
+ if(Heroic) DoCast(m_creature, SPELL_FLAMESTRIKE1_HEROIC, true);
+ else DoCast(m_creature, SPELL_FLAMESTRIKE1_NORMAL, true);
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else FlameStrikeTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
+{
+ mob_felkael_phoenixAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BurnTimer;
+
+ void Reset()
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ BurnTimer = 2000;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void JustDied(Unit* slayer)
+ {
+ DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (BurnTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_PHOENIX_BURN);
+ BurnTimer = 2000;
+ }else BurnTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
+{
+ mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HatchTimer;
+
+ void Reset() { HatchTimer = 15000; }
+
+ void Aggro(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(HatchTimer < diff)
+ {
+ DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else HatchTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI
+{
+ mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 DespawnTimer;
+ uint32 ChangeTargetTimer;
+
+ bool TargetLocked;
+
+ void Reset()
+ {
+ DespawnTimer = 30000;
+ ChangeTargetTimer = 5000;
+ TargetLocked = false;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(14);
+ DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(TargetLocked)
+ return;
+ if(who && who->IsHostileTo(m_creature) && (m_creature->IsWithinDistInMap(who, 25)))
+ StalkTarget(who);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void StalkTarget(Unit* target)
+ {
+ if(!target)
+ return;
+
+ m_creature->GetMotionMaster()->MoveChase(target);
+ TargetLocked = true;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(DespawnTimer < diff)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ else DespawnTimer -= diff;
+
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(ChangeTargetTimer < diff)
+ {
+ TargetLocked = false;
+ ChangeTargetTimer = 10000;
+ }else ChangeTargetTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c)
+{
+ return new boss_felblood_kaelthasAI(c);
+}
+
+CreatureAI* GetAI_mob_arcane_sphere(Creature* c)
+{
+ return new mob_arcane_sphereAI(c);
+}
+
+CreatureAI* GetAI_mob_felkael_phoenix(Creature* c)
+{
+ return new mob_felkael_phoenixAI(c);
+}
+
+CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* c)
+{
+ return new mob_felkael_phoenix_eggAI(c);
+}
+
+CreatureAI* GetAI_mob_felkael_flamestrike(Creature* c)
+{
+ return new mob_felkael_flamestrikeAI(c);
+}
+
+void AddSC_boss_felblood_kaelthas()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_felblood_kaelthas";
+ newscript->GetAI = GetAI_boss_felblood_kaelthas;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_arcane_sphere";
+ newscript->GetAI = GetAI_mob_arcane_sphere;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_felkael_phoenix";
+ newscript->GetAI = GetAI_mob_felkael_phoenix;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_felkael_phoenix_egg";
+ newscript->GetAI = GetAI_mob_felkael_phoenix_egg;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_felkael_flamestrike";
+ newscript->GetAI = GetAI_mob_felkael_flamestrike;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
index 79588c0fd87..494ff9e0da8 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
@@ -1,1367 +1,1367 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Priestess_Delrissa
-SD%Complete: 45
-SDComment: No Heroic support yet. Needs further testing. Several scripts for pets disabled, not seem to require any special script.
-SDCategory: Magister's Terrace
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magisters_terrace.h"
-
-#define SAY_AGGRO "Annihilate them!"
-#define SOUND_AGGRO 12395
-
-struct Speech
-{
- const char* text;
- uint32 sound;
-};
-
-static Speech LackeyDeath[]=
-{
- {"Oh, the horror.", 12398},
- {"Well, aren't you lucky?", 12400},
- {"Now I'm getting annoyed.", 12401},
- {"Lackies be damned! I'll finish you myself!", 12403},
-};
-
-static Speech PlayerDeath[]=
-{
- {"I call that a good start.", 12405},
- {"I could have sworn there were more of you.", 12407},
- {"Not really much of a group, anymore, is it?", 12409},
- {"One is such a lonely number", 12410},
- {"It's been a kick, really", 12411},
-};
-
-#define SAY_DEATH "Not what I had... planned..."
-#define SOUND_DEATH 12397
-
-#define SPELL_DISPEL_MAGIC 27609
-#define SPELL_FLASH_HEAL 17843
-#define SPELL_SW_PAIN_NORMAL 14032
-#define SPELL_SW_PAIN_HEROIC 15654
-#define SPELL_SHIELD 44291
-#define SPELL_RENEW_NORMAL 44174
-#define SPELL_RENEW_HEROIC 46192
-
-#define ORIENT 4.98
-#define POS_Z -19.9215
-
-float LackeyLocations[4][2]=
-{
- {123.77, 17.6007},
- {131.731, 15.0827},
- {121.563, 15.6213},
- {129.988, 17.2355},
-};
-
-const uint32 AddEntry[8]=
-{
- 24557, //Kagani Nightstrike
- 24558, //Elris Duskhallow
- 24554, //Eramas Brightblaze
- 24561, //Yazzaj
- 24559, //Warlord Salaris
- 24555, //Garaxxas
- 24553, //Apoko
- 24556, //Zelfan
-};
-
-struct Add
-{
- Add(uint32 _entry, uint64 _guid)
- {
- entry = _entry;
- guid = _guid;
- }
-
- uint32 entry;
- uint64 guid;
-};
-
-struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
-{
- boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Adds.clear();
- Reset();
- SummonAdds();
- Heroic = c->GetMap()->IsHeroic();
- }
-
- ScriptedInstance* pInstance;
-
- std::vector<Add*> Adds;
-
- uint8 LackeysKilled;
- uint8 PlayersKilled;
-
- uint32 HealTimer;
- uint32 RenewTimer;
- uint32 ShieldTimer;
- uint32 SWPainTimer;
- uint32 DispelTimer;
-
- uint32 CombatPulseTimer; // Periodically puts all players in the instance in combat
-
- bool Heroic;
-
- void Reset()
- {
- LackeysKilled = 0;
- PlayersKilled = 0;
-
- HealTimer = 15000;
- RenewTimer = 10000;
- ShieldTimer = 2000;
- SWPainTimer = 5000;
- DispelTimer = 7500;
-
- CombatPulseTimer = 5000;
-
- CheckAdds();
-
- if(pInstance)
- {
- pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED);
- pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0);
- }
- else error_log(ERROR_INST_DATA);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- for(uint8 i = 0; i < Adds.size(); ++i)
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
- pAdd->AddThreat(who, 1.0f);
- }
-
- void SummonAdds()
- {
- std::vector<uint32> AddList;
- for(uint8 i = 0; i < 8; ++i)
- AddList.push_back(AddEntry[i]);
-
- while(AddList.size() > 4)
- AddList.erase(AddList.begin() + rand()%AddList.size());
-
- for(uint8 i = 0; i < AddList.size(); ++i)
- {
- Creature* pAdd = m_creature->SummonCreature(AddList[i], LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(pAdd)
- {
- Add* nAdd = new Add(AddList[i], pAdd->GetGUID());
- Adds.push_back(nAdd);
- }
- }
- }
-
- void CheckAdds()
- {
- if(Adds.empty())
- return;
-
- for(uint8 i = 0; i < Adds.size(); ++i)
- {
- bool resummon = true;
- Creature* pAdd = ((Creature*)Unit::GetUnit(*m_creature, Adds[i]->guid));
- if(pAdd && pAdd->isAlive())
- {
- pAdd->AI()->EnterEvadeMode(); // Force them out of combat and reset if they are in combat.
- resummon = false;
- }
- if(resummon)
- {
- pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
- Add* nAdd = new Add(Adds[i]->entry, pAdd->GetGUID());
- Adds.erase(Adds.begin() + i);
- Adds.push_back(nAdd);
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if(victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- DoYell(PlayerDeath[PlayersKilled].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, PlayerDeath[PlayersKilled].sound);
- if( PlayersKilled < 4 )
- ++PlayersKilled;
- }
-
- void KilledLackey()
- {
- DoYell(LackeyDeath[LackeysKilled].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, LackeyDeath[LackeysKilled].sound);
- if( LackeysKilled < 3 )
- ++LackeysKilled;
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- CheckLootable();
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
- pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
- if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR)))
- Door->SetGoState(0);
- }
-
- void CheckLootable()
- {
- if(LackeysKilled > 4)
- m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- else
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(HealTimer < diff)
- {
- uint32 health = m_creature->GetHealth();
- Unit* target = m_creature;
- for(uint8 i = 0; i < Adds.size(); ++i)
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
- if(pAdd->isAlive() && pAdd->GetHealth() < health)
- target = pAdd;
-
- DoCast(target, SPELL_FLASH_HEAL);
- HealTimer = 15000;
- }else HealTimer -= diff;
-
- if(RenewTimer < diff)
- {
- Unit* target = m_creature;
- if(rand()%2 == 1)
- {
- std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
- Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
- if(pAdd && pAdd->isAlive())
- target = pAdd;
- }
- DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL);
- RenewTimer = 5000;
- }else RenewTimer -= diff;
-
- if(ShieldTimer < diff)
- {
- Unit* target = m_creature;
- if(rand()%2 == 1)
- {
- std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
- if(Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
- if(!pAdd->HasAura(SPELL_SHIELD, 0) && pAdd->isAlive())
- target = pAdd;
- }
- DoCast(target, SPELL_SHIELD);
- ShieldTimer = 7500;
- }else ShieldTimer -= diff;
-
- if(DispelTimer < diff)
- {
- Unit* target = NULL;
- bool friendly = false;
- if(rand()%2 == 1)
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- else
- {
- friendly = true;
- if(rand()%2 == 1)
- target = m_creature;
- else
- {
- std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
- Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
- if(pAdd && pAdd->isAlive())
- target = pAdd;
- }
- }
- if(target)
- {
- DoCast(target, SPELL_DISPEL_MAGIC);
- DispelTimer = 12000;
- }
- }else DispelTimer -= diff;
-
- if(SWPainTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL);
- SWPainTimer = 10000;
- }else SWPainTimer -= diff;
-
- /*
- if(CombatPulseTimer < diff)
- {
- DoZoneInCombat();
- for(uint8 i = 0; i < Adds.size(); ++i)
- {
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Add[i]->guid))
- if(pAdd->isAlive())
- DoZoneInCombat(pAdd);
- }
-
- CombatPulseTimer = 10000;
- }else CombatPulseTimer -= diff;*/
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_HEALING_POTION 15503
-
-struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
-{
- boss_priestess_guestAI(Creature* c) : ScriptedAI(c)
- {
- Group.clear();
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- AcquireGUIDs();
- }
-
- ScriptedInstance* pInstance;
-
- std::vector<Add*> Group;
-
- uint32 ResetThreatTimer;
-
- bool UsedPotion;
-
- void Reset()
- {
- UsedPotion = false;
-
- ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked.
- }
-
- void Aggro(Unit* who) {}
-
- void JustDied(Unit* killer)
- {
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
- {
- ((boss_priestess_delrissaAI*)Delrissa->AI())->KilledLackey();
- if(!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3)
- ((boss_priestess_delrissaAI*)Delrissa->AI())->CheckLootable();
-
- pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
- Delrissa->AI()->KilledUnit(victim);
- }
-
- void AcquireGUIDs()
- {
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
- {
- Group = ((boss_priestess_delrissaAI*)Delrissa->AI())->Adds;
- Add* dAdd = new Add(Delrissa->GetEntry(), Delrissa->GetGUID());
- Group.push_back(dAdd);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion)
- {
- DoCast(m_creature, SPELL_HEALING_POTION, true);
- UsedPotion = true;
- }
-
- if(ResetThreatTimer < diff)
- {
- DoResetThreat();
- ResetThreatTimer = 5000 + rand()%15000;
- }else ResetThreatTimer -= diff;
- }
-};
-
-#define SPELL_KIDNEY_SHOT 27615
-#define SPELL_GOUGE 12540
-#define SPELL_KICK 27613
-#define SPELL_VANISH 44290
-#define SPELL_BACKSTAB 15657
-#define SPELL_EVISCERATE 27611
-
-struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestAI
-{
- //Rogue
- boss_kagani_nightstrikeAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- uint32 Gouge_Timer;
- uint32 Kick_Timer;
- uint32 Vanish_Timer;
- uint32 Eviscerate_Timer;
- uint32 Wait_Timer;
- bool InVanish;
-
- void Reset()
- {
- Gouge_Timer = 5500;
- Kick_Timer = 7000;
- Vanish_Timer = 2000;
- Eviscerate_Timer = 6000;
- Wait_Timer = 5000;
- InVanish = false;
- m_creature->SetVisibility(VISIBILITY_ON);
-
- boss_priestess_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Vanish_Timer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF); // ...? Hacklike
- DoCast(m_creature, SPELL_VANISH);
- InVanish = true;
- Vanish_Timer = 30000;
- Wait_Timer = 10000;
- DoResetThreat();
- m_creature->AddThreat(SelectUnit(SELECT_TARGET_RANDOM, 0), 1000.0f);
- }else Vanish_Timer -= diff;
-
- if(InVanish)
- if(Wait_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true);
- DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true);
- m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike
- InVanish = false;
- }else Wait_Timer -= diff;
-
- if(Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
- Gouge_Timer = 5500;
- }else Gouge_Timer -= diff;
-
- if(Kick_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_KICK);
- Kick_Timer = 7000;
- }else Kick_Timer -= diff;
-
- if(Eviscerate_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_EVISCERATE);
- Eviscerate_Timer = 4000;
- }else Eviscerate_Timer -= diff;
-
- if(!InVanish)
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_IMMOLATE 44267
-#define SPELL_SHADOW_BOLT 12471
-#define SPELL_SEED_OF_CORRUPTION 44141
-#define SPELL_CURSE_OF_AGONY 14875
-#define SPELL_FEAR 38595
-#define SPELL_IMP_FIREBALL 44164
-#define SPELL_SUMMON_IMP 44163
-
-//#define CREATURE_IMP 44163
-//#define CREATURE_FIZZLE 24656
-
-/*struct TRINITY_DLL_DECL mob_fizzleAI : public ScriptedAI
-{
- mob_fizzleAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 EllrisGUID;
- uint32 Firebal_Timer;
-
- void Reset() { EllrisGUID = 0; }
-
- void KilledUnit(Unit* victim);
- void JustDied(Unit* killer);
-
- void Aggro(Unit* who){}
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Chain cast
- if (!m_creature->IsNonMeleeSpellCasted(false))
- DoCast(m_creature->getVictim(),SPELL_IMP_FIREBALL);
- else DoMeleeAttackIfReady();
- }
-};*/
-
-struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
-{
- //Warlock
- boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c)
- {
- }
-
- bool HasSummonedImp;
-
- uint32 Immolate_Timer;
- uint32 Shadow_Bolt_Timer;
- uint32 Seed_of_Corruption_Timer;
- uint32 Curse_of_Agony_Timer;
- uint32 Fear_Timer;
-
- void Reset()
- {
- //HasSummonedImp = false;
-
- Immolate_Timer = 6000;
- Shadow_Bolt_Timer = 3000;
- Seed_of_Corruption_Timer = 2000;
- Curse_of_Agony_Timer = 1000;
- Fear_Timer = 10000;
-
- boss_priestess_guestAI::Reset();
- }
-
- void JustDied(Unit* killer)
- {
- boss_priestess_guestAI::JustDied(killer);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!HasSummonedImp)
- {
- //Imp will not despawn unless it's killed, even if owner dies, this is correct way.
- DoCast(m_creature,SPELL_SUMMON_IMP);
- HasSummonedImp = true;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Immolate_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_IMMOLATE);
- Immolate_Timer = 6000;
- }else Immolate_Timer -= diff;
-
- if(Shadow_Bolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOW_BOLT);
- Shadow_Bolt_Timer = 5000;
- }else Shadow_Bolt_Timer -= diff;
-
- if(Seed_of_Corruption_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SEED_OF_CORRUPTION);
- Seed_of_Corruption_Timer = 10000;
- }else Seed_of_Corruption_Timer -= diff;
-
- if(Curse_of_Agony_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_AGONY);
- Curse_of_Agony_Timer = 13000;
- }else Curse_of_Agony_Timer -= diff;
-
- if(Fear_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FEAR);
- Fear_Timer = 10000;
- }else Fear_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-/*void mob_fizzleAI::JustDied(Unit* killer)
-{
- if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
- ((boss_ellris_duskhallowAI*)Ellris->AI())->ImpGUID = 0;
-}
-
-void mob_fizzleAI::KilledUnit(Unit* victim)
-{
- if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
- ((boss_ellris_duskhallowAI*)Ellris->AI())->KilledUnit(victim);
-}*/
-
-#define SPELL_KNOCKDOWN 11428
-#define SPELL_SNAP_KICK 46182
-
-struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestAI
-{
- //Monk
- boss_eramas_brightblazeAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- uint32 Knockdown_Timer;
- uint32 Snap_Kick_Timer;
-
- void Reset()
- {
- Knockdown_Timer = 6000;
- Snap_Kick_Timer = 4500;
-
- boss_priestess_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Knockdown_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
- Knockdown_Timer = 6000;
- }else Knockdown_Timer -= diff;
-
- if(Snap_Kick_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SNAP_KICK);
- Snap_Kick_Timer = 4500;
- }else Snap_Kick_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_POLYMORPH 13323
-#define SPELL_ICE_BLOCK 27619
-#define SPELL_BLIZZARD 44178
-#define SPELL_ICE_LANCE 46194
-#define SPELL_CONE_OF_COLD 38384
-#define SPELL_FROSTBOLT 15043
-#define SPELL_BLINK 14514
-
-struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
-{
- //Mage
- boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- bool HasIceBlocked;
-
- uint32 Polymorph_Timer;
- uint32 Ice_Block_Timer;
- uint32 Wait_Timer;
- uint32 Blizzard_Timer;
- uint32 Ice_Lance_Timer;
- uint32 Cone_of_Cold_Timer;
- uint32 Frostbolt_Timer;
- uint32 Blink_Timer;
-
- void Reset()
- {
- HasIceBlocked = false;
-
- Polymorph_Timer = 1000;
- Ice_Block_Timer = 20000;
- Wait_Timer = 10000;
- Blizzard_Timer = 8000;
- Ice_Lance_Timer = 12000;
- Cone_of_Cold_Timer = 10000;
- Frostbolt_Timer = 3000;
- Blink_Timer = 8000;
-
- boss_priestess_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Polymorph_Timer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoCast(target, SPELL_POLYMORPH);
- m_creature->getThreatManager().modifyThreatPercent(target,-100);
- Polymorph_Timer = 20000;
- }
- }else Polymorph_Timer -= diff;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
- {
- DoCast(m_creature, SPELL_ICE_BLOCK);
- HasIceBlocked = true;
- }
-
- if(Blizzard_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLIZZARD);
- Blizzard_Timer = 8000;
- }else Blizzard_Timer -= diff;
-
- if(Ice_Lance_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ICE_LANCE);
- Ice_Lance_Timer = 12000;
- }else Ice_Lance_Timer -= diff;
-
- if(Cone_of_Cold_Timer < diff)
- {
- DoCast(m_creature->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);
- Frostbolt_Timer = 8000;
- }else Frostbolt_Timer -= diff;
-
- if(Blink_Timer < diff)
- {
- bool InMeleeRange = false;
- std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
- for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
- //if in melee range
- if (target->IsWithinDistInMap(m_creature, 5))
- {
- InMeleeRange = true;
- break;
- }
- }
- //if anybody is in melee range than escape by blink
- if(InMeleeRange)
- DoCast(m_creature, SPELL_BLINK);
-
- Blink_Timer = 8000;
- }else Blink_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_INTERCEPT_STUN 27577
-#define SPELL_DISARM 27581
-#define SPELL_PIERCING_HOWL 23600
-#define SPELL_FRIGHTENING_SHOUT 19134
-#define SPELL_HAMSTRING 27584
-#define SPELL_BATTLE_SHOUT 27578
-#define SPELL_MORTAL_STRIKE 44268
-
-struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
-{
- //Warrior
- boss_warlord_salarisAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- uint32 Intercept_Stun_Timer;
- uint32 Disarm_Timer;
- uint32 Piercing_Howl_Timer;
- uint32 Frightening_Shout_Timer;
- uint32 Hamstring_Timer;
- uint32 Mortal_Strike_Timer;
-
- void Reset()
- {
- Intercept_Stun_Timer = 500;
- Disarm_Timer = 6000;
- Piercing_Howl_Timer = 10000;
- Frightening_Shout_Timer = 18000;
- Hamstring_Timer = 4500;
- Mortal_Strike_Timer = 8000;
- DoCast(m_creature, SPELL_BATTLE_SHOUT);
- boss_priestess_guestAI::Reset();
- }
-
- void Aggro(Unit* who)
- {
- DoCast(m_creature, SPELL_BATTLE_SHOUT);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Intercept_Stun_Timer < diff)
- {
- bool InMeleeRange = false;
- std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
- for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
- //if in melee range
- if (target->IsWithinDistInMap(m_creature, 5))
- {
- InMeleeRange = true;
- break;
- }
- }
- //if nobody is in melee range than try to use Intercept
- if(!InMeleeRange)
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_INTERCEPT_STUN);
- Intercept_Stun_Timer = 10000;
- }else Intercept_Stun_Timer -= diff;
-
- if(Disarm_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DISARM);
- Disarm_Timer = 6000;
- }else Disarm_Timer -= diff;
-
- if(Hamstring_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
- Hamstring_Timer = 4500;
- }else Hamstring_Timer -= diff;
-
- if(Mortal_Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- Mortal_Strike_Timer = 4500;
- }else Mortal_Strike_Timer -= diff;
-
- if(Piercing_Howl_Timer < diff)
- {
- DoCast(m_creature->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);
- Frightening_Shout_Timer = 18000;
- }else Frightening_Shout_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_AIMED_SHOT 44271
-#define SPELL_SHOOT 15620
-#define SPELL_CONCUSSIVE_SHOT 27634
-#define TRIGGER_CONCUSSIVE_SHOT 19410
-#define SPELL_MULTI_SHOT 31942
-#define SPELL_WING_CLIP 44286
-#define SPELL_FREEZING_TRAP 44136
-
-#define CREATURE_SLIVER 24552
-
-/*struct TRINITY_DLL_DECL mob_sliverAI : public ScriptedAI
-{
- mob_sliverAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 GaraxxasGUID;
-
- void Reset() { GaraxxasGUID = 0; }
-
- void KilledUnit(Unit* victim);
- void JustDied(Unit* killer);
-
- void Aggro(Unit* who){}
-
-};*/
-
-struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
-{
- //Hunter
- boss_garaxxasAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- //uint64 SliverGUID;
- bool HasSummonedSliver;
-
- uint32 Aimed_Shot_Timer;
- uint32 Shoot_Timer;
- uint32 Concussive_Shot_Timer;
- uint32 Multi_Shot_Timer;
- uint32 Wing_Clip_Timer;
- uint32 Freezing_Trap_Timer;
-
- void Reset()
- {
- //SliverGUID = 0;
- //HasSummonedSliver = false;
-
- Aimed_Shot_Timer = 6000;
- Shoot_Timer = 2500;
- Concussive_Shot_Timer = 8000;
- Multi_Shot_Timer = 10000;
- Wing_Clip_Timer = 4000;
- Freezing_Trap_Timer = 15000;
-
- boss_priestess_guestAI::Reset();
- }
-
- void JustDied(Unit* killer)
- {
- boss_priestess_guestAI::JustDied(killer);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!HasSummonedSliver)
- {
- Creature* Sliver = m_creature->SummonCreature(CREATURE_SLIVER, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Sliver)
- {
- //((mob_sliverAI*)Sliver->AI())->GaraxxasGUID = m_creature->GetGUID();
- //SliverGUID = Sliver->GetGUID();
- HasSummonedSliver = true;
- }
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
- {
- if(Wing_Clip_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WING_CLIP);
- Wing_Clip_Timer = 4000;
- }else Wing_Clip_Timer -= diff;
-
- if(Freezing_Trap_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
- Freezing_Trap_Timer = 30000;
- }else Freezing_Trap_Timer -= diff;
-
- if(!m_creature->getVictim()->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED | UNIT_STAT_DISTRACTED))
- DoMeleeAttackIfReady();
- }else
- {
- if(Concussive_Shot_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT);
- Concussive_Shot_Timer = 8000;
- }else Concussive_Shot_Timer -= diff;
-
- if(Multi_Shot_Timer < diff)
- {
- DoCast(m_creature->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);
- Aimed_Shot_Timer = 6000;
- }else Aimed_Shot_Timer -= diff;
-
- if(Shoot_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHOOT);
- Shoot_Timer = 2500;
- }else Shoot_Timer -= diff;
- }
- }
-};
-
-/*void mob_sliverAI::JustDied(Unit* killer)
-{
- if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
- ((boss_garaxxasAI*)Garaxxas->AI())->SliverGUID = 0;
-}
-
-void mob_sliverAI::KilledUnit(Unit* victim)
-{
- if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
- ((boss_garaxxasAI*)Garaxxas->AI())->KilledUnit(victim);
-}*/
-
-#define SPELL_WINDFURY_TOTEM 27621
-#define SPELL_WAR_STOMP 46026
-#define SPELL_PURGE 27626
-#define SPELL_LESSER_HEALING_WAVE 44256
-#define SPELL_FROST_SHOCK 21401
-#define SPELL_FIRE_NOVA_TOTEM 44257
-#define SPELL_EARTHBIND_TOTEM 15786
-
-struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI
-{
- //Shaman
- boss_apokoAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- uint32 Totem_Timer;
- uint8 Totem_Amount;
- uint32 War_Stomp_Timer;
- uint32 Purge_Timer;
- uint32 Healing_Wave_Timer;
- uint32 Frost_Shock_Timer;
-
- void Reset()
- {
- Totem_Timer = 2000;
- Totem_Amount = 1;
- War_Stomp_Timer = 10000;
- Purge_Timer = 8000;
- Healing_Wave_Timer = 5000;
- Frost_Shock_Timer = 7000;
-
- boss_priestess_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Totem_Timer < diff)
- {
- switch(rand()%3)
- {
- case 0:
- DoCast(m_creature, SPELL_WINDFURY_TOTEM);
- break;
- case 1:
- DoCast(m_creature, SPELL_FIRE_NOVA_TOTEM);
- break;
- case 2:
- DoCast(m_creature, SPELL_EARTHBIND_TOTEM);
- break;
- }
- ++Totem_Amount;
- Totem_Timer = Totem_Amount*2000;
- }else Totem_Timer -= diff;
-
- if(War_Stomp_Timer < diff)
- {
- DoCast(m_creature, SPELL_WAR_STOMP);
- War_Stomp_Timer = 10000;
- }else War_Stomp_Timer -= diff;
-
- if(Purge_Timer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_PURGE);
- Purge_Timer = 15000;
- }else Purge_Timer -= diff;
-
- if(Frost_Shock_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
- Frost_Shock_Timer = 7000;
- }else Frost_Shock_Timer -= diff;
-
- if(Healing_Wave_Timer < diff)
- {
- // std::vector<Add*>::iterator itr = Group.begin() + rand()%Group.size();
- // uint64 guid = (*itr)->guid;
- // if(guid)
- // {
- // Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
- // if(pAdd && pAdd->isAlive())
- // {
- DoCast(m_creature, SPELL_LESSER_HEALING_WAVE);
- Healing_Wave_Timer = 5000;
- // }
- // }
- }else Healing_Wave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-#define SPELL_GOBLIN_DRAGON_GUN 44272
-#define SPELL_ROCKET_LAUNCH 44137
-#define SPELL_RECOMBOBULATE 44274
-#define SPELL_HIGH_EXPLOSIVE_SHEEP 44276
-#define SPELL_FEL_IRON_BOMB 46024
-#define SPELL_SHEEP_EXPLOSION 44279
-
-#define CREATURE_EXPLOSIVE_SHEEP 24715
-
-struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
-{
- //Engineer
- boss_zelfanAI(Creature *c) : boss_priestess_guestAI(c) {}
-
- uint32 Goblin_Dragon_Gun_Timer;
- uint32 Rocket_Launch_Timer;
- uint32 Recombobulate_Timer;
- uint32 High_Explosive_Sheep_Timer;
- uint32 Fel_Iron_Bomb_Timer;
-
- void Reset()
- {
- Goblin_Dragon_Gun_Timer = 20000;
- Rocket_Launch_Timer = 7000;
- Recombobulate_Timer = 4000;
- High_Explosive_Sheep_Timer = 10000;
- Fel_Iron_Bomb_Timer = 15000;
-
- boss_priestess_guestAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_priestess_guestAI::UpdateAI(diff);
-
- if(Goblin_Dragon_Gun_Timer < diff)
- {
- DoCast(m_creature->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);
- Rocket_Launch_Timer = 9000;
- }else Rocket_Launch_Timer -= diff;
-
- if(Fel_Iron_Bomb_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB);
- Fel_Iron_Bomb_Timer = 15000;
- }else Fel_Iron_Bomb_Timer -= diff;
-
- if(Recombobulate_Timer < diff)
- {
- for(uint8 i = 0; i < Group.size(); ++i)
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid))
- if(pAdd->IsPolymorphed())
- {
- DoCast(pAdd, SPELL_RECOMBOBULATE);
- break;
- }
- }else Recombobulate_Timer -= diff;
-
- if(High_Explosive_Sheep_Timer < diff)
- {
- DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP);
- High_Explosive_Sheep_Timer = 65000;
- }else High_Explosive_Sheep_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//struct TRINITY_DLL_DECL mob_high_explosive_sheepAI : public ScriptedAI
-//{
-// mob_high_explosive_sheepAI(Creature *c) : ScriptedAI(c) {Reset();}
-//
-// uint32 Explosion_Timer;
-//
-// void Reset()
-// {
-// Explosion_Timer = 60000;
-// }
-//
-// void JustDied(Unit *Killer){}
-//
-// void Aggro(Unit *who){}
-//
-// void UpdateAI(const uint32 diff)
-// {
-// if(Explosion_Timer < diff)
-// {
-// DoCast(m_creature->getVictim(), SPELL_SHEEP_EXPLOSION);
-// }else
-// Explosion_Timer -= diff;
-// }
-//};
-
-/*CreatureAI* GetAI_mob_sliver(Creature *_Creature)
-{
- return new mob_sliverAI (_Creature);
-};*/
-
-//CreatureAI* GetAI_mob_high_explosive_sheep(Creature *_Creature)
-//{
-// return new mob_high_explosive_sheepAI (_Creature);
-//};
-
-/*CreatureAI* GetAI_mob_fizzle(Creature *_Creature)
-{
- return new mob_fizzleAI (_Creature);
-};*/
-
-CreatureAI* GetAI_boss_priestess_delrissa(Creature *_Creature)
-{
- return new boss_priestess_delrissaAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_kagani_nightstrike(Creature *_Creature)
-{
- return new boss_kagani_nightstrikeAI (_Creature);
-}
-
-CreatureAI* GetAI_ellris_duskhallow(Creature *_Creature)
-{
- return new boss_ellris_duskhallowAI (_Creature);
-}
-
-CreatureAI* GetAI_eramas_brightblaze(Creature *_Creature)
-{
- return new boss_eramas_brightblazeAI (_Creature);
-}
-
-CreatureAI* GetAI_yazzai(Creature *_Creature)
-{
- return new boss_yazzaiAI (_Creature);
-}
-
-CreatureAI* GetAI_warlord_salaris(Creature *_Creature)
-{
- return new boss_warlord_salarisAI (_Creature);
-}
-
-CreatureAI* GetAI_garaxxas(Creature *_Creature)
-{
- return new boss_garaxxasAI (_Creature);
-}
-
-CreatureAI* GetAI_apoko(Creature *_Creature)
-{
- return new boss_apokoAI (_Creature);
-}
-
-CreatureAI* GetAI_zelfan(Creature *_Creature)
-{
- return new boss_zelfanAI (_Creature);
-}
-
-void AddSC_boss_priestess_delrissa()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_priestess_delrissa";
- newscript->GetAI = GetAI_boss_priestess_delrissa;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_kagani_nightstrike";
- newscript->GetAI = GetAI_boss_kagani_nightstrike;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_ellris_duskhallow";
- newscript->GetAI = GetAI_ellris_duskhallow;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_eramas_brightblaze";
- newscript->GetAI = GetAI_eramas_brightblaze;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_yazzai";
- newscript->GetAI = GetAI_yazzai;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_warlord_salaris";
- newscript->GetAI = GetAI_warlord_salaris;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_garaxxas";
- newscript->GetAI = GetAI_garaxxas;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_apoko";
- newscript->GetAI = GetAI_apoko;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_zelfan";
- newscript->GetAI = GetAI_zelfan;
- m_scripts[nrscripts++] = newscript;
-
- /*newscript = new Script;
- newscript->Name="mob_high_explosive_sheep";
- newscript->GetAI = GetAI_mob_high_explosive_sheep;
- m_scripts[nrscripts++] = newscript;*/
-
- /*newscript = new Script;
- newscript->Name="mob_fizzle";
- newscript->GetAI = GetAI_mob_fizzle;
- m_scripts[nrscripts++] = newscript;*/
-
- /*newscript = new Script;
- newscript->Name="mob_sliver";
- newscript->GetAI = GetAI_mob_sliver;
- m_scripts[nrscripts++] = newscript;*/
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Priestess_Delrissa
+SD%Complete: 45
+SDComment: No Heroic support yet. Needs further testing. Several scripts for pets disabled, not seem to require any special script.
+SDCategory: Magister's Terrace
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magisters_terrace.h"
+
+#define SAY_AGGRO "Annihilate them!"
+#define SOUND_AGGRO 12395
+
+struct Speech
+{
+ const char* text;
+ uint32 sound;
+};
+
+static Speech LackeyDeath[]=
+{
+ {"Oh, the horror.", 12398},
+ {"Well, aren't you lucky?", 12400},
+ {"Now I'm getting annoyed.", 12401},
+ {"Lackies be damned! I'll finish you myself!", 12403},
+};
+
+static Speech PlayerDeath[]=
+{
+ {"I call that a good start.", 12405},
+ {"I could have sworn there were more of you.", 12407},
+ {"Not really much of a group, anymore, is it?", 12409},
+ {"One is such a lonely number", 12410},
+ {"It's been a kick, really", 12411},
+};
+
+#define SAY_DEATH "Not what I had... planned..."
+#define SOUND_DEATH 12397
+
+#define SPELL_DISPEL_MAGIC 27609
+#define SPELL_FLASH_HEAL 17843
+#define SPELL_SW_PAIN_NORMAL 14032
+#define SPELL_SW_PAIN_HEROIC 15654
+#define SPELL_SHIELD 44291
+#define SPELL_RENEW_NORMAL 44174
+#define SPELL_RENEW_HEROIC 46192
+
+#define ORIENT 4.98
+#define POS_Z -19.9215
+
+float LackeyLocations[4][2]=
+{
+ {123.77, 17.6007},
+ {131.731, 15.0827},
+ {121.563, 15.6213},
+ {129.988, 17.2355},
+};
+
+const uint32 AddEntry[8]=
+{
+ 24557, //Kagani Nightstrike
+ 24558, //Elris Duskhallow
+ 24554, //Eramas Brightblaze
+ 24561, //Yazzaj
+ 24559, //Warlord Salaris
+ 24555, //Garaxxas
+ 24553, //Apoko
+ 24556, //Zelfan
+};
+
+struct Add
+{
+ Add(uint32 _entry, uint64 _guid)
+ {
+ entry = _entry;
+ guid = _guid;
+ }
+
+ uint32 entry;
+ uint64 guid;
+};
+
+struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
+{
+ boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Adds.clear();
+ Reset();
+ SummonAdds();
+ Heroic = c->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::vector<Add*> Adds;
+
+ uint8 LackeysKilled;
+ uint8 PlayersKilled;
+
+ uint32 HealTimer;
+ uint32 RenewTimer;
+ uint32 ShieldTimer;
+ uint32 SWPainTimer;
+ uint32 DispelTimer;
+
+ uint32 CombatPulseTimer; // Periodically puts all players in the instance in combat
+
+ bool Heroic;
+
+ void Reset()
+ {
+ LackeysKilled = 0;
+ PlayersKilled = 0;
+
+ HealTimer = 15000;
+ RenewTimer = 10000;
+ ShieldTimer = 2000;
+ SWPainTimer = 5000;
+ DispelTimer = 7500;
+
+ CombatPulseTimer = 5000;
+
+ CheckAdds();
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED);
+ pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0);
+ }
+ else error_log(ERROR_INST_DATA);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ for(uint8 i = 0; i < Adds.size(); ++i)
+ if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
+ pAdd->AddThreat(who, 1.0f);
+ }
+
+ void SummonAdds()
+ {
+ std::vector<uint32> AddList;
+ for(uint8 i = 0; i < 8; ++i)
+ AddList.push_back(AddEntry[i]);
+
+ while(AddList.size() > 4)
+ AddList.erase(AddList.begin() + rand()%AddList.size());
+
+ for(uint8 i = 0; i < AddList.size(); ++i)
+ {
+ Creature* pAdd = m_creature->SummonCreature(AddList[i], LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
+ if(pAdd)
+ {
+ Add* nAdd = new Add(AddList[i], pAdd->GetGUID());
+ Adds.push_back(nAdd);
+ }
+ }
+ }
+
+ void CheckAdds()
+ {
+ if(Adds.empty())
+ return;
+
+ for(uint8 i = 0; i < Adds.size(); ++i)
+ {
+ bool resummon = true;
+ Creature* pAdd = ((Creature*)Unit::GetUnit(*m_creature, Adds[i]->guid));
+ if(pAdd && pAdd->isAlive())
+ {
+ pAdd->AI()->EnterEvadeMode(); // Force them out of combat and reset if they are in combat.
+ resummon = false;
+ }
+ if(resummon)
+ {
+ pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Add* nAdd = new Add(Adds[i]->entry, pAdd->GetGUID());
+ Adds.erase(Adds.begin() + i);
+ Adds.push_back(nAdd);
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if(victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ DoYell(PlayerDeath[PlayersKilled].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, PlayerDeath[PlayersKilled].sound);
+ if( PlayersKilled < 4 )
+ ++PlayersKilled;
+ }
+
+ void KilledLackey()
+ {
+ DoYell(LackeyDeath[LackeysKilled].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, LackeyDeath[LackeysKilled].sound);
+ if( LackeysKilled < 3 )
+ ++LackeysKilled;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ CheckLootable();
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
+ pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
+ if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR)))
+ Door->SetGoState(0);
+ }
+
+ void CheckLootable()
+ {
+ if(LackeysKilled > 4)
+ m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ else
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(HealTimer < diff)
+ {
+ uint32 health = m_creature->GetHealth();
+ Unit* target = m_creature;
+ for(uint8 i = 0; i < Adds.size(); ++i)
+ if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
+ if(pAdd->isAlive() && pAdd->GetHealth() < health)
+ target = pAdd;
+
+ DoCast(target, SPELL_FLASH_HEAL);
+ HealTimer = 15000;
+ }else HealTimer -= diff;
+
+ if(RenewTimer < diff)
+ {
+ Unit* target = m_creature;
+ if(rand()%2 == 1)
+ {
+ std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
+ Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
+ if(pAdd && pAdd->isAlive())
+ target = pAdd;
+ }
+ DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL);
+ RenewTimer = 5000;
+ }else RenewTimer -= diff;
+
+ if(ShieldTimer < diff)
+ {
+ Unit* target = m_creature;
+ if(rand()%2 == 1)
+ {
+ std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
+ if(Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
+ if(!pAdd->HasAura(SPELL_SHIELD, 0) && pAdd->isAlive())
+ target = pAdd;
+ }
+ DoCast(target, SPELL_SHIELD);
+ ShieldTimer = 7500;
+ }else ShieldTimer -= diff;
+
+ if(DispelTimer < diff)
+ {
+ Unit* target = NULL;
+ bool friendly = false;
+ if(rand()%2 == 1)
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ else
+ {
+ friendly = true;
+ if(rand()%2 == 1)
+ target = m_creature;
+ else
+ {
+ std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
+ Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
+ if(pAdd && pAdd->isAlive())
+ target = pAdd;
+ }
+ }
+ if(target)
+ {
+ DoCast(target, SPELL_DISPEL_MAGIC);
+ DispelTimer = 12000;
+ }
+ }else DispelTimer -= diff;
+
+ if(SWPainTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL);
+ SWPainTimer = 10000;
+ }else SWPainTimer -= diff;
+
+ /*
+ if(CombatPulseTimer < diff)
+ {
+ DoZoneInCombat();
+ for(uint8 i = 0; i < Adds.size(); ++i)
+ {
+ if(Unit* pAdd = Unit::GetUnit(*m_creature, Add[i]->guid))
+ if(pAdd->isAlive())
+ DoZoneInCombat(pAdd);
+ }
+
+ CombatPulseTimer = 10000;
+ }else CombatPulseTimer -= diff;*/
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_HEALING_POTION 15503
+
+struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
+{
+ boss_priestess_guestAI(Creature* c) : ScriptedAI(c)
+ {
+ Group.clear();
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ AcquireGUIDs();
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::vector<Add*> Group;
+
+ uint32 ResetThreatTimer;
+
+ bool UsedPotion;
+
+ void Reset()
+ {
+ UsedPotion = false;
+
+ ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked.
+ }
+
+ void Aggro(Unit* who) {}
+
+ void JustDied(Unit* killer)
+ {
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
+ if(Delrissa)
+ {
+ ((boss_priestess_delrissaAI*)Delrissa->AI())->KilledLackey();
+ if(!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3)
+ ((boss_priestess_delrissaAI*)Delrissa->AI())->CheckLootable();
+
+ pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
+ if(Delrissa)
+ Delrissa->AI()->KilledUnit(victim);
+ }
+
+ void AcquireGUIDs()
+ {
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
+ if(Delrissa)
+ {
+ Group = ((boss_priestess_delrissaAI*)Delrissa->AI())->Adds;
+ Add* dAdd = new Add(Delrissa->GetEntry(), Delrissa->GetGUID());
+ Group.push_back(dAdd);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion)
+ {
+ DoCast(m_creature, SPELL_HEALING_POTION, true);
+ UsedPotion = true;
+ }
+
+ if(ResetThreatTimer < diff)
+ {
+ DoResetThreat();
+ ResetThreatTimer = 5000 + rand()%15000;
+ }else ResetThreatTimer -= diff;
+ }
+};
+
+#define SPELL_KIDNEY_SHOT 27615
+#define SPELL_GOUGE 12540
+#define SPELL_KICK 27613
+#define SPELL_VANISH 44290
+#define SPELL_BACKSTAB 15657
+#define SPELL_EVISCERATE 27611
+
+struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestAI
+{
+ //Rogue
+ boss_kagani_nightstrikeAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ uint32 Gouge_Timer;
+ uint32 Kick_Timer;
+ uint32 Vanish_Timer;
+ uint32 Eviscerate_Timer;
+ uint32 Wait_Timer;
+ bool InVanish;
+
+ void Reset()
+ {
+ Gouge_Timer = 5500;
+ Kick_Timer = 7000;
+ Vanish_Timer = 2000;
+ Eviscerate_Timer = 6000;
+ Wait_Timer = 5000;
+ InVanish = false;
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Vanish_Timer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF); // ...? Hacklike
+ DoCast(m_creature, SPELL_VANISH);
+ InVanish = true;
+ Vanish_Timer = 30000;
+ Wait_Timer = 10000;
+ DoResetThreat();
+ m_creature->AddThreat(SelectUnit(SELECT_TARGET_RANDOM, 0), 1000.0f);
+ }else Vanish_Timer -= diff;
+
+ if(InVanish)
+ if(Wait_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true);
+ DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true);
+ m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike
+ InVanish = false;
+ }else Wait_Timer -= diff;
+
+ if(Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
+ Gouge_Timer = 5500;
+ }else Gouge_Timer -= diff;
+
+ if(Kick_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_KICK);
+ Kick_Timer = 7000;
+ }else Kick_Timer -= diff;
+
+ if(Eviscerate_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EVISCERATE);
+ Eviscerate_Timer = 4000;
+ }else Eviscerate_Timer -= diff;
+
+ if(!InVanish)
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_IMMOLATE 44267
+#define SPELL_SHADOW_BOLT 12471
+#define SPELL_SEED_OF_CORRUPTION 44141
+#define SPELL_CURSE_OF_AGONY 14875
+#define SPELL_FEAR 38595
+#define SPELL_IMP_FIREBALL 44164
+#define SPELL_SUMMON_IMP 44163
+
+//#define CREATURE_IMP 44163
+//#define CREATURE_FIZZLE 24656
+
+/*struct TRINITY_DLL_DECL mob_fizzleAI : public ScriptedAI
+{
+ mob_fizzleAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 EllrisGUID;
+ uint32 Firebal_Timer;
+
+ void Reset() { EllrisGUID = 0; }
+
+ void KilledUnit(Unit* victim);
+ void JustDied(Unit* killer);
+
+ void Aggro(Unit* who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Chain cast
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ DoCast(m_creature->getVictim(),SPELL_IMP_FIREBALL);
+ else DoMeleeAttackIfReady();
+ }
+};*/
+
+struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
+{
+ //Warlock
+ boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c)
+ {
+ }
+
+ bool HasSummonedImp;
+
+ uint32 Immolate_Timer;
+ uint32 Shadow_Bolt_Timer;
+ uint32 Seed_of_Corruption_Timer;
+ uint32 Curse_of_Agony_Timer;
+ uint32 Fear_Timer;
+
+ void Reset()
+ {
+ //HasSummonedImp = false;
+
+ Immolate_Timer = 6000;
+ Shadow_Bolt_Timer = 3000;
+ Seed_of_Corruption_Timer = 2000;
+ Curse_of_Agony_Timer = 1000;
+ Fear_Timer = 10000;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ boss_priestess_guestAI::JustDied(killer);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!HasSummonedImp)
+ {
+ //Imp will not despawn unless it's killed, even if owner dies, this is correct way.
+ DoCast(m_creature,SPELL_SUMMON_IMP);
+ HasSummonedImp = true;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Immolate_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_IMMOLATE);
+ Immolate_Timer = 6000;
+ }else Immolate_Timer -= diff;
+
+ if(Shadow_Bolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOW_BOLT);
+ Shadow_Bolt_Timer = 5000;
+ }else Shadow_Bolt_Timer -= diff;
+
+ if(Seed_of_Corruption_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SEED_OF_CORRUPTION);
+ Seed_of_Corruption_Timer = 10000;
+ }else Seed_of_Corruption_Timer -= diff;
+
+ if(Curse_of_Agony_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_AGONY);
+ Curse_of_Agony_Timer = 13000;
+ }else Curse_of_Agony_Timer -= diff;
+
+ if(Fear_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FEAR);
+ Fear_Timer = 10000;
+ }else Fear_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+/*void mob_fizzleAI::JustDied(Unit* killer)
+{
+ if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
+ ((boss_ellris_duskhallowAI*)Ellris->AI())->ImpGUID = 0;
+}
+
+void mob_fizzleAI::KilledUnit(Unit* victim)
+{
+ if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
+ ((boss_ellris_duskhallowAI*)Ellris->AI())->KilledUnit(victim);
+}*/
+
+#define SPELL_KNOCKDOWN 11428
+#define SPELL_SNAP_KICK 46182
+
+struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestAI
+{
+ //Monk
+ boss_eramas_brightblazeAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ uint32 Knockdown_Timer;
+ uint32 Snap_Kick_Timer;
+
+ void Reset()
+ {
+ Knockdown_Timer = 6000;
+ Snap_Kick_Timer = 4500;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Knockdown_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
+ Knockdown_Timer = 6000;
+ }else Knockdown_Timer -= diff;
+
+ if(Snap_Kick_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SNAP_KICK);
+ Snap_Kick_Timer = 4500;
+ }else Snap_Kick_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_POLYMORPH 13323
+#define SPELL_ICE_BLOCK 27619
+#define SPELL_BLIZZARD 44178
+#define SPELL_ICE_LANCE 46194
+#define SPELL_CONE_OF_COLD 38384
+#define SPELL_FROSTBOLT 15043
+#define SPELL_BLINK 14514
+
+struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
+{
+ //Mage
+ boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ bool HasIceBlocked;
+
+ uint32 Polymorph_Timer;
+ uint32 Ice_Block_Timer;
+ uint32 Wait_Timer;
+ uint32 Blizzard_Timer;
+ uint32 Ice_Lance_Timer;
+ uint32 Cone_of_Cold_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 Blink_Timer;
+
+ void Reset()
+ {
+ HasIceBlocked = false;
+
+ Polymorph_Timer = 1000;
+ Ice_Block_Timer = 20000;
+ Wait_Timer = 10000;
+ Blizzard_Timer = 8000;
+ Ice_Lance_Timer = 12000;
+ Cone_of_Cold_Timer = 10000;
+ Frostbolt_Timer = 3000;
+ Blink_Timer = 8000;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Polymorph_Timer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoCast(target, SPELL_POLYMORPH);
+ m_creature->getThreatManager().modifyThreatPercent(target,-100);
+ Polymorph_Timer = 20000;
+ }
+ }else Polymorph_Timer -= diff;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
+ {
+ DoCast(m_creature, SPELL_ICE_BLOCK);
+ HasIceBlocked = true;
+ }
+
+ if(Blizzard_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLIZZARD);
+ Blizzard_Timer = 8000;
+ }else Blizzard_Timer -= diff;
+
+ if(Ice_Lance_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ICE_LANCE);
+ Ice_Lance_Timer = 12000;
+ }else Ice_Lance_Timer -= diff;
+
+ if(Cone_of_Cold_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ Frostbolt_Timer = 8000;
+ }else Frostbolt_Timer -= diff;
+
+ if(Blink_Timer < diff)
+ {
+ bool InMeleeRange = false;
+ std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
+ for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ //if in melee range
+ if (target->IsWithinDistInMap(m_creature, 5))
+ {
+ InMeleeRange = true;
+ break;
+ }
+ }
+ //if anybody is in melee range than escape by blink
+ if(InMeleeRange)
+ DoCast(m_creature, SPELL_BLINK);
+
+ Blink_Timer = 8000;
+ }else Blink_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_INTERCEPT_STUN 27577
+#define SPELL_DISARM 27581
+#define SPELL_PIERCING_HOWL 23600
+#define SPELL_FRIGHTENING_SHOUT 19134
+#define SPELL_HAMSTRING 27584
+#define SPELL_BATTLE_SHOUT 27578
+#define SPELL_MORTAL_STRIKE 44268
+
+struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
+{
+ //Warrior
+ boss_warlord_salarisAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ uint32 Intercept_Stun_Timer;
+ uint32 Disarm_Timer;
+ uint32 Piercing_Howl_Timer;
+ uint32 Frightening_Shout_Timer;
+ uint32 Hamstring_Timer;
+ uint32 Mortal_Strike_Timer;
+
+ void Reset()
+ {
+ Intercept_Stun_Timer = 500;
+ Disarm_Timer = 6000;
+ Piercing_Howl_Timer = 10000;
+ Frightening_Shout_Timer = 18000;
+ Hamstring_Timer = 4500;
+ Mortal_Strike_Timer = 8000;
+ DoCast(m_creature, SPELL_BATTLE_SHOUT);
+ boss_priestess_guestAI::Reset();
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoCast(m_creature, SPELL_BATTLE_SHOUT);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Intercept_Stun_Timer < diff)
+ {
+ bool InMeleeRange = false;
+ std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
+ for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ //if in melee range
+ if (target->IsWithinDistInMap(m_creature, 5))
+ {
+ InMeleeRange = true;
+ break;
+ }
+ }
+ //if nobody is in melee range than try to use Intercept
+ if(!InMeleeRange)
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_INTERCEPT_STUN);
+ Intercept_Stun_Timer = 10000;
+ }else Intercept_Stun_Timer -= diff;
+
+ if(Disarm_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DISARM);
+ Disarm_Timer = 6000;
+ }else Disarm_Timer -= diff;
+
+ if(Hamstring_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
+ Hamstring_Timer = 4500;
+ }else Hamstring_Timer -= diff;
+
+ if(Mortal_Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ Mortal_Strike_Timer = 4500;
+ }else Mortal_Strike_Timer -= diff;
+
+ if(Piercing_Howl_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ Frightening_Shout_Timer = 18000;
+ }else Frightening_Shout_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_AIMED_SHOT 44271
+#define SPELL_SHOOT 15620
+#define SPELL_CONCUSSIVE_SHOT 27634
+#define TRIGGER_CONCUSSIVE_SHOT 19410
+#define SPELL_MULTI_SHOT 31942
+#define SPELL_WING_CLIP 44286
+#define SPELL_FREEZING_TRAP 44136
+
+#define CREATURE_SLIVER 24552
+
+/*struct TRINITY_DLL_DECL mob_sliverAI : public ScriptedAI
+{
+ mob_sliverAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 GaraxxasGUID;
+
+ void Reset() { GaraxxasGUID = 0; }
+
+ void KilledUnit(Unit* victim);
+ void JustDied(Unit* killer);
+
+ void Aggro(Unit* who){}
+
+};*/
+
+struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
+{
+ //Hunter
+ boss_garaxxasAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ //uint64 SliverGUID;
+ bool HasSummonedSliver;
+
+ uint32 Aimed_Shot_Timer;
+ uint32 Shoot_Timer;
+ uint32 Concussive_Shot_Timer;
+ uint32 Multi_Shot_Timer;
+ uint32 Wing_Clip_Timer;
+ uint32 Freezing_Trap_Timer;
+
+ void Reset()
+ {
+ //SliverGUID = 0;
+ //HasSummonedSliver = false;
+
+ Aimed_Shot_Timer = 6000;
+ Shoot_Timer = 2500;
+ Concussive_Shot_Timer = 8000;
+ Multi_Shot_Timer = 10000;
+ Wing_Clip_Timer = 4000;
+ Freezing_Trap_Timer = 15000;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ boss_priestess_guestAI::JustDied(killer);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!HasSummonedSliver)
+ {
+ Creature* Sliver = m_creature->SummonCreature(CREATURE_SLIVER, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Sliver)
+ {
+ //((mob_sliverAI*)Sliver->AI())->GaraxxasGUID = m_creature->GetGUID();
+ //SliverGUID = Sliver->GetGUID();
+ HasSummonedSliver = true;
+ }
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
+ {
+ if(Wing_Clip_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WING_CLIP);
+ Wing_Clip_Timer = 4000;
+ }else Wing_Clip_Timer -= diff;
+
+ if(Freezing_Trap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
+ Freezing_Trap_Timer = 30000;
+ }else Freezing_Trap_Timer -= diff;
+
+ if(!m_creature->getVictim()->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED | UNIT_STAT_DISTRACTED))
+ DoMeleeAttackIfReady();
+ }else
+ {
+ if(Concussive_Shot_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT);
+ Concussive_Shot_Timer = 8000;
+ }else Concussive_Shot_Timer -= diff;
+
+ if(Multi_Shot_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ Aimed_Shot_Timer = 6000;
+ }else Aimed_Shot_Timer -= diff;
+
+ if(Shoot_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHOOT);
+ Shoot_Timer = 2500;
+ }else Shoot_Timer -= diff;
+ }
+ }
+};
+
+/*void mob_sliverAI::JustDied(Unit* killer)
+{
+ if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
+ ((boss_garaxxasAI*)Garaxxas->AI())->SliverGUID = 0;
+}
+
+void mob_sliverAI::KilledUnit(Unit* victim)
+{
+ if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
+ ((boss_garaxxasAI*)Garaxxas->AI())->KilledUnit(victim);
+}*/
+
+#define SPELL_WINDFURY_TOTEM 27621
+#define SPELL_WAR_STOMP 46026
+#define SPELL_PURGE 27626
+#define SPELL_LESSER_HEALING_WAVE 44256
+#define SPELL_FROST_SHOCK 21401
+#define SPELL_FIRE_NOVA_TOTEM 44257
+#define SPELL_EARTHBIND_TOTEM 15786
+
+struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI
+{
+ //Shaman
+ boss_apokoAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ uint32 Totem_Timer;
+ uint8 Totem_Amount;
+ uint32 War_Stomp_Timer;
+ uint32 Purge_Timer;
+ uint32 Healing_Wave_Timer;
+ uint32 Frost_Shock_Timer;
+
+ void Reset()
+ {
+ Totem_Timer = 2000;
+ Totem_Amount = 1;
+ War_Stomp_Timer = 10000;
+ Purge_Timer = 8000;
+ Healing_Wave_Timer = 5000;
+ Frost_Shock_Timer = 7000;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Totem_Timer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoCast(m_creature, SPELL_WINDFURY_TOTEM);
+ break;
+ case 1:
+ DoCast(m_creature, SPELL_FIRE_NOVA_TOTEM);
+ break;
+ case 2:
+ DoCast(m_creature, SPELL_EARTHBIND_TOTEM);
+ break;
+ }
+ ++Totem_Amount;
+ Totem_Timer = Totem_Amount*2000;
+ }else Totem_Timer -= diff;
+
+ if(War_Stomp_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WAR_STOMP);
+ War_Stomp_Timer = 10000;
+ }else War_Stomp_Timer -= diff;
+
+ if(Purge_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_PURGE);
+ Purge_Timer = 15000;
+ }else Purge_Timer -= diff;
+
+ if(Frost_Shock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
+ Frost_Shock_Timer = 7000;
+ }else Frost_Shock_Timer -= diff;
+
+ if(Healing_Wave_Timer < diff)
+ {
+ // std::vector<Add*>::iterator itr = Group.begin() + rand()%Group.size();
+ // uint64 guid = (*itr)->guid;
+ // if(guid)
+ // {
+ // Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
+ // if(pAdd && pAdd->isAlive())
+ // {
+ DoCast(m_creature, SPELL_LESSER_HEALING_WAVE);
+ Healing_Wave_Timer = 5000;
+ // }
+ // }
+ }else Healing_Wave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+#define SPELL_GOBLIN_DRAGON_GUN 44272
+#define SPELL_ROCKET_LAUNCH 44137
+#define SPELL_RECOMBOBULATE 44274
+#define SPELL_HIGH_EXPLOSIVE_SHEEP 44276
+#define SPELL_FEL_IRON_BOMB 46024
+#define SPELL_SHEEP_EXPLOSION 44279
+
+#define CREATURE_EXPLOSIVE_SHEEP 24715
+
+struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
+{
+ //Engineer
+ boss_zelfanAI(Creature *c) : boss_priestess_guestAI(c) {}
+
+ uint32 Goblin_Dragon_Gun_Timer;
+ uint32 Rocket_Launch_Timer;
+ uint32 Recombobulate_Timer;
+ uint32 High_Explosive_Sheep_Timer;
+ uint32 Fel_Iron_Bomb_Timer;
+
+ void Reset()
+ {
+ Goblin_Dragon_Gun_Timer = 20000;
+ Rocket_Launch_Timer = 7000;
+ Recombobulate_Timer = 4000;
+ High_Explosive_Sheep_Timer = 10000;
+ Fel_Iron_Bomb_Timer = 15000;
+
+ boss_priestess_guestAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_priestess_guestAI::UpdateAI(diff);
+
+ if(Goblin_Dragon_Gun_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ Rocket_Launch_Timer = 9000;
+ }else Rocket_Launch_Timer -= diff;
+
+ if(Fel_Iron_Bomb_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB);
+ Fel_Iron_Bomb_Timer = 15000;
+ }else Fel_Iron_Bomb_Timer -= diff;
+
+ if(Recombobulate_Timer < diff)
+ {
+ for(uint8 i = 0; i < Group.size(); ++i)
+ if(Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid))
+ if(pAdd->IsPolymorphed())
+ {
+ DoCast(pAdd, SPELL_RECOMBOBULATE);
+ break;
+ }
+ }else Recombobulate_Timer -= diff;
+
+ if(High_Explosive_Sheep_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP);
+ High_Explosive_Sheep_Timer = 65000;
+ }else High_Explosive_Sheep_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//struct TRINITY_DLL_DECL mob_high_explosive_sheepAI : public ScriptedAI
+//{
+// mob_high_explosive_sheepAI(Creature *c) : ScriptedAI(c) {Reset();}
+//
+// uint32 Explosion_Timer;
+//
+// void Reset()
+// {
+// Explosion_Timer = 60000;
+// }
+//
+// void JustDied(Unit *Killer){}
+//
+// void Aggro(Unit *who){}
+//
+// void UpdateAI(const uint32 diff)
+// {
+// if(Explosion_Timer < diff)
+// {
+// DoCast(m_creature->getVictim(), SPELL_SHEEP_EXPLOSION);
+// }else
+// Explosion_Timer -= diff;
+// }
+//};
+
+/*CreatureAI* GetAI_mob_sliver(Creature *_Creature)
+{
+ return new mob_sliverAI (_Creature);
+};*/
+
+//CreatureAI* GetAI_mob_high_explosive_sheep(Creature *_Creature)
+//{
+// return new mob_high_explosive_sheepAI (_Creature);
+//};
+
+/*CreatureAI* GetAI_mob_fizzle(Creature *_Creature)
+{
+ return new mob_fizzleAI (_Creature);
+};*/
+
+CreatureAI* GetAI_boss_priestess_delrissa(Creature *_Creature)
+{
+ return new boss_priestess_delrissaAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_kagani_nightstrike(Creature *_Creature)
+{
+ return new boss_kagani_nightstrikeAI (_Creature);
+}
+
+CreatureAI* GetAI_ellris_duskhallow(Creature *_Creature)
+{
+ return new boss_ellris_duskhallowAI (_Creature);
+}
+
+CreatureAI* GetAI_eramas_brightblaze(Creature *_Creature)
+{
+ return new boss_eramas_brightblazeAI (_Creature);
+}
+
+CreatureAI* GetAI_yazzai(Creature *_Creature)
+{
+ return new boss_yazzaiAI (_Creature);
+}
+
+CreatureAI* GetAI_warlord_salaris(Creature *_Creature)
+{
+ return new boss_warlord_salarisAI (_Creature);
+}
+
+CreatureAI* GetAI_garaxxas(Creature *_Creature)
+{
+ return new boss_garaxxasAI (_Creature);
+}
+
+CreatureAI* GetAI_apoko(Creature *_Creature)
+{
+ return new boss_apokoAI (_Creature);
+}
+
+CreatureAI* GetAI_zelfan(Creature *_Creature)
+{
+ return new boss_zelfanAI (_Creature);
+}
+
+void AddSC_boss_priestess_delrissa()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_priestess_delrissa";
+ newscript->GetAI = GetAI_boss_priestess_delrissa;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_kagani_nightstrike";
+ newscript->GetAI = GetAI_boss_kagani_nightstrike;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ellris_duskhallow";
+ newscript->GetAI = GetAI_ellris_duskhallow;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_eramas_brightblaze";
+ newscript->GetAI = GetAI_eramas_brightblaze;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_yazzai";
+ newscript->GetAI = GetAI_yazzai;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_warlord_salaris";
+ newscript->GetAI = GetAI_warlord_salaris;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_garaxxas";
+ newscript->GetAI = GetAI_garaxxas;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_apoko";
+ newscript->GetAI = GetAI_apoko;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_zelfan";
+ newscript->GetAI = GetAI_zelfan;
+ m_scripts[nrscripts++] = newscript;
+
+ /*newscript = new Script;
+ newscript->Name="mob_high_explosive_sheep";
+ newscript->GetAI = GetAI_mob_high_explosive_sheep;
+ m_scripts[nrscripts++] = newscript;*/
+
+ /*newscript = new Script;
+ newscript->Name="mob_fizzle";
+ newscript->GetAI = GetAI_mob_fizzle;
+ m_scripts[nrscripts++] = newscript;*/
+
+ /*newscript = new Script;
+ newscript->Name="mob_sliver";
+ newscript->GetAI = GetAI_mob_sliver;
+ m_scripts[nrscripts++] = newscript;*/
+}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
index d4f963a6704..349c5521cac 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
@@ -1,402 +1,402 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Selin_Fireheart
-SD%Complete: 90
-SDComment: Heroic and Normal Support. Needs further testing.
-SDCategory: Magister's Terrace
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magisters_terrace.h"
-
-#define SAY_AGGRO "You only waste my time!"
-#define SOUND_AGGRO 12378
-
-#define SAY_ENERGY "My hunger knows no bounds! "
-#define SOUND_ENERGY 12381
-
-#define SAY_EMPOWERED "Yes! I am a god!"
-#define SOUND_EMPOWERED 12382
-
-#define SAY_KILL_1 "Enough distractions!"
-#define SOUND_KILL_1 12388
-
-#define SAY_KILL_2 "I am invincible!"
-#define SOUND_KILL_2 12385
-
-#define SAY_DEATH "No! More... I must have more!"
-#define SOUND_DEATH 12383
-
-//Crystal efect spells
-#define SPELL_FEL_CRYSTAL_COSMETIC 44374
-#define SPELL_FEL_CRYSTAL_DUMMY 44329
-#define SPELL_FEL_CRYSTAL_VISUAL 44355
-#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target
-
-//Selin's spells
-#define SPELL_DRAIN_LIFE 44294
-#define SPELL_FEL_EXPLOSION 44314
-
-#define SPELL_DRAIN_MANA 46153 // Heroic only
-
-#define CRYSTALS_NUMBER 5
-#define DATA_CRYSTALS 6
-
-#define CREATURE_FEL_CRYSTAL 24722
-
-struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
-{
- boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
-
- Crystals.clear();
- // GUIDs per instance is static, so we only need to load them once.
- if(pInstance)
- {
- uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
- for(uint8 i = 0; i < size; ++i)
- {
- uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
- debug_log("SD2: Selin: Adding Fel Crystal %u to list", guid);
- Crystals.push_back(guid);
- }
- }
- Reset();
- Heroic = c->GetMap()->IsHeroic() ? true : false;
- }
-
- ScriptedInstance* pInstance;
-
- std::list<uint64> Crystals;
-
- uint32 DrainLifeTimer;
- uint32 DrainManaTimer;
- uint32 FelExplosionTimer;
- uint32 DrainCrystalTimer;
- uint32 EmpowerTimer;
-
- bool IsDraining;
- bool DrainingCrystal;
- bool Heroic;
- uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
-
- void Reset()
- {
- if(pInstance)
- {
- //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
- for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
- {
- //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
- Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
- if(pUnit)
- {
- if(!pUnit->isAlive())
- ((Creature*)pUnit)->Respawn(); // Let TrinIty handle setting death state, etc.
-
- // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
- pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
-
- GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( Door )
- Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
- // Small door opened after event are expected to be closed by default
- // Set Inst data for encounter
- pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
- }else error_log(ERROR_INST_DATA);
-
- DrainLifeTimer = 3000 + rand()%4000;
- DrainManaTimer = DrainLifeTimer + 5000;
- FelExplosionTimer = 2100;
- DrainCrystalTimer = 10000 + rand()%5000;
- DrainCrystalTimer = 20000 + rand()%5000;
- EmpowerTimer = 10000;
-
- IsDraining = false;
- DrainingCrystal = false;
- CrystalGUID = 0;
- }
-
- void SelectNearestCrystal()
- {
- if(Crystals.empty())
- return;
-
- float ShortestDistance = 0;
- CrystalGUID = 0;
- Unit* pCrystal = NULL;
- Unit* CrystalChosen = NULL;
- //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
- for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
- {
- pCrystal = NULL;
- //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
- pCrystal = Unit::GetUnit(*m_creature, *itr);
- if(pCrystal && pCrystal->isAlive())
- {
- if(!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal)))
- {
- ShortestDistance = m_creature->GetDistance2d(pCrystal);
- 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.
- }
- }
- }
- if( CrystalChosen )
- {
- DoYell(SAY_ENERGY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENERGY);
-
- 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);
-
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
- DrainingCrystal = true;
- }
- }
-
- void ShatterRemainingCrystals()
- {
- if(Crystals.empty())
- return;
-
- //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
- for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
- {
- //Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, FelCrystals[i]));
- Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, *itr));
- if( pCrystal && pCrystal->isAlive())
- pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- if( pInstance )
- {
- GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( EncounterDoor )
- EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_2);
- break;
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type == POINT_MOTION_TYPE && id == 1)
- {
- Unit* CrystalChosen = Unit::GetUnit(*m_creature, 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);
- IsDraining = true;
- }
- else
- {
- // Make an error message in case something weird happened here
- error_log("SD2: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
- DrainingCrystal = false;
- }
- }
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
-
- GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( EncounterDoor )
- EncounterDoor->SetGoState(0); // Open the encounter door
-
- GameObject* ContinueDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_DOOR));
- if( ContinueDoor )
- ContinueDoor->SetGoState(0); // Open the door leading further in
-
- ShatterRemainingCrystals();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(!DrainingCrystal)
- {
- uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
- if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) )
- {
- if( DrainLifeTimer < diff )
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
- DrainLifeTimer = 10000;
- }else DrainLifeTimer -= diff;
-
- // Heroic only
- if( Heroic )
- {
- if( DrainManaTimer < diff )
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_MANA);
- DrainManaTimer = 10000;
- }else DrainManaTimer -= diff;
- }
- }
-
- if( FelExplosionTimer < diff )
- {
- if(!m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature, 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) )
- {
- if(DrainCrystalTimer < diff)
- {
- SelectNearestCrystal();
- if(Heroic) DrainCrystalTimer = 10000 + rand()%5000;
- else DrainCrystalTimer = 20000 + rand()%5000;
- }else DrainCrystalTimer -= diff;
- }
-
- }else
- {
- if( IsDraining )
- {
- if( EmpowerTimer < diff )
- {
- IsDraining = false;
- DrainingCrystal = false;
-
- DoYell(SAY_EMPOWERED, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EMPOWERED);
-
- Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
- if( CrystalChosen && CrystalChosen->isAlive() )
- // Use Deal Damage to kill it, not setDeathState.
- CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- CrystalGUID = 0;
-
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }else EmpowerTimer -= diff;
- }
- }
-
- DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
- }
-};
-
-CreatureAI* GetAI_boss_selin_fireheart(Creature *_Creature)
-{
- return new boss_selin_fireheartAI (_Creature);
-};
-
-struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
-{
- mob_fel_crystalAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- void Reset() {}
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-
- void JustDied(Unit* killer)
- {
- if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
- {
- Creature* Selin = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SELIN)));
- if(Selin && Selin->isAlive())
- {
- if(((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID())
- {
- // Set this to false if we are the creature that Selin is draining so his AI flows properly
- ((boss_selin_fireheartAI*)Selin->AI())->DrainingCrystal = false;
- ((boss_selin_fireheartAI*)Selin->AI())->IsDraining = false;
- ((boss_selin_fireheartAI*)Selin->AI())->EmpowerTimer = 10000;
- if(Selin->getVictim())
- {
- Selin->AI()->AttackStart(Selin->getVictim());
- Selin->GetMotionMaster()->MoveChase(Selin->getVictim());
- }
- }
- }
- }else error_log(ERROR_INST_DATA);
- }
-};
-
-CreatureAI* GetAI_mob_fel_crystal(Creature *_Creature)
-{
- return new mob_fel_crystalAI (_Creature);
-};
-
-void AddSC_boss_selin_fireheart()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_selin_fireheart";
- newscript->GetAI = GetAI_boss_selin_fireheart;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_fel_crystal";
- newscript->GetAI = GetAI_mob_fel_crystal;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Selin_Fireheart
+SD%Complete: 90
+SDComment: Heroic and Normal Support. Needs further testing.
+SDCategory: Magister's Terrace
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magisters_terrace.h"
+
+#define SAY_AGGRO "You only waste my time!"
+#define SOUND_AGGRO 12378
+
+#define SAY_ENERGY "My hunger knows no bounds! "
+#define SOUND_ENERGY 12381
+
+#define SAY_EMPOWERED "Yes! I am a god!"
+#define SOUND_EMPOWERED 12382
+
+#define SAY_KILL_1 "Enough distractions!"
+#define SOUND_KILL_1 12388
+
+#define SAY_KILL_2 "I am invincible!"
+#define SOUND_KILL_2 12385
+
+#define SAY_DEATH "No! More... I must have more!"
+#define SOUND_DEATH 12383
+
+//Crystal efect spells
+#define SPELL_FEL_CRYSTAL_COSMETIC 44374
+#define SPELL_FEL_CRYSTAL_DUMMY 44329
+#define SPELL_FEL_CRYSTAL_VISUAL 44355
+#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target
+
+//Selin's spells
+#define SPELL_DRAIN_LIFE 44294
+#define SPELL_FEL_EXPLOSION 44314
+
+#define SPELL_DRAIN_MANA 46153 // Heroic only
+
+#define CRYSTALS_NUMBER 5
+#define DATA_CRYSTALS 6
+
+#define CREATURE_FEL_CRYSTAL 24722
+
+struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
+{
+ boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+
+ Crystals.clear();
+ // GUIDs per instance is static, so we only need to load them once.
+ if(pInstance)
+ {
+ uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
+ for(uint8 i = 0; i < size; ++i)
+ {
+ uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
+ debug_log("SD2: Selin: Adding Fel Crystal %u to list", guid);
+ Crystals.push_back(guid);
+ }
+ }
+ Reset();
+ Heroic = c->GetMap()->IsHeroic() ? true : false;
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::list<uint64> Crystals;
+
+ uint32 DrainLifeTimer;
+ uint32 DrainManaTimer;
+ uint32 FelExplosionTimer;
+ uint32 DrainCrystalTimer;
+ uint32 EmpowerTimer;
+
+ bool IsDraining;
+ bool DrainingCrystal;
+ bool Heroic;
+ uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
+ for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
+ {
+ //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
+ Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
+ if(pUnit)
+ {
+ if(!pUnit->isAlive())
+ ((Creature*)pUnit)->Respawn(); // Let TrinIty handle setting death state, etc.
+
+ // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
+ pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+
+ GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
+ if( Door )
+ Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
+ // Small door opened after event are expected to be closed by default
+ // Set Inst data for encounter
+ pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
+ }else error_log(ERROR_INST_DATA);
+
+ DrainLifeTimer = 3000 + rand()%4000;
+ DrainManaTimer = DrainLifeTimer + 5000;
+ FelExplosionTimer = 2100;
+ DrainCrystalTimer = 10000 + rand()%5000;
+ DrainCrystalTimer = 20000 + rand()%5000;
+ EmpowerTimer = 10000;
+
+ IsDraining = false;
+ DrainingCrystal = false;
+ CrystalGUID = 0;
+ }
+
+ void SelectNearestCrystal()
+ {
+ if(Crystals.empty())
+ return;
+
+ float ShortestDistance = 0;
+ CrystalGUID = 0;
+ Unit* pCrystal = NULL;
+ Unit* CrystalChosen = NULL;
+ //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
+ for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
+ {
+ pCrystal = NULL;
+ //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
+ pCrystal = Unit::GetUnit(*m_creature, *itr);
+ if(pCrystal && pCrystal->isAlive())
+ {
+ if(!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal)))
+ {
+ ShortestDistance = m_creature->GetDistance2d(pCrystal);
+ 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.
+ }
+ }
+ }
+ if( CrystalChosen )
+ {
+ DoYell(SAY_ENERGY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENERGY);
+
+ 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);
+
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
+ DrainingCrystal = true;
+ }
+ }
+
+ void ShatterRemainingCrystals()
+ {
+ if(Crystals.empty())
+ return;
+
+ //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
+ for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
+ {
+ //Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, FelCrystals[i]));
+ Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, *itr));
+ if( pCrystal && pCrystal->isAlive())
+ pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ if( pInstance )
+ {
+ GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
+ if( EncounterDoor )
+ EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type == POINT_MOTION_TYPE && id == 1)
+ {
+ Unit* CrystalChosen = Unit::GetUnit(*m_creature, 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);
+ IsDraining = true;
+ }
+ else
+ {
+ // Make an error message in case something weird happened here
+ error_log("SD2: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
+ DrainingCrystal = false;
+ }
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
+
+ GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
+ if( EncounterDoor )
+ EncounterDoor->SetGoState(0); // Open the encounter door
+
+ GameObject* ContinueDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_DOOR));
+ if( ContinueDoor )
+ ContinueDoor->SetGoState(0); // Open the door leading further in
+
+ ShatterRemainingCrystals();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(!DrainingCrystal)
+ {
+ uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
+ if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) )
+ {
+ if( DrainLifeTimer < diff )
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
+ DrainLifeTimer = 10000;
+ }else DrainLifeTimer -= diff;
+
+ // Heroic only
+ if( Heroic )
+ {
+ if( DrainManaTimer < diff )
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_MANA);
+ DrainManaTimer = 10000;
+ }else DrainManaTimer -= diff;
+ }
+ }
+
+ if( FelExplosionTimer < diff )
+ {
+ if(!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature, 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) )
+ {
+ if(DrainCrystalTimer < diff)
+ {
+ SelectNearestCrystal();
+ if(Heroic) DrainCrystalTimer = 10000 + rand()%5000;
+ else DrainCrystalTimer = 20000 + rand()%5000;
+ }else DrainCrystalTimer -= diff;
+ }
+
+ }else
+ {
+ if( IsDraining )
+ {
+ if( EmpowerTimer < diff )
+ {
+ IsDraining = false;
+ DrainingCrystal = false;
+
+ DoYell(SAY_EMPOWERED, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EMPOWERED);
+
+ Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
+ if( CrystalChosen && CrystalChosen->isAlive() )
+ // Use Deal Damage to kill it, not setDeathState.
+ CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CrystalGUID = 0;
+
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }else EmpowerTimer -= diff;
+ }
+ }
+
+ DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
+ }
+};
+
+CreatureAI* GetAI_boss_selin_fireheart(Creature *_Creature)
+{
+ return new boss_selin_fireheartAI (_Creature);
+};
+
+struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
+{
+ mob_fel_crystalAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+
+ void JustDied(Unit* killer)
+ {
+ if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
+ {
+ Creature* Selin = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SELIN)));
+ if(Selin && Selin->isAlive())
+ {
+ if(((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID())
+ {
+ // Set this to false if we are the creature that Selin is draining so his AI flows properly
+ ((boss_selin_fireheartAI*)Selin->AI())->DrainingCrystal = false;
+ ((boss_selin_fireheartAI*)Selin->AI())->IsDraining = false;
+ ((boss_selin_fireheartAI*)Selin->AI())->EmpowerTimer = 10000;
+ if(Selin->getVictim())
+ {
+ Selin->AI()->AttackStart(Selin->getVictim());
+ Selin->GetMotionMaster()->MoveChase(Selin->getVictim());
+ }
+ }
+ }
+ }else error_log(ERROR_INST_DATA);
+ }
+};
+
+CreatureAI* GetAI_mob_fel_crystal(Creature *_Creature)
+{
+ return new mob_fel_crystalAI (_Creature);
+};
+
+void AddSC_boss_selin_fireheart()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_selin_fireheart";
+ newscript->GetAI = GetAI_boss_selin_fireheart;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_fel_crystal";
+ newscript->GetAI = GetAI_mob_fel_crystal;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
index 0a2d1f9666f..7f6521d1c60 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
@@ -1,233 +1,233 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vexallus
-SD%Complete: 90
-SDComment: Heroic and Normal support. Needs further testing.
-SDCategory: Magister's Terrace
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magisters_terrace.h"
-
-#define SAY_AGGRO "Drain...life..."
-#define SOUND_AGGRO 12389
-
-#define SAY_ENERGY "Un...con...tainable."
-#define SOUND_ENERGY 12392
-
-#define SAY_OVERLOAD "Un...leash..."
-#define SOUND_OVERLOAD 12390
-
-#define SAY_KILL "Con...sume."
-#define SOUND_KILL 12393
-
-#define SAY_DEATH "What...happen...ed."
-
-//Pure energy spell info
-#define SPELL_ENERGY_BOLT 44342
-#define SPELL_ENERGY_FEEDBACK 44335
-
-//Vexallus spell info
-#define SPELL_CHAIN_LIGHTNING 44318
-#define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell
-#define SPELL_OVERLOAD 44353
-#define SPELL_ARCANE_SHOCK 44319
-
-//Creatures
-#define CREATURE_PURE_ENERGY 24745
-
-struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
-{
- boss_vexallusAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- Heroic = c->GetMap()->IsHeroic() ? true : false;
- }
-
- ScriptedInstance* pInstance;
-
- uint32 ChainLightningTimer;
- uint32 ArcaneShockTimer;
- uint32 OverloadTimer;
- uint32 SpawnAddInterval;
- uint32 AlreadySpawnedAmount;
- bool Enraged;
- bool Heroic;
-
- void Reset()
- {
- ChainLightningTimer = 10000;
- ArcaneShockTimer = 8000;
- OverloadTimer = 2200;
- SpawnAddInterval = 15;
- AlreadySpawnedAmount = 0;
-
- Enraged = false;
-
- if(pInstance)
- pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(victim, SOUND_KILL);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- if (pInstance)
- {
- pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
-
- GameObject* Door = NULL;
- Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR));
- if(Door)
- Door->SetGoState(0);
- }
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- if (pInstance)
- pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)
- {
- Enraged = true;
- }
-
- if(!Enraged)
- {
- //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
- {
- DoYell(SAY_ENERGY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENERGY);
- Creature* PureEnergyCreature = NULL;
- PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (PureEnergyCreature && target)
- PureEnergyCreature->AI()->AttackStart(target);
-
- if(Heroic) // *Heroic mode only - he summons two instead of one.
- {
- PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (PureEnergyCreature && target)
- PureEnergyCreature->AI()->AttackStart(target);
- }
-
- ++AlreadySpawnedAmount;
- };
-
- if(ChainLightningTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target, SPELL_CHAIN_LIGHTNING);
- ChainLightningTimer = 10000;
- }else ChainLightningTimer -= diff;
-
- if(ArcaneShockTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target, SPELL_ARCANE_SHOCK);
- ArcaneShockTimer = 8000;
- }else ArcaneShockTimer -= diff;
- }else
- {
- if(OverloadTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target, SPELL_OVERLOAD);
- OverloadTimer = 2200;
- }else OverloadTimer -= diff;
- }
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_vexallus(Creature *_Creature)
-{
- return new boss_vexallusAI (_Creature);
-};
-
-struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
-{
- mob_pure_energyAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 EnergyBoltTimer;
-
- void Reset()
- {
- EnergyBoltTimer = 1700;
- }
-
- void JustDied(Unit* slayer)
- {
- slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, m_creature->GetGUID());
- }
-
- void Aggro(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(EnergyBoltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT);
- EnergyBoltTimer = 1700;
- }else EnergyBoltTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_mob_pure_energy(Creature *_Creature)
-{
- return new mob_pure_energyAI (_Creature);
-};
-
-void AddSC_boss_vexallus()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_vexallus";
- newscript->GetAI = GetAI_boss_vexallus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_pure_energy";
- newscript->GetAI = GetAI_mob_pure_energy;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vexallus
+SD%Complete: 90
+SDComment: Heroic and Normal support. Needs further testing.
+SDCategory: Magister's Terrace
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magisters_terrace.h"
+
+#define SAY_AGGRO "Drain...life..."
+#define SOUND_AGGRO 12389
+
+#define SAY_ENERGY "Un...con...tainable."
+#define SOUND_ENERGY 12392
+
+#define SAY_OVERLOAD "Un...leash..."
+#define SOUND_OVERLOAD 12390
+
+#define SAY_KILL "Con...sume."
+#define SOUND_KILL 12393
+
+#define SAY_DEATH "What...happen...ed."
+
+//Pure energy spell info
+#define SPELL_ENERGY_BOLT 44342
+#define SPELL_ENERGY_FEEDBACK 44335
+
+//Vexallus spell info
+#define SPELL_CHAIN_LIGHTNING 44318
+#define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell
+#define SPELL_OVERLOAD 44353
+#define SPELL_ARCANE_SHOCK 44319
+
+//Creatures
+#define CREATURE_PURE_ENERGY 24745
+
+struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
+{
+ boss_vexallusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ Heroic = c->GetMap()->IsHeroic() ? true : false;
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 ChainLightningTimer;
+ uint32 ArcaneShockTimer;
+ uint32 OverloadTimer;
+ uint32 SpawnAddInterval;
+ uint32 AlreadySpawnedAmount;
+ bool Enraged;
+ bool Heroic;
+
+ void Reset()
+ {
+ ChainLightningTimer = 10000;
+ ArcaneShockTimer = 8000;
+ OverloadTimer = 2200;
+ SpawnAddInterval = 15;
+ AlreadySpawnedAmount = 0;
+
+ Enraged = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(victim, SOUND_KILL);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
+
+ GameObject* Door = NULL;
+ Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR));
+ if(Door)
+ Door->SetGoState(0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ if (pInstance)
+ pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)
+ {
+ Enraged = true;
+ }
+
+ if(!Enraged)
+ {
+ //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
+ {
+ DoYell(SAY_ENERGY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENERGY);
+ Creature* PureEnergyCreature = NULL;
+ PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (PureEnergyCreature && target)
+ PureEnergyCreature->AI()->AttackStart(target);
+
+ if(Heroic) // *Heroic mode only - he summons two instead of one.
+ {
+ PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (PureEnergyCreature && target)
+ PureEnergyCreature->AI()->AttackStart(target);
+ }
+
+ ++AlreadySpawnedAmount;
+ };
+
+ if(ChainLightningTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target, SPELL_CHAIN_LIGHTNING);
+ ChainLightningTimer = 10000;
+ }else ChainLightningTimer -= diff;
+
+ if(ArcaneShockTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target, SPELL_ARCANE_SHOCK);
+ ArcaneShockTimer = 8000;
+ }else ArcaneShockTimer -= diff;
+ }else
+ {
+ if(OverloadTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target, SPELL_OVERLOAD);
+ OverloadTimer = 2200;
+ }else OverloadTimer -= diff;
+ }
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_vexallus(Creature *_Creature)
+{
+ return new boss_vexallusAI (_Creature);
+};
+
+struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
+{
+ mob_pure_energyAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 EnergyBoltTimer;
+
+ void Reset()
+ {
+ EnergyBoltTimer = 1700;
+ }
+
+ void JustDied(Unit* slayer)
+ {
+ slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, m_creature->GetGUID());
+ }
+
+ void Aggro(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(EnergyBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT);
+ EnergyBoltTimer = 1700;
+ }else EnergyBoltTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_pure_energy(Creature *_Creature)
+{
+ return new mob_pure_energyAI (_Creature);
+};
+
+void AddSC_boss_vexallus()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_vexallus";
+ newscript->GetAI = GetAI_boss_vexallus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_pure_energy";
+ newscript->GetAI = GetAI_mob_pure_energy;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
index ed5aa46366a..d064a50cc13 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
@@ -1,29 +1,29 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_MAGISTERS_TERRACE_H
-#define DEF_MAGISTERS_TERRACE_H
-
-#define DATA_SELIN_EVENT 1
-#define DATA_VEXALLUS_EVENT 2
-#define DATA_DELRISSA_EVENT 3
-#define DATA_KAELTHAS_EVENT 4
-
-#define DATA_SELIN 5
-#define DATA_FEL_CRYSTAL 6
-#define DATA_FEL_CRYSTAL_SIZE 7
-
-#define DATA_VEXALLUS_DOOR 8
-#define DATA_SELIN_DOOR 9
-#define DATA_DELRISSA 10
-#define DATA_DELRISSA_DOOR 11
-#define DATA_SELIN_ENCOUNTER_DOOR 12
-
-#define DATA_KAEL_STATUE_LEFT 13
-#define DATA_KAEL_STATUE_RIGHT 14
-
-#define DATA_DELRISSA_DEATH_COUNT 15
-
-#define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_MAGISTERS_TERRACE_H
+#define DEF_MAGISTERS_TERRACE_H
+
+#define DATA_SELIN_EVENT 1
+#define DATA_VEXALLUS_EVENT 2
+#define DATA_DELRISSA_EVENT 3
+#define DATA_KAELTHAS_EVENT 4
+
+#define DATA_SELIN 5
+#define DATA_FEL_CRYSTAL 6
+#define DATA_FEL_CRYSTAL_SIZE 7
+
+#define DATA_VEXALLUS_DOOR 8
+#define DATA_SELIN_DOOR 9
+#define DATA_DELRISSA 10
+#define DATA_DELRISSA_DOOR 11
+#define DATA_SELIN_ENCOUNTER_DOOR 12
+
+#define DATA_KAEL_STATUE_LEFT 13
+#define DATA_KAEL_STATUE_RIGHT 14
+
+#define DATA_DELRISSA_DEATH_COUNT 15
+
+#define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
+#endif
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
index d1219134f3b..fd7ae851dfd 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
@@ -1,191 +1,191 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Magisters_Terrace
-SD%Complete: 60
-SDComment: Designed only for Selin Fireheart
-SDCategory: Magister's Terrace
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_magisters_terrace.h"
-
-#define NUMBER_OF_ENCOUNTERS 4
-
-/*
-0 - Selin Fireheart
-1 - Vexallus
-2 - Priestess Delrissa
-3 - Kael'thas Sunstrider
-*/
-
-struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
-{
- instance_magisters_terrace(Map* map) : ScriptedInstance(map)
- {
- Initialize();
- }
-
- uint32 Encounters[NUMBER_OF_ENCOUNTERS];
- uint32 DelrissaDeathCount;
-
- std::list<uint64> FelCrystals;
- std::list<uint64>::iterator CrystalItr;
-
- uint64 SelinGUID;
- uint64 DelrissaGUID;
- uint64 VexallusDoorGUID;
- uint64 SelinDoorGUID;
- uint64 SelinEncounterDoorGUID;
- uint64 DelrissaDoorGUID;
- uint64 KaelStatue[2];
-
- bool InitializedItr;
-
- void Initialize()
- {
- for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
- Encounters[i] = NOT_STARTED;
-
- FelCrystals.clear();
-
- DelrissaDeathCount = 0;
-
- SelinGUID = 0;
- DelrissaGUID = 0;
- VexallusDoorGUID = 0;
- SelinDoorGUID = 0;
- SelinEncounterDoorGUID = 0;
- DelrissaDoorGUID = 0;
- KaelStatue[0] = 0;
- KaelStatue[1] = 0;
-
- InitializedItr = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
- if(Encounters[i] == IN_PROGRESS)
- return true;
- return false;
- }
-
- uint32 GetData(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_SELIN_EVENT: return Encounters[0];
- case DATA_VEXALLUS_EVENT: return Encounters[1];
- case DATA_DELRISSA_EVENT: return Encounters[2];
- case DATA_KAELTHAS_EVENT: return Encounters[3];
- case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount;
- case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size();
- }
- return 0;
- }
-
- void SetData(uint32 identifier, uint32 data)
- {
- switch(identifier)
- {
- case DATA_SELIN_EVENT: Encounters[0] = data; break;
- case DATA_VEXALLUS_EVENT: Encounters[1] = data; break;
- case DATA_DELRISSA_EVENT: Encounters[2] = data; break;
- case DATA_KAELTHAS_EVENT: Encounters[3] = data; break;
-
- case DATA_DELRISSA_DEATH_COUNT:
- if(data) ++DelrissaDeathCount;
- else DelrissaDeathCount = 0;
- }
- }
-
- void OnCreatureCreate(Creature *creature, uint32 entry)
- {
- switch(entry)
- {
- case 24723: SelinGUID = creature->GetGUID(); break;
- case 24560: DelrissaGUID = creature->GetGUID(); break;
- case 24722: FelCrystals.push_back(creature->GetGUID()); break;
- }
- }
-
- void OnObjectCreate(GameObject* go)
- {
- switch(go->GetEntry())
- {
- case 187896: VexallusDoorGUID = go->GetGUID(); break;
- //SunwellRaid Gate 02
- case 187979: SelinDoorGUID = go->GetGUID(); break;
- //Assembly Chamber Door
- case 188065: SelinEncounterDoorGUID = go->GetGUID(); break;
- case 187770: DelrissaDoorGUID = go->GetGUID(); break;
- case 188165: KaelStatue[0] = go->GetGUID(); break;
- case 188166: KaelStatue[1] = go->GetGUID(); break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_SELIN: return SelinGUID;
- case DATA_DELRISSA: return DelrissaGUID;
- case DATA_VEXALLUS_DOOR: return VexallusDoorGUID;
- case DATA_SELIN_DOOR: return SelinDoorGUID;
- case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID;
- case DATA_DELRISSA_DOOR: return DelrissaDoorGUID;
- case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
- case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
-
- case DATA_FEL_CRYSTAL:
- {
- if(FelCrystals.empty())
- {
- error_log("SD2: Magisters Terrace: No Fel Crystals loaded in Inst Data");
- return 0;
- }
-
- if(!InitializedItr)
- {
- CrystalItr = FelCrystals.begin();
- InitializedItr = true;
- }
-
- uint64 guid = *CrystalItr;
- ++CrystalItr;
- return guid;
- }
- }
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_magisters_terrace(Map* map)
-{
- return new instance_magisters_terrace(map);
-}
-
-void AddSC_instance_magisters_terrace()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "instance_magisters_terrace";
- newscript->GetInstanceData = GetInstanceData_instance_magisters_terrace;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Magisters_Terrace
+SD%Complete: 60
+SDComment: Designed only for Selin Fireheart
+SDCategory: Magister's Terrace
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_magisters_terrace.h"
+
+#define NUMBER_OF_ENCOUNTERS 4
+
+/*
+0 - Selin Fireheart
+1 - Vexallus
+2 - Priestess Delrissa
+3 - Kael'thas Sunstrider
+*/
+
+struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
+{
+ instance_magisters_terrace(Map* map) : ScriptedInstance(map)
+ {
+ Initialize();
+ }
+
+ uint32 Encounters[NUMBER_OF_ENCOUNTERS];
+ uint32 DelrissaDeathCount;
+
+ std::list<uint64> FelCrystals;
+ std::list<uint64>::iterator CrystalItr;
+
+ uint64 SelinGUID;
+ uint64 DelrissaGUID;
+ uint64 VexallusDoorGUID;
+ uint64 SelinDoorGUID;
+ uint64 SelinEncounterDoorGUID;
+ uint64 DelrissaDoorGUID;
+ uint64 KaelStatue[2];
+
+ bool InitializedItr;
+
+ void Initialize()
+ {
+ for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
+ Encounters[i] = NOT_STARTED;
+
+ FelCrystals.clear();
+
+ DelrissaDeathCount = 0;
+
+ SelinGUID = 0;
+ DelrissaGUID = 0;
+ VexallusDoorGUID = 0;
+ SelinDoorGUID = 0;
+ SelinEncounterDoorGUID = 0;
+ DelrissaDoorGUID = 0;
+ KaelStatue[0] = 0;
+ KaelStatue[1] = 0;
+
+ InitializedItr = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
+ if(Encounters[i] == IN_PROGRESS)
+ return true;
+ return false;
+ }
+
+ uint32 GetData(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_SELIN_EVENT: return Encounters[0];
+ case DATA_VEXALLUS_EVENT: return Encounters[1];
+ case DATA_DELRISSA_EVENT: return Encounters[2];
+ case DATA_KAELTHAS_EVENT: return Encounters[3];
+ case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount;
+ case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size();
+ }
+ return 0;
+ }
+
+ void SetData(uint32 identifier, uint32 data)
+ {
+ switch(identifier)
+ {
+ case DATA_SELIN_EVENT: Encounters[0] = data; break;
+ case DATA_VEXALLUS_EVENT: Encounters[1] = data; break;
+ case DATA_DELRISSA_EVENT: Encounters[2] = data; break;
+ case DATA_KAELTHAS_EVENT: Encounters[3] = data; break;
+
+ case DATA_DELRISSA_DEATH_COUNT:
+ if(data) ++DelrissaDeathCount;
+ else DelrissaDeathCount = 0;
+ }
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 entry)
+ {
+ switch(entry)
+ {
+ case 24723: SelinGUID = creature->GetGUID(); break;
+ case 24560: DelrissaGUID = creature->GetGUID(); break;
+ case 24722: FelCrystals.push_back(creature->GetGUID()); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ switch(go->GetEntry())
+ {
+ case 187896: VexallusDoorGUID = go->GetGUID(); break;
+ //SunwellRaid Gate 02
+ case 187979: SelinDoorGUID = go->GetGUID(); break;
+ //Assembly Chamber Door
+ case 188065: SelinEncounterDoorGUID = go->GetGUID(); break;
+ case 187770: DelrissaDoorGUID = go->GetGUID(); break;
+ case 188165: KaelStatue[0] = go->GetGUID(); break;
+ case 188166: KaelStatue[1] = go->GetGUID(); break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_SELIN: return SelinGUID;
+ case DATA_DELRISSA: return DelrissaGUID;
+ case DATA_VEXALLUS_DOOR: return VexallusDoorGUID;
+ case DATA_SELIN_DOOR: return SelinDoorGUID;
+ case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID;
+ case DATA_DELRISSA_DOOR: return DelrissaDoorGUID;
+ case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
+ case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
+
+ case DATA_FEL_CRYSTAL:
+ {
+ if(FelCrystals.empty())
+ {
+ error_log("SD2: Magisters Terrace: No Fel Crystals loaded in Inst Data");
+ return 0;
+ }
+
+ if(!InitializedItr)
+ {
+ CrystalItr = FelCrystals.begin();
+ InitializedItr = true;
+ }
+
+ uint64 guid = *CrystalItr;
+ ++CrystalItr;
+ return guid;
+ }
+ }
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_magisters_terrace(Map* map)
+{
+ return new instance_magisters_terrace(map);
+}
+
+void AddSC_instance_magisters_terrace()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "instance_magisters_terrace";
+ newscript->GetInstanceData = GetInstanceData_instance_magisters_terrace;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
index b2b8a4bcebc..543686e2648 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
@@ -1,97 +1,97 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Celebras_the_Cursed
-SD%Complete: 100
-SDComment:
-SDCategory: Maraudon
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WRATH 21807
-#define SPELL_ENTANGLINGROOTS 12747
-#define SPELL_CORRUPT_FORCES 21968
-
-struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI
-{
- celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Wrath_Timer;
- uint32 EntanglingRoots_Timer;
- uint32 CorruptForces_Timer;
-
- void Reset()
- {
- Wrath_Timer = 8000;
- EntanglingRoots_Timer = 2000;
- CorruptForces_Timer = 30000;
- }
-
- void Aggro(Unit *who) { }
-
- void JustDied(Unit* Killer)
- {
- m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Wrath
- if (Wrath_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if( target )
- DoCast(target,SPELL_WRATH);
- Wrath_Timer = 8000;
- }else Wrath_Timer -= diff;
-
- //EntanglingRoots
- if (EntanglingRoots_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS);
- EntanglingRoots_Timer = 20000;
- }else EntanglingRoots_Timer -= diff;
-
- //CorruptForces
- if (CorruptForces_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature,SPELL_CORRUPT_FORCES);
- CorruptForces_Timer = 20000;
- }else CorruptForces_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_celebras_the_cursed(Creature *_Creature)
-{
- return new celebras_the_cursedAI (_Creature);
-}
-
-void AddSC_boss_celebras_the_cursed()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="celebras_the_cursed";
- newscript->GetAI = GetAI_celebras_the_cursed;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Celebras_the_Cursed
+SD%Complete: 100
+SDComment:
+SDCategory: Maraudon
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WRATH 21807
+#define SPELL_ENTANGLINGROOTS 12747
+#define SPELL_CORRUPT_FORCES 21968
+
+struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI
+{
+ celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Wrath_Timer;
+ uint32 EntanglingRoots_Timer;
+ uint32 CorruptForces_Timer;
+
+ void Reset()
+ {
+ Wrath_Timer = 8000;
+ EntanglingRoots_Timer = 2000;
+ CorruptForces_Timer = 30000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void JustDied(Unit* Killer)
+ {
+ m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Wrath
+ if (Wrath_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if( target )
+ DoCast(target,SPELL_WRATH);
+ Wrath_Timer = 8000;
+ }else Wrath_Timer -= diff;
+
+ //EntanglingRoots
+ if (EntanglingRoots_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS);
+ EntanglingRoots_Timer = 20000;
+ }else EntanglingRoots_Timer -= diff;
+
+ //CorruptForces
+ if (CorruptForces_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature,SPELL_CORRUPT_FORCES);
+ CorruptForces_Timer = 20000;
+ }else CorruptForces_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_celebras_the_cursed(Creature *_Creature)
+{
+ return new celebras_the_cursedAI (_Creature);
+}
+
+void AddSC_boss_celebras_the_cursed()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="celebras_the_cursed";
+ newscript->GetAI = GetAI_celebras_the_cursed;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
index 811b8d7cd31..20b93fe64b3 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
@@ -1,94 +1,94 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Landslide
-SD%Complete: 100
-SDComment:
-SDCategory: Maraudon
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_KNOCKAWAY 18670
-#define SPELL_TRAMPLE 5568
-#define SPELL_LANDSLIDE 21808
-
-struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI
-{
- boss_landslideAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 KnockAway_Timer;
- uint32 Trample_Timer;
- uint32 Landslide_Timer;
-
- void Reset()
- {
- KnockAway_Timer = 8000;
- Trample_Timer = 2000;
- Landslide_Timer = 0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //KnockAway_Timer
- if (KnockAway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- KnockAway_Timer = 15000;
- }else KnockAway_Timer -= diff;
-
- //Trample_Timer
- if (Trample_Timer < diff)
- {
- DoCast(m_creature,SPELL_TRAMPLE);
- Trample_Timer = 8000;
- }else Trample_Timer -= diff;
-
- //Landslide
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
- {
- if (Landslide_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature,SPELL_LANDSLIDE);
- Landslide_Timer = 60000;
- } else Landslide_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_landslide(Creature *_Creature)
-{
- return new boss_landslideAI (_Creature);
-}
-
-void AddSC_boss_landslide()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_landslide";
- newscript->GetAI = GetAI_boss_landslide;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Landslide
+SD%Complete: 100
+SDComment:
+SDCategory: Maraudon
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_KNOCKAWAY 18670
+#define SPELL_TRAMPLE 5568
+#define SPELL_LANDSLIDE 21808
+
+struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI
+{
+ boss_landslideAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 KnockAway_Timer;
+ uint32 Trample_Timer;
+ uint32 Landslide_Timer;
+
+ void Reset()
+ {
+ KnockAway_Timer = 8000;
+ Trample_Timer = 2000;
+ Landslide_Timer = 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //KnockAway_Timer
+ if (KnockAway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ KnockAway_Timer = 15000;
+ }else KnockAway_Timer -= diff;
+
+ //Trample_Timer
+ if (Trample_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_TRAMPLE);
+ Trample_Timer = 8000;
+ }else Trample_Timer -= diff;
+
+ //Landslide
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
+ {
+ if (Landslide_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature,SPELL_LANDSLIDE);
+ Landslide_Timer = 60000;
+ } else Landslide_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_landslide(Creature *_Creature)
+{
+ return new boss_landslideAI (_Creature);
+}
+
+void AddSC_boss_landslide()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_landslide";
+ newscript->GetAI = GetAI_boss_landslide;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
index b0c9e5d5d38..c5d5a51ffb9 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
@@ -1,149 +1,149 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Noxxion
-SD%Complete: 100
-SDComment:
-SDCategory: Maraudon
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_TOXICVOLLEY 21687
-#define SPELL_UPPERCUT 22916
-
-struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI
-{
- boss_noxxionAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ToxicVolley_Timer;
- uint32 Uppercut_Timer;
- uint32 Adds_Timer;
- uint32 Invisible_Timer;
- bool Invisible;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- ToxicVolley_Timer = 7000;
- Uppercut_Timer = 16000;
- Adds_Timer = 19000;
- Invisible_Timer = 15000; //Too much too low?
- Invisible = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonAdds(Unit* victim)
- {
- Rand = rand()%8;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%8;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (Invisible && Invisible_Timer < diff)
- {
- //Become visible again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //Noxxion model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11172);
- Invisible = false;
- //m_creature->m_canMove = true;
- } else if (Invisible)
- {
- Invisible_Timer -= diff;
- //Do nothing while invisible
- return;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ToxicVolley_Timer
- if (ToxicVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY);
- ToxicVolley_Timer = 9000;
- }else ToxicVolley_Timer -= diff;
-
- //Uppercut_Timer
- if (Uppercut_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
- Uppercut_Timer = 12000;
- }else Uppercut_Timer -= diff;
-
- //Adds_Timer
- if (!Invisible && Adds_Timer < diff)
- {
- //Inturrupt any spell casting
- //m_creature->m_canMove = true;
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Invisible Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- Invisible = true;
- Invisible_Timer = 15000;
-
- Adds_Timer = 40000;
- }else Adds_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_noxxion(Creature *_Creature)
-{
- return new boss_noxxionAI (_Creature);
-}
-
-void AddSC_boss_noxxion()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_noxxion";
- newscript->GetAI = GetAI_boss_noxxion;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Noxxion
+SD%Complete: 100
+SDComment:
+SDCategory: Maraudon
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_TOXICVOLLEY 21687
+#define SPELL_UPPERCUT 22916
+
+struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI
+{
+ boss_noxxionAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ToxicVolley_Timer;
+ uint32 Uppercut_Timer;
+ uint32 Adds_Timer;
+ uint32 Invisible_Timer;
+ bool Invisible;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ ToxicVolley_Timer = 7000;
+ Uppercut_Timer = 16000;
+ Adds_Timer = 19000;
+ Invisible_Timer = 15000; //Too much too low?
+ Invisible = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonAdds(Unit* victim)
+ {
+ Rand = rand()%8;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%8;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (Invisible && Invisible_Timer < diff)
+ {
+ //Become visible again
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //Noxxion model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11172);
+ Invisible = false;
+ //m_creature->m_canMove = true;
+ } else if (Invisible)
+ {
+ Invisible_Timer -= diff;
+ //Do nothing while invisible
+ return;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ToxicVolley_Timer
+ if (ToxicVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY);
+ ToxicVolley_Timer = 9000;
+ }else ToxicVolley_Timer -= diff;
+
+ //Uppercut_Timer
+ if (Uppercut_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
+ Uppercut_Timer = 12000;
+ }else Uppercut_Timer -= diff;
+
+ //Adds_Timer
+ if (!Invisible && Adds_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ //m_creature->m_canMove = true;
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Invisible Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ Invisible = true;
+ Invisible_Timer = 15000;
+
+ Adds_Timer = 40000;
+ }else Adds_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_noxxion(Creature *_Creature)
+{
+ return new boss_noxxionAI (_Creature);
+}
+
+void AddSC_boss_noxxion()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_noxxion";
+ newscript->GetAI = GetAI_boss_noxxion;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
index 9a34450b201..1920109f3d8 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
@@ -1,108 +1,108 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Princess_Theradras
-SD%Complete: 100
-SDComment:
-SDCategory: Maraudon
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_DUSTFIELD 21909
-#define SPELL_BOULDER 21832
-#define SPELL_THRASH 3391
-#define SPELL_REPULSIVEGAZE 21869
-
-struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI
-{
- boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Dustfield_Timer;
- uint32 Boulder_Timer;
- uint32 Thrash_Timer;
- uint32 RepulsiveGaze_Timer;
-
- void Reset()
- {
- Dustfield_Timer = 8000;
- Boulder_Timer = 2000;
- Thrash_Timer = 5000;
- RepulsiveGaze_Timer = 23000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Dustfield_Timer
- if (Dustfield_Timer < diff)
- {
- DoCast(m_creature,SPELL_DUSTFIELD);
- Dustfield_Timer = 14000;
- }else Dustfield_Timer -= diff;
-
- //Boulder_Timer
- if (Boulder_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if( target )
- DoCast(target,SPELL_BOULDER);
- Boulder_Timer = 10000;
- }else Boulder_Timer -= diff;
-
- //RepulsiveGaze_Timer
- if (RepulsiveGaze_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE);
- RepulsiveGaze_Timer = 20000;
- }else RepulsiveGaze_Timer -= diff;
-
- //Thrash_Timer
- if (Thrash_Timer < diff)
- {
- DoCast(m_creature,SPELL_THRASH);
- Thrash_Timer = 18000;
- }else Thrash_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ptheradras(Creature *_Creature)
-{
- return new boss_ptheradrasAI (_Creature);
-}
-
-void AddSC_boss_ptheradras()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_princess_theradras";
- newscript->GetAI = GetAI_boss_ptheradras;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Princess_Theradras
+SD%Complete: 100
+SDComment:
+SDCategory: Maraudon
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_DUSTFIELD 21909
+#define SPELL_BOULDER 21832
+#define SPELL_THRASH 3391
+#define SPELL_REPULSIVEGAZE 21869
+
+struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI
+{
+ boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Dustfield_Timer;
+ uint32 Boulder_Timer;
+ uint32 Thrash_Timer;
+ uint32 RepulsiveGaze_Timer;
+
+ void Reset()
+ {
+ Dustfield_Timer = 8000;
+ Boulder_Timer = 2000;
+ Thrash_Timer = 5000;
+ RepulsiveGaze_Timer = 23000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Dustfield_Timer
+ if (Dustfield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DUSTFIELD);
+ Dustfield_Timer = 14000;
+ }else Dustfield_Timer -= diff;
+
+ //Boulder_Timer
+ if (Boulder_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if( target )
+ DoCast(target,SPELL_BOULDER);
+ Boulder_Timer = 10000;
+ }else Boulder_Timer -= diff;
+
+ //RepulsiveGaze_Timer
+ if (RepulsiveGaze_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE);
+ RepulsiveGaze_Timer = 20000;
+ }else RepulsiveGaze_Timer -= diff;
+
+ //Thrash_Timer
+ if (Thrash_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_THRASH);
+ Thrash_Timer = 18000;
+ }else Thrash_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ptheradras(Creature *_Creature)
+{
+ return new boss_ptheradrasAI (_Creature);
+}
+
+void AddSC_boss_ptheradras()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_princess_theradras";
+ newscript->GetAI = GetAI_boss_ptheradras;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
index 6ae242b89b4..163926881f6 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
@@ -1,105 +1,105 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Baron_Geddon
-SD%Complete: 100
-SDComment:
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_INFERNO 19695
-#define SPELL_IGNITEMANA 19659
-#define SPELL_LIVINGBOMB 20475
-#define SPELL_ARMAGEDDOM 20479
-
-struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI
-{
- boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Inferno_Timer;
- uint32 IgniteMana_Timer;
- uint32 LivingBomb_Timer;
-
- void Reset()
- {
- Inferno_Timer = 45000; //These times are probably wrong
- IgniteMana_Timer = 30000;
- LivingBomb_Timer = 35000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <2% hp cast Armageddom
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature,SPELL_ARMAGEDDOM);
- DoTextEmote("performs one last service for Ragnaros.",NULL);
- return;
- }
-
- //Inferno_Timer
- if (Inferno_Timer < diff)
- {
- DoCast(m_creature,SPELL_INFERNO);
- Inferno_Timer = 45000;
- }else Inferno_Timer -= diff;
-
- //IgniteMana_Timer
- if (IgniteMana_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_IGNITEMANA);
-
- IgniteMana_Timer = 30000;
- }else IgniteMana_Timer -= diff;
-
- //LivingBomb_Timer
- if (LivingBomb_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_LIVINGBOMB);
-
- LivingBomb_Timer = 35000;
- }else LivingBomb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_baron_geddon(Creature *_Creature)
-{
- return new boss_baron_geddonAI (_Creature);
-}
-
-void AddSC_boss_baron_geddon()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_baron_geddon";
- newscript->GetAI = GetAI_boss_baron_geddon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Baron_Geddon
+SD%Complete: 100
+SDComment:
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_INFERNO 19695
+#define SPELL_IGNITEMANA 19659
+#define SPELL_LIVINGBOMB 20475
+#define SPELL_ARMAGEDDOM 20479
+
+struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI
+{
+ boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Inferno_Timer;
+ uint32 IgniteMana_Timer;
+ uint32 LivingBomb_Timer;
+
+ void Reset()
+ {
+ Inferno_Timer = 45000; //These times are probably wrong
+ IgniteMana_Timer = 30000;
+ LivingBomb_Timer = 35000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <2% hp cast Armageddom
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature,SPELL_ARMAGEDDOM);
+ DoTextEmote("performs one last service for Ragnaros.",NULL);
+ return;
+ }
+
+ //Inferno_Timer
+ if (Inferno_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_INFERNO);
+ Inferno_Timer = 45000;
+ }else Inferno_Timer -= diff;
+
+ //IgniteMana_Timer
+ if (IgniteMana_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_IGNITEMANA);
+
+ IgniteMana_Timer = 30000;
+ }else IgniteMana_Timer -= diff;
+
+ //LivingBomb_Timer
+ if (LivingBomb_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_LIVINGBOMB);
+
+ LivingBomb_Timer = 35000;
+ }else LivingBomb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_baron_geddon(Creature *_Creature)
+{
+ return new boss_baron_geddonAI (_Creature);
+}
+
+void AddSC_boss_baron_geddon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_baron_geddon";
+ newscript->GetAI = GetAI_boss_baron_geddon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
index 3cac5335fe2..70e98d648ee 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
@@ -1,149 +1,149 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Garr
-SD%Complete: 50
-SDComment: Adds NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-// Garr spells
-#define SPELL_ANTIMAGICPULSE 19492
-#define SPELL_MAGMASHACKLES 19496
-#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times)
-
-//Add spells
-#define SPELL_ERUPTION 19497
-#define SPELL_IMMOLATE 20294
-
-struct TRINITY_DLL_DECL boss_garrAI : public ScriptedAI
-{
- boss_garrAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 AntiMagicPulse_Timer;
- uint32 MagmaShackles_Timer;
- uint32 CheckAdds_Timer;
- uint64 Add[8];
- bool Enraged[8];
-
- void Reset()
- {
- AntiMagicPulse_Timer = 25000; //These times are probably wrong
- MagmaShackles_Timer = 15000;
- CheckAdds_Timer = 2000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //AntiMagicPulse_Timer
- if (AntiMagicPulse_Timer < diff)
- {
- DoCast(m_creature,SPELL_ANTIMAGICPULSE);
- AntiMagicPulse_Timer = 10000 + rand()%5000;
- }else AntiMagicPulse_Timer -= diff;
-
- //MagmaShackles_Timer
- if (MagmaShackles_Timer < diff)
- {
- DoCast(m_creature,SPELL_MAGMASHACKLES);
- MagmaShackles_Timer = 8000 + rand()%4000;
- }else MagmaShackles_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_fireswornAI : public ScriptedAI
-{
- mob_fireswornAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Immolate_Timer;
-
- void Reset()
- {
- Immolate_Timer = 4000; //These times are probably wrong
-
- //m_creature->RemoveAllAuras();
- //m_creature->DeleteThreatList();
- //m_creature->CombatStop();
- //DoGoHome();
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_IMMOLATE);
-
- Immolate_Timer = 5000 + rand()%5000;
- }else Immolate_Timer -= diff;
-
- //Cast Erruption and let them die
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10)
- {
- DoCast(m_creature->getVictim(),SPELL_ERUPTION);
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_garr(Creature *_Creature)
-{
- return new boss_garrAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_firesworn(Creature *_Creature)
-{
- return new mob_fireswornAI (_Creature);
-}
-
-void AddSC_boss_garr()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_garr";
- newscript->GetAI = GetAI_boss_garr;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_firesworn";
- newscript->GetAI = GetAI_mob_firesworn;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Garr
+SD%Complete: 50
+SDComment: Adds NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+// Garr spells
+#define SPELL_ANTIMAGICPULSE 19492
+#define SPELL_MAGMASHACKLES 19496
+#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times)
+
+//Add spells
+#define SPELL_ERUPTION 19497
+#define SPELL_IMMOLATE 20294
+
+struct TRINITY_DLL_DECL boss_garrAI : public ScriptedAI
+{
+ boss_garrAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 AntiMagicPulse_Timer;
+ uint32 MagmaShackles_Timer;
+ uint32 CheckAdds_Timer;
+ uint64 Add[8];
+ bool Enraged[8];
+
+ void Reset()
+ {
+ AntiMagicPulse_Timer = 25000; //These times are probably wrong
+ MagmaShackles_Timer = 15000;
+ CheckAdds_Timer = 2000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //AntiMagicPulse_Timer
+ if (AntiMagicPulse_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ANTIMAGICPULSE);
+ AntiMagicPulse_Timer = 10000 + rand()%5000;
+ }else AntiMagicPulse_Timer -= diff;
+
+ //MagmaShackles_Timer
+ if (MagmaShackles_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_MAGMASHACKLES);
+ MagmaShackles_Timer = 8000 + rand()%4000;
+ }else MagmaShackles_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_fireswornAI : public ScriptedAI
+{
+ mob_fireswornAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Immolate_Timer;
+
+ void Reset()
+ {
+ Immolate_Timer = 4000; //These times are probably wrong
+
+ //m_creature->RemoveAllAuras();
+ //m_creature->DeleteThreatList();
+ //m_creature->CombatStop();
+ //DoGoHome();
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_IMMOLATE);
+
+ Immolate_Timer = 5000 + rand()%5000;
+ }else Immolate_Timer -= diff;
+
+ //Cast Erruption and let them die
+ if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ERUPTION);
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->RemoveCorpse();
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_garr(Creature *_Creature)
+{
+ return new boss_garrAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_firesworn(Creature *_Creature)
+{
+ return new mob_fireswornAI (_Creature);
+}
+
+void AddSC_boss_garr()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_garr";
+ newscript->GetAI = GetAI_boss_garr;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_firesworn";
+ newscript->GetAI = GetAI_mob_firesworn;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
index 7aa700399d4..f15c66f26af 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gehennas
-SD%Complete: 90
-SDComment: Adds MC NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLT 19728
-#define SPELL_RAINOFFIRE 19717
-#define SPELL_GEHENNASCURSE 19716
-
-struct TRINITY_DLL_DECL boss_gehennasAI : public ScriptedAI
-{
- boss_gehennasAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 RainOfFire_Timer;
- uint32 GehennasCurse_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 6000;
- RainOfFire_Timer = 10000;
- GehennasCurse_Timer = 12000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- if( Unit* bTarget = SelectUnit(SELECT_TARGET_RANDOM,1) )
- DoCast(bTarget,SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 7000;
- }else ShadowBolt_Timer -= diff;
-
- //RainOfFire_Timer
- if (RainOfFire_Timer < diff)
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_RAINOFFIRE);
-
- RainOfFire_Timer = 4000 + rand()%8000;
- }else RainOfFire_Timer -= diff;
-
- //GehennasCurse_Timer
- if (GehennasCurse_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GEHENNASCURSE);
- GehennasCurse_Timer = 22000 + rand()%8000;
- }else GehennasCurse_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gehennas(Creature *_Creature)
-{
- return new boss_gehennasAI (_Creature);
-}
-
-void AddSC_boss_gehennas()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gehennas";
- newscript->GetAI = GetAI_boss_gehennas;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gehennas
+SD%Complete: 90
+SDComment: Adds MC NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLT 19728
+#define SPELL_RAINOFFIRE 19717
+#define SPELL_GEHENNASCURSE 19716
+
+struct TRINITY_DLL_DECL boss_gehennasAI : public ScriptedAI
+{
+ boss_gehennasAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 RainOfFire_Timer;
+ uint32 GehennasCurse_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 6000;
+ RainOfFire_Timer = 10000;
+ GehennasCurse_Timer = 12000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ if( Unit* bTarget = SelectUnit(SELECT_TARGET_RANDOM,1) )
+ DoCast(bTarget,SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 7000;
+ }else ShadowBolt_Timer -= diff;
+
+ //RainOfFire_Timer
+ if (RainOfFire_Timer < diff)
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_RAINOFFIRE);
+
+ RainOfFire_Timer = 4000 + rand()%8000;
+ }else RainOfFire_Timer -= diff;
+
+ //GehennasCurse_Timer
+ if (GehennasCurse_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GEHENNASCURSE);
+ GehennasCurse_Timer = 22000 + rand()%8000;
+ }else GehennasCurse_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gehennas(Creature *_Creature)
+{
+ return new boss_gehennasAI (_Creature);
+}
+
+void AddSC_boss_gehennas()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gehennas";
+ newscript->GetAI = GetAI_boss_gehennas;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
index 9c0633776ca..6d17621ceb2 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
@@ -1,201 +1,201 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Golemagg
-SD%Complete: 90
-SDComment:
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_molten_core.h"
-
-#define SPELL_MAGMASPLASH 13879
-#define SPELL_PYROBLAST 20228
-#define SPELL_EARTHQUAKE 19798
-#define SPELL_ENRAGE 19953
-#define SPELL_BUFF 20553
-
-//-- CoreRager Spells --
-#define SPELL_MANGLE 19820
-#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50%
-
-#define EMOTE_AEGIS "refuses to die while its master is in trouble"
-
-struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
-{
- boss_golemaggAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Pyroblast_Timer;
- uint32 EarthQuake_Timer;
- uint32 Enrage_Timer;
- uint32 Buff_Timer;
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Pyroblast_Timer = 7000; //These times are probably wrong
- EarthQuake_Timer = 3000;
- Buff_Timer = 2500;
- Enrage_Timer = 0;
-
- m_creature->CastSpell(m_creature,SPELL_MAGMASPLASH,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
- }
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Pyroblast_Timer
- if (Pyroblast_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_PYROBLAST);
-
- Pyroblast_Timer = 7000;
- }else Pyroblast_Timer -= diff;
-
- //Enrage_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 )
- {
- if (Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 62000;
- }else Enrage_Timer -= diff;
- }
-
- //EarthQuake_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 )
- {
- if (EarthQuake_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_EARTHQUAKE);
- EarthQuake_Timer = 3000;
- }else EarthQuake_Timer -= diff;
- }
-
- //Casting Buff for Coreragers. Spell is not working right. Players get the buff...
- // if(Buff_Timer < diff)
- // {
- // DoCast(m_creature, SPELL_BUFF);
- // Buff_Timer = 2500;
- // }else Buff_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI
-{
- mob_core_ragerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Mangle_Timer;
- uint32 Check_Timer;
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Mangle_Timer = 7000; //These times are probably wrong
- Check_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Mangle_Timer
- if (Mangle_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MANGLE);
- Mangle_Timer = 10000;
- }else Mangle_Timer -= diff;
-
- //Cast AEGIS
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
- {
- DoCast(m_creature,SPELL_AEGIS);
- DoTextEmote(EMOTE_AEGIS, NULL);
- }
-
- //Check_Timer
- if(Check_Timer < diff)
- {
- if(pInstance)
- {
- Unit *pGolemagg = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GOLEMAGG));
- if(!pGolemagg || !pGolemagg->isAlive())
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true);
- }
- }
-
- Check_Timer = 1000;
- }else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_golemagg(Creature *_Creature)
-{
- return new boss_golemaggAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_core_rager(Creature *_Creature)
-{
- return new mob_core_ragerAI (_Creature);
-}
-
-void AddSC_boss_golemagg()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_golemagg";
- newscript->GetAI = GetAI_boss_golemagg;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_core_rager";
- newscript->GetAI = GetAI_mob_core_rager;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Golemagg
+SD%Complete: 90
+SDComment:
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_molten_core.h"
+
+#define SPELL_MAGMASPLASH 13879
+#define SPELL_PYROBLAST 20228
+#define SPELL_EARTHQUAKE 19798
+#define SPELL_ENRAGE 19953
+#define SPELL_BUFF 20553
+
+//-- CoreRager Spells --
+#define SPELL_MANGLE 19820
+#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50%
+
+#define EMOTE_AEGIS "refuses to die while its master is in trouble"
+
+struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
+{
+ boss_golemaggAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Pyroblast_Timer;
+ uint32 EarthQuake_Timer;
+ uint32 Enrage_Timer;
+ uint32 Buff_Timer;
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Pyroblast_Timer = 7000; //These times are probably wrong
+ EarthQuake_Timer = 3000;
+ Buff_Timer = 2500;
+ Enrage_Timer = 0;
+
+ m_creature->CastSpell(m_creature,SPELL_MAGMASPLASH,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Pyroblast_Timer
+ if (Pyroblast_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_PYROBLAST);
+
+ Pyroblast_Timer = 7000;
+ }else Pyroblast_Timer -= diff;
+
+ //Enrage_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 )
+ {
+ if (Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 62000;
+ }else Enrage_Timer -= diff;
+ }
+
+ //EarthQuake_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 )
+ {
+ if (EarthQuake_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_EARTHQUAKE);
+ EarthQuake_Timer = 3000;
+ }else EarthQuake_Timer -= diff;
+ }
+
+ //Casting Buff for Coreragers. Spell is not working right. Players get the buff...
+ // if(Buff_Timer < diff)
+ // {
+ // DoCast(m_creature, SPELL_BUFF);
+ // Buff_Timer = 2500;
+ // }else Buff_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI
+{
+ mob_core_ragerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Mangle_Timer;
+ uint32 Check_Timer;
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Mangle_Timer = 7000; //These times are probably wrong
+ Check_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Mangle_Timer
+ if (Mangle_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MANGLE);
+ Mangle_Timer = 10000;
+ }else Mangle_Timer -= diff;
+
+ //Cast AEGIS
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
+ {
+ DoCast(m_creature,SPELL_AEGIS);
+ DoTextEmote(EMOTE_AEGIS, NULL);
+ }
+
+ //Check_Timer
+ if(Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *pGolemagg = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GOLEMAGG));
+ if(!pGolemagg || !pGolemagg->isAlive())
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true);
+ }
+ }
+
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_golemagg(Creature *_Creature)
+{
+ return new boss_golemaggAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_core_rager(Creature *_Creature)
+{
+ return new mob_core_ragerAI (_Creature);
+}
+
+void AddSC_boss_golemagg()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_golemagg";
+ newscript->GetAI = GetAI_boss_golemagg;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_core_rager";
+ newscript->GetAI = GetAI_mob_core_rager;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
index 5589c3150a2..6e8938bc542 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
@@ -1,90 +1,90 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Lucifron
-SD%Complete: 100
-SDComment:
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_IMPENDINGDOOM 19702
-#define SPELL_LUCIFRONCURSE 19703
-#define SPELL_SHADOWSHOCK 20603
-
-struct TRINITY_DLL_DECL boss_lucifronAI : public ScriptedAI
-{
- boss_lucifronAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ImpendingDoom_Timer;
- uint32 LucifronCurse_Timer;
- uint32 ShadowShock_Timer;
-
- void Reset()
- {
- ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate
- LucifronCurse_Timer = 20000; //Initial cast after 20 seconds
- ShadowShock_Timer = 6000; //6 seconds
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Impending doom timer
- if (ImpendingDoom_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_IMPENDINGDOOM);
- ImpendingDoom_Timer = 20000;
- }else ImpendingDoom_Timer -= diff;
-
- //Lucifron's curse timer
- if (LucifronCurse_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_LUCIFRONCURSE);
- LucifronCurse_Timer = 15000;
- }else LucifronCurse_Timer -= diff;
-
- //Shadowshock
- if (ShadowShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWSHOCK);
- ShadowShock_Timer = 6000;
- }else ShadowShock_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_lucifron(Creature *_Creature)
-{
- return new boss_lucifronAI (_Creature);
-}
-
-void AddSC_boss_lucifron()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_lucifron";
- newscript->GetAI = GetAI_boss_lucifron;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Lucifron
+SD%Complete: 100
+SDComment:
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_IMPENDINGDOOM 19702
+#define SPELL_LUCIFRONCURSE 19703
+#define SPELL_SHADOWSHOCK 20603
+
+struct TRINITY_DLL_DECL boss_lucifronAI : public ScriptedAI
+{
+ boss_lucifronAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ImpendingDoom_Timer;
+ uint32 LucifronCurse_Timer;
+ uint32 ShadowShock_Timer;
+
+ void Reset()
+ {
+ ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate
+ LucifronCurse_Timer = 20000; //Initial cast after 20 seconds
+ ShadowShock_Timer = 6000; //6 seconds
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Impending doom timer
+ if (ImpendingDoom_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_IMPENDINGDOOM);
+ ImpendingDoom_Timer = 20000;
+ }else ImpendingDoom_Timer -= diff;
+
+ //Lucifron's curse timer
+ if (LucifronCurse_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_LUCIFRONCURSE);
+ LucifronCurse_Timer = 15000;
+ }else LucifronCurse_Timer -= diff;
+
+ //Shadowshock
+ if (ShadowShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWSHOCK);
+ ShadowShock_Timer = 6000;
+ }else ShadowShock_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_lucifron(Creature *_Creature)
+{
+ return new boss_lucifronAI (_Creature);
+}
+
+void AddSC_boss_lucifron()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_lucifron";
+ newscript->GetAI = GetAI_boss_lucifron;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
index 681ff0c1848..a892c83f175 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
@@ -1,97 +1,97 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Magmadar
-SD%Complete: 75
-SDComment: Conflag on ground nyi, fear causes issues without VMAPs
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FRENZY 19451
-#define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself
-#define SPELL_PANIC 19408
-#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet
-#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts
-
-struct TRINITY_DLL_DECL boss_magmadarAI : public ScriptedAI
-{
- boss_magmadarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Frenzy_Timer;
- uint32 Panic_Timer;
- uint32 Lavabomb_Timer;
-
- void Reset()
- {
- Frenzy_Timer = 30000;
- Panic_Timer = 20000;
- Lavabomb_Timer = 12000;
-
- m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoTextEmote("goes into a killing frenzy!",NULL);
- DoCast(m_creature,SPELL_FRENZY);
- Frenzy_Timer = 15000;
- }else Frenzy_Timer -= diff;
-
- //Panic_Timer
- if (Panic_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_PANIC);
- Panic_Timer = 35000;
- }else Panic_Timer -= diff;
-
- //Lavabomb_Timer
- if (Lavabomb_Timer < diff)
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_LAVABOMB_ALT);
-
- Lavabomb_Timer = 12000;
- }else Lavabomb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_magmadar(Creature *_Creature)
-{
- return new boss_magmadarAI (_Creature);
-}
-
-void AddSC_boss_magmadar()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_magmadar";
- newscript->GetAI = GetAI_boss_magmadar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Magmadar
+SD%Complete: 75
+SDComment: Conflag on ground nyi, fear causes issues without VMAPs
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FRENZY 19451
+#define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself
+#define SPELL_PANIC 19408
+#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet
+#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts
+
+struct TRINITY_DLL_DECL boss_magmadarAI : public ScriptedAI
+{
+ boss_magmadarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Frenzy_Timer;
+ uint32 Panic_Timer;
+ uint32 Lavabomb_Timer;
+
+ void Reset()
+ {
+ Frenzy_Timer = 30000;
+ Panic_Timer = 20000;
+ Lavabomb_Timer = 12000;
+
+ m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoTextEmote("goes into a killing frenzy!",NULL);
+ DoCast(m_creature,SPELL_FRENZY);
+ Frenzy_Timer = 15000;
+ }else Frenzy_Timer -= diff;
+
+ //Panic_Timer
+ if (Panic_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_PANIC);
+ Panic_Timer = 35000;
+ }else Panic_Timer -= diff;
+
+ //Lavabomb_Timer
+ if (Lavabomb_Timer < diff)
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_LAVABOMB_ALT);
+
+ Lavabomb_Timer = 12000;
+ }else Lavabomb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_magmadar(Creature *_Creature)
+{
+ return new boss_magmadarAI (_Creature);
+}
+
+void AddSC_boss_magmadar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_magmadar";
+ newscript->GetAI = GetAI_boss_magmadar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
index a8e2377aff6..d61f08ee7e7 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
@@ -1,133 +1,133 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_MajorDomo_Executus
-SD%Complete: 30
-SDComment: Correct spawning and Event NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MAGICREFLECTION 20619
-#define SPELL_DAMAGEREFLECTION 21075
-#define SPELL_BLASTWAVE 20229
-#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50%
-
-#define SAY_AGGRO "Reckless mortals, none may challenge the sons of the living flame!"
-#define SOUND_AGGRO 8035
-
-#define SAY_SPAWN "The runes of warding have been destroyed! Hunt down the infedels my bretheren."
-#define SOUND_SPAWN 8039
-
-#define SAY_DEFEAT "Impossible! Stay your attack mortals! I submitt! I submitt! Brashly you have come to rest the secrets of the living flame. You will soon regret the recklessness of your quest. I go now to summon the lord whos house this is. Should you seek an audiance with him your paltry lives will surly be forfit. Nevertheless seek out his lair if you dare!"
-#define SOUND_DEFEAT 8038
-
-#define SAY_KILL "Ashes to Ashes!"
-#define SOUND_KILL 8037
-
-#define SAY_SPECIAL "Burn mortals! Burn for this transgression!"
-#define SOUND_SPECIAL 8036
-
-#define SAY_SUMMON "Behold Ragnaros, the Firelord! He who was ancient when this world was young! Bow before him, mortals! Bow before your ending!"
-#define SOUND_SUMMON 8040
-
-#define SAY_ARRIVAL1 "These mortal infidels, my lord! They have invaded your sanctum, and seek to steal your secrets!"
-#define SOUND_ARRIVAL1 8041
-
-struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI
-{
- boss_majordomoAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MagicReflection_Timer;
- uint32 DamageReflection_Timer;
- uint32 Blastwave_Timer;
-
- void Reset()
- {
- MagicReflection_Timer = 30000; //Damage reflection first so we alternate
- DamageReflection_Timer = 15000;
- Blastwave_Timer = 10000;
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_KILL,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Cast Ageis if less than 50% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
- {
- DoCast(m_creature,SPELL_AEGIS);
- }
-
- //MagicReflection_Timer
- // if (MagicReflection_Timer < diff)
- // {
- // DoCast(m_creature, SPELL_MAGICREFLECTION);
-
- //60 seconds until we should cast this agian
- // MagicReflection_Timer = 30000;
- // }else MagicReflection_Timer -= diff;
-
- //DamageReflection_Timer
- // if (DamageReflection_Timer < diff)
- // {
- // DoCast(m_creature, SPELL_DAMAGEREFLECTION);
-
- //60 seconds until we should cast this agian
- // DamageReflection_Timer = 30000;
- // }else DamageReflection_Timer -= diff;
-
- //Blastwave_Timer
- if (Blastwave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- Blastwave_Timer = 10000;
- }else Blastwave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_majordomo(Creature *_Creature)
-{
- return new boss_majordomoAI (_Creature);
-}
-
-void AddSC_boss_majordomo()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_majordomo";
- newscript->GetAI = GetAI_boss_majordomo;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_MajorDomo_Executus
+SD%Complete: 30
+SDComment: Correct spawning and Event NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MAGICREFLECTION 20619
+#define SPELL_DAMAGEREFLECTION 21075
+#define SPELL_BLASTWAVE 20229
+#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50%
+
+#define SAY_AGGRO "Reckless mortals, none may challenge the sons of the living flame!"
+#define SOUND_AGGRO 8035
+
+#define SAY_SPAWN "The runes of warding have been destroyed! Hunt down the infedels my bretheren."
+#define SOUND_SPAWN 8039
+
+#define SAY_DEFEAT "Impossible! Stay your attack mortals! I submitt! I submitt! Brashly you have come to rest the secrets of the living flame. You will soon regret the recklessness of your quest. I go now to summon the lord whos house this is. Should you seek an audiance with him your paltry lives will surly be forfit. Nevertheless seek out his lair if you dare!"
+#define SOUND_DEFEAT 8038
+
+#define SAY_KILL "Ashes to Ashes!"
+#define SOUND_KILL 8037
+
+#define SAY_SPECIAL "Burn mortals! Burn for this transgression!"
+#define SOUND_SPECIAL 8036
+
+#define SAY_SUMMON "Behold Ragnaros, the Firelord! He who was ancient when this world was young! Bow before him, mortals! Bow before your ending!"
+#define SOUND_SUMMON 8040
+
+#define SAY_ARRIVAL1 "These mortal infidels, my lord! They have invaded your sanctum, and seek to steal your secrets!"
+#define SOUND_ARRIVAL1 8041
+
+struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI
+{
+ boss_majordomoAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MagicReflection_Timer;
+ uint32 DamageReflection_Timer;
+ uint32 Blastwave_Timer;
+
+ void Reset()
+ {
+ MagicReflection_Timer = 30000; //Damage reflection first so we alternate
+ DamageReflection_Timer = 15000;
+ Blastwave_Timer = 10000;
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_KILL,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Cast Ageis if less than 50% hp
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ {
+ DoCast(m_creature,SPELL_AEGIS);
+ }
+
+ //MagicReflection_Timer
+ // if (MagicReflection_Timer < diff)
+ // {
+ // DoCast(m_creature, SPELL_MAGICREFLECTION);
+
+ //60 seconds until we should cast this agian
+ // MagicReflection_Timer = 30000;
+ // }else MagicReflection_Timer -= diff;
+
+ //DamageReflection_Timer
+ // if (DamageReflection_Timer < diff)
+ // {
+ // DoCast(m_creature, SPELL_DAMAGEREFLECTION);
+
+ //60 seconds until we should cast this agian
+ // DamageReflection_Timer = 30000;
+ // }else DamageReflection_Timer -= diff;
+
+ //Blastwave_Timer
+ if (Blastwave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ Blastwave_Timer = 10000;
+ }else Blastwave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_majordomo(Creature *_Creature)
+{
+ return new boss_majordomoAI (_Creature);
+}
+
+void AddSC_boss_majordomo()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_majordomo";
+ newscript->GetAI = GetAI_boss_majordomo;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
index b2c0959605d..990f38e0b37 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
@@ -1,317 +1,317 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ragnaros
-SD%Complete: 75
-SDComment: Intro Dialog and event NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HANDOFRAGNAROS 19780
-#define SPELL_WRATHOFRAGNAROS 20566
-#define SPELL_LAVABURST 21158
-
-#define SPELL_MAGMABURST 20565 //Ranged attack
-
-#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect
-#define SPELL_RAGSUBMERGE 21107 //Stealth aura
-#define SPELL_RAGEMERGE 20568
-#define SPELL_MELTWEAPON 21388
-#define SPELL_ELEMENTALFIRE 20564
-#define SPELL_ERRUPTION 17731
-
-#define SAY_ARRIVAL_1 "TOO SOON! YOU HAVE AWAKENED ME TOO SOON, EXECUTUS! WHAT IS THE MEANING OF THIS INTRUSION?"
-#define SAY_ARRIVAL_3 "FOOL! YOU ALLOWED THESE INSECTS TO RUN RAMPANT THROUGH THE HALLOWED CORE, AND NOW YOU LEAD THEM TO MY VERY LAIR? YOU HAVE FAILED ME, EXECUTUS! JUSTICE SHALL BE MET, INDEED!"
-#define SAY_ARRIVAL_5 "NOW FOR YOU, INSECTS. BOLDLY YOU SAUGHT THE POWER OF RAGNAROS NOW YOU SHALL SEE IT FIRST HAND."
-#define SAY_REINFORCEMENTS1 "COME FORTH, MY SERVANTS! DEFEND YOUR MASTER!"
-#define SAY_REINFORCEMENTS2 "YOU CANNOT DEFEAT THE LIVING FLAME! COME YOU MINIONS OF FIRE! COME FORTH YOU CREATURES OF HATE! YOUR MASTER CALLS!"
-#define SAY_HAND "BY FIRE BE PURGED!"
-#define SAY_WRATH "TASTE THE FLAMES OF SULFURON!"
-#define SAY_KILL "DIE INSECT!"
-#define SAY_MAGMABURST "MY PATIENCE IS DWINDILING! COME NATS TO YOUR DEATH!"
-
-#define SOUND_ARRIVAL_1 8043
-#define SOUND_ARRIVAL_3 8044
-#define SOUND_ARRIVAL_5 8045
-#define SOUND_REINFORCEMENTS1 8049
-#define SOUND_REINFORCEMENTS2 8050
-#define SOUND_HAND 8046
-#define SOUND_WRATH 8047
-#define SOUND_KILL 8051
-#define SOUND_MAGMABURST 8048
-
-#define ADD_1X 848.740356
-#define ADD_1Y -816.103455
-#define ADD_1Z -229.74327
-#define ADD_1O 2.615287
-
-#define ADD_2X 852.560791
-#define ADD_2Y -849.861511
-#define ADD_2Z -228.560974
-#define ADD_2O 2.836073
-
-#define ADD_3X 808.710632
-#define ADD_3Y -852.845764
-#define ADD_3Z -227.914963
-#define ADD_3O 0.964207
-
-#define ADD_4X 786.597107
-#define ADD_4Y -821.132874
-#define ADD_4Z -226.350128
-#define ADD_4O 0.949377
-
-#define ADD_5X 796.219116
-#define ADD_5Y -800.948059
-#define ADD_5Z -226.010361
-#define ADD_5O 0.560603
-
-#define ADD_6X 821.602539
-#define ADD_6Y -782.744109
-#define ADD_6Z -226.023575
-#define ADD_6O 6.157440
-
-#define ADD_7X 844.924744
-#define ADD_7Y -769.453735
-#define ADD_7Z -225.521698
-#define ADD_7O 4.4539958
-
-#define ADD_8X 839.823364
-#define ADD_8Y -810.869385
-#define ADD_8Z -229.683182
-#define ADD_8O 4.693108
-
-struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
-{
- boss_ragnarosAI(Creature *c) : Scripted_NoMovementAI(c) {Reset();}
-
- uint32 WrathOfRagnaros_Timer;
- uint32 HandOfRagnaros_Timer;
- uint32 LavaBurst_Timer;
- uint32 MagmaBurst_Timer;
- uint32 ElementalFire_Timer;
- uint32 Erruption_Timer;
- uint32 Submerge_Timer;
- uint32 Attack_Timer;
- Creature *Summoned;
- bool HasYelledMagmaBurst;
- bool HasSubmergedOnce;
- bool WasBanished;
- bool HasAura;
-
- void Reset()
- {
- WrathOfRagnaros_Timer = 30000;
- HandOfRagnaros_Timer = 25000;
- LavaBurst_Timer = 10000;
- MagmaBurst_Timer = 2000;
- Erruption_Timer = 15000;
- ElementalFire_Timer = 3000;
- Submerge_Timer = 180000;
- Attack_Timer = 90000;
- HasYelledMagmaBurst = false;
- HasSubmergedOnce = false;
- WasBanished = false;
-
- m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true);
- HasAura = true;
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_ARRIVAL_5,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL_5);
- }
-
- void UpdateAI(const uint32 diff)
- {
- 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);
- WasBanished = false;
- } else if (WasBanished)
- {
- Attack_Timer -= diff;
- //Do nothing while banished
- return;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //WrathOfRagnaros_Timer
- if (WrathOfRagnaros_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS);
-
- if (rand()%2 == 0)
- {
- DoYell(SAY_WRATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_WRATH);
- }
-
- WrathOfRagnaros_Timer = 30000;
- }else WrathOfRagnaros_Timer -= diff;
-
- //HandOfRagnaros_Timer
- if (HandOfRagnaros_Timer < diff)
- {
- DoCast(m_creature,SPELL_HANDOFRAGNAROS);
-
- if (rand()%2==0)
- {
- DoYell(SAY_HAND,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HAND);
- }
-
- HandOfRagnaros_Timer = 25000;
- }else HandOfRagnaros_Timer -= diff;
-
- //LavaBurst_Timer
- if (LavaBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_LAVABURST);
- LavaBurst_Timer = 10000;
- }else LavaBurst_Timer -= diff;
-
- //Erruption_Timer
- if (LavaBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ERRUPTION);
- Erruption_Timer = 20000 + rand()%25000;
- }else Erruption_Timer -= diff;
-
- //ElementalFire_Timer
- if (ElementalFire_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ELEMENTALFIRE);
- ElementalFire_Timer = 10000 + rand()%4000;
- }else ElementalFire_Timer -= diff;
-
- //Submerge_Timer
- if (!WasBanished && Submerge_Timer < diff)
- {
- //Creature spawning and ragnaros becomming unattackable
- //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);
- //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);
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if (!HasSubmergedOnce)
- {
- DoYell(SAY_REINFORCEMENTS1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS1);
-
- // summon 10 elementals
- Unit* target = NULL;
- for(int i = 0; i < 9;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- }
-
- HasSubmergedOnce = true;
- WasBanished = true;
- DoCast(m_creature,SPELL_RAGSUBMERGE);
- Attack_Timer = 90000;
-
- }else
- {
- DoYell(SAY_REINFORCEMENTS2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS2);
-
- Unit* target = NULL;
- for(int i = 0; i < 9;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- }
-
- WasBanished = true;
- DoCast(m_creature,SPELL_RAGSUBMERGE);
- Attack_Timer = 90000;
- }
-
- Submerge_Timer = 180000;
- }else Submerge_Timer -= diff;
-
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- //Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }else
- {
- //MagmaBurst_Timer
- if (MagmaBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MAGMABURST);
-
- if (!HasYelledMagmaBurst)
- {
- //Say our dialog
- DoYell(SAY_MAGMABURST,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_MAGMABURST);
- HasYelledMagmaBurst = true;
- }
-
- MagmaBurst_Timer = 2500;
- }else MagmaBurst_Timer -= diff;
- }
- }
-};
-CreatureAI* GetAI_boss_ragnaros(Creature *_Creature)
-{
- return new boss_ragnarosAI (_Creature);
-}
-
-void AddSC_boss_ragnaros()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ragnaros";
- newscript->GetAI = GetAI_boss_ragnaros;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ragnaros
+SD%Complete: 75
+SDComment: Intro Dialog and event NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HANDOFRAGNAROS 19780
+#define SPELL_WRATHOFRAGNAROS 20566
+#define SPELL_LAVABURST 21158
+
+#define SPELL_MAGMABURST 20565 //Ranged attack
+
+#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect
+#define SPELL_RAGSUBMERGE 21107 //Stealth aura
+#define SPELL_RAGEMERGE 20568
+#define SPELL_MELTWEAPON 21388
+#define SPELL_ELEMENTALFIRE 20564
+#define SPELL_ERRUPTION 17731
+
+#define SAY_ARRIVAL_1 "TOO SOON! YOU HAVE AWAKENED ME TOO SOON, EXECUTUS! WHAT IS THE MEANING OF THIS INTRUSION?"
+#define SAY_ARRIVAL_3 "FOOL! YOU ALLOWED THESE INSECTS TO RUN RAMPANT THROUGH THE HALLOWED CORE, AND NOW YOU LEAD THEM TO MY VERY LAIR? YOU HAVE FAILED ME, EXECUTUS! JUSTICE SHALL BE MET, INDEED!"
+#define SAY_ARRIVAL_5 "NOW FOR YOU, INSECTS. BOLDLY YOU SAUGHT THE POWER OF RAGNAROS NOW YOU SHALL SEE IT FIRST HAND."
+#define SAY_REINFORCEMENTS1 "COME FORTH, MY SERVANTS! DEFEND YOUR MASTER!"
+#define SAY_REINFORCEMENTS2 "YOU CANNOT DEFEAT THE LIVING FLAME! COME YOU MINIONS OF FIRE! COME FORTH YOU CREATURES OF HATE! YOUR MASTER CALLS!"
+#define SAY_HAND "BY FIRE BE PURGED!"
+#define SAY_WRATH "TASTE THE FLAMES OF SULFURON!"
+#define SAY_KILL "DIE INSECT!"
+#define SAY_MAGMABURST "MY PATIENCE IS DWINDILING! COME NATS TO YOUR DEATH!"
+
+#define SOUND_ARRIVAL_1 8043
+#define SOUND_ARRIVAL_3 8044
+#define SOUND_ARRIVAL_5 8045
+#define SOUND_REINFORCEMENTS1 8049
+#define SOUND_REINFORCEMENTS2 8050
+#define SOUND_HAND 8046
+#define SOUND_WRATH 8047
+#define SOUND_KILL 8051
+#define SOUND_MAGMABURST 8048
+
+#define ADD_1X 848.740356
+#define ADD_1Y -816.103455
+#define ADD_1Z -229.74327
+#define ADD_1O 2.615287
+
+#define ADD_2X 852.560791
+#define ADD_2Y -849.861511
+#define ADD_2Z -228.560974
+#define ADD_2O 2.836073
+
+#define ADD_3X 808.710632
+#define ADD_3Y -852.845764
+#define ADD_3Z -227.914963
+#define ADD_3O 0.964207
+
+#define ADD_4X 786.597107
+#define ADD_4Y -821.132874
+#define ADD_4Z -226.350128
+#define ADD_4O 0.949377
+
+#define ADD_5X 796.219116
+#define ADD_5Y -800.948059
+#define ADD_5Z -226.010361
+#define ADD_5O 0.560603
+
+#define ADD_6X 821.602539
+#define ADD_6Y -782.744109
+#define ADD_6Z -226.023575
+#define ADD_6O 6.157440
+
+#define ADD_7X 844.924744
+#define ADD_7Y -769.453735
+#define ADD_7Z -225.521698
+#define ADD_7O 4.4539958
+
+#define ADD_8X 839.823364
+#define ADD_8Y -810.869385
+#define ADD_8Z -229.683182
+#define ADD_8O 4.693108
+
+struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
+{
+ boss_ragnarosAI(Creature *c) : Scripted_NoMovementAI(c) {Reset();}
+
+ uint32 WrathOfRagnaros_Timer;
+ uint32 HandOfRagnaros_Timer;
+ uint32 LavaBurst_Timer;
+ uint32 MagmaBurst_Timer;
+ uint32 ElementalFire_Timer;
+ uint32 Erruption_Timer;
+ uint32 Submerge_Timer;
+ uint32 Attack_Timer;
+ Creature *Summoned;
+ bool HasYelledMagmaBurst;
+ bool HasSubmergedOnce;
+ bool WasBanished;
+ bool HasAura;
+
+ void Reset()
+ {
+ WrathOfRagnaros_Timer = 30000;
+ HandOfRagnaros_Timer = 25000;
+ LavaBurst_Timer = 10000;
+ MagmaBurst_Timer = 2000;
+ Erruption_Timer = 15000;
+ ElementalFire_Timer = 3000;
+ Submerge_Timer = 180000;
+ Attack_Timer = 90000;
+ HasYelledMagmaBurst = false;
+ HasSubmergedOnce = false;
+ WasBanished = false;
+
+ m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true);
+ HasAura = true;
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_ARRIVAL_5,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL_5);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ 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);
+ WasBanished = false;
+ } else if (WasBanished)
+ {
+ Attack_Timer -= diff;
+ //Do nothing while banished
+ return;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //WrathOfRagnaros_Timer
+ if (WrathOfRagnaros_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS);
+
+ if (rand()%2 == 0)
+ {
+ DoYell(SAY_WRATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WRATH);
+ }
+
+ WrathOfRagnaros_Timer = 30000;
+ }else WrathOfRagnaros_Timer -= diff;
+
+ //HandOfRagnaros_Timer
+ if (HandOfRagnaros_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_HANDOFRAGNAROS);
+
+ if (rand()%2==0)
+ {
+ DoYell(SAY_HAND,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HAND);
+ }
+
+ HandOfRagnaros_Timer = 25000;
+ }else HandOfRagnaros_Timer -= diff;
+
+ //LavaBurst_Timer
+ if (LavaBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_LAVABURST);
+ LavaBurst_Timer = 10000;
+ }else LavaBurst_Timer -= diff;
+
+ //Erruption_Timer
+ if (LavaBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ERRUPTION);
+ Erruption_Timer = 20000 + rand()%25000;
+ }else Erruption_Timer -= diff;
+
+ //ElementalFire_Timer
+ if (ElementalFire_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ELEMENTALFIRE);
+ ElementalFire_Timer = 10000 + rand()%4000;
+ }else ElementalFire_Timer -= diff;
+
+ //Submerge_Timer
+ if (!WasBanished && Submerge_Timer < diff)
+ {
+ //Creature spawning and ragnaros becomming unattackable
+ //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);
+ //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);
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if (!HasSubmergedOnce)
+ {
+ DoYell(SAY_REINFORCEMENTS1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS1);
+
+ // summon 10 elementals
+ Unit* target = NULL;
+ for(int i = 0; i < 9;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ }
+
+ HasSubmergedOnce = true;
+ WasBanished = true;
+ DoCast(m_creature,SPELL_RAGSUBMERGE);
+ Attack_Timer = 90000;
+
+ }else
+ {
+ DoYell(SAY_REINFORCEMENTS2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS2);
+
+ Unit* target = NULL;
+ for(int i = 0; i < 9;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ }
+
+ WasBanished = true;
+ DoCast(m_creature,SPELL_RAGSUBMERGE);
+ Attack_Timer = 90000;
+ }
+
+ Submerge_Timer = 180000;
+ }else Submerge_Timer -= diff;
+
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ //Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }else
+ {
+ //MagmaBurst_Timer
+ if (MagmaBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MAGMABURST);
+
+ if (!HasYelledMagmaBurst)
+ {
+ //Say our dialog
+ DoYell(SAY_MAGMABURST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MAGMABURST);
+ HasYelledMagmaBurst = true;
+ }
+
+ MagmaBurst_Timer = 2500;
+ }else MagmaBurst_Timer -= diff;
+ }
+ }
+};
+CreatureAI* GetAI_boss_ragnaros(Creature *_Creature)
+{
+ return new boss_ragnarosAI (_Creature);
+}
+
+void AddSC_boss_ragnaros()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ragnaros";
+ newscript->GetAI = GetAI_boss_ragnaros;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
index 5ac5ad81f5e..c9d4f4f3eec 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
@@ -1,121 +1,121 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shazzrah
-SD%Complete: 75
-SDComment: Teleport NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ARCANEEXPLOSION 19712
-#define SPELL_SHAZZRAHCURSE 19713
-#define SPELL_DEADENMAGIC 19714
-#define SPELL_COUNTERSPELL 19715
-
-struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI
-{
- boss_shazzrahAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ArcaneExplosion_Timer;
- uint32 ShazzrahCurse_Timer;
- uint32 DeadenMagic_Timer;
- uint32 Countspell_Timer;
- uint32 Blink_Timer;
-
- void Reset()
- {
- ArcaneExplosion_Timer = 6000; //These times are probably wrong
- ShazzrahCurse_Timer = 10000;
- DeadenMagic_Timer = 24000;
- Countspell_Timer = 15000;
- Blink_Timer = 30000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ArcaneExplosion_Timer
- if (ArcaneExplosion_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION);
- ArcaneExplosion_Timer = 5000 + rand()%4000;
- }else ArcaneExplosion_Timer -= diff;
-
- //ShazzrahCurse_Timer
- if (ShazzrahCurse_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SHAZZRAHCURSE);
-
- ShazzrahCurse_Timer = 25000 + rand()%5000;
- }else ShazzrahCurse_Timer -= diff;
-
- //DeadenMagic_Timer
- if (DeadenMagic_Timer < diff)
- {
- DoCast(m_creature,SPELL_DEADENMAGIC);
- DeadenMagic_Timer = 35000;
- }else DeadenMagic_Timer -= diff;
-
- //Countspell_Timer
- if (Countspell_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_COUNTERSPELL);
- Countspell_Timer = 16000 + rand()%4000;
- }else Countspell_Timer -= diff;
-
- //Blink_Timer
- if (Blink_Timer < diff)
- {
- // Teleporting him to a random gamer and casting Arcane Explosion after that.
- // Blink is not working cause of LoS System we need to do this hardcoded.
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,true,0);
- DoCast(target,SPELL_ARCANEEXPLOSION);
- DoResetThreat();
-
- Blink_Timer = 45000;
- }else Blink_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_shazzrah(Creature *_Creature)
-{
- return new boss_shazzrahAI (_Creature);
-}
-
-void AddSC_boss_shazzrah()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_shazzrah";
- newscript->GetAI = GetAI_boss_shazzrah;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shazzrah
+SD%Complete: 75
+SDComment: Teleport NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ARCANEEXPLOSION 19712
+#define SPELL_SHAZZRAHCURSE 19713
+#define SPELL_DEADENMAGIC 19714
+#define SPELL_COUNTERSPELL 19715
+
+struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI
+{
+ boss_shazzrahAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ArcaneExplosion_Timer;
+ uint32 ShazzrahCurse_Timer;
+ uint32 DeadenMagic_Timer;
+ uint32 Countspell_Timer;
+ uint32 Blink_Timer;
+
+ void Reset()
+ {
+ ArcaneExplosion_Timer = 6000; //These times are probably wrong
+ ShazzrahCurse_Timer = 10000;
+ DeadenMagic_Timer = 24000;
+ Countspell_Timer = 15000;
+ Blink_Timer = 30000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ArcaneExplosion_Timer
+ if (ArcaneExplosion_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION);
+ ArcaneExplosion_Timer = 5000 + rand()%4000;
+ }else ArcaneExplosion_Timer -= diff;
+
+ //ShazzrahCurse_Timer
+ if (ShazzrahCurse_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SHAZZRAHCURSE);
+
+ ShazzrahCurse_Timer = 25000 + rand()%5000;
+ }else ShazzrahCurse_Timer -= diff;
+
+ //DeadenMagic_Timer
+ if (DeadenMagic_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DEADENMAGIC);
+ DeadenMagic_Timer = 35000;
+ }else DeadenMagic_Timer -= diff;
+
+ //Countspell_Timer
+ if (Countspell_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_COUNTERSPELL);
+ Countspell_Timer = 16000 + rand()%4000;
+ }else Countspell_Timer -= diff;
+
+ //Blink_Timer
+ if (Blink_Timer < diff)
+ {
+ // Teleporting him to a random gamer and casting Arcane Explosion after that.
+ // Blink is not working cause of LoS System we need to do this hardcoded.
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,true,0);
+ DoCast(target,SPELL_ARCANEEXPLOSION);
+ DoResetThreat();
+
+ Blink_Timer = 45000;
+ }else Blink_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_shazzrah(Creature *_Creature)
+{
+ return new boss_shazzrahAI (_Creature);
+}
+
+void AddSC_boss_shazzrah()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shazzrah";
+ newscript->GetAI = GetAI_boss_shazzrah;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
index bf6524b1a5e..8a2a7764daa 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
@@ -1,215 +1,215 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Sulfuron_Harbringer
-SD%Complete: 80
-SDComment: Adds NYI
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_molten_core.h"
-
-#define SPELL_DARKSTRIKE 19777
-#define SPELL_DEMORALIZINGSHOUT 19778
-#define SPELL_INSPIRE 19779
-#define SPELL_KNOCKDOWN 19780
-#define SPELL_FLAMESPEAR 19781
-
-//Adds Spells
-#define SPELL_HEAL 19775
-#define SPELL_SHADOWWORDPAIN 19776
-#define SPELL_IMMOLATE 20294
-
-struct TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI
-{
- boss_sulfuronAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Darkstrike_Timer;
- uint32 DemoralizingShout_Timer;
- uint32 Inspire_Timer;
- uint32 Knockdown_Timer;
- uint32 Flamespear_Timer;
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Darkstrike_Timer=10000; //These times are probably wrong
- DemoralizingShout_Timer = 15000;
- Inspire_Timer = 13000;
- Knockdown_Timer = 6000;
- Flamespear_Timer = 2000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //DemoralizingShout_Timer
- if (DemoralizingShout_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT);
- DemoralizingShout_Timer = 15000 + rand()%5000;
- }else DemoralizingShout_Timer -= diff;
-
- //Inspire_Timer
- if (Inspire_Timer < diff)
- {
- Creature* target = NULL;
- std::list<Creature*> pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE);
- if (!pList.empty())
- {
- std::list<Creature*>::iterator i = pList.begin();
- advance(i, (rand()%pList.size()));
- target = (*i);
- }
-
- if (target)
- DoCast(target,SPELL_INSPIRE);
-
- DoCast(m_creature,SPELL_INSPIRE);
-
- Inspire_Timer = 20000 + rand()%6000;
- }else Inspire_Timer -= diff;
-
- //Knockdown_Timer
- if (Knockdown_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
- Knockdown_Timer = 12000 + rand()%3000;
- }else Knockdown_Timer -= diff;
-
- //Flamespear_Timer
- if (Flamespear_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_FLAMESPEAR);
-
- Flamespear_Timer = 12000 + rand()%4000;
- }else Flamespear_Timer -= diff;
-
- //DarkStrike_Timer
- if (Darkstrike_Timer < diff)
- {
- DoCast(m_creature, SPELL_DARKSTRIKE);
- Darkstrike_Timer = 15000 + rand()%3000;
- }else Darkstrike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI
-{
- mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Heal_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 Immolate_Timer;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Heal_Timer = 15000+rand()%15000;
- ShadowWordPain_Timer = 2000;
- Immolate_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Casting Heal to Sulfuron or other Guards.
- if(Heal_Timer < diff)
- {
- Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1);
- if (!pUnit)
- return;
-
- DoCast(pUnit, SPELL_HEAL);
-
- Heal_Timer = 15000+rand()%5000;
- }else Heal_Timer -= diff;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SHADOWWORDPAIN);
-
- ShadowWordPain_Timer = 18000+rand()%8000;
- }else ShadowWordPain_Timer -= diff;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_IMMOLATE);
-
- Immolate_Timer = 15000+rand()%10000;
- }else Immolate_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_sulfuron(Creature *_Creature)
-{
- return new boss_sulfuronAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_flamewaker_priest(Creature *_Creature)
-{
- return new mob_flamewaker_priestAI (_Creature);
-}
-
-void AddSC_boss_sulfuron()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_sulfuron";
- newscript->GetAI = GetAI_boss_sulfuron;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_flamewaker_priest";
- newscript->GetAI = GetAI_mob_flamewaker_priest;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Sulfuron_Harbringer
+SD%Complete: 80
+SDComment: Adds NYI
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_molten_core.h"
+
+#define SPELL_DARKSTRIKE 19777
+#define SPELL_DEMORALIZINGSHOUT 19778
+#define SPELL_INSPIRE 19779
+#define SPELL_KNOCKDOWN 19780
+#define SPELL_FLAMESPEAR 19781
+
+//Adds Spells
+#define SPELL_HEAL 19775
+#define SPELL_SHADOWWORDPAIN 19776
+#define SPELL_IMMOLATE 20294
+
+struct TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI
+{
+ boss_sulfuronAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Darkstrike_Timer;
+ uint32 DemoralizingShout_Timer;
+ uint32 Inspire_Timer;
+ uint32 Knockdown_Timer;
+ uint32 Flamespear_Timer;
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Darkstrike_Timer=10000; //These times are probably wrong
+ DemoralizingShout_Timer = 15000;
+ Inspire_Timer = 13000;
+ Knockdown_Timer = 6000;
+ Flamespear_Timer = 2000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //DemoralizingShout_Timer
+ if (DemoralizingShout_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT);
+ DemoralizingShout_Timer = 15000 + rand()%5000;
+ }else DemoralizingShout_Timer -= diff;
+
+ //Inspire_Timer
+ if (Inspire_Timer < diff)
+ {
+ Creature* target = NULL;
+ std::list<Creature*> pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE);
+ if (!pList.empty())
+ {
+ std::list<Creature*>::iterator i = pList.begin();
+ advance(i, (rand()%pList.size()));
+ target = (*i);
+ }
+
+ if (target)
+ DoCast(target,SPELL_INSPIRE);
+
+ DoCast(m_creature,SPELL_INSPIRE);
+
+ Inspire_Timer = 20000 + rand()%6000;
+ }else Inspire_Timer -= diff;
+
+ //Knockdown_Timer
+ if (Knockdown_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
+ Knockdown_Timer = 12000 + rand()%3000;
+ }else Knockdown_Timer -= diff;
+
+ //Flamespear_Timer
+ if (Flamespear_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_FLAMESPEAR);
+
+ Flamespear_Timer = 12000 + rand()%4000;
+ }else Flamespear_Timer -= diff;
+
+ //DarkStrike_Timer
+ if (Darkstrike_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_DARKSTRIKE);
+ Darkstrike_Timer = 15000 + rand()%3000;
+ }else Darkstrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI
+{
+ mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Heal_Timer;
+ uint32 ShadowWordPain_Timer;
+ uint32 Immolate_Timer;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Heal_Timer = 15000+rand()%15000;
+ ShadowWordPain_Timer = 2000;
+ Immolate_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Casting Heal to Sulfuron or other Guards.
+ if(Heal_Timer < diff)
+ {
+ Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1);
+ if (!pUnit)
+ return;
+
+ DoCast(pUnit, SPELL_HEAL);
+
+ Heal_Timer = 15000+rand()%5000;
+ }else Heal_Timer -= diff;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SHADOWWORDPAIN);
+
+ ShadowWordPain_Timer = 18000+rand()%8000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_IMMOLATE);
+
+ Immolate_Timer = 15000+rand()%10000;
+ }else Immolate_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_sulfuron(Creature *_Creature)
+{
+ return new boss_sulfuronAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_flamewaker_priest(Creature *_Creature)
+{
+ return new mob_flamewaker_priestAI (_Creature);
+}
+
+void AddSC_boss_sulfuron()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_sulfuron";
+ newscript->GetAI = GetAI_boss_sulfuron;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_flamewaker_priest";
+ newscript->GetAI = GetAI_mob_flamewaker_priest;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
index 793bedb3ca8..584adce0d31 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
+++ b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
@@ -1,21 +1,21 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_MOLTEN_CORE_H
-#define DEF_MOLTEN_CORE_H
-
-#define DATA_FLAMEWAKERPRIEST 1
-#define DATA_GARRISDEAD 2
-#define DATA_GEDDONISDEAD 3
-#define DATA_GEHENNASISDEAD 4
-#define DATA_GOLEMAGGISDEAD 5
-#define DATA_GOLEMAGG_DEATH 6
-#define DATA_LUCIFRONISDEAD 7
-#define DATA_MAGMADARISDEAD 8
-#define DATA_MAJORDOMOISDEAD 9
-#define DATA_SHAZZRAHISDEAD 10
-#define DATA_SULFURON 11
-#define DATA_SULFURONISDEAD 12
-#define DATA_GOLEMAGG 13
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_MOLTEN_CORE_H
+#define DEF_MOLTEN_CORE_H
+
+#define DATA_FLAMEWAKERPRIEST 1
+#define DATA_GARRISDEAD 2
+#define DATA_GEDDONISDEAD 3
+#define DATA_GEHENNASISDEAD 4
+#define DATA_GOLEMAGGISDEAD 5
+#define DATA_GOLEMAGG_DEATH 6
+#define DATA_LUCIFRONISDEAD 7
+#define DATA_MAGMADARISDEAD 8
+#define DATA_MAJORDOMOISDEAD 9
+#define DATA_SHAZZRAHISDEAD 10
+#define DATA_SULFURON 11
+#define DATA_SULFURONISDEAD 12
+#define DATA_GOLEMAGG 13
+#endif
diff --git a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
index 1f79e6e3499..42a2ec35678 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
@@ -1,257 +1,257 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Molten_Core
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Molten Core
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_molten_core.h"
-
-#define ID_LUCIFRON 12118
-#define ID_MAGMADAR 11982
-#define ID_GEHENNAS 12259
-#define ID_GARR 12057
-#define ID_GEDDON 12056
-#define ID_SHAZZRAH 12264
-#define ID_GOLEMAGG 11988
-#define ID_SULFURON 12098
-#define ID_DOMO 12018
-#define ID_RAGNAROS 11502
-#define ID_FLAMEWAKERPRIEST 11662
-
-class TRINITY_DLL_SPEC instance_molten_core : public ScriptedInstance
-{
- public:
-
- instance_molten_core(Map *map) : ScriptedInstance(map) {}
-
- uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest;
- uint64 RuneGUID[8];
-
- //If all Bosses are dead.
- bool IsBossDied[9];
-
- uint32 CheckTimer;
-
- //On creation, NOT load.
- void Initialize()
- {
- //Clear all GUIDs
- Lucifron = 0;
- Magmadar = 0;
- Gehennas = 0;
- Garr = 0;
- Geddon = 0;
- Shazzrah = 0;
- Sulfuron = 0;
- Golemagg = 0;
- Domo = 0;
- Ragnaros = 0;
- FlamewakerPriest = 0;
-
- RuneGUID[0] = 0;
- RuneGUID[1] = 0;
- RuneGUID[2] = 0;
- RuneGUID[3] = 0;
- RuneGUID[4] = 0;
- RuneGUID[5] = 0;
- RuneGUID[6] = 0;
- RuneGUID[7] = 0;
-
- IsBossDied[0] = false;
- IsBossDied[1] = false;
- IsBossDied[2] = false;
- IsBossDied[3] = false;
- IsBossDied[4] = false;
- IsBossDied[5] = false;
- IsBossDied[6] = false;
-
- IsBossDied[7] = false;
- IsBossDied[8] = false;
-
- CheckTimer = 10000;
- }
- //Called every map update
- void Update(uint32 diff)
- {
-
- if (CheckTimer < diff)
- {
- //Check if all bosses are dead and activate Major Domo
-
- }else CheckTimer -= diff;
-
- }
-
- //Used by the map's CanEnter function.
- //This is to prevent players from entering during boss encounters.
- bool IsEncounterInProgress() const
- {
- return false;
- };
-
- //Called when a gameobject is created
- void OnObjectCreate(GameObject *obj)
- {
- //Still searching for the individual rune ids.
- //Currently they don't exist within most databases and are hard to find on websites
- }
-
- //called on creature creation
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- //Store specific creatures based on entry id
- switch (creature_entry)
- {
- case ID_LUCIFRON:
- Lucifron = creature->GetGUID();
- break;
-
- case ID_MAGMADAR:
- Magmadar = creature->GetGUID();
- break;
-
- case ID_GEHENNAS:
- Gehennas = creature->GetGUID();
- break;
-
- case ID_GARR:
- Garr = creature->GetGUID();
- break;
-
- case ID_GEDDON:
- Geddon = creature->GetGUID();
- break;
-
- case ID_SHAZZRAH:
- Shazzrah = creature->GetGUID();
- break;
-
- case ID_SULFURON:
- Sulfuron = creature->GetGUID();
- break;
-
- case ID_GOLEMAGG:
- Golemagg = creature->GetGUID();
- break;
-
- case ID_DOMO:
- Domo = creature->GetGUID();
- break;
-
- case ID_RAGNAROS:
- Ragnaros = creature->GetGUID();
- break;
-
- case ID_FLAMEWAKERPRIEST:
- FlamewakerPriest = creature->GetGUID();
- break;
- }
- }
-
- uint64 GetData64 (uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_SULFURON:
- return Sulfuron;
- case DATA_GOLEMAGG:
- return Sulfuron;
-
- case DATA_FLAMEWAKERPRIEST:
- return FlamewakerPriest;
- }
-
- return 0;
- } // end GetData64
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_LUCIFRONISDEAD:
- if(IsBossDied[0])
- return 1;
- break;
-
- case DATA_MAGMADARISDEAD:
- if(IsBossDied[1])
- return 1;
- break;
-
- case DATA_GEHENNASISDEAD:
- if(IsBossDied[2])
- return 1;
- break;
-
- case DATA_GARRISDEAD:
- if(IsBossDied[3])
- return 1;
- break;
-
- case DATA_GEDDONISDEAD:
- if(IsBossDied[4])
- return 1;
- break;
-
- case DATA_SHAZZRAHISDEAD:
- if(IsBossDied[5])
- return 1;
- break;
-
- case DATA_SULFURONISDEAD:
- if(IsBossDied[6])
- return 1;
- break;
-
- case DATA_GOLEMAGGISDEAD:
- if(IsBossDied[7])
- return 1;
- break;
-
- case DATA_MAJORDOMOISDEAD:
- if(IsBossDied[8])
- return 1;
- break;
- }
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- if(type == DATA_GOLEMAGG_DEATH)
- IsBossDied[7] = true;
- }
-};
-
-InstanceData* GetInstance_instance_molten_core(Map *_Map)
-{
- return new instance_molten_core (_Map);
-}
-
-void AddSC_instance_molten_core()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="instance_molten_core";
- newscript->GetInstanceData = &GetInstance_instance_molten_core;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Molten_Core
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Molten Core
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_molten_core.h"
+
+#define ID_LUCIFRON 12118
+#define ID_MAGMADAR 11982
+#define ID_GEHENNAS 12259
+#define ID_GARR 12057
+#define ID_GEDDON 12056
+#define ID_SHAZZRAH 12264
+#define ID_GOLEMAGG 11988
+#define ID_SULFURON 12098
+#define ID_DOMO 12018
+#define ID_RAGNAROS 11502
+#define ID_FLAMEWAKERPRIEST 11662
+
+class TRINITY_DLL_SPEC instance_molten_core : public ScriptedInstance
+{
+ public:
+
+ instance_molten_core(Map *map) : ScriptedInstance(map) {}
+
+ uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest;
+ uint64 RuneGUID[8];
+
+ //If all Bosses are dead.
+ bool IsBossDied[9];
+
+ uint32 CheckTimer;
+
+ //On creation, NOT load.
+ void Initialize()
+ {
+ //Clear all GUIDs
+ Lucifron = 0;
+ Magmadar = 0;
+ Gehennas = 0;
+ Garr = 0;
+ Geddon = 0;
+ Shazzrah = 0;
+ Sulfuron = 0;
+ Golemagg = 0;
+ Domo = 0;
+ Ragnaros = 0;
+ FlamewakerPriest = 0;
+
+ RuneGUID[0] = 0;
+ RuneGUID[1] = 0;
+ RuneGUID[2] = 0;
+ RuneGUID[3] = 0;
+ RuneGUID[4] = 0;
+ RuneGUID[5] = 0;
+ RuneGUID[6] = 0;
+ RuneGUID[7] = 0;
+
+ IsBossDied[0] = false;
+ IsBossDied[1] = false;
+ IsBossDied[2] = false;
+ IsBossDied[3] = false;
+ IsBossDied[4] = false;
+ IsBossDied[5] = false;
+ IsBossDied[6] = false;
+
+ IsBossDied[7] = false;
+ IsBossDied[8] = false;
+
+ CheckTimer = 10000;
+ }
+ //Called every map update
+ void Update(uint32 diff)
+ {
+
+ if (CheckTimer < diff)
+ {
+ //Check if all bosses are dead and activate Major Domo
+
+ }else CheckTimer -= diff;
+
+ }
+
+ //Used by the map's CanEnter function.
+ //This is to prevent players from entering during boss encounters.
+ bool IsEncounterInProgress() const
+ {
+ return false;
+ };
+
+ //Called when a gameobject is created
+ void OnObjectCreate(GameObject *obj)
+ {
+ //Still searching for the individual rune ids.
+ //Currently they don't exist within most databases and are hard to find on websites
+ }
+
+ //called on creature creation
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ //Store specific creatures based on entry id
+ switch (creature_entry)
+ {
+ case ID_LUCIFRON:
+ Lucifron = creature->GetGUID();
+ break;
+
+ case ID_MAGMADAR:
+ Magmadar = creature->GetGUID();
+ break;
+
+ case ID_GEHENNAS:
+ Gehennas = creature->GetGUID();
+ break;
+
+ case ID_GARR:
+ Garr = creature->GetGUID();
+ break;
+
+ case ID_GEDDON:
+ Geddon = creature->GetGUID();
+ break;
+
+ case ID_SHAZZRAH:
+ Shazzrah = creature->GetGUID();
+ break;
+
+ case ID_SULFURON:
+ Sulfuron = creature->GetGUID();
+ break;
+
+ case ID_GOLEMAGG:
+ Golemagg = creature->GetGUID();
+ break;
+
+ case ID_DOMO:
+ Domo = creature->GetGUID();
+ break;
+
+ case ID_RAGNAROS:
+ Ragnaros = creature->GetGUID();
+ break;
+
+ case ID_FLAMEWAKERPRIEST:
+ FlamewakerPriest = creature->GetGUID();
+ break;
+ }
+ }
+
+ uint64 GetData64 (uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_SULFURON:
+ return Sulfuron;
+ case DATA_GOLEMAGG:
+ return Sulfuron;
+
+ case DATA_FLAMEWAKERPRIEST:
+ return FlamewakerPriest;
+ }
+
+ return 0;
+ } // end GetData64
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_LUCIFRONISDEAD:
+ if(IsBossDied[0])
+ return 1;
+ break;
+
+ case DATA_MAGMADARISDEAD:
+ if(IsBossDied[1])
+ return 1;
+ break;
+
+ case DATA_GEHENNASISDEAD:
+ if(IsBossDied[2])
+ return 1;
+ break;
+
+ case DATA_GARRISDEAD:
+ if(IsBossDied[3])
+ return 1;
+ break;
+
+ case DATA_GEDDONISDEAD:
+ if(IsBossDied[4])
+ return 1;
+ break;
+
+ case DATA_SHAZZRAHISDEAD:
+ if(IsBossDied[5])
+ return 1;
+ break;
+
+ case DATA_SULFURONISDEAD:
+ if(IsBossDied[6])
+ return 1;
+ break;
+
+ case DATA_GOLEMAGGISDEAD:
+ if(IsBossDied[7])
+ return 1;
+ break;
+
+ case DATA_MAJORDOMOISDEAD:
+ if(IsBossDied[8])
+ return 1;
+ break;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ if(type == DATA_GOLEMAGG_DEATH)
+ IsBossDied[7] = true;
+ }
+};
+
+InstanceData* GetInstance_instance_molten_core(Map *_Map)
+{
+ return new instance_molten_core (_Map);
+}
+
+void AddSC_instance_molten_core()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="instance_molten_core";
+ newscript->GetInstanceData = &GetInstance_instance_molten_core;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
index 67c915e71a4..e36f56c7817 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
@@ -1,88 +1,88 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Molten_Core
-SD%Complete: 100
-SDComment:
-SDCategory: Molten Core
-EndScriptData */
-
-/* ContentData
-mob_ancient_core_hound
-EndContentData */
-
-#include "precompiled.h"
-#include "../../creature/simple_ai.h"
-
-#define SPELL_CONE_OF_FIRE 19630
-#define SPELL_BITE 19771
-
-//Random Debuff (each hound has only one of these)
-#define SPELL_GROUND_STOMP 19364
-#define SPELL_ANCIENT_DREAD 19365
-#define SPELL_CAUTERIZING_FLAMES 19366
-#define SPELL_WITHERING_HEAT 19367
-#define SPELL_ANCIENT_DESPAIR 19369
-#define SPELL_ANCIENT_HYSTERIA 19372
-
-CreatureAI* GetAI_mob_ancient_core_hound(Creature *_Creature)
-{
- SimpleAI *ai = new SimpleAI(_Creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE;
- ai->Spell[0].Cooldown = 7000;
- ai->Spell[0].First_Cast = 10000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- uint32 RandDebuff;
- switch(rand()%6)
- {
- case 0 : RandDebuff = SPELL_GROUND_STOMP; break;
- case 1 : RandDebuff = SPELL_ANCIENT_DREAD; break;
- case 2 : RandDebuff = SPELL_CAUTERIZING_FLAMES; break;
- case 3 : RandDebuff = SPELL_WITHERING_HEAT; break;
- case 4 : RandDebuff = SPELL_ANCIENT_DESPAIR; break;
- case 5 : RandDebuff = SPELL_ANCIENT_HYSTERIA; break;
- }
-
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = RandDebuff;
- ai->Spell[1].Cooldown = 24000;
- ai->Spell[1].First_Cast = 15000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = SPELL_BITE;
- ai->Spell[2].Cooldown = 6000;
- ai->Spell[2].First_Cast = 4000;
- ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-void AddSC_molten_core()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_ancient_core_hound";
- newscript->GetAI = GetAI_mob_ancient_core_hound;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Molten_Core
+SD%Complete: 100
+SDComment:
+SDCategory: Molten Core
+EndScriptData */
+
+/* ContentData
+mob_ancient_core_hound
+EndContentData */
+
+#include "precompiled.h"
+#include "../../creature/simple_ai.h"
+
+#define SPELL_CONE_OF_FIRE 19630
+#define SPELL_BITE 19771
+
+//Random Debuff (each hound has only one of these)
+#define SPELL_GROUND_STOMP 19364
+#define SPELL_ANCIENT_DREAD 19365
+#define SPELL_CAUTERIZING_FLAMES 19366
+#define SPELL_WITHERING_HEAT 19367
+#define SPELL_ANCIENT_DESPAIR 19369
+#define SPELL_ANCIENT_HYSTERIA 19372
+
+CreatureAI* GetAI_mob_ancient_core_hound(Creature *_Creature)
+{
+ SimpleAI *ai = new SimpleAI(_Creature);
+
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE;
+ ai->Spell[0].Cooldown = 7000;
+ ai->Spell[0].First_Cast = 10000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ uint32 RandDebuff;
+ switch(rand()%6)
+ {
+ case 0 : RandDebuff = SPELL_GROUND_STOMP; break;
+ case 1 : RandDebuff = SPELL_ANCIENT_DREAD; break;
+ case 2 : RandDebuff = SPELL_CAUTERIZING_FLAMES; break;
+ case 3 : RandDebuff = SPELL_WITHERING_HEAT; break;
+ case 4 : RandDebuff = SPELL_ANCIENT_DESPAIR; break;
+ case 5 : RandDebuff = SPELL_ANCIENT_HYSTERIA; break;
+ }
+
+ ai->Spell[1].Enabled = true;
+ ai->Spell[1].Spell_Id = RandDebuff;
+ ai->Spell[1].Cooldown = 24000;
+ ai->Spell[1].First_Cast = 15000;
+ ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ ai->Spell[2].Enabled = true;
+ ai->Spell[2].Spell_Id = SPELL_BITE;
+ ai->Spell[2].Cooldown = 6000;
+ ai->Spell[2].First_Cast = 4000;
+ ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+void AddSC_molten_core()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ancient_core_hound";
+ newscript->GetAI = GetAI_mob_ancient_core_hound;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
index c2bc8ae2201..2e9ca764584 100644
--- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
+++ b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
@@ -1,217 +1,217 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Moonglade
-SD%Complete: 100
-SDComment: Quest support: 30, 272, 5929, 5930. Special Flight Paths for Druid class.
-SDCategory: Moonglade
-EndScriptData */
-
-/* ContentData
-npc_bunthen_plainswind
-npc_great_bear_spirit
-npc_silva_filnaveth
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_bunthen_plainswind
-######*/
-
-bool GossipHello_npc_bunthen_plainswind(Player *player, Creature *_Creature)
-{
- if(player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4916,_Creature->GetGUID());
- else if(player->GetTeam() != HORDE)
- {
- if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Endurance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4917,_Creature->GetGUID());
- }
- else if(player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- {
- player->ADD_GOSSIP_ITEM( 0, "I'd like to fly to Thunder Bluff.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Endurance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4918,_Creature->GetGUID());
- }
- return true;
-}
-
-bool GossipSelect_npc_bunthen_plainswind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- {
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- {
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 63; // Nighthaven, Moonglade
- nodes[1] = 22; // Thunder Bluff, Mulgore
- player->ActivateTaxiPathTo(nodes);
- }
- break;
- }
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5373,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5376,_Creature->GetGUID());
- break;
- }
- return true;
-}
-
-/*######
-## npc_great_bear_spirit
-######*/
-
-#define GOSSIP_BEAR1 "What do you represent, spirit?"
-#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body."
-#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart."
-#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw."
-
-bool GossipHello_npc_great_bear_spirit(Player *player, Creature *_Creature)
-{
- //ally or horde quest
- if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(4719, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(4718, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_great_bear_spirit(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(4721, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(4733, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(4734, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(4735, _Creature->GetGUID());
- if (player->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(5929);
- if (player->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(5930);
- break;
- }
- return true;
-}
-
-/*######
-## npc_silva_filnaveth
-######*/
-
-bool GossipHello_npc_silva_filnaveth(Player *player, Creature *_Creature)
-{
- if(player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4913,_Creature->GetGUID());
- else if(player->GetTeam() != ALLIANCE)
- {
- if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Agility?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4915,_Creature->GetGUID());
- }
- else if(player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- {
- player->ADD_GOSSIP_ITEM( 0, "I'd like to fly to Rut'theran Village.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Agility?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4914,_Creature->GetGUID());
- }
- return true;
-}
-
-bool GossipSelect_npc_silva_filnaveth(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- {
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- {
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 62; // Nighthaven, Moonglade
- nodes[1] = 27; // Rut'theran Village, Teldrassil
- player->ActivateTaxiPathTo(nodes);
- }
- break;
- }
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5374,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5375,_Creature->GetGUID());
- break;
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_moonglade()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_bunthen_plainswind";
- newscript->pGossipHello = &GossipHello_npc_bunthen_plainswind;
- newscript->pGossipSelect = &GossipSelect_npc_bunthen_plainswind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_great_bear_spirit";
- newscript->pGossipHello = &GossipHello_npc_great_bear_spirit;
- newscript->pGossipSelect = &GossipSelect_npc_great_bear_spirit;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_silva_filnaveth";
- newscript->pGossipHello = &GossipHello_npc_silva_filnaveth;
- newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Moonglade
+SD%Complete: 100
+SDComment: Quest support: 30, 272, 5929, 5930. Special Flight Paths for Druid class.
+SDCategory: Moonglade
+EndScriptData */
+
+/* ContentData
+npc_bunthen_plainswind
+npc_great_bear_spirit
+npc_silva_filnaveth
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_bunthen_plainswind
+######*/
+
+bool GossipHello_npc_bunthen_plainswind(Player *player, Creature *_Creature)
+{
+ if(player->getClass() != CLASS_DRUID)
+ player->SEND_GOSSIP_MENU(4916,_Creature->GetGUID());
+ else if(player->GetTeam() != HORDE)
+ {
+ if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Endurance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->SEND_GOSSIP_MENU(4917,_Creature->GetGUID());
+ }
+ else if(player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "I'd like to fly to Thunder Bluff.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Endurance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+
+ player->SEND_GOSSIP_MENU(4918,_Creature->GetGUID());
+ }
+ return true;
+}
+
+bool GossipSelect_npc_bunthen_plainswind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ {
+ player->CLOSE_GOSSIP_MENU();
+ if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
+ {
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 63; // Nighthaven, Moonglade
+ nodes[1] = 22; // Thunder Bluff, Mulgore
+ player->ActivateTaxiPathTo(nodes);
+ }
+ break;
+ }
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_GOSSIP_MENU(5373,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(5376,_Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_great_bear_spirit
+######*/
+
+#define GOSSIP_BEAR1 "What do you represent, spirit?"
+#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body."
+#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart."
+#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw."
+
+bool GossipHello_npc_great_bear_spirit(Player *player, Creature *_Creature)
+{
+ //ally or horde quest
+ if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(4719, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(4718, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_great_bear_spirit(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(4721, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(4733, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(4734, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(4735, _Creature->GetGUID());
+ if (player->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(5929);
+ if (player->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(5930);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_silva_filnaveth
+######*/
+
+bool GossipHello_npc_silva_filnaveth(Player *player, Creature *_Creature)
+{
+ if(player->getClass() != CLASS_DRUID)
+ player->SEND_GOSSIP_MENU(4913,_Creature->GetGUID());
+ else if(player->GetTeam() != ALLIANCE)
+ {
+ if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Agility?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->SEND_GOSSIP_MENU(4915,_Creature->GetGUID());
+ }
+ else if(player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "I'd like to fly to Rut'theran Village.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Do you know where I can find Half Pendant of Aquatic Agility?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+
+ player->SEND_GOSSIP_MENU(4914,_Creature->GetGUID());
+ }
+ return true;
+}
+
+bool GossipSelect_npc_silva_filnaveth(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ {
+ player->CLOSE_GOSSIP_MENU();
+ if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
+ {
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 62; // Nighthaven, Moonglade
+ nodes[1] = 27; // Rut'theran Village, Teldrassil
+ player->ActivateTaxiPathTo(nodes);
+ }
+ break;
+ }
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_GOSSIP_MENU(5374,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(5375,_Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_moonglade()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_bunthen_plainswind";
+ newscript->pGossipHello = &GossipHello_npc_bunthen_plainswind;
+ newscript->pGossipSelect = &GossipSelect_npc_bunthen_plainswind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_great_bear_spirit";
+ newscript->pGossipHello = &GossipHello_npc_great_bear_spirit;
+ newscript->pGossipSelect = &GossipSelect_npc_great_bear_spirit;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_silva_filnaveth";
+ newscript->pGossipHello = &GossipHello_npc_silva_filnaveth;
+ newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
index be71be42e09..d2fb6643423 100644
--- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
+++ b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
@@ -1,64 +1,64 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Mulgore
-SD%Complete: 100
-SDComment: Skorn Whitecloud: Just a story if not rewarded for quest
-SDCategory: Mulgore
-EndScriptData */
-
-/* ContentData
-npc_skorn_whitecloud
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-# npc_skorn_whitecloud
-######*/
-
-bool GossipHello_npc_skorn_whitecloud(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (!player->GetQuestRewardStatus(770))
- player->ADD_GOSSIP_ITEM( 0, "Tell me a story, Skorn.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF );
-
- player->SEND_GOSSIP_MENU(522,_Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_skorn_whitecloud(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF)
- player->SEND_GOSSIP_MENU(523,_Creature->GetGUID());
-
- return true;
-}
-
-void AddSC_mulgore()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_skorn_whitecloud";
- newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud;
- newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Mulgore
+SD%Complete: 100
+SDComment: Skorn Whitecloud: Just a story if not rewarded for quest
+SDCategory: Mulgore
+EndScriptData */
+
+/* ContentData
+npc_skorn_whitecloud
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+# npc_skorn_whitecloud
+######*/
+
+bool GossipHello_npc_skorn_whitecloud(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (!player->GetQuestRewardStatus(770))
+ player->ADD_GOSSIP_ITEM( 0, "Tell me a story, Skorn.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF );
+
+ player->SEND_GOSSIP_MENU(522,_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_skorn_whitecloud(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF)
+ player->SEND_GOSSIP_MENU(523,_Creature->GetGUID());
+
+ return true;
+}
+
+void AddSC_mulgore()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_skorn_whitecloud";
+ newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud;
+ newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
index b40136b2dc9..9255575a2e9 100644
--- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
+++ b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
@@ -1,568 +1,568 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Nagrand
-SD%Complete: 90
-SDComment: Quest support: 9849, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
-SDCategory: Nagrand
-EndScriptData */
-
-/* ContentData
-mob_shattered_rumbler
-mob_lump
-mob_sunspring_villager
-npc_altruis_the_sufferer
-npc_greatmother_geyah
-npc_lantresor_of_the_blade
-npc_creditmarker_visit_with_ancestors
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_shattered_rumbler - this should be done with ACID
-######*/
-
-struct TRINITY_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI
-{
- bool Spawn;
-
- mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- Spawn = false;
- }
-
- void Aggro(Unit* who) {}
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if(Spellkind->Id == 32001 && !Spawn)
- {
- float x = m_creature->GetPositionX();
- float y = m_creature->GetPositionY();
- float z = m_creature->GetPositionZ();
-
- Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- m_creature->setDeathState(CORPSE);
- Spawn = true;
- }
- return;
- }
-};
-CreatureAI* GetAI_mob_shattered_rumbler(Creature *_Creature)
-{
- return new mob_shattered_rumblerAI (_Creature);
-}
-
-/*######
-## mob_lump
-######*/
-
-#define SPELL_VISUAL_SLEEP 16093
-#define SPELL_SPEAR_THROW 32248
-
-#define LUMP_SAY0 "In Nagrand, food hunt ogre!"
-#define LUMP_SAY1 "You taste good with maybe a little salt and pepper."
-
-#define LUMP_DEFEAT "OK, OK! Lump give up!"
-
-struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
-{
- mob_lumpAI(Creature *c) : ScriptedAI(c)
- {
- bReset = false;
- Reset();
- }
-
- uint32 Reset_Timer;
- uint32 Spear_Throw_Timer;
- bool bReset;
-
- void Reset()
- {
- Reset_Timer = 60000;
- Spear_Throw_Timer = 2000;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void DamageTaken(Unit *done_by, uint32 & damage)
- {
- if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30)
- {
- if (!bReset && ((Player*)done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- {
- //Take 0 damage
- damage = 0;
-
- ((Player*)done_by)->AttackStop();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->setFaction(1080); //friendly
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
- m_creature->Say(LUMP_DEFEAT, LANG_UNIVERSAL, 0);
-
- bReset = true;
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- if (m_creature->HasAura(SPELL_VISUAL_SLEEP,0))
- m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0);
-
- if (!m_creature->IsStandState())
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
-
- switch(rand()%2)
- {
- case 0:
- DoSay(LUMP_SAY0,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoSay(LUMP_SAY1,LANG_UNIVERSAL,NULL);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //check if we waiting for a reset
- if (bReset)
- {
- if (Reset_Timer < diff)
- {
- EnterEvadeMode();
- bReset = false;
- m_creature->setFaction(1711); //hostile
- }
- else Reset_Timer -= diff;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Spear_Throw_Timer
- if (Spear_Throw_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SPEAR_THROW);
- Spear_Throw_Timer = 20000;
- }else Spear_Throw_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_lump(Creature *_creature)
-{
- return new mob_lumpAI(_creature);
-}
-
-bool GossipHello_mob_lump(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "I need answers, ogre!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9352, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_mob_lump(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "Why are Boulderfist out this far? You know that this is Kurenai territory.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9353, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9354, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "This means war, Lump! War I say!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(9355, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->SEND_GOSSIP_MENU(9356, _Creature->GetGUID());
- player->TalkedToCreature(18354, _Creature->GetGUID());
- break;
- }
- return true;
-}
-
-/*####
-# mob_sunspring_villager - should be done with ACID
-####*/
-
-struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI
-{
- mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
- }
-
- void Aggro(Unit *who) {}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == 32146)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
- }
- }
-};
-CreatureAI* GetAI_mob_sunspring_villager(Creature *_Creature)
-{
- return new mob_sunspring_villagerAI (_Creature);
-}
-
-/*######
-## npc_altruis_the_sufferer
-######*/
-
-bool GossipHello_npc_altruis_the_sufferer(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- //gossip before obtaining Survey the Land
- if ( player->GetQuestStatus(9991) == QUEST_STATUS_NONE )
- player->ADD_GOSSIP_ITEM( 0, "I see twisted steel and smell sundered earth.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
-
- //gossip when Survey the Land is incomplete (technically, after the flight)
- if (player->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Well...?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
-
- //wowwiki.com/Varedis
- if (player->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "[PH] Story about Illidan's Pupil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
-
- player->SEND_GOSSIP_MENU(9419, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_altruis_the_sufferer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM( 0, "Legion?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9420, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->ADD_GOSSIP_ITEM( 0, "And now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(9421, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- player->ADD_GOSSIP_ITEM( 0, "How do you see them now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9422, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- player->ADD_GOSSIP_ITEM( 0, "Forge camps?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- player->SEND_GOSSIP_MENU(9423, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- player->SEND_GOSSIP_MENU(9424, _Creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+20:
- player->ADD_GOSSIP_ITEM( 0, "Ok.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(9427, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(9991);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+30:
- player->ADD_GOSSIP_ITEM( 0, "[PH] Story done", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
- player->SEND_GOSSIP_MENU(384, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+31:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(10646);
- break;
- }
- return true;
-}
-
-bool QuestAccept_npc_altruis_the_sufferer(Player *player, Creature *creature, Quest const *quest )
-{
- if ( !player->GetQuestRewardStatus(9991) ) //Survey the Land, q-id 9991
- {
- player->CLOSE_GOSSIP_MENU();
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 113; //from
- nodes[1] = 114; //end at
- player->ActivateTaxiPathTo(nodes); //TaxiPath 532
- }
- return true;
-}
-
-/*######
-## npc_greatmother_geyah
-######*/
-
-//all the textId's for the below is unknown, but i do believe the gossip item texts are proper.
-bool GossipHello_npc_greatmother_geyah(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, "Hello, Greatmother. Garrosh told me that you wanted to speak with me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- }
- else if (player->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- }
- else
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_greatmother_geyah(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM( 0, "You raised all of the orcs here, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM( 0, "Do you believe that?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->ADD_GOSSIP_ITEM( 0, "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->ADD_GOSSIP_ITEM( 0, "Left? How can you choose to leave?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->ADD_GOSSIP_ITEM( 0, "What is this duty?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->ADD_GOSSIP_ITEM( 0, "Is there anything I can do for you, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7:
- player->AreaExploredOrEventHappens(10044);
- player->CLOSE_GOSSIP_MENU();
- break;
-
- case GOSSIP_ACTION_INFO_DEF + 10:
- player->ADD_GOSSIP_ITEM( 0, "I have done all that I could, Greatmother. I thank you for your kind words.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11:
- player->ADD_GOSSIP_ITEM( 0, "Greatmother, you are the mother of Durotan?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12:
- player->ADD_GOSSIP_ITEM( 0, "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13:
- player->ADD_GOSSIP_ITEM( 0, "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 14:
- player->ADD_GOSSIP_ITEM( 0, "I will return to Azeroth at once, Greatmother.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 15:
- player->AreaExploredOrEventHappens(10172);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- return true;
-}
-
-/*######
-## npc_lantresor_of_the_blade
-######*/
-
-bool GossipHello_npc_lantresor_of_the_blade(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "I have killed many of your ogres, Lantresor. I have no fear.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9361, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lantresor_of_the_blade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "Should I know? You look like an orc to me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9362, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "And the other half?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9363, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "I have heard of your kind, but I never thought to see the day when I would meet a half-breed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(9364, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "My apologies. I did not mean to offend. I am here on behalf of my people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(9365, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9366, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(9367, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM( 0, "What do I need to do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9368, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->SEND_GOSSIP_MENU(9369, _Creature->GetGUID());
- if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(10107);
- if (player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(10108);
- break;
- }
- return true;
-}
-
-/*######
-## npc_creditmarker_visist_with_ancestors (Quest 10085)
-######*/
-
-struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
-{
- npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- void Reset() {}
-
- void Aggro(Unit* who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER)
- {
- if(((Player*)who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
- {
- uint32 creditMarkerId = m_creature->GetEntry();
- if((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
- {
- // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
- if(!((Player*)who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
- ((Player*)who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
- }
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature *_Creature)
-{
- return new npc_creditmarker_visit_with_ancestorsAI (_Creature);
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_nagrand()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_shattered_rumbler";
- newscript->GetAI = GetAI_mob_shattered_rumbler;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_lump";
- newscript->GetAI = GetAI_mob_lump;
- newscript->pGossipHello = &GossipHello_mob_lump;
- newscript->pGossipSelect = &GossipSelect_mob_lump;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_sunspring_villager";
- newscript->GetAI = GetAI_mob_sunspring_villager;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_altruis_the_sufferer";
- newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer;
- newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer;
- newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_greatmother_geyah";
- newscript->pGossipHello = &GossipHello_npc_greatmother_geyah;
- newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lantresor_of_the_blade";
- newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade;
- newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_creditmarker_visit_with_ancestors";
- newscript->GetAI = GetAI_npc_creditmarker_visit_with_ancestors;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Nagrand
+SD%Complete: 90
+SDComment: Quest support: 9849, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
+SDCategory: Nagrand
+EndScriptData */
+
+/* ContentData
+mob_shattered_rumbler
+mob_lump
+mob_sunspring_villager
+npc_altruis_the_sufferer
+npc_greatmother_geyah
+npc_lantresor_of_the_blade
+npc_creditmarker_visit_with_ancestors
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_shattered_rumbler - this should be done with ACID
+######*/
+
+struct TRINITY_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI
+{
+ bool Spawn;
+
+ mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ Spawn = false;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if(Spellkind->Id == 32001 && !Spawn)
+ {
+ float x = m_creature->GetPositionX();
+ float y = m_creature->GetPositionY();
+ float z = m_creature->GetPositionZ();
+
+ Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ m_creature->setDeathState(CORPSE);
+ Spawn = true;
+ }
+ return;
+ }
+};
+CreatureAI* GetAI_mob_shattered_rumbler(Creature *_Creature)
+{
+ return new mob_shattered_rumblerAI (_Creature);
+}
+
+/*######
+## mob_lump
+######*/
+
+#define SPELL_VISUAL_SLEEP 16093
+#define SPELL_SPEAR_THROW 32248
+
+#define LUMP_SAY0 "In Nagrand, food hunt ogre!"
+#define LUMP_SAY1 "You taste good with maybe a little salt and pepper."
+
+#define LUMP_DEFEAT "OK, OK! Lump give up!"
+
+struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
+{
+ mob_lumpAI(Creature *c) : ScriptedAI(c)
+ {
+ bReset = false;
+ Reset();
+ }
+
+ uint32 Reset_Timer;
+ uint32 Spear_Throw_Timer;
+ bool bReset;
+
+ void Reset()
+ {
+ Reset_Timer = 60000;
+ Spear_Throw_Timer = 2000;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 & damage)
+ {
+ if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30)
+ {
+ if (!bReset && ((Player*)done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
+ {
+ //Take 0 damage
+ damage = 0;
+
+ ((Player*)done_by)->AttackStop();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->setFaction(1080); //friendly
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
+ m_creature->Say(LUMP_DEFEAT, LANG_UNIVERSAL, 0);
+
+ bReset = true;
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (m_creature->HasAura(SPELL_VISUAL_SLEEP,0))
+ m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0);
+
+ if (!m_creature->IsStandState())
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoSay(LUMP_SAY0,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoSay(LUMP_SAY1,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //check if we waiting for a reset
+ if (bReset)
+ {
+ if (Reset_Timer < diff)
+ {
+ EnterEvadeMode();
+ bReset = false;
+ m_creature->setFaction(1711); //hostile
+ }
+ else Reset_Timer -= diff;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Spear_Throw_Timer
+ if (Spear_Throw_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SPEAR_THROW);
+ Spear_Throw_Timer = 20000;
+ }else Spear_Throw_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_lump(Creature *_creature)
+{
+ return new mob_lumpAI(_creature);
+}
+
+bool GossipHello_mob_lump(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "I need answers, ogre!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(9352, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_mob_lump(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "Why are Boulderfist out this far? You know that this is Kurenai territory.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(9353, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9354, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "This means war, Lump! War I say!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(9355, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->SEND_GOSSIP_MENU(9356, _Creature->GetGUID());
+ player->TalkedToCreature(18354, _Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+/*####
+# mob_sunspring_villager - should be done with ACID
+####*/
+
+struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI
+{
+ mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ }
+
+ void Aggro(Unit *who) {}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == 32146)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+ }
+};
+CreatureAI* GetAI_mob_sunspring_villager(Creature *_Creature)
+{
+ return new mob_sunspring_villagerAI (_Creature);
+}
+
+/*######
+## npc_altruis_the_sufferer
+######*/
+
+bool GossipHello_npc_altruis_the_sufferer(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ //gossip before obtaining Survey the Land
+ if ( player->GetQuestStatus(9991) == QUEST_STATUS_NONE )
+ player->ADD_GOSSIP_ITEM( 0, "I see twisted steel and smell sundered earth.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
+
+ //gossip when Survey the Land is incomplete (technically, after the flight)
+ if (player->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Well...?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
+
+ //wowwiki.com/Varedis
+ if (player->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Story about Illidan's Pupil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
+
+ player->SEND_GOSSIP_MENU(9419, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_altruis_the_sufferer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+10:
+ player->ADD_GOSSIP_ITEM( 0, "Legion?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(9420, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->ADD_GOSSIP_ITEM( 0, "And now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(9421, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+12:
+ player->ADD_GOSSIP_ITEM( 0, "How do you see them now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(9422, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+13:
+ player->ADD_GOSSIP_ITEM( 0, "Forge camps?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ player->SEND_GOSSIP_MENU(9423, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+14:
+ player->SEND_GOSSIP_MENU(9424, _Creature->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+20:
+ player->ADD_GOSSIP_ITEM( 0, "Ok.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ player->SEND_GOSSIP_MENU(9427, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(9991);
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+30:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Story done", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
+ player->SEND_GOSSIP_MENU(384, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+31:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(10646);
+ break;
+ }
+ return true;
+}
+
+bool QuestAccept_npc_altruis_the_sufferer(Player *player, Creature *creature, Quest const *quest )
+{
+ if ( !player->GetQuestRewardStatus(9991) ) //Survey the Land, q-id 9991
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 113; //from
+ nodes[1] = 114; //end at
+ player->ActivateTaxiPathTo(nodes); //TaxiPath 532
+ }
+ return true;
+}
+
+/*######
+## npc_greatmother_geyah
+######*/
+
+//all the textId's for the below is unknown, but i do believe the gossip item texts are proper.
+bool GossipHello_npc_greatmother_geyah(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "Hello, Greatmother. Garrosh told me that you wanted to speak with me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ }
+ else if (player->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ }
+ else
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_greatmother_geyah(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->ADD_GOSSIP_ITEM( 0, "You raised all of the orcs here, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->ADD_GOSSIP_ITEM( 0, "Do you believe that?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->ADD_GOSSIP_ITEM( 0, "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ player->ADD_GOSSIP_ITEM( 0, "Left? How can you choose to leave?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ player->ADD_GOSSIP_ITEM( 0, "What is this duty?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ player->ADD_GOSSIP_ITEM( 0, "Is there anything I can do for you, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7:
+ player->AreaExploredOrEventHappens(10044);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF + 10:
+ player->ADD_GOSSIP_ITEM( 0, "I have done all that I could, Greatmother. I thank you for your kind words.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11:
+ player->ADD_GOSSIP_ITEM( 0, "Greatmother, you are the mother of Durotan?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12:
+ player->ADD_GOSSIP_ITEM( 0, "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13:
+ player->ADD_GOSSIP_ITEM( 0, "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 14:
+ player->ADD_GOSSIP_ITEM( 0, "I will return to Azeroth at once, Greatmother.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 15:
+ player->AreaExploredOrEventHappens(10172);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_lantresor_of_the_blade
+######*/
+
+bool GossipHello_npc_lantresor_of_the_blade(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "I have killed many of your ogres, Lantresor. I have no fear.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(9361, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lantresor_of_the_blade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "Should I know? You look like an orc to me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(9362, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "And the other half?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9363, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "I have heard of your kind, but I never thought to see the day when I would meet a half-breed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(9364, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "My apologies. I did not mean to offend. I am here on behalf of my people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(9365, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(9366, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(9367, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM( 0, "What do I need to do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(9368, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->SEND_GOSSIP_MENU(9369, _Creature->GetGUID());
+ if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(10107);
+ if (player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(10108);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_creditmarker_visist_with_ancestors (Quest 10085)
+######*/
+
+struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
+{
+ npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() {}
+
+ void Aggro(Unit* who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who)
+ return;
+
+ if(who->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(((Player*)who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
+ {
+ uint32 creditMarkerId = m_creature->GetEntry();
+ if((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
+ {
+ // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
+ if(!((Player*)who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
+ ((Player*)who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature *_Creature)
+{
+ return new npc_creditmarker_visit_with_ancestorsAI (_Creature);
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_nagrand()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shattered_rumbler";
+ newscript->GetAI = GetAI_mob_shattered_rumbler;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_lump";
+ newscript->GetAI = GetAI_mob_lump;
+ newscript->pGossipHello = &GossipHello_mob_lump;
+ newscript->pGossipSelect = &GossipSelect_mob_lump;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_sunspring_villager";
+ newscript->GetAI = GetAI_mob_sunspring_villager;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_altruis_the_sufferer";
+ newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer;
+ newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer;
+ newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_greatmother_geyah";
+ newscript->pGossipHello = &GossipHello_npc_greatmother_geyah;
+ newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lantresor_of_the_blade";
+ newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade;
+ newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_creditmarker_visit_with_ancestors";
+ newscript->GetAI = GetAI_npc_creditmarker_visit_with_ancestors;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
index bccc0e0b3f3..8561524af09 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
@@ -1,215 +1,215 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Anubrekhan
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO1 "Just a little taste..."
-#define SAY_AGGRO2 "There is no way out."
-#define SAY_AGGRO3 "Yes, Run! It makes the blood pump faster!"
-#define SAY_GREET "Ahh... welcome to my parlor"
-#define SAY_TAUNT1 "I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop."
-#define SAY_TAUNT2 "Where to go? What to do? So many choices that all end in pain, end in death."
-#define SAY_TAUNT3 "Which one shall I eat first? So difficult to choose... the all smell so delicious."
-#define SAY_TAUNT4 "Closer now... tasty morsels. I've been too long without food. Without blood to drink."
-#define SAY_SLAY "Shh... it will all be over soon."
-
-#define SOUND_AGGRO1 8785
-#define SOUND_AGGRO2 8786
-#define SOUND_AGGRO3 8787
-#define SOUND_GREET 8788
-#define SOUND_TAUNT1 8790
-#define SOUND_TAUNT2 8791
-#define SOUND_TAUNT3 8792
-#define SOUND_TAUNT4 8793
-#define SOUND_SLAY 8789
-
-#define SPELL_IMPALE 28783 //May be wrong spell id. Causes more dmg than I expect
-#define SPELL_LOCUSTSWARM 28785 //This is a self buff that triggers the dmg debuff
-#define SPELL_SUMMONGUARD 29508 //Summons 1 crypt guard at targeted location
-
-#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death)
-#define SPELL_SELF_SPAWN_10 28864 //This is used by the crypt guards when they die
-
-struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
-{
- boss_anubrekhanAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Impale_Timer;
- uint32 LocustSwarm_Timer;
- uint32 Summon_Timer;
- bool HasTaunted;
-
- void Reset()
- {
- Impale_Timer = 15000; //15 seconds
- LocustSwarm_Timer = 80000 + (rand()%40000); //Random time between 80 seconds and 2 minutes for initial cast
- Summon_Timer = LocustSwarm_Timer + 45000; //45 seconds after initial locust swarm
- }
-
- void KilledUnit(Unit* Victim)
- {
- //Force the player to spawn corpse scarabs via spell
- Victim->CastSpell(Victim, SPELL_SELF_SPAWN_5, true);
-
- if (rand()%5)
- return;
-
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin melee attack if we are within range
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
- }
- }
- else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
- {
- switch(rand()%5)
- {
- case 0:
- DoYell(SAY_TAUNT1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
- break;
- case 1:
- DoYell(SAY_TAUNT2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
- break;
- case 2:
- DoYell(SAY_TAUNT3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
- break;
- case 3:
- DoYell(SAY_TAUNT4, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT4);
- break;
- case 4:
- DoYell(SAY_GREET, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_GREET);
- break;
- }
- HasTaunted = true;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Impale_Timer
- if (Impale_Timer < diff)
- {
- //Cast Impale on a random target
- //Do NOT cast it when we are afflicted by locust swarm
- if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
- {
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_IMPALE);
- }
-
- Impale_Timer = 15000;
- }else Impale_Timer -= diff;
-
- //LocustSwarm_Timer
- if (LocustSwarm_Timer < diff)
- {
- DoCast(m_creature, SPELL_LOCUSTSWARM);
- LocustSwarm_Timer = 90000;
- }else LocustSwarm_Timer -= diff;
-
- //Summon_Timer
- if (Summon_Timer < diff)
- {
- DoCast(m_creature, SPELL_SUMMONGUARD);
- Summon_Timer = 45000;
- }else Summon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_anubrekhan(Creature *_Creature)
-{
- return new boss_anubrekhanAI (_Creature);
-}
-
-void AddSC_boss_anubrekhan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_anubrekhan";
- newscript->GetAI = GetAI_boss_anubrekhan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Anubrekhan
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO1 "Just a little taste..."
+#define SAY_AGGRO2 "There is no way out."
+#define SAY_AGGRO3 "Yes, Run! It makes the blood pump faster!"
+#define SAY_GREET "Ahh... welcome to my parlor"
+#define SAY_TAUNT1 "I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop."
+#define SAY_TAUNT2 "Where to go? What to do? So many choices that all end in pain, end in death."
+#define SAY_TAUNT3 "Which one shall I eat first? So difficult to choose... the all smell so delicious."
+#define SAY_TAUNT4 "Closer now... tasty morsels. I've been too long without food. Without blood to drink."
+#define SAY_SLAY "Shh... it will all be over soon."
+
+#define SOUND_AGGRO1 8785
+#define SOUND_AGGRO2 8786
+#define SOUND_AGGRO3 8787
+#define SOUND_GREET 8788
+#define SOUND_TAUNT1 8790
+#define SOUND_TAUNT2 8791
+#define SOUND_TAUNT3 8792
+#define SOUND_TAUNT4 8793
+#define SOUND_SLAY 8789
+
+#define SPELL_IMPALE 28783 //May be wrong spell id. Causes more dmg than I expect
+#define SPELL_LOCUSTSWARM 28785 //This is a self buff that triggers the dmg debuff
+#define SPELL_SUMMONGUARD 29508 //Summons 1 crypt guard at targeted location
+
+#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death)
+#define SPELL_SELF_SPAWN_10 28864 //This is used by the crypt guards when they die
+
+struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
+{
+ boss_anubrekhanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Impale_Timer;
+ uint32 LocustSwarm_Timer;
+ uint32 Summon_Timer;
+ bool HasTaunted;
+
+ void Reset()
+ {
+ Impale_Timer = 15000; //15 seconds
+ LocustSwarm_Timer = 80000 + (rand()%40000); //Random time between 80 seconds and 2 minutes for initial cast
+ Summon_Timer = LocustSwarm_Timer + 45000; //45 seconds after initial locust swarm
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ //Force the player to spawn corpse scarabs via spell
+ Victim->CastSpell(Victim, SPELL_SELF_SPAWN_5, true);
+
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin melee attack if we are within range
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+ }
+ }
+ else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
+ {
+ switch(rand()%5)
+ {
+ case 0:
+ DoYell(SAY_TAUNT1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
+ break;
+ case 1:
+ DoYell(SAY_TAUNT2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
+ break;
+ case 2:
+ DoYell(SAY_TAUNT3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
+ break;
+ case 3:
+ DoYell(SAY_TAUNT4, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT4);
+ break;
+ case 4:
+ DoYell(SAY_GREET, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_GREET);
+ break;
+ }
+ HasTaunted = true;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Impale_Timer
+ if (Impale_Timer < diff)
+ {
+ //Cast Impale on a random target
+ //Do NOT cast it when we are afflicted by locust swarm
+ if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
+ {
+ Unit* target = NULL;
+
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_IMPALE);
+ }
+
+ Impale_Timer = 15000;
+ }else Impale_Timer -= diff;
+
+ //LocustSwarm_Timer
+ if (LocustSwarm_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_LOCUSTSWARM);
+ LocustSwarm_Timer = 90000;
+ }else LocustSwarm_Timer -= diff;
+
+ //Summon_Timer
+ if (Summon_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_SUMMONGUARD);
+ Summon_Timer = 45000;
+ }else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_anubrekhan(Creature *_Creature)
+{
+ return new boss_anubrekhanAI (_Creature);
+}
+
+void AddSC_boss_anubrekhan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_anubrekhan";
+ newscript->GetAI = GetAI_boss_anubrekhan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
index 9fbdd9d5158..5f5be2cd1de 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
@@ -1,202 +1,202 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Faerlina
-SD%Complete: 50
-SDComment: Without Mindcontrol boss cannot be defeated
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_GREET "Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master's service!"
-#define SAY_AGGRO1 "Slay them in the master's name!"
-#define SAY_AGGRO2 "You cannot hide from me!"
-#define SAY_AGGRO3 "Kneel before me, worm!"
-#define SAY_AGGRO4 "Run while you still can!"
-#define SAY_SLAY1 "You have failed!"
-#define SAY_SLAY2 "Pathetic wretch!"
-#define SAY_DEATH "The master... will avenge me!"
-#define SAY_RANDOM_AGGRO "???"
-
-#define SOUND_GREET 8799
-#define SOUND_AGGRO1 8794
-#define SOUND_AGGRO2 8795
-#define SOUND_AGGRO3 8796
-#define SOUND_AGGRO4 8797
-#define SOUND_SLAY1 8800
-#define SOUND_SLAY2 8801
-#define SOUND_DEATH 8798
-#define SOUND_RANDOM_AGGRO 8955
-
-#define SPELL_POSIONBOLT_VOLLEY 28796
-#define SPELL_RAINOFFIRE 28794 //Not sure if targeted AoEs work if casted directly upon a player
-#define SPELL_ENRAGE 26527
-
-struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI
-{
- boss_faerlinaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 PoisonBoltVolley_Timer;
- uint32 RainOfFire_Timer;
- uint32 Enrage_Timer;
- bool HasTaunted;
-
- void Reset()
- {
- PoisonBoltVolley_Timer = 8000;
- RainOfFire_Timer = 16000;
- Enrage_Timer = 60000;
- HasTaunted = false;
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%4)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- case 3:
- DoYell(SAY_AGGRO4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO4);
- break;
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- //Say our dialog on initial aggro
- if (!InCombat)
- {
- switch (rand()%4)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- case 3:
- DoYell(SAY_AGGRO4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO4);
- break;
- }
- }
- }
- else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
- {
- DoYell(SAY_GREET, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_GREET);
- HasTaunted = true;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch (rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //PoisonBoltVolley_Timer
- if (PoisonBoltVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POSIONBOLT_VOLLEY);
- PoisonBoltVolley_Timer = 11000;
- }else PoisonBoltVolley_Timer -= diff;
-
- //RainOfFire_Timer
- if (RainOfFire_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_RAINOFFIRE);
-
- RainOfFire_Timer = 16000;
- }else RainOfFire_Timer -= diff;
-
- //Enrage_Timer
- if (Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 61000;
- }else Enrage_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_faerlina(Creature *_Creature)
-{
- return new boss_faerlinaAI (_Creature);
-}
-
-void AddSC_boss_faerlina()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_faerlina";
- newscript->GetAI = GetAI_boss_faerlina;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Faerlina
+SD%Complete: 50
+SDComment: Without Mindcontrol boss cannot be defeated
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_GREET "Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master's service!"
+#define SAY_AGGRO1 "Slay them in the master's name!"
+#define SAY_AGGRO2 "You cannot hide from me!"
+#define SAY_AGGRO3 "Kneel before me, worm!"
+#define SAY_AGGRO4 "Run while you still can!"
+#define SAY_SLAY1 "You have failed!"
+#define SAY_SLAY2 "Pathetic wretch!"
+#define SAY_DEATH "The master... will avenge me!"
+#define SAY_RANDOM_AGGRO "???"
+
+#define SOUND_GREET 8799
+#define SOUND_AGGRO1 8794
+#define SOUND_AGGRO2 8795
+#define SOUND_AGGRO3 8796
+#define SOUND_AGGRO4 8797
+#define SOUND_SLAY1 8800
+#define SOUND_SLAY2 8801
+#define SOUND_DEATH 8798
+#define SOUND_RANDOM_AGGRO 8955
+
+#define SPELL_POSIONBOLT_VOLLEY 28796
+#define SPELL_RAINOFFIRE 28794 //Not sure if targeted AoEs work if casted directly upon a player
+#define SPELL_ENRAGE 26527
+
+struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI
+{
+ boss_faerlinaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 PoisonBoltVolley_Timer;
+ uint32 RainOfFire_Timer;
+ uint32 Enrage_Timer;
+ bool HasTaunted;
+
+ void Reset()
+ {
+ PoisonBoltVolley_Timer = 8000;
+ RainOfFire_Timer = 16000;
+ Enrage_Timer = 60000;
+ HasTaunted = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%4)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ case 3:
+ DoYell(SAY_AGGRO4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO4);
+ break;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ //Say our dialog on initial aggro
+ if (!InCombat)
+ {
+ switch (rand()%4)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ case 3:
+ DoYell(SAY_AGGRO4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO4);
+ break;
+ }
+ }
+ }
+ else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
+ {
+ DoYell(SAY_GREET, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GREET);
+ HasTaunted = true;
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch (rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //PoisonBoltVolley_Timer
+ if (PoisonBoltVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POSIONBOLT_VOLLEY);
+ PoisonBoltVolley_Timer = 11000;
+ }else PoisonBoltVolley_Timer -= diff;
+
+ //RainOfFire_Timer
+ if (RainOfFire_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_RAINOFFIRE);
+
+ RainOfFire_Timer = 16000;
+ }else RainOfFire_Timer -= diff;
+
+ //Enrage_Timer
+ if (Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 61000;
+ }else Enrage_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_faerlina(Creature *_Creature)
+{
+ return new boss_faerlinaAI (_Creature);
+}
+
+void AddSC_boss_faerlina()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_faerlina";
+ newscript->GetAI = GetAI_boss_faerlina;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_feugen.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_feugen.cpp
index 2857c7ffdbb..d7f7de9eaca 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_feugen.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_feugen.cpp
@@ -1,33 +1,33 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Feugen
-SD%Complete: 0
-SDComment: Merge with Thaddius
-SDCategory: Naxxramas
-EndScriptData */
-
-//Feugen
-//8801 aggro Feed you to master!
-//8804 slay Feugen make master happy!
-//8803 death No... more... Feugen...
-
-#include "precompiled.h"
-
-#define SPELL_WARSTOMP 28125
-#define SPELL_MANABURN 28135
-#define SPELL_CHAIN_LIGHTNING 28900
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Feugen
+SD%Complete: 0
+SDComment: Merge with Thaddius
+SDCategory: Naxxramas
+EndScriptData */
+
+//Feugen
+//8801 aggro Feed you to master!
+//8804 slay Feugen make master happy!
+//8803 death No... more... Feugen...
+
+#include "precompiled.h"
+
+#define SPELL_WARSTOMP 28125
+#define SPELL_MANABURN 28135
+#define SPELL_CHAIN_LIGHTNING 28900
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
index 5420195b0c6..09e3c1ecf25 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
@@ -1,174 +1,174 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gluth
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MORTALWOUND 25646
-#define SPELL_DECIMATE 28374
-#define SPELL_TERRIFYINGROAR 29685
-#define SPELL_FRENZY 19812
-#define SPELL_ENRAGE 28747
-
-#define ADD_1X 3269.590
-#define ADD_1Y -3161.287
-#define ADD_1Z 297.423
-
-#define ADD_2X 3277.797
-#define ADD_2Y -3170.352
-#define ADD_2Z 297.423
-
-#define ADD_3X 3267.049
-#define ADD_3Y -3172.820
-#define ADD_3Z 297.423
-
-#define ADD_4X 3252.157
-#define ADD_4Y -3132.135
-#define ADD_4Z 297.423
-
-#define ADD_5X 3259.990
-#define ADD_5Y -3126.590
-#define ADD_5Z 297.423
-
-#define ADD_6X 3259.815
-#define ADD_6Y -3137.576
-#define ADD_6Z 297.423
-
-#define ADD_7X 3308.030
-#define ADD_7Y -3132.135
-#define ADD_7Z 297.423
-
-#define ADD_8X 3303.046
-#define ADD_8Y -3180.682
-#define ADD_8Z 297.423
-
-#define ADD_9X 3313.283
-#define ADD_9Y -3180.766
-#define ADD_9Z 297.423
-
-struct TRINITY_DLL_DECL boss_gluthAI : public ScriptedAI
-{
- boss_gluthAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MortalWound_Timer;
- uint32 Decimate_Timer;
- uint32 TerrifyingRoar_Timer;
- uint32 Frenzy_Timer;
- uint32 Enrage_Timer;
- uint32 Summon_Timer;
-
- void Reset()
- {
- MortalWound_Timer = 8000;
- Decimate_Timer = 100000;
- TerrifyingRoar_Timer = 21000;
- Frenzy_Timer = 15000;
- Enrage_Timer = 304000;
- Summon_Timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //MortalWound_Timer
- if (MortalWound_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALWOUND);
- MortalWound_Timer = 10000;
- }else MortalWound_Timer -= diff;
-
- //Decimate_Timer
- if (Decimate_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DECIMATE);
- Decimate_Timer = 100000;
- }else Decimate_Timer -= diff;
-
- //TerrifyingRoar_Timer
- if (TerrifyingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
- TerrifyingRoar_Timer = 20000;
- }else TerrifyingRoar_Timer -= diff;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- Frenzy_Timer = 10500;
- }else Frenzy_Timer -= diff;
-
- //Enrage_Timer
- if (Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 61000;
- }else Enrage_Timer -= diff;
-
- //Summon_Timer
- if (Summon_Timer < diff)
- {
- Unit* target = NULL;
- Unit* SummonedZombies = NULL;
-
- SummonedZombies = m_creature->SummonCreature(16360,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_4X,ADD_4Y,ADD_4Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_5X,ADD_5Y,ADD_5Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_6X,ADD_6Y,ADD_6Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_7X,ADD_7Y,ADD_7Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_8X,ADD_8Y,ADD_8Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedZombies = m_creature->SummonCreature(16360,ADD_9X,ADD_9Y,ADD_9Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
-
- if (SummonedZombies)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- SummonedZombies->AddThreat(target,1.0f);
- }
-
- Summon_Timer = 28000;
- } else Summon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gluth(Creature *_Creature)
-{
- return new boss_gluthAI (_Creature);
-}
-
-void AddSC_boss_gluth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gluth";
- newscript->GetAI = GetAI_boss_gluth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gluth
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MORTALWOUND 25646
+#define SPELL_DECIMATE 28374
+#define SPELL_TERRIFYINGROAR 29685
+#define SPELL_FRENZY 19812
+#define SPELL_ENRAGE 28747
+
+#define ADD_1X 3269.590
+#define ADD_1Y -3161.287
+#define ADD_1Z 297.423
+
+#define ADD_2X 3277.797
+#define ADD_2Y -3170.352
+#define ADD_2Z 297.423
+
+#define ADD_3X 3267.049
+#define ADD_3Y -3172.820
+#define ADD_3Z 297.423
+
+#define ADD_4X 3252.157
+#define ADD_4Y -3132.135
+#define ADD_4Z 297.423
+
+#define ADD_5X 3259.990
+#define ADD_5Y -3126.590
+#define ADD_5Z 297.423
+
+#define ADD_6X 3259.815
+#define ADD_6Y -3137.576
+#define ADD_6Z 297.423
+
+#define ADD_7X 3308.030
+#define ADD_7Y -3132.135
+#define ADD_7Z 297.423
+
+#define ADD_8X 3303.046
+#define ADD_8Y -3180.682
+#define ADD_8Z 297.423
+
+#define ADD_9X 3313.283
+#define ADD_9Y -3180.766
+#define ADD_9Z 297.423
+
+struct TRINITY_DLL_DECL boss_gluthAI : public ScriptedAI
+{
+ boss_gluthAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MortalWound_Timer;
+ uint32 Decimate_Timer;
+ uint32 TerrifyingRoar_Timer;
+ uint32 Frenzy_Timer;
+ uint32 Enrage_Timer;
+ uint32 Summon_Timer;
+
+ void Reset()
+ {
+ MortalWound_Timer = 8000;
+ Decimate_Timer = 100000;
+ TerrifyingRoar_Timer = 21000;
+ Frenzy_Timer = 15000;
+ Enrage_Timer = 304000;
+ Summon_Timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //MortalWound_Timer
+ if (MortalWound_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALWOUND);
+ MortalWound_Timer = 10000;
+ }else MortalWound_Timer -= diff;
+
+ //Decimate_Timer
+ if (Decimate_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DECIMATE);
+ Decimate_Timer = 100000;
+ }else Decimate_Timer -= diff;
+
+ //TerrifyingRoar_Timer
+ if (TerrifyingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
+ TerrifyingRoar_Timer = 20000;
+ }else TerrifyingRoar_Timer -= diff;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ Frenzy_Timer = 10500;
+ }else Frenzy_Timer -= diff;
+
+ //Enrage_Timer
+ if (Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 61000;
+ }else Enrage_Timer -= diff;
+
+ //Summon_Timer
+ if (Summon_Timer < diff)
+ {
+ Unit* target = NULL;
+ Unit* SummonedZombies = NULL;
+
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_4X,ADD_4Y,ADD_4Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_5X,ADD_5Y,ADD_5Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_6X,ADD_6Y,ADD_6Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_7X,ADD_7Y,ADD_7Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_8X,ADD_8Y,ADD_8Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedZombies = m_creature->SummonCreature(16360,ADD_9X,ADD_9Y,ADD_9Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+
+ if (SummonedZombies)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ SummonedZombies->AddThreat(target,1.0f);
+ }
+
+ Summon_Timer = 28000;
+ } else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gluth(Creature *_Creature)
+{
+ return new boss_gluthAI (_Creature);
+}
+
+void AddSC_boss_gluth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gluth";
+ newscript->GetAI = GetAI_boss_gluth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
index 48c76bb5e89..65e7a9d1387 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
@@ -1,62 +1,62 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gothik
-SD%Complete: 0
-SDComment: Placeholder
-SDCategory: Naxxramas
-EndScriptData */
-
-//Gothik
-//8806 spch - Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.
-//8808 tlpt - I have waited long enough! Now, you face the harvester of souls!
-//8806 slay - Death is the only escape.
-//8805 death - I... am... undone!
-
-#include "precompiled.h"
-
-//Gothik
-#define SPELL_HARVESTSOUL 28679
-#define SPELL_SHADOWBOLT 19729
-
-//Unrelenting Trainee
-#define SPELL_EAGLECLAW 30285
-#define SPELL_KNOCKDOWN_PASSIVE 6961
-
-//Unrelenting Deathknight
-#define SPELL_CHARGE 22120
-#define SPELL_SHADOW_MARK 27825
-
-//Unrelenting Rider
-#define SPELL_UNHOLY_AURA 28340
-#define SPELL_SHADOWBOLT 19729 //Search thru targets and find those who have the SHADOW_MARK to cast this on
-
-//Spectral Trainee
-#define SPELL_ARCANE_EXPLOSION 27989
-
-//Spectral Deathknight
-#define SPELL_WHIRLWIND 28334
-#define SPELL_SUNDER_ARMOR 25051 //cannot find sunder that reduces armor by 2950
-#define SPELL_CLEAVE 20677
-#define SPELL_MANA_BURN 17631
-
-//Spectral Rider
-#define SPELL_LIFEDRAIN 24300
-//USES SAME UNHOLY AURA AS UNRELENTING RIDER
-
-//Spectral Horse
-#define SPELL_STOMP 27993
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gothik
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Naxxramas
+EndScriptData */
+
+//Gothik
+//8806 spch - Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.
+//8808 tlpt - I have waited long enough! Now, you face the harvester of souls!
+//8806 slay - Death is the only escape.
+//8805 death - I... am... undone!
+
+#include "precompiled.h"
+
+//Gothik
+#define SPELL_HARVESTSOUL 28679
+#define SPELL_SHADOWBOLT 19729
+
+//Unrelenting Trainee
+#define SPELL_EAGLECLAW 30285
+#define SPELL_KNOCKDOWN_PASSIVE 6961
+
+//Unrelenting Deathknight
+#define SPELL_CHARGE 22120
+#define SPELL_SHADOW_MARK 27825
+
+//Unrelenting Rider
+#define SPELL_UNHOLY_AURA 28340
+#define SPELL_SHADOWBOLT 19729 //Search thru targets and find those who have the SHADOW_MARK to cast this on
+
+//Spectral Trainee
+#define SPELL_ARCANE_EXPLOSION 27989
+
+//Spectral Deathknight
+#define SPELL_WHIRLWIND 28334
+#define SPELL_SUNDER_ARMOR 25051 //cannot find sunder that reduces armor by 2950
+#define SPELL_CLEAVE 20677
+#define SPELL_MANA_BURN 17631
+
+//Spectral Rider
+#define SPELL_LIFEDRAIN 24300
+//USES SAME UNHOLY AURA AS UNRELENTING RIDER
+
+//Spectral Horse
+#define SPELL_STOMP 27993
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
index 72827f02285..f187bad2a7c 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
@@ -1,30 +1,30 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grobbulus
-SD%Complete: 0
-SDComment: Place holder
-SDCategory: Naxxramas
-EndScriptData */
-
-/*Poison Cloud 26590
-Slime Spray 28157
-Fallout slime 28218
-Mutating Injection 28169
-Enrages 26527*/
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grobbulus
+SD%Complete: 0
+SDComment: Place holder
+SDCategory: Naxxramas
+EndScriptData */
+
+/*Poison Cloud 26590
+Slime Spray 28157
+Fallout slime 28218
+Mutating Injection 28169
+Enrages 26527*/
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
index 5496a83af9f..7a9361457c4 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
@@ -1,46 +1,46 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Heigan
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Naxxramas
-EndScriptData */
-
-//Lotheb or Heigan?
-//8825 aggro1 - You are mine now!
-//8826 aggro2 - I see you!
-//8827 aggro3 - You...are next!
-//8828 death -
-//8829 slay - close your eyes... sleep
-//8830 taunt1 - The races of the world will perish. It is only a matter of time.
-//8831 taunt2 - I see endless suffering, I see torment, I see rage. I see... everything!
-//8832 taunt3 - Soon... the world will tremble!
-//8833 taunt4 - The end is upon you.
-//8834 taunt5 - Hungry worms will feast on your rotten flesh!
-
-#include "precompiled.h"
-
-//Spell used by floor peices to cause damage to players
-#define SPELL_ERUPTION 29371
-
-//Spells by boss
-#define SPELL_WILT 23772
-#define SPELL_FEAVER 29998
-
-//Spell by eye stalks
-#define SPELL_MIND_FLAY 26143
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Heigan
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Naxxramas
+EndScriptData */
+
+//Lotheb or Heigan?
+//8825 aggro1 - You are mine now!
+//8826 aggro2 - I see you!
+//8827 aggro3 - You...are next!
+//8828 death -
+//8829 slay - close your eyes... sleep
+//8830 taunt1 - The races of the world will perish. It is only a matter of time.
+//8831 taunt2 - I see endless suffering, I see torment, I see rage. I see... everything!
+//8832 taunt3 - Soon... the world will tremble!
+//8833 taunt4 - The end is upon you.
+//8834 taunt5 - Hungry worms will feast on your rotten flesh!
+
+#include "precompiled.h"
+
+//Spell used by floor peices to cause damage to players
+#define SPELL_ERUPTION 29371
+
+//Spells by boss
+#define SPELL_WILT 23772
+#define SPELL_FEAVER 29998
+
+//Spell by eye stalks
+#define SPELL_MIND_FLAY 26143
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp
index 671ebc80068..96d94ad51ad 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp
@@ -1,178 +1,178 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Highlord_Mograine
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//All horsemen
-#define SPELL_SHIELDWALL 29061
-#define SPELL_BESERK 26662
-
-// highlord mograine
-#define SPELL_MARK_OF_MOGRAINE 28834
-#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim()
-
-#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust."
-#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough."
-#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested."
-#define SAY_AGGRO1 "You seek death?"
-#define SAY_AGGRO2 "None shall pass!"
-#define SAY_AGGRO3 "Be still!"
-#define SAY_SLAY1 "You will find no peace in death."
-#define SAY_SLAY2 "The master's will is done."
-#define SAY_SPECIAL "Bow to the might of the Highlord!"
-#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..."
-
-#define SOUND_TAUNT1 8842
-#define SOUND_TAUNT2 8843
-#define SOUND_TAUNT3 8844
-#define SOUND_AGGRO1 8835
-#define SOUND_AGGRO2 8836
-#define SOUND_AGGRO3 8837
-#define SOUND_SLAY1 8839
-#define SOUND_SLAY2 8840
-#define SOUND_SPECIAL 8841
-#define SOUND_DEATH 8838
-
-#define SPIRIT_OF_MOGRAINE 16775
-
-struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
-{
- boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mark_Timer;
- uint32 RighteousFire_Timer;
- bool ShieldWall1;
- bool ShieldWall2;
-
- void Reset()
- {
- Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
- RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks
- ShieldWall1 = true;
- ShieldWall2 = true;
- }
-
- void InitialYell()
- {
- if(!InCombat)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
- }
- }
-
- void KilledUnit()
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- InitialYell();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Mark of Mograine
- if(Mark_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE);
- Mark_Timer = 12000;
- }else Mark_Timer -= diff;
-
- // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
- if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- {
- if(ShieldWall1)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall1 = false;
- }
- }
- if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- if(ShieldWall2)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall2 = false;
- }
- }
-
- // Righteous Fire
- if(RighteousFire_Timer < diff)
- {
- if(rand()%4 == 1) // 1/4
- {
- DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE);
- }
- RighteousFire_Timer = 2000;
- }else RighteousFire_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_highlord_mograine(Creature *_Creature)
-{
- return new boss_highlord_mograineAI (_Creature);
-}
-
-void AddSC_boss_highlord_mograine()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_highlord_mograine";
- newscript->GetAI = GetAI_boss_highlord_mograine;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Highlord_Mograine
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//All horsemen
+#define SPELL_SHIELDWALL 29061
+#define SPELL_BESERK 26662
+
+// highlord mograine
+#define SPELL_MARK_OF_MOGRAINE 28834
+#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim()
+
+#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust."
+#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough."
+#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested."
+#define SAY_AGGRO1 "You seek death?"
+#define SAY_AGGRO2 "None shall pass!"
+#define SAY_AGGRO3 "Be still!"
+#define SAY_SLAY1 "You will find no peace in death."
+#define SAY_SLAY2 "The master's will is done."
+#define SAY_SPECIAL "Bow to the might of the Highlord!"
+#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..."
+
+#define SOUND_TAUNT1 8842
+#define SOUND_TAUNT2 8843
+#define SOUND_TAUNT3 8844
+#define SOUND_AGGRO1 8835
+#define SOUND_AGGRO2 8836
+#define SOUND_AGGRO3 8837
+#define SOUND_SLAY1 8839
+#define SOUND_SLAY2 8840
+#define SOUND_SPECIAL 8841
+#define SOUND_DEATH 8838
+
+#define SPIRIT_OF_MOGRAINE 16775
+
+struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
+{
+ boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mark_Timer;
+ uint32 RighteousFire_Timer;
+ bool ShieldWall1;
+ bool ShieldWall2;
+
+ void Reset()
+ {
+ Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
+ RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks
+ ShieldWall1 = true;
+ ShieldWall2 = true;
+ }
+
+ void InitialYell()
+ {
+ if(!InCombat)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ }
+ }
+ }
+
+ void KilledUnit()
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ InitialYell();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Mark of Mograine
+ if(Mark_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE);
+ Mark_Timer = 12000;
+ }else Mark_Timer -= diff;
+
+ // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
+ if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ {
+ if(ShieldWall1)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall1 = false;
+ }
+ }
+ if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ if(ShieldWall2)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall2 = false;
+ }
+ }
+
+ // Righteous Fire
+ if(RighteousFire_Timer < diff)
+ {
+ if(rand()%4 == 1) // 1/4
+ {
+ DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE);
+ }
+ RighteousFire_Timer = 2000;
+ }else RighteousFire_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_highlord_mograine(Creature *_Creature)
+{
+ return new boss_highlord_mograineAI (_Creature);
+}
+
+void AddSC_boss_highlord_mograine()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_highlord_mograine";
+ newscript->GetAI = GetAI_boss_highlord_mograine;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
index 619f531c157..3a47f6f5c27 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
@@ -1,542 +1,542 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_KelThuzud
-SD%Complete: 0
-SDComment: VERIFY SCRIPT
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//***THIS SCRIPTS IS UNDER DEVELOPMENT***
-/*
-DATA.
-This script has been made with info taken from wowwikki... so there are things wrong...
-like spell timers and Says. Also there's another major problem as there is no aggroed list
-I cannot make Kel'thuzad to target specific party members, that is needed for spells like
-Mana Detonation... so what I'm doing untill now is just to cast everything on my main aggroed
-target. Sorry for him.
-Another bug is that there are spells that are actually NOT working... I have to implement
-them first.
-Need DISPELL efect
-I also don't know the emotes
-*/
-
-//Kel'thuzad. Still don't know where to use these...
-//Dialog
-//8878 dialog01 - Our preparations continue as planned, master.
-//8881 lich_naxx_dialog01 - It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.
-//8879 dialog02 - I see no complications... Wait... What is this?
-//8882 lich_naxx_dialog03 - Your security measures have failed! See to this interruption immediately!
-//8880 dialog03 - Yes, master!
-//Bigglesworth death
-//No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...
-//slay
-//8818
-
-//common needed defines
-#define NAXXRAMAS_MAP 533
-//Positional defines
-#define ADDX_LEFT_FAR 3783.272705
-#define ADDY_LEFT_FAR -5062.697266
-#define ADDZ_LEFT_FAR 143.711203
-#define ADDO_LEFT_FAR 3.617599
-
-#define ADDX_LEFT_MIDDLE 3730.291260
-#define ADDY_LEFT_MIDDLE -5027.239258
-#define ADDZ_LEFT_MIDDLE 143.956909
-#define ADDO_LEFT_MIDDLE 4.461900
-
-#define ADDX_LEFT_NEAR 3683.868652
-#define ADDY_LEFT_NEAR -5057.281250
-#define ADDZ_LEFT_NEAR 143.183884
-#define ADDO_LEFT_NEAR 5.237086
-
-#define ADDX_RIGHT_FAR 3759.355225
-#define ADDY_RIGHT_FAR -5174.128418
-#define ADDZ_RIGHT_FAR 143.802383
-#define ADDO_RIGHT_FAR 2.170104
-
-#define ADDX_RIGHT_MIDDLE 370.724365
-#define ADDY_RIGHT_MIDDLE -5185.123047
-#define ADDZ_RIGHT_MIDDLE 143.928024
-#define ADDO_RIGHT_MIDDLE 1.309310
-
-#define ADDX_RIGHT_NEAR 3665.121094
-#define ADDY_RIGHT_NEAR -5138.679199
-#define ADDZ_RIGHT_NEAR 143.183212
-#define ADDO_RIGHT_NEAR 0.604023
-
-#define WALKX_LEFT_FAR 3754.431396
-#define WALKY_LEFT_FAR -5080.727734
-#define WALKZ_LEFT_FAR 142.036316
-#define WALKO_LEFT_FAR 3.736189
-
-#define WALKX_LEFT_MIDDLE 3724.396484
-#define WALKY_LEFT_MIDDLE -5061.330566
-#define WALKZ_LEFT_MIDDLE 142.032700
-#define WALKO_LEFT_MIDDLE 4.564785
-
-#define WALKX_LEFT_NEAR 3687.158424
-#define WALKY_LEFT_NEAR -5076.834473
-#define WALKZ_LEFT_NEAR 142.017319
-#define WALKO_LEFT_NEAR 5.237086
-
-#define WALKX_RIGHT_FAR 3687.571777
-#define WALKY_RIGHT_FAR -5126.831055
-#define WALKZ_RIGHT_FAR 142.017807
-#define WALKO_RIGHT_FAR 0.604023
-
-#define WALKX_RIGHT_MIDDLE 3707.990733
-#define WALKY_RIGHT_MIDDLE -5151.450195
-#define WALKZ_RIGHT_MIDDLE 142.032562
-#define WALKO_RIGHT_MIDDLE 1.376855
-
-#define WALKX_RIGHT_NEAR 3739.500000
-#define WALKY_RIGHT_NEAR -5141.883989
-#define WALKZ_RIGHT_NEAR 142.0141130
-#define WALKO_RIGHT_NEAR 2.121412
-
-//spells to be casted
-#define SPELL_FROST_BOLT 28478
-#define SPELL_FROST_BOLT_NOVA 28479
-#define SPELL_CHAINS_OF_KELTHUZAD 28410
-#define SPELL_MANA_DETONATION 27819
-#define SPELL_SHADOW_FISURE 27810
-#define SPELL_FROST_BLAST 27808
-
-//On Aggro
-#define SAY_ARRIVAL1 "PRAY FOR MERCY!"
-#define SOUND_ARRIVAL1 8809
-#define SAY_ARRIVAL3 "SCREAM YOR DYING BREATH!"
-#define SOUND_ARRIVAL3 8810
-#define SAY_ARRIVAL5 "THE END IS UPON YOU!"
-#define SOUND_ARRIVAL5 8811
-
-//On Summon
-#define SAY_REINFORCEMENTS1 "MINIONS, SERVANTS, SOLDIERS OF THE COLD DARK, OBEY THE CALL OF KEL'THUZAD!"
-#define SOUND_REINFORCEMENTS1 8819
-#define SAY_REINFORCEMENTS2 "MASTER, I REQUIRE AID!"
-#define SOUND_REINFORCEMENTS2 8816
-#define SAY_LICH_NAXX_SUMMON "VERY WELL. WARRIORS OF THE FROZEN WASTES RISE UP!. I COMMAND YOU TO FIGHT, KILL AND DIE AND DIE FOR YOUR MASTER! LET NONE SURVIVE!"
-#define SOUND_LICH_NAXX_SUMMON 8824
-
-//Random 1/4 taunt said when player enters 300 yards
-#define SAY_TAUNT01 "WHO DARES VIOLATE THE SACTITY OF MY DOMAIN? BE WARNED, ALL WHO TRASPASS HERE ARE DOOMED"
-#define SOUND_TAUNT01 8820
-#define SAY_TAUNT02 "FOOLS, YOU THINK YOURSELVES TRIUMPHANT? YOU HAVE ONLY TAKEN ONE STEP CLOSER TO THE ABYSS!"
-#define SOUND_TAUNT02 8821
-#define SAY_TAUNT03 "I GROW TIRED OF THESE GAMES. PROCEED, AND I WILL BANISH YOUR SOULS TO OBLIVION!"
-#define SOUND_TAUNT03 8822
-#define SAY_TAUNT04 "YOU HAVE NO IDEA WHAT HORRORS LIE AHEAD. YOU HAVE SEEN NOTHING! THE FROZEN HEART OF NAXXRAMAS AWAITS YOU!"
-#define SOUND_TAUNT04 8823
-
-//On kill unit
-#define SAY_SLAY "THE DARK VOID AWAITS YOU!"
-#define SOUND_SLAY 8817
-
-//Specials
-#define SAY_FROST "I WILL FREEZE THE BLOOD IN YOUR VEINS!"
-#define SOUND_FROST 8815
-#define SAY_CHAIN1 "YOUR SOUL IS BOUND TO ME NOW!"
-#define SOUND_CHAIN1 8812
-#define SAY_CHAIN2 "THERE WILL BE NO ESCAPE!"
-#define SOUND_CHAIN2 8813
-#define SAY_SPECIAL1 "YOUR PETTY MAGICS ARE NO CHALLENGE TO THE MIGTH OF THE SCOURGE"
-#define SOUND_SPECIAL1 9088
-#define SAY_SPECIAL2 "ENOUGH! I GROW TIRED OF THESE DISTRACTIONS!"
-#define SOUND_SPECIAL2 9090
-#define SAY_DISPEL "FOOLS, YOU HAVE SPREAD YOUR POWERS TOO THIN. BE FREE, MY MINIONS!"
-#define SOUND_DISPEL 9089
-
-//On death
-#define SAY_DEATH "DO NOT REJOICE... YOUR VICTORY IS A HOLLOW ONE... FOR I SHALL RETURN WITH POWERS BEYOND YOUR IMAGINING!"
-#define SOUND_DEATH 8814
-
-struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
-{
- boss_kelthuzadAI(Creature* c) : ScriptedAI(c)
- {
- GuardiansOfIcecrown[0] = 0;
- GuardiansOfIcecrown[1] = 0;
- GuardiansOfIcecrown[2] = 0;
- GuardiansOfIcecrown[3] = 0;
- GuardiansOfIcecrown[4] = 0;
- GuardiansOfIcecrown_Count = 0;
- Reset();
- }
-
- uint64 GuardiansOfIcecrown[5];
- uint32 GuardiansOfIcecrown_Count;
- uint32 GuardiansOfIcecrown_Timer;
- uint32 FrostBolt_Timer;
- uint32 FrostBoltNova_Timer;
- uint32 ChainsOfKelthuzad_Timer;
- uint32 ManaDetonation_Timer;
- uint32 ShadowFisure_Timer;
- uint32 FrostBlast_Timer;
- uint32 ChainsOfKelthuzad_Targets;
- uint32 Phase1_Timer;
- bool Phase2;
- bool Phase3;
-
- void Reset()
- {
- FrostBolt_Timer = (rand()%60)*1000; //It won't be more than a minute without cast it
- FrostBoltNova_Timer = 15000; //Cast every 15 seconds
- ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; //Cast no sooner than once every 30 seconds
- ManaDetonation_Timer = 20000; //Seems to cast about every 20 seconds
- ShadowFisure_Timer = 25000; //25 seconds
- FrostBlast_Timer = (rand()%30+30)*1000; //Random time between 30-60 seconds
- GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3
-
- for(int i=0; i<5; i++)
- if(GuardiansOfIcecrown[i])
- {
- //delete creature
- Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
- if (pUnit && pUnit->isAlive())
- pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- GuardiansOfIcecrown[i] = 0;
- }
-
- Phase1_Timer = 310000; //Phase 1 lasts 5 minutes and 10 seconds
- Phase2 = false;
- Phase3 = false;
- }
-
- void KilledUnit()
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- for(int i=0; i<5; i++)
- if(GuardiansOfIcecrown[i])
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
- if (!pUnit || !pUnit->isAlive())
- continue;
-
- pUnit->CombatStop();
- float Walk_Pos_X;
- float Walk_Pos_Y;
- float Walk_Pos_Z;
- switch(rand()%6)
- {
- case 0:
- Walk_Pos_X = ADDX_LEFT_FAR;
- Walk_Pos_Y = ADDY_LEFT_FAR;
- Walk_Pos_Z = ADDZ_LEFT_FAR;
- break;
- case 1:
- Walk_Pos_X = ADDX_LEFT_MIDDLE;
- Walk_Pos_Y = ADDY_LEFT_MIDDLE;
- Walk_Pos_Z = ADDZ_LEFT_MIDDLE;
- break;
- case 2:
- Walk_Pos_X = ADDX_LEFT_NEAR;
- Walk_Pos_Y = ADDY_LEFT_NEAR;
- Walk_Pos_Z = ADDZ_LEFT_NEAR;
- break;
- case 3:
- Walk_Pos_X = ADDX_RIGHT_FAR;
- Walk_Pos_Y = ADDY_RIGHT_FAR;
- Walk_Pos_Z = ADDZ_RIGHT_FAR;
- break;
- case 4:
- Walk_Pos_X = ADDX_RIGHT_MIDDLE;
- Walk_Pos_Y = ADDY_RIGHT_MIDDLE;
- Walk_Pos_Z = ADDZ_RIGHT_MIDDLE;
- break;
- case 5:
- Walk_Pos_X = ADDX_RIGHT_NEAR;
- Walk_Pos_Y = ADDY_RIGHT_NEAR;
- Walk_Pos_Z = ADDZ_RIGHT_NEAR;
- break;
- }
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
- }
- }
-
- void SayInitialAggro() //randomly select 1 of 3 say for aggro
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_ARRIVAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL1);
- break;
- case 1:
- DoYell(SAY_ARRIVAL3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL3);
- break;
- case 2:
- DoYell(SAY_ARRIVAL5,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL5);
- break;
- }
- }
-
- void Aggro(Unit* who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_ARRIVAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL1);
- break;
- case 1:
- DoYell(SAY_ARRIVAL3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL3);
- break;
- case 2:
- DoYell(SAY_ARRIVAL5,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ARRIVAL5);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget())
- return;
-
- if(m_creature->getVictim() && m_creature->isAlive())
- {
- //Check for Frost Bolt
- if(FrostBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_BOLT);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_FROST);
- }
- //Cast again on time
- FrostBolt_Timer = (rand()%60)*1000;
- }
- else FrostBolt_Timer -= diff;
-
- //Check for Frost Bolt Nova
- if(FrostBoltNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_NOVA);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_FROST);
- }
-
- FrostBoltNova_Timer = 15000;
- }
- else FrostBoltNova_Timer -= diff;
-
- //Check for Chains Of Kelthuzad
- if(ChainsOfKelthuzad_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD);
-
- if(rand()%2 == 0)
- if(rand()%2 == 0)
- {
- DoYell(SAY_CHAIN1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_CHAIN1);
- }
- else
- {
- DoYell(SAY_CHAIN2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_CHAIN2);
- }
-
- //cast again on time
- ChainsOfKelthuzad_Timer = (rand()%30+30)*1000;
- }
- else ChainsOfKelthuzad_Timer -= diff;
-
- //Check for Mana Detonation
- if(ManaDetonation_Timer < diff)
- {
- //time to cast
- //DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPECIAL1);
- }
- ManaDetonation_Timer = 20000;
- }
- else ManaDetonation_Timer -= diff;
-
- //Check for Shadow Fissure
- if(ShadowFisure_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPECIAL2);
- }
-
- ShadowFisure_Timer = 25000;
- }
- else ShadowFisure_Timer -= diff;
-
- //Check for Frost Blast
- if(FrostBlast_Timer < diff)
- {
- //time to cast
- //DoCast(m_creature->getVictim(),SPELL_FROST_BLAST);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_FROST);
- }
-
- FrostBlast_Timer = (rand()%30+30)*1000;
- }
- else FrostBlast_Timer -= diff;
-
- //start phase 3 when we are 40% health
- if(!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40)
- {
- Phase3 = true;
- switch(rand()%2)
- {
- case 1:
- DoYell(SAY_REINFORCEMENTS1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS1);
- break;
- case 2:
- DoYell(SAY_REINFORCEMENTS2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS2);
- break;
- }
- //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.
- DoPlaySoundToSet(m_creature,SOUND_LICH_NAXX_SUMMON);
- }
-
- if(Phase3 && (GuardiansOfIcecrown_Count < 5))
- if(GuardiansOfIcecrown_Timer < diff)
- {
- //Summon a Guardian of Icecrown in a random alcove (Creature # 16441)
- //uint32 TimeToWalk;
- Unit* pUnit = NULL;
- float Walk_Pos_X;
- float Walk_Pos_Y;
- float Walk_Pos_Z;
- switch(rand()%6)
- {
- case 0:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_FAR,ADDY_LEFT_FAR,ADDZ_LEFT_FAR,ADDO_LEFT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Setting walk position
- Walk_Pos_X = WALKX_LEFT_FAR;
- Walk_Pos_Y = WALKY_LEFT_FAR;
- Walk_Pos_Z = WALKZ_LEFT_FAR;
- break;
- case 1:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_MIDDLE,ADDY_LEFT_MIDDLE,ADDZ_LEFT_MIDDLE,ADDO_LEFT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_LEFT_MIDDLE;
- Walk_Pos_Y = WALKY_LEFT_MIDDLE;
- Walk_Pos_Z = WALKZ_LEFT_MIDDLE;
- break;
- case 2:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_NEAR,ADDY_LEFT_NEAR,ADDZ_LEFT_NEAR,ADDO_LEFT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_LEFT_NEAR;
- Walk_Pos_Y = WALKY_LEFT_NEAR;
- Walk_Pos_Z = WALKZ_LEFT_NEAR;
- break;
- case 3:
-
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_FAR,ADDY_RIGHT_FAR,ADDZ_RIGHT_FAR,ADDO_RIGHT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_FAR;
- Walk_Pos_Y = WALKY_RIGHT_FAR;
- Walk_Pos_Z = WALKZ_RIGHT_FAR;
- break;
- case 4:
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_MIDDLE,ADDY_RIGHT_MIDDLE,ADDZ_RIGHT_MIDDLE,ADDO_RIGHT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_MIDDLE;
- Walk_Pos_Y = WALKY_RIGHT_MIDDLE;
- Walk_Pos_Z = WALKZ_RIGHT_MIDDLE;
- break;
- case 5:
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_NEAR,ADDY_RIGHT_NEAR,ADDZ_RIGHT_NEAR,ADDO_RIGHT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_NEAR;
- Walk_Pos_Y = WALKY_RIGHT_NEAR;
- Walk_Pos_Z = WALKZ_RIGHT_NEAR;
- break;
- }
-
- if (pUnit)
- {
- //if we find no one to figth walk to the center
- if(!pUnit->isInCombat())
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
-
- //Safe storing of creatures
- GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID();
-
- //Update guardian count
- GuardiansOfIcecrown_Count++;
-
- }
- //5 seconds until summoning next guardian
- GuardiansOfIcecrown_Timer = 5000;
- }
- else GuardiansOfIcecrown_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-CreatureAI* GetAI_boss_kelthuzadAI(Creature *_Creature)
-{
- return new boss_kelthuzadAI (_Creature);
-}
-
-void AddSC_boss_kelthuzad()
-{
- //This script is disabled until it has been throughly tested
-
- /*
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kelthuzad";
- newscript->GetAI = GetAI_boss_kelthuzadAI;
- m_scripts[nrscripts++] = newscript;
- */
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_KelThuzud
+SD%Complete: 0
+SDComment: VERIFY SCRIPT
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//***THIS SCRIPTS IS UNDER DEVELOPMENT***
+/*
+DATA.
+This script has been made with info taken from wowwikki... so there are things wrong...
+like spell timers and Says. Also there's another major problem as there is no aggroed list
+I cannot make Kel'thuzad to target specific party members, that is needed for spells like
+Mana Detonation... so what I'm doing untill now is just to cast everything on my main aggroed
+target. Sorry for him.
+Another bug is that there are spells that are actually NOT working... I have to implement
+them first.
+Need DISPELL efect
+I also don't know the emotes
+*/
+
+//Kel'thuzad. Still don't know where to use these...
+//Dialog
+//8878 dialog01 - Our preparations continue as planned, master.
+//8881 lich_naxx_dialog01 - It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.
+//8879 dialog02 - I see no complications... Wait... What is this?
+//8882 lich_naxx_dialog03 - Your security measures have failed! See to this interruption immediately!
+//8880 dialog03 - Yes, master!
+//Bigglesworth death
+//No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...
+//slay
+//8818
+
+//common needed defines
+#define NAXXRAMAS_MAP 533
+//Positional defines
+#define ADDX_LEFT_FAR 3783.272705
+#define ADDY_LEFT_FAR -5062.697266
+#define ADDZ_LEFT_FAR 143.711203
+#define ADDO_LEFT_FAR 3.617599
+
+#define ADDX_LEFT_MIDDLE 3730.291260
+#define ADDY_LEFT_MIDDLE -5027.239258
+#define ADDZ_LEFT_MIDDLE 143.956909
+#define ADDO_LEFT_MIDDLE 4.461900
+
+#define ADDX_LEFT_NEAR 3683.868652
+#define ADDY_LEFT_NEAR -5057.281250
+#define ADDZ_LEFT_NEAR 143.183884
+#define ADDO_LEFT_NEAR 5.237086
+
+#define ADDX_RIGHT_FAR 3759.355225
+#define ADDY_RIGHT_FAR -5174.128418
+#define ADDZ_RIGHT_FAR 143.802383
+#define ADDO_RIGHT_FAR 2.170104
+
+#define ADDX_RIGHT_MIDDLE 370.724365
+#define ADDY_RIGHT_MIDDLE -5185.123047
+#define ADDZ_RIGHT_MIDDLE 143.928024
+#define ADDO_RIGHT_MIDDLE 1.309310
+
+#define ADDX_RIGHT_NEAR 3665.121094
+#define ADDY_RIGHT_NEAR -5138.679199
+#define ADDZ_RIGHT_NEAR 143.183212
+#define ADDO_RIGHT_NEAR 0.604023
+
+#define WALKX_LEFT_FAR 3754.431396
+#define WALKY_LEFT_FAR -5080.727734
+#define WALKZ_LEFT_FAR 142.036316
+#define WALKO_LEFT_FAR 3.736189
+
+#define WALKX_LEFT_MIDDLE 3724.396484
+#define WALKY_LEFT_MIDDLE -5061.330566
+#define WALKZ_LEFT_MIDDLE 142.032700
+#define WALKO_LEFT_MIDDLE 4.564785
+
+#define WALKX_LEFT_NEAR 3687.158424
+#define WALKY_LEFT_NEAR -5076.834473
+#define WALKZ_LEFT_NEAR 142.017319
+#define WALKO_LEFT_NEAR 5.237086
+
+#define WALKX_RIGHT_FAR 3687.571777
+#define WALKY_RIGHT_FAR -5126.831055
+#define WALKZ_RIGHT_FAR 142.017807
+#define WALKO_RIGHT_FAR 0.604023
+
+#define WALKX_RIGHT_MIDDLE 3707.990733
+#define WALKY_RIGHT_MIDDLE -5151.450195
+#define WALKZ_RIGHT_MIDDLE 142.032562
+#define WALKO_RIGHT_MIDDLE 1.376855
+
+#define WALKX_RIGHT_NEAR 3739.500000
+#define WALKY_RIGHT_NEAR -5141.883989
+#define WALKZ_RIGHT_NEAR 142.0141130
+#define WALKO_RIGHT_NEAR 2.121412
+
+//spells to be casted
+#define SPELL_FROST_BOLT 28478
+#define SPELL_FROST_BOLT_NOVA 28479
+#define SPELL_CHAINS_OF_KELTHUZAD 28410
+#define SPELL_MANA_DETONATION 27819
+#define SPELL_SHADOW_FISURE 27810
+#define SPELL_FROST_BLAST 27808
+
+//On Aggro
+#define SAY_ARRIVAL1 "PRAY FOR MERCY!"
+#define SOUND_ARRIVAL1 8809
+#define SAY_ARRIVAL3 "SCREAM YOR DYING BREATH!"
+#define SOUND_ARRIVAL3 8810
+#define SAY_ARRIVAL5 "THE END IS UPON YOU!"
+#define SOUND_ARRIVAL5 8811
+
+//On Summon
+#define SAY_REINFORCEMENTS1 "MINIONS, SERVANTS, SOLDIERS OF THE COLD DARK, OBEY THE CALL OF KEL'THUZAD!"
+#define SOUND_REINFORCEMENTS1 8819
+#define SAY_REINFORCEMENTS2 "MASTER, I REQUIRE AID!"
+#define SOUND_REINFORCEMENTS2 8816
+#define SAY_LICH_NAXX_SUMMON "VERY WELL. WARRIORS OF THE FROZEN WASTES RISE UP!. I COMMAND YOU TO FIGHT, KILL AND DIE AND DIE FOR YOUR MASTER! LET NONE SURVIVE!"
+#define SOUND_LICH_NAXX_SUMMON 8824
+
+//Random 1/4 taunt said when player enters 300 yards
+#define SAY_TAUNT01 "WHO DARES VIOLATE THE SACTITY OF MY DOMAIN? BE WARNED, ALL WHO TRASPASS HERE ARE DOOMED"
+#define SOUND_TAUNT01 8820
+#define SAY_TAUNT02 "FOOLS, YOU THINK YOURSELVES TRIUMPHANT? YOU HAVE ONLY TAKEN ONE STEP CLOSER TO THE ABYSS!"
+#define SOUND_TAUNT02 8821
+#define SAY_TAUNT03 "I GROW TIRED OF THESE GAMES. PROCEED, AND I WILL BANISH YOUR SOULS TO OBLIVION!"
+#define SOUND_TAUNT03 8822
+#define SAY_TAUNT04 "YOU HAVE NO IDEA WHAT HORRORS LIE AHEAD. YOU HAVE SEEN NOTHING! THE FROZEN HEART OF NAXXRAMAS AWAITS YOU!"
+#define SOUND_TAUNT04 8823
+
+//On kill unit
+#define SAY_SLAY "THE DARK VOID AWAITS YOU!"
+#define SOUND_SLAY 8817
+
+//Specials
+#define SAY_FROST "I WILL FREEZE THE BLOOD IN YOUR VEINS!"
+#define SOUND_FROST 8815
+#define SAY_CHAIN1 "YOUR SOUL IS BOUND TO ME NOW!"
+#define SOUND_CHAIN1 8812
+#define SAY_CHAIN2 "THERE WILL BE NO ESCAPE!"
+#define SOUND_CHAIN2 8813
+#define SAY_SPECIAL1 "YOUR PETTY MAGICS ARE NO CHALLENGE TO THE MIGTH OF THE SCOURGE"
+#define SOUND_SPECIAL1 9088
+#define SAY_SPECIAL2 "ENOUGH! I GROW TIRED OF THESE DISTRACTIONS!"
+#define SOUND_SPECIAL2 9090
+#define SAY_DISPEL "FOOLS, YOU HAVE SPREAD YOUR POWERS TOO THIN. BE FREE, MY MINIONS!"
+#define SOUND_DISPEL 9089
+
+//On death
+#define SAY_DEATH "DO NOT REJOICE... YOUR VICTORY IS A HOLLOW ONE... FOR I SHALL RETURN WITH POWERS BEYOND YOUR IMAGINING!"
+#define SOUND_DEATH 8814
+
+struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
+{
+ boss_kelthuzadAI(Creature* c) : ScriptedAI(c)
+ {
+ GuardiansOfIcecrown[0] = 0;
+ GuardiansOfIcecrown[1] = 0;
+ GuardiansOfIcecrown[2] = 0;
+ GuardiansOfIcecrown[3] = 0;
+ GuardiansOfIcecrown[4] = 0;
+ GuardiansOfIcecrown_Count = 0;
+ Reset();
+ }
+
+ uint64 GuardiansOfIcecrown[5];
+ uint32 GuardiansOfIcecrown_Count;
+ uint32 GuardiansOfIcecrown_Timer;
+ uint32 FrostBolt_Timer;
+ uint32 FrostBoltNova_Timer;
+ uint32 ChainsOfKelthuzad_Timer;
+ uint32 ManaDetonation_Timer;
+ uint32 ShadowFisure_Timer;
+ uint32 FrostBlast_Timer;
+ uint32 ChainsOfKelthuzad_Targets;
+ uint32 Phase1_Timer;
+ bool Phase2;
+ bool Phase3;
+
+ void Reset()
+ {
+ FrostBolt_Timer = (rand()%60)*1000; //It won't be more than a minute without cast it
+ FrostBoltNova_Timer = 15000; //Cast every 15 seconds
+ ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; //Cast no sooner than once every 30 seconds
+ ManaDetonation_Timer = 20000; //Seems to cast about every 20 seconds
+ ShadowFisure_Timer = 25000; //25 seconds
+ FrostBlast_Timer = (rand()%30+30)*1000; //Random time between 30-60 seconds
+ GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3
+
+ for(int i=0; i<5; i++)
+ if(GuardiansOfIcecrown[i])
+ {
+ //delete creature
+ Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
+ if (pUnit && pUnit->isAlive())
+ pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ GuardiansOfIcecrown[i] = 0;
+ }
+
+ Phase1_Timer = 310000; //Phase 1 lasts 5 minutes and 10 seconds
+ Phase2 = false;
+ Phase3 = false;
+ }
+
+ void KilledUnit()
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ for(int i=0; i<5; i++)
+ if(GuardiansOfIcecrown[i])
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
+ if (!pUnit || !pUnit->isAlive())
+ continue;
+
+ pUnit->CombatStop();
+ float Walk_Pos_X;
+ float Walk_Pos_Y;
+ float Walk_Pos_Z;
+ switch(rand()%6)
+ {
+ case 0:
+ Walk_Pos_X = ADDX_LEFT_FAR;
+ Walk_Pos_Y = ADDY_LEFT_FAR;
+ Walk_Pos_Z = ADDZ_LEFT_FAR;
+ break;
+ case 1:
+ Walk_Pos_X = ADDX_LEFT_MIDDLE;
+ Walk_Pos_Y = ADDY_LEFT_MIDDLE;
+ Walk_Pos_Z = ADDZ_LEFT_MIDDLE;
+ break;
+ case 2:
+ Walk_Pos_X = ADDX_LEFT_NEAR;
+ Walk_Pos_Y = ADDY_LEFT_NEAR;
+ Walk_Pos_Z = ADDZ_LEFT_NEAR;
+ break;
+ case 3:
+ Walk_Pos_X = ADDX_RIGHT_FAR;
+ Walk_Pos_Y = ADDY_RIGHT_FAR;
+ Walk_Pos_Z = ADDZ_RIGHT_FAR;
+ break;
+ case 4:
+ Walk_Pos_X = ADDX_RIGHT_MIDDLE;
+ Walk_Pos_Y = ADDY_RIGHT_MIDDLE;
+ Walk_Pos_Z = ADDZ_RIGHT_MIDDLE;
+ break;
+ case 5:
+ Walk_Pos_X = ADDX_RIGHT_NEAR;
+ Walk_Pos_Y = ADDY_RIGHT_NEAR;
+ Walk_Pos_Z = ADDZ_RIGHT_NEAR;
+ break;
+ }
+ pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
+ }
+ }
+
+ void SayInitialAggro() //randomly select 1 of 3 say for aggro
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_ARRIVAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL1);
+ break;
+ case 1:
+ DoYell(SAY_ARRIVAL3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL3);
+ break;
+ case 2:
+ DoYell(SAY_ARRIVAL5,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL5);
+ break;
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_ARRIVAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL1);
+ break;
+ case 1:
+ DoYell(SAY_ARRIVAL3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL3);
+ break;
+ case 2:
+ DoYell(SAY_ARRIVAL5,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ARRIVAL5);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget())
+ return;
+
+ if(m_creature->getVictim() && m_creature->isAlive())
+ {
+ //Check for Frost Bolt
+ if(FrostBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROST_BOLT);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_FROST);
+ }
+ //Cast again on time
+ FrostBolt_Timer = (rand()%60)*1000;
+ }
+ else FrostBolt_Timer -= diff;
+
+ //Check for Frost Bolt Nova
+ if(FrostBoltNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_NOVA);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_FROST);
+ }
+
+ FrostBoltNova_Timer = 15000;
+ }
+ else FrostBoltNova_Timer -= diff;
+
+ //Check for Chains Of Kelthuzad
+ if(ChainsOfKelthuzad_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD);
+
+ if(rand()%2 == 0)
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_CHAIN1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_CHAIN1);
+ }
+ else
+ {
+ DoYell(SAY_CHAIN2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_CHAIN2);
+ }
+
+ //cast again on time
+ ChainsOfKelthuzad_Timer = (rand()%30+30)*1000;
+ }
+ else ChainsOfKelthuzad_Timer -= diff;
+
+ //Check for Mana Detonation
+ if(ManaDetonation_Timer < diff)
+ {
+ //time to cast
+ //DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPECIAL1);
+ }
+ ManaDetonation_Timer = 20000;
+ }
+ else ManaDetonation_Timer -= diff;
+
+ //Check for Shadow Fissure
+ if(ShadowFisure_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPECIAL2);
+ }
+
+ ShadowFisure_Timer = 25000;
+ }
+ else ShadowFisure_Timer -= diff;
+
+ //Check for Frost Blast
+ if(FrostBlast_Timer < diff)
+ {
+ //time to cast
+ //DoCast(m_creature->getVictim(),SPELL_FROST_BLAST);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_FROST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_FROST);
+ }
+
+ FrostBlast_Timer = (rand()%30+30)*1000;
+ }
+ else FrostBlast_Timer -= diff;
+
+ //start phase 3 when we are 40% health
+ if(!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40)
+ {
+ Phase3 = true;
+ switch(rand()%2)
+ {
+ case 1:
+ DoYell(SAY_REINFORCEMENTS1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS1);
+ break;
+ case 2:
+ DoYell(SAY_REINFORCEMENTS2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_REINFORCEMENTS2);
+ break;
+ }
+ //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.
+ DoPlaySoundToSet(m_creature,SOUND_LICH_NAXX_SUMMON);
+ }
+
+ if(Phase3 && (GuardiansOfIcecrown_Count < 5))
+ if(GuardiansOfIcecrown_Timer < diff)
+ {
+ //Summon a Guardian of Icecrown in a random alcove (Creature # 16441)
+ //uint32 TimeToWalk;
+ Unit* pUnit = NULL;
+ float Walk_Pos_X;
+ float Walk_Pos_Y;
+ float Walk_Pos_Z;
+ switch(rand()%6)
+ {
+ case 0:
+ pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_FAR,ADDY_LEFT_FAR,ADDZ_LEFT_FAR,ADDO_LEFT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Setting walk position
+ Walk_Pos_X = WALKX_LEFT_FAR;
+ Walk_Pos_Y = WALKY_LEFT_FAR;
+ Walk_Pos_Z = WALKZ_LEFT_FAR;
+ break;
+ case 1:
+ pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_MIDDLE,ADDY_LEFT_MIDDLE,ADDZ_LEFT_MIDDLE,ADDO_LEFT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Start moving guardian towards the center of the room
+ Walk_Pos_X = WALKX_LEFT_MIDDLE;
+ Walk_Pos_Y = WALKY_LEFT_MIDDLE;
+ Walk_Pos_Z = WALKZ_LEFT_MIDDLE;
+ break;
+ case 2:
+ pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_NEAR,ADDY_LEFT_NEAR,ADDZ_LEFT_NEAR,ADDO_LEFT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Start moving guardian towards the center of the room
+ Walk_Pos_X = WALKX_LEFT_NEAR;
+ Walk_Pos_Y = WALKY_LEFT_NEAR;
+ Walk_Pos_Z = WALKZ_LEFT_NEAR;
+ break;
+ case 3:
+
+ pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_FAR,ADDY_RIGHT_FAR,ADDZ_RIGHT_FAR,ADDO_RIGHT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Start moving guardian towards the center of the room
+ Walk_Pos_X = WALKX_RIGHT_FAR;
+ Walk_Pos_Y = WALKY_RIGHT_FAR;
+ Walk_Pos_Z = WALKZ_RIGHT_FAR;
+ break;
+ case 4:
+ pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_MIDDLE,ADDY_RIGHT_MIDDLE,ADDZ_RIGHT_MIDDLE,ADDO_RIGHT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Start moving guardian towards the center of the room
+ Walk_Pos_X = WALKX_RIGHT_MIDDLE;
+ Walk_Pos_Y = WALKY_RIGHT_MIDDLE;
+ Walk_Pos_Z = WALKZ_RIGHT_MIDDLE;
+ break;
+ case 5:
+ pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_NEAR,ADDY_RIGHT_NEAR,ADDZ_RIGHT_NEAR,ADDO_RIGHT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ //Start moving guardian towards the center of the room
+ Walk_Pos_X = WALKX_RIGHT_NEAR;
+ Walk_Pos_Y = WALKY_RIGHT_NEAR;
+ Walk_Pos_Z = WALKZ_RIGHT_NEAR;
+ break;
+ }
+
+ if (pUnit)
+ {
+ //if we find no one to figth walk to the center
+ if(!pUnit->isInCombat())
+ pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
+
+ //Safe storing of creatures
+ GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID();
+
+ //Update guardian count
+ GuardiansOfIcecrown_Count++;
+
+ }
+ //5 seconds until summoning next guardian
+ GuardiansOfIcecrown_Timer = 5000;
+ }
+ else GuardiansOfIcecrown_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_kelthuzadAI(Creature *_Creature)
+{
+ return new boss_kelthuzadAI (_Creature);
+}
+
+void AddSC_boss_kelthuzad()
+{
+ //This script is disabled until it has been throughly tested
+
+ /*
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kelthuzad";
+ newscript->GetAI = GetAI_boss_kelthuzadAI;
+ m_scripts[nrscripts++] = newscript;
+ */
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_lady_blaumeux.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_lady_blaumeux.cpp
index 98102aaa120..ee3b47e478d 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_lady_blaumeux.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_lady_blaumeux.cpp
@@ -1,147 +1,147 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Lady_Blaumeux
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//All horsemen
-#define SPELL_SHIELDWALL 29061
-#define SPELL_BESERK 26662
-
-// lady blaumeux
-#define SPELL_MARK_OF_BLAUMEUX 28833
-#define SPELL_VOIDZONE 28863
-
-#define SAY_AGGRO "Defend youself!"
-#define SAY_TAUNT1 "Come, Zeliek, do not drive them out. Not before we've had our fun."
-#define SAY_TAUNT2 "I do hope they stay alive long enough for me to... introduce myself."
-#define SAY_TAUNT3 "The first kill goes to me! Anyone care to wager?"
-#define SAY_SPECIAL "Your life is mine!"
-#define SAY_SLAY "Who's next?"
-#define SAY_DEATH "Tou... che!"
-
-#define SOUND_AGGRO 8892
-#define SOUND_TAUNT1 8896
-#define SOUND_TAUNT2 8897
-#define SOUND_TAUNT3 8898
-#define SOUND_SPECIAL 8895
-#define SOUND_SLAY 8894
-#define SOUND_DEATH 8893
-
-#define SPIRIT_OF_BLAUMEUX 16776
-
-struct TRINITY_DLL_DECL boss_lady_blaumeuxAI : public ScriptedAI
-{
- boss_lady_blaumeuxAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mark_Timer;
- uint32 VoidZone_Timer;
- bool ShieldWall1;
- bool ShieldWall2;
-
- void Reset()
- {
- Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
- VoidZone_Timer = 12000; // right
- ShieldWall1 = true;
- ShieldWall2 = true;
- }
-
- void InitialYell()
- {
- if(!InCombat)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
- }
-
- void KilledUnit()
- {
- DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- InitialYell();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Mark of Blaumeux
- if(Mark_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MARK_OF_BLAUMEUX);
- Mark_Timer = 12000;
- }else Mark_Timer -= diff;
-
- // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
- if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- {
- if(ShieldWall1)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall1 = false;
- }
- }
- if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- if(ShieldWall2)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall2 = false;
- }
- }
-
- // Void Zone
- if(VoidZone_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VOIDZONE);
- VoidZone_Timer = 12000;
- }else VoidZone_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_lady_blaumeux(Creature *_Creature)
-{
- return new boss_lady_blaumeuxAI (_Creature);
-}
-
-void AddSC_boss_lady_blaumeux()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_lady_blaumeux";
- newscript->GetAI = GetAI_boss_lady_blaumeux;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Lady_Blaumeux
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//All horsemen
+#define SPELL_SHIELDWALL 29061
+#define SPELL_BESERK 26662
+
+// lady blaumeux
+#define SPELL_MARK_OF_BLAUMEUX 28833
+#define SPELL_VOIDZONE 28863
+
+#define SAY_AGGRO "Defend youself!"
+#define SAY_TAUNT1 "Come, Zeliek, do not drive them out. Not before we've had our fun."
+#define SAY_TAUNT2 "I do hope they stay alive long enough for me to... introduce myself."
+#define SAY_TAUNT3 "The first kill goes to me! Anyone care to wager?"
+#define SAY_SPECIAL "Your life is mine!"
+#define SAY_SLAY "Who's next?"
+#define SAY_DEATH "Tou... che!"
+
+#define SOUND_AGGRO 8892
+#define SOUND_TAUNT1 8896
+#define SOUND_TAUNT2 8897
+#define SOUND_TAUNT3 8898
+#define SOUND_SPECIAL 8895
+#define SOUND_SLAY 8894
+#define SOUND_DEATH 8893
+
+#define SPIRIT_OF_BLAUMEUX 16776
+
+struct TRINITY_DLL_DECL boss_lady_blaumeuxAI : public ScriptedAI
+{
+ boss_lady_blaumeuxAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mark_Timer;
+ uint32 VoidZone_Timer;
+ bool ShieldWall1;
+ bool ShieldWall2;
+
+ void Reset()
+ {
+ Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
+ VoidZone_Timer = 12000; // right
+ ShieldWall1 = true;
+ ShieldWall2 = true;
+ }
+
+ void InitialYell()
+ {
+ if(!InCombat)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+ }
+
+ void KilledUnit()
+ {
+ DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ InitialYell();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Mark of Blaumeux
+ if(Mark_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MARK_OF_BLAUMEUX);
+ Mark_Timer = 12000;
+ }else Mark_Timer -= diff;
+
+ // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
+ if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ {
+ if(ShieldWall1)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall1 = false;
+ }
+ }
+ if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ if(ShieldWall2)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall2 = false;
+ }
+ }
+
+ // Void Zone
+ if(VoidZone_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOIDZONE);
+ VoidZone_Timer = 12000;
+ }else VoidZone_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_lady_blaumeux(Creature *_Creature)
+{
+ return new boss_lady_blaumeuxAI (_Creature);
+}
+
+void AddSC_boss_lady_blaumeux()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_lady_blaumeux";
+ newscript->GetAI = GetAI_boss_lady_blaumeux;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
index ceff0d8bfe9..56fe786e6c8 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
@@ -1,216 +1,216 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Loatheb
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO1 "You are mine now!"
-#define SAY_AGGRO2 "I see you!"
-#define SAY_AGGRO3 "You...are next!"
-#define SAY_SLAY1 "Close your eyes... sleep!"
-#define SAY_SLAY2 "The races of the world will perish. It is only a matter of time."
-#define SAY_SLAY3 "I see endless suffering, I see torment, I see rage. I see... everything!"
-#define SAY_SLAY4 "Soon... the world will tremble!"
-#define SAY_SLAY5 "The end is upon you."
-#define SAY_SLAY6 "Hungry worms will feast on your rotten flesh!"
-#define SAY_DEATH ""
-
-#define SOUND_AGGRO1 8825
-#define SOUND_AGGRO2 8826
-#define SOUND_AGGRO3 8827
-#define SOUND_SLAY1 8829
-#define SOUND_SLAY2 8830
-#define SOUND_SLAY3 8831
-#define SOUND_SLAY4 8832
-#define SOUND_SLAY5 8833
-#define SOUND_SLAY6 8834
-#define SOUND_DEATH 8828
-
-#define SPELL_CORRUPTED_MIND 29198
-#define SPELL_POISON_AURA 29865
-#define SPELL_INEVITABLE_DOOM 29204
-#define SPELL_REMOVE_CURSE 30281
-
-#define ADD_1X 2957.040
-#define ADD_1Y -3997.590
-#define ADD_1Z 274.280
-
-#define ADD_2X 2909.130
-#define ADD_2Y -4042.970
-#define ADD_2Z 274.280
-
-#define ADD_3X 2861.102
-#define ADD_3Y -3997.901
-#define ADD_3Z 274.280
-
-struct TRINITY_DLL_DECL boss_loathebAI : public ScriptedAI
-{
- boss_loathebAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CorruptedMind_Timer;
- uint32 PoisonAura_Timer;
- uint32 InevitableDoom_Timer;
- uint32 InevitableDoom5mins_Timer;
- uint32 RemoveCurse_Timer;
- uint32 Summon_Timer;
-
- void Reset()
- {
- CorruptedMind_Timer = 4000;
- PoisonAura_Timer = 2500;
- InevitableDoom_Timer = 120000;
- InevitableDoom5mins_Timer = 300000;
- RemoveCurse_Timer = 30000;
- Summon_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch (rand()%6)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY3);
- break;
- case 3:
- DoYell(SAY_SLAY4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY4);
- break;
- case 4:
- DoYell(SAY_SLAY5,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY5);
- break;
- case 5:
- DoYell(SAY_SLAY6,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY6);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //CorruptedMind_Timer
- if (CorruptedMind_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTED_MIND);
- CorruptedMind_Timer = 62000;
- }else CorruptedMind_Timer -= diff;
-
- //PoisonAura_Timer
- if (PoisonAura_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POISON_AURA);
- PoisonAura_Timer = 60000;
- }else PoisonAura_Timer -= diff;
-
- //InevitableDoom_Timer
- if (InevitableDoom_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
- InevitableDoom_Timer = 120000;
- }else InevitableDoom_Timer -= diff;
-
- //InevitableDoom5mins_Timer
- if (InevitableDoom5mins_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
- InevitableDoom5mins_Timer = 15000;
- }else InevitableDoom5mins_Timer -= diff;
-
- //RemoveCurse_Timer
- if (RemoveCurse_Timer < diff)
- {
- DoCast(m_creature,SPELL_REMOVE_CURSE);
- RemoveCurse_Timer = 30000;
- }else RemoveCurse_Timer -= diff;
-
- //Summon_Timer
- if (Summon_Timer < diff)
- {
- Unit* target = NULL;
- Unit* SummonedSpores = NULL;
-
- SummonedSpores = m_creature->SummonCreature(16286,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSpores = m_creature->SummonCreature(16286,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSpores = m_creature->SummonCreature(16286,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- if (SummonedSpores)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- SummonedSpores->AddThreat(target,1.0f);
- }
-
- Summon_Timer = 28000;
- } else Summon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_loatheb(Creature *_Creature)
-{
- return new boss_loathebAI (_Creature);
-}
-
-void AddSC_boss_loatheb()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_loatheb";
- newscript->GetAI = GetAI_boss_loatheb;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Loatheb
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO1 "You are mine now!"
+#define SAY_AGGRO2 "I see you!"
+#define SAY_AGGRO3 "You...are next!"
+#define SAY_SLAY1 "Close your eyes... sleep!"
+#define SAY_SLAY2 "The races of the world will perish. It is only a matter of time."
+#define SAY_SLAY3 "I see endless suffering, I see torment, I see rage. I see... everything!"
+#define SAY_SLAY4 "Soon... the world will tremble!"
+#define SAY_SLAY5 "The end is upon you."
+#define SAY_SLAY6 "Hungry worms will feast on your rotten flesh!"
+#define SAY_DEATH ""
+
+#define SOUND_AGGRO1 8825
+#define SOUND_AGGRO2 8826
+#define SOUND_AGGRO3 8827
+#define SOUND_SLAY1 8829
+#define SOUND_SLAY2 8830
+#define SOUND_SLAY3 8831
+#define SOUND_SLAY4 8832
+#define SOUND_SLAY5 8833
+#define SOUND_SLAY6 8834
+#define SOUND_DEATH 8828
+
+#define SPELL_CORRUPTED_MIND 29198
+#define SPELL_POISON_AURA 29865
+#define SPELL_INEVITABLE_DOOM 29204
+#define SPELL_REMOVE_CURSE 30281
+
+#define ADD_1X 2957.040
+#define ADD_1Y -3997.590
+#define ADD_1Z 274.280
+
+#define ADD_2X 2909.130
+#define ADD_2Y -4042.970
+#define ADD_2Z 274.280
+
+#define ADD_3X 2861.102
+#define ADD_3Y -3997.901
+#define ADD_3Z 274.280
+
+struct TRINITY_DLL_DECL boss_loathebAI : public ScriptedAI
+{
+ boss_loathebAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CorruptedMind_Timer;
+ uint32 PoisonAura_Timer;
+ uint32 InevitableDoom_Timer;
+ uint32 InevitableDoom5mins_Timer;
+ uint32 RemoveCurse_Timer;
+ uint32 Summon_Timer;
+
+ void Reset()
+ {
+ CorruptedMind_Timer = 4000;
+ PoisonAura_Timer = 2500;
+ InevitableDoom_Timer = 120000;
+ InevitableDoom5mins_Timer = 300000;
+ RemoveCurse_Timer = 30000;
+ Summon_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch (rand()%6)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY3);
+ break;
+ case 3:
+ DoYell(SAY_SLAY4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY4);
+ break;
+ case 4:
+ DoYell(SAY_SLAY5,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY5);
+ break;
+ case 5:
+ DoYell(SAY_SLAY6,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY6);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //CorruptedMind_Timer
+ if (CorruptedMind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTED_MIND);
+ CorruptedMind_Timer = 62000;
+ }else CorruptedMind_Timer -= diff;
+
+ //PoisonAura_Timer
+ if (PoisonAura_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POISON_AURA);
+ PoisonAura_Timer = 60000;
+ }else PoisonAura_Timer -= diff;
+
+ //InevitableDoom_Timer
+ if (InevitableDoom_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
+ InevitableDoom_Timer = 120000;
+ }else InevitableDoom_Timer -= diff;
+
+ //InevitableDoom5mins_Timer
+ if (InevitableDoom5mins_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
+ InevitableDoom5mins_Timer = 15000;
+ }else InevitableDoom5mins_Timer -= diff;
+
+ //RemoveCurse_Timer
+ if (RemoveCurse_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_REMOVE_CURSE);
+ RemoveCurse_Timer = 30000;
+ }else RemoveCurse_Timer -= diff;
+
+ //Summon_Timer
+ if (Summon_Timer < diff)
+ {
+ Unit* target = NULL;
+ Unit* SummonedSpores = NULL;
+
+ SummonedSpores = m_creature->SummonCreature(16286,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSpores = m_creature->SummonCreature(16286,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSpores = m_creature->SummonCreature(16286,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ if (SummonedSpores)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ SummonedSpores->AddThreat(target,1.0f);
+ }
+
+ Summon_Timer = 28000;
+ } else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_loatheb(Creature *_Creature)
+{
+ return new boss_loathebAI (_Creature);
+}
+
+void AddSC_boss_loatheb()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_loatheb";
+ newscript->GetAI = GetAI_boss_loatheb;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
index 8196fff8049..4c65feb9c7b 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
@@ -1,246 +1,246 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Maexxna
-SD%Complete: 80
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WEBTRAP 28622 //Spell is normally used by the webtrap on the wall NOT by Maexxna
-#define SPELL_WEBSPRAY 29484
-#define SPELL_POISONSHOCK 28741
-#define SPELL_NECROTICPOISON 28776
-#define SPELL_ENRAGE 28747
-#define SPELL_SUMMON_SPIDERLING 29434
-
-#define LOC_X1 3546.796
-#define LOC_Y1 -3869.082
-#define LOC_Z1 296.450
-
-#define LOC_X2 3531.271
-#define LOC_Y2 -3847.424
-#define LOC_Z2 299.450
-
-#define LOC_X3 3497.067
-#define LOC_Y3 -3843.384
-#define LOC_Z3 302.384
-
-struct TRINITY_DLL_DECL mob_webwrapAI : public ScriptedAI
-{
- mob_webwrapAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 victimGUID;
-
- void Reset()
- {
- victimGUID = 0;
- }
-
- void SetVictim(Unit* victim)
- {
- if(victim)
- {
- victimGUID = victim->GetGUID();
- victim->CastSpell(victim, SPELL_WEBTRAP, true);
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth())
- {
- if(victimGUID)
- {
- Unit* victim = NULL;
- victim = Unit::GetUnit((*m_creature), victimGUID);
- victim->RemoveAurasDueToSpell(SPELL_WEBTRAP);
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- }
-};
-
-struct TRINITY_DLL_DECL boss_maexxnaAI : public ScriptedAI
-{
- boss_maexxnaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WebTrap_Timer;
- uint32 WebSpray_Timer;
- uint32 PoisonShock_Timer;
- uint32 NecroticPoison_Timer;
- uint32 SummonSpiderling_Timer;
- bool Enraged;
-
- void Reset()
- {
- WebTrap_Timer = 20000; //20 sec init, 40 sec normal
- WebSpray_Timer = 40000; //40 seconds
- PoisonShock_Timer = 20000; //20 seconds
- NecroticPoison_Timer = 30000; //30 seconds
- SummonSpiderling_Timer = 30000; //30 sec init, 40 sec normal
- Enraged = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void DoCastWebWrap()
- {
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- std::vector<Unit *> targets;
-
- //This spell doesn't work if we only have 1 player on threat list
- if(t_list.size() < 2)
- return;
-
- //begin + 1 , so we don't target the one with the highest threat
- std::list<HostilReference *>::iterator itr = t_list.begin();
- std::advance(itr, 1);
- for( ; itr!= t_list.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //only on alive players
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
- targets.push_back( target);
- }
-
- while(targets.size() > 3)
- //cut down to size if we have more than 3 targets
- targets.erase(targets.begin()+rand()%targets.size());
-
- int i = 0;
- for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i)
- {
- // Teleport the 3 targets to a location on the wall and summon a Web Wrap on them
- Unit *target = *itr;
- Creature* Wrap = NULL;
- if(target)
- {
- switch(i)
- {
- case 0:
- DoTeleportPlayer(target, LOC_X1, LOC_Y1, LOC_Z1, target->GetOrientation());
- Wrap = m_creature->SummonCreature(16486, LOC_X1, LOC_Y1, LOC_Z1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- break;
- case 1:
- DoTeleportPlayer(target, LOC_X2, LOC_Y2, LOC_Z2, target->GetOrientation());
- Wrap = m_creature->SummonCreature(16486, LOC_X2, LOC_Y2, LOC_Z2, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- break;
- case 2:
- DoTeleportPlayer(target, LOC_X3, LOC_Y3, LOC_Z3, target->GetOrientation());
- Wrap = m_creature->SummonCreature(16486, LOC_X3, LOC_Y3, LOC_Z3, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- break;
- }
- if(Wrap)
- {
- Wrap->setFaction(m_creature->getFaction());
- ((mob_webwrapAI*)Wrap->AI())->SetVictim(target);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //WebTrap_Timer
- if (WebTrap_Timer < diff)
- {
- DoCastWebWrap();
- WebTrap_Timer = 40000;
- }else WebTrap_Timer -= diff;
-
- //WebSpray_Timer
- if (WebSpray_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WEBSPRAY);
- WebSpray_Timer = 40000;
- }else WebSpray_Timer -= diff;
-
- //PoisonShock_Timer
- if (PoisonShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_POISONSHOCK);
- PoisonShock_Timer = 20000;
- }else PoisonShock_Timer -= diff;
-
- //NecroticPoison_Timer
- if (NecroticPoison_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_NECROTICPOISON);
- NecroticPoison_Timer = 30000;
- }else NecroticPoison_Timer -= diff;
-
- //SummonSpiderling_Timer
- if (SummonSpiderling_Timer < diff)
- {
- DoCast(m_creature, SPELL_SUMMON_SPIDERLING);
- SummonSpiderling_Timer = 40000;
- }else SummonSpiderling_Timer -= diff;
-
- //Enrage if not already enraged and below 30%
- if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_webwrap(Creature* _Creature)
-{
- return new mob_webwrapAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_maexxna(Creature *_Creature)
-{
- return new boss_maexxnaAI (_Creature);
-}
-
-void AddSC_boss_maexxna()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_maexxna";
- newscript->GetAI = GetAI_boss_maexxna;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_webwrap";
- newscript->GetAI = GetAI_mob_webwrap;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Maexxna
+SD%Complete: 80
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WEBTRAP 28622 //Spell is normally used by the webtrap on the wall NOT by Maexxna
+#define SPELL_WEBSPRAY 29484
+#define SPELL_POISONSHOCK 28741
+#define SPELL_NECROTICPOISON 28776
+#define SPELL_ENRAGE 28747
+#define SPELL_SUMMON_SPIDERLING 29434
+
+#define LOC_X1 3546.796
+#define LOC_Y1 -3869.082
+#define LOC_Z1 296.450
+
+#define LOC_X2 3531.271
+#define LOC_Y2 -3847.424
+#define LOC_Z2 299.450
+
+#define LOC_X3 3497.067
+#define LOC_Y3 -3843.384
+#define LOC_Z3 302.384
+
+struct TRINITY_DLL_DECL mob_webwrapAI : public ScriptedAI
+{
+ mob_webwrapAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 victimGUID;
+
+ void Reset()
+ {
+ victimGUID = 0;
+ }
+
+ void SetVictim(Unit* victim)
+ {
+ if(victim)
+ {
+ victimGUID = victim->GetGUID();
+ victim->CastSpell(victim, SPELL_WEBTRAP, true);
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth())
+ {
+ if(victimGUID)
+ {
+ Unit* victim = NULL;
+ victim = Unit::GetUnit((*m_creature), victimGUID);
+ victim->RemoveAurasDueToSpell(SPELL_WEBTRAP);
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ }
+};
+
+struct TRINITY_DLL_DECL boss_maexxnaAI : public ScriptedAI
+{
+ boss_maexxnaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WebTrap_Timer;
+ uint32 WebSpray_Timer;
+ uint32 PoisonShock_Timer;
+ uint32 NecroticPoison_Timer;
+ uint32 SummonSpiderling_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ WebTrap_Timer = 20000; //20 sec init, 40 sec normal
+ WebSpray_Timer = 40000; //40 seconds
+ PoisonShock_Timer = 20000; //20 seconds
+ NecroticPoison_Timer = 30000; //30 seconds
+ SummonSpiderling_Timer = 30000; //30 sec init, 40 sec normal
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void DoCastWebWrap()
+ {
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::vector<Unit *> targets;
+
+ //This spell doesn't work if we only have 1 player on threat list
+ if(t_list.size() < 2)
+ return;
+
+ //begin + 1 , so we don't target the one with the highest threat
+ std::list<HostilReference *>::iterator itr = t_list.begin();
+ std::advance(itr, 1);
+ for( ; itr!= t_list.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //only on alive players
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
+ targets.push_back( target);
+ }
+
+ while(targets.size() > 3)
+ //cut down to size if we have more than 3 targets
+ targets.erase(targets.begin()+rand()%targets.size());
+
+ int i = 0;
+ for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i)
+ {
+ // Teleport the 3 targets to a location on the wall and summon a Web Wrap on them
+ Unit *target = *itr;
+ Creature* Wrap = NULL;
+ if(target)
+ {
+ switch(i)
+ {
+ case 0:
+ DoTeleportPlayer(target, LOC_X1, LOC_Y1, LOC_Z1, target->GetOrientation());
+ Wrap = m_creature->SummonCreature(16486, LOC_X1, LOC_Y1, LOC_Z1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ break;
+ case 1:
+ DoTeleportPlayer(target, LOC_X2, LOC_Y2, LOC_Z2, target->GetOrientation());
+ Wrap = m_creature->SummonCreature(16486, LOC_X2, LOC_Y2, LOC_Z2, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ break;
+ case 2:
+ DoTeleportPlayer(target, LOC_X3, LOC_Y3, LOC_Z3, target->GetOrientation());
+ Wrap = m_creature->SummonCreature(16486, LOC_X3, LOC_Y3, LOC_Z3, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ break;
+ }
+ if(Wrap)
+ {
+ Wrap->setFaction(m_creature->getFaction());
+ ((mob_webwrapAI*)Wrap->AI())->SetVictim(target);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //WebTrap_Timer
+ if (WebTrap_Timer < diff)
+ {
+ DoCastWebWrap();
+ WebTrap_Timer = 40000;
+ }else WebTrap_Timer -= diff;
+
+ //WebSpray_Timer
+ if (WebSpray_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WEBSPRAY);
+ WebSpray_Timer = 40000;
+ }else WebSpray_Timer -= diff;
+
+ //PoisonShock_Timer
+ if (PoisonShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_POISONSHOCK);
+ PoisonShock_Timer = 20000;
+ }else PoisonShock_Timer -= diff;
+
+ //NecroticPoison_Timer
+ if (NecroticPoison_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_NECROTICPOISON);
+ NecroticPoison_Timer = 30000;
+ }else NecroticPoison_Timer -= diff;
+
+ //SummonSpiderling_Timer
+ if (SummonSpiderling_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_SUMMON_SPIDERLING);
+ SummonSpiderling_Timer = 40000;
+ }else SummonSpiderling_Timer -= diff;
+
+ //Enrage if not already enraged and below 30%
+ if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_webwrap(Creature* _Creature)
+{
+ return new mob_webwrapAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_maexxna(Creature *_Creature)
+{
+ return new boss_maexxnaAI (_Creature);
+}
+
+void AddSC_boss_maexxna()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_maexxna";
+ newscript->GetAI = GetAI_boss_maexxna;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_webwrap";
+ newscript->GetAI = GetAI_mob_webwrap;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
index 46c9a5c0afb..cda01c57e40 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
@@ -1,180 +1,180 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Noth
-SD%Complete: 40
-SDComment: Missing Balcony stage
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO1 "Glory to the master!"
-#define SAY_AGGRO2 "Your life is forfeit!"
-#define SAY_AGGRO3 "Die, trespasser!"
-#define SAY_SUMMON "Rise, my soldiers! Rise and fight once more!"
-#define SAY_SLAY1 "My task is done!"
-#define SAY_SLAY2 "Breathe no more!"
-#define SAY_DEATH "I will serve the master... in... death!"
-#define SOUND_AGGRO1 8845
-#define SOUND_AGGRO2 8846
-#define SOUND_AGGRO3 8847
-#define SOUND_SUMMON 8851
-#define SOUND_SLAY1 8849
-#define SOUND_SLAY2 8850
-#define SOUND_DEATH 8848
-
-// Teleport position of Noth on his balcony
-#define TELE_X 2631.370
-#define TELE_Y -3529.680
-#define TELE_Z 274.040
-#define TELE_O 6.277
-
-#define SPELL_BLINK 29211
-#define SPELL_CRIPPLE 29212
-#define SPELL_CURSEPLAGUEBRINGER 28213
-#define SPELL_WRATHPLAGUEBRINGER 28214
-
-// IMPORTANT: BALCONY TELEPORT NOT ADDED YET! WILL BE ADDED SOON!
-
-struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
-{
- boss_nothAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Blink_Timer;
- uint32 Curse_Timer;
- uint32 Wrath_Timer;
- uint32 Summon_Timer;
-
- void Reset()
- {
- Blink_Timer = 25000;
- Curse_Timer = 4000;
- Wrath_Timer = 9000;
- Summon_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch (rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Blink_Timer
- if (Blink_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CRIPPLE);
- DoCast(m_creature,SPELL_BLINK);
-
- Blink_Timer = 25000;
- }else Blink_Timer -= diff;
-
- //Curse_Timer
- if (Curse_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEPLAGUEBRINGER);
- Curse_Timer = 28000;
- }else Curse_Timer -= diff;
-
- //Wrath_Timer
- if (Wrath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WRATHPLAGUEBRINGER);
- Wrath_Timer = 18000;
- }else Wrath_Timer -= diff;
-
- //Summon_Timer
- if (Summon_Timer < diff)
- {
- DoYell(SAY_SUMMON,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- Unit* target = NULL;
- Unit* SummonedSkeletons = NULL;
-
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
- SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
-
- if (SummonedSkeletons)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- SummonedSkeletons->AddThreat(target,1.0f);
- }
-
- Summon_Timer = 30500;
- } else Summon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_noth(Creature *_Creature)
-{
- return new boss_nothAI (_Creature);
-}
-
-void AddSC_boss_noth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_noth";
- newscript->GetAI = GetAI_boss_noth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Noth
+SD%Complete: 40
+SDComment: Missing Balcony stage
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO1 "Glory to the master!"
+#define SAY_AGGRO2 "Your life is forfeit!"
+#define SAY_AGGRO3 "Die, trespasser!"
+#define SAY_SUMMON "Rise, my soldiers! Rise and fight once more!"
+#define SAY_SLAY1 "My task is done!"
+#define SAY_SLAY2 "Breathe no more!"
+#define SAY_DEATH "I will serve the master... in... death!"
+#define SOUND_AGGRO1 8845
+#define SOUND_AGGRO2 8846
+#define SOUND_AGGRO3 8847
+#define SOUND_SUMMON 8851
+#define SOUND_SLAY1 8849
+#define SOUND_SLAY2 8850
+#define SOUND_DEATH 8848
+
+// Teleport position of Noth on his balcony
+#define TELE_X 2631.370
+#define TELE_Y -3529.680
+#define TELE_Z 274.040
+#define TELE_O 6.277
+
+#define SPELL_BLINK 29211
+#define SPELL_CRIPPLE 29212
+#define SPELL_CURSEPLAGUEBRINGER 28213
+#define SPELL_WRATHPLAGUEBRINGER 28214
+
+// IMPORTANT: BALCONY TELEPORT NOT ADDED YET! WILL BE ADDED SOON!
+
+struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
+{
+ boss_nothAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Blink_Timer;
+ uint32 Curse_Timer;
+ uint32 Wrath_Timer;
+ uint32 Summon_Timer;
+
+ void Reset()
+ {
+ Blink_Timer = 25000;
+ Curse_Timer = 4000;
+ Wrath_Timer = 9000;
+ Summon_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch (rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Blink_Timer
+ if (Blink_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CRIPPLE);
+ DoCast(m_creature,SPELL_BLINK);
+
+ Blink_Timer = 25000;
+ }else Blink_Timer -= diff;
+
+ //Curse_Timer
+ if (Curse_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEPLAGUEBRINGER);
+ Curse_Timer = 28000;
+ }else Curse_Timer -= diff;
+
+ //Wrath_Timer
+ if (Wrath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WRATHPLAGUEBRINGER);
+ Wrath_Timer = 18000;
+ }else Wrath_Timer -= diff;
+
+ //Summon_Timer
+ if (Summon_Timer < diff)
+ {
+ DoYell(SAY_SUMMON,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ Unit* target = NULL;
+ Unit* SummonedSkeletons = NULL;
+
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+ SummonedSkeletons = m_creature->SummonCreature(16984,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
+
+ if (SummonedSkeletons)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ SummonedSkeletons->AddThreat(target,1.0f);
+ }
+
+ Summon_Timer = 30500;
+ } else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_noth(Creature *_Creature)
+{
+ return new boss_nothAI (_Creature);
+}
+
+void AddSC_boss_noth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_noth";
+ newscript->GetAI = GetAI_boss_noth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
index 7f27a713346..d0edc7f46b3 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
@@ -1,160 +1,160 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Patchwerk
-SD%Complete: 100
-SDComment: Some issues with hateful strike inturrupting the melee swing timer. Probably core issue.
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO1 "Patchwerk want to play!"
-#define SAY_AGGRO2 "Kel'Thuzad make Patchwerk his Avatar of War!"
-#define SAY_SLAY "No more play?"
-#define SAY_DEATH "What happened to... Patch..."
-
-#define SOUND_AGGRO1 8909
-#define SOUND_AGGRO2 8910
-#define SOUND_SLAY 8912
-#define SOUND_DEATH 8911
-
-#define EMOTE_BERSERK "Patchwerk goes into a berserker rage!"
-#define EMOTE_ENRAGE "Patchwerk becomes enraged!"
-
-#define SPELL_HATEFULSTRIKE 28308
-#define SPELL_ENRAGE 29691
-#define SPELL_BERSERK 27680
-#define SPELL_SLIMEBOLT 32309
-
-struct TRINITY_DLL_DECL boss_patchwerkAI : public ScriptedAI
-{
- boss_patchwerkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HatefullStrike_Timer;
- uint32 Enrage_Timer;
- uint32 Slimebolt_Timer;
- bool Enraged;
-
- void Reset()
- {
- HatefullStrike_Timer = 1200; //1.2 seconds
- Enrage_Timer = 420000; //7 minutes 420,000
- Slimebolt_Timer = 450000; //7.5 minutes 450,000
- Enraged = false;
- }
-
- void KilledUnit(Unit* Victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- if (rand()%2)
- {
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- }
- else
- {
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //HatefullStrike_Timer
- if (HatefullStrike_Timer < diff)
- {
- //Cast Hateful strike on the player with the highest
- //amount of HP within melee distance
- uint32 MostHP = 0;
- Unit* pMostHPTarget = NULL;
- Unit* pTemp = NULL;
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
-
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!=m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (pTemp && pTemp->isAlive() && pTemp->GetHealth() > MostHP && m_creature->GetDistance2d(pTemp) < 5)
- {
- MostHP = pTemp->GetHealth();
- pMostHPTarget = pTemp;
- }
- }
-
- if (pMostHPTarget)
- DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE);
-
- HatefullStrike_Timer = 1200;
- }else HatefullStrike_Timer -= diff;
-
- //Enrage_Timer
- if (Enrage_Timer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoTextEmote(EMOTE_BERSERK, m_creature->getVictim());
-
- Enrage_Timer = 300000;
- }else Enrage_Timer -= diff;
-
- //Slimebolt_Timer
- if (Slimebolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLIMEBOLT);
- Slimebolt_Timer = 5000;
- }else Slimebolt_Timer -= diff;
-
- //Enrage if not already enraged and below 5%
- if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 5)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- DoTextEmote(EMOTE_ENRAGE,NULL);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_patchwerk(Creature *_Creature)
-{
- return new boss_patchwerkAI (_Creature);
-}
-
-void AddSC_boss_patchwerk()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_patchwerk";
- newscript->GetAI = GetAI_boss_patchwerk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Patchwerk
+SD%Complete: 100
+SDComment: Some issues with hateful strike inturrupting the melee swing timer. Probably core issue.
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO1 "Patchwerk want to play!"
+#define SAY_AGGRO2 "Kel'Thuzad make Patchwerk his Avatar of War!"
+#define SAY_SLAY "No more play?"
+#define SAY_DEATH "What happened to... Patch..."
+
+#define SOUND_AGGRO1 8909
+#define SOUND_AGGRO2 8910
+#define SOUND_SLAY 8912
+#define SOUND_DEATH 8911
+
+#define EMOTE_BERSERK "Patchwerk goes into a berserker rage!"
+#define EMOTE_ENRAGE "Patchwerk becomes enraged!"
+
+#define SPELL_HATEFULSTRIKE 28308
+#define SPELL_ENRAGE 29691
+#define SPELL_BERSERK 27680
+#define SPELL_SLIMEBOLT 32309
+
+struct TRINITY_DLL_DECL boss_patchwerkAI : public ScriptedAI
+{
+ boss_patchwerkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HatefullStrike_Timer;
+ uint32 Enrage_Timer;
+ uint32 Slimebolt_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ HatefullStrike_Timer = 1200; //1.2 seconds
+ Enrage_Timer = 420000; //7 minutes 420,000
+ Slimebolt_Timer = 450000; //7.5 minutes 450,000
+ Enraged = false;
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (rand()%2)
+ {
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ }
+ else
+ {
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //HatefullStrike_Timer
+ if (HatefullStrike_Timer < diff)
+ {
+ //Cast Hateful strike on the player with the highest
+ //amount of HP within melee distance
+ uint32 MostHP = 0;
+ Unit* pMostHPTarget = NULL;
+ Unit* pTemp = NULL;
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!=m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ if (pTemp && pTemp->isAlive() && pTemp->GetHealth() > MostHP && m_creature->GetDistance2d(pTemp) < 5)
+ {
+ MostHP = pTemp->GetHealth();
+ pMostHPTarget = pTemp;
+ }
+ }
+
+ if (pMostHPTarget)
+ DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE);
+
+ HatefullStrike_Timer = 1200;
+ }else HatefullStrike_Timer -= diff;
+
+ //Enrage_Timer
+ if (Enrage_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoTextEmote(EMOTE_BERSERK, m_creature->getVictim());
+
+ Enrage_Timer = 300000;
+ }else Enrage_Timer -= diff;
+
+ //Slimebolt_Timer
+ if (Slimebolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLIMEBOLT);
+ Slimebolt_Timer = 5000;
+ }else Slimebolt_Timer -= diff;
+
+ //Enrage if not already enraged and below 5%
+ if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 5)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ DoTextEmote(EMOTE_ENRAGE,NULL);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_patchwerk(Creature *_Creature)
+{
+ return new boss_patchwerkAI (_Creature);
+}
+
+void AddSC_boss_patchwerk()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_patchwerk";
+ newscript->GetAI = GetAI_boss_patchwerk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
index 08cc51f2c55..d83f99bda43 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
@@ -1,167 +1,167 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Razuvious
-SD%Complete: 50
-SDComment: Missing adds and event is impossible without Mind Control
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//Razuvious - NO TEXT sound only
-//8852 aggro01 - Hah hah, I'm just getting warmed up!
-//8853 aggro02 Stand and fight!
-//8854 aggro03 Show me what you've got!
-//8861 slay1 - You should've stayed home!
-//8863 slay2-
-//8858 cmmnd3 - You disappoint me, students!
-//8855 cmmnd1 - Do as I taught you!
-//8856 cmmnd2 - Show them no mercy!
-//8859 cmmnd4 - The time for practice is over! Show me what you've learned!
-//8861 Sweep the leg! Do you have a problem with that?
-//8860 death - An honorable... death...
-//8947 - Aggro Mixed? - ?
-
-#define SOUND_AGGRO1 8852
-#define SOUND_AGGRO2 8853
-#define SOUND_AGGRO3 8854
-#define SOUND_SLAY1 8861
-#define SOUND_SLAY2 8863
-#define SOUND_COMMND1 8855
-#define SOUND_COMMND2 8856
-#define SOUND_COMMND3 8858
-#define SOUND_COMMND4 8859
-#define SOUND_COMMND5 8861
-#define SOUND_DEATH 8860
-#define SOUND_AGGROMIX 8847
-
-#define SPELL_UNBALANCINGSTRIKE 26613
-#define SPELL_DISRUPTINGSHOUT 29107
-
-struct TRINITY_DLL_DECL boss_razuviousAI : public ScriptedAI
-{
- boss_razuviousAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 UnbalancingStrike_Timer;
- uint32 DisruptingShout_Timer;
- uint32 CommandSound_Timer;
-
- void Reset()
- {
- UnbalancingStrike_Timer = 30000; //30 seconds
- DisruptingShout_Timer = 25000; //25 seconds
- CommandSound_Timer = 40000; //40 seconds
- }
-
- void KilledUnit(Unit* Victim)
- {
- if (rand()%3)
- return;
-
- switch (rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //UnbalancingStrike_Timer
- if (UnbalancingStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_UNBALANCINGSTRIKE);
- UnbalancingStrike_Timer = 30000;
- }else UnbalancingStrike_Timer -= diff;
-
- //DisruptingShout_Timer
- if (DisruptingShout_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DISRUPTINGSHOUT);
- DisruptingShout_Timer = 25000;
- }else DisruptingShout_Timer -= diff;
-
- //CommandSound_Timer
- if (CommandSound_Timer < diff)
- {
- switch (rand()%5)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_COMMND1);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_COMMND2);
- break;
- case 2:
- DoPlaySoundToSet(m_creature, SOUND_COMMND3);
- break;
- case 3:
- DoPlaySoundToSet(m_creature, SOUND_COMMND4);
- break;
- case 4:
- DoPlaySoundToSet(m_creature, SOUND_COMMND5);
- break;
- }
-
- CommandSound_Timer = 40000;
- }else CommandSound_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_razuvious(Creature *_Creature)
-{
- return new boss_razuviousAI (_Creature);
-}
-
-void AddSC_boss_razuvious()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_razuvious";
- newscript->GetAI = GetAI_boss_razuvious;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Razuvious
+SD%Complete: 50
+SDComment: Missing adds and event is impossible without Mind Control
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//Razuvious - NO TEXT sound only
+//8852 aggro01 - Hah hah, I'm just getting warmed up!
+//8853 aggro02 Stand and fight!
+//8854 aggro03 Show me what you've got!
+//8861 slay1 - You should've stayed home!
+//8863 slay2-
+//8858 cmmnd3 - You disappoint me, students!
+//8855 cmmnd1 - Do as I taught you!
+//8856 cmmnd2 - Show them no mercy!
+//8859 cmmnd4 - The time for practice is over! Show me what you've learned!
+//8861 Sweep the leg! Do you have a problem with that?
+//8860 death - An honorable... death...
+//8947 - Aggro Mixed? - ?
+
+#define SOUND_AGGRO1 8852
+#define SOUND_AGGRO2 8853
+#define SOUND_AGGRO3 8854
+#define SOUND_SLAY1 8861
+#define SOUND_SLAY2 8863
+#define SOUND_COMMND1 8855
+#define SOUND_COMMND2 8856
+#define SOUND_COMMND3 8858
+#define SOUND_COMMND4 8859
+#define SOUND_COMMND5 8861
+#define SOUND_DEATH 8860
+#define SOUND_AGGROMIX 8847
+
+#define SPELL_UNBALANCINGSTRIKE 26613
+#define SPELL_DISRUPTINGSHOUT 29107
+
+struct TRINITY_DLL_DECL boss_razuviousAI : public ScriptedAI
+{
+ boss_razuviousAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 UnbalancingStrike_Timer;
+ uint32 DisruptingShout_Timer;
+ uint32 CommandSound_Timer;
+
+ void Reset()
+ {
+ UnbalancingStrike_Timer = 30000; //30 seconds
+ DisruptingShout_Timer = 25000; //25 seconds
+ CommandSound_Timer = 40000; //40 seconds
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if (rand()%3)
+ return;
+
+ switch (rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //UnbalancingStrike_Timer
+ if (UnbalancingStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_UNBALANCINGSTRIKE);
+ UnbalancingStrike_Timer = 30000;
+ }else UnbalancingStrike_Timer -= diff;
+
+ //DisruptingShout_Timer
+ if (DisruptingShout_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DISRUPTINGSHOUT);
+ DisruptingShout_Timer = 25000;
+ }else DisruptingShout_Timer -= diff;
+
+ //CommandSound_Timer
+ if (CommandSound_Timer < diff)
+ {
+ switch (rand()%5)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_COMMND1);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_COMMND2);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature, SOUND_COMMND3);
+ break;
+ case 3:
+ DoPlaySoundToSet(m_creature, SOUND_COMMND4);
+ break;
+ case 4:
+ DoPlaySoundToSet(m_creature, SOUND_COMMND5);
+ break;
+ }
+
+ CommandSound_Timer = 40000;
+ }else CommandSound_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_razuvious(Creature *_Creature)
+{
+ return new boss_razuviousAI (_Creature);
+}
+
+void AddSC_boss_razuvious()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_razuvious";
+ newscript->GetAI = GetAI_boss_razuvious;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index f8559d3004b..6f2a2ac4055 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -1,199 +1,199 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Sapphiron
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ICEBOLT 28522
-#define SPELL_FROST_BREATH 29318
-#define SPELL_FROST_AURA 28531
-#define SPELL_LIFE_DRAIN 28542
-#define SPELL_BLIZZARD 28547
-#define SPELL_BESERK 26662
-
-struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
-{
- boss_sapphironAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 Icebolt_Count;
- uint32 Icebolt_Timer;
- uint32 FrostBreath_Timer;
- uint32 FrostAura_Timer;
- uint32 LifeDrain_Timer;
- uint32 Blizzard_Timer;
- uint32 Fly_Timer;
- uint32 Fly2_Timer;
- uint32 Beserk_Timer;
- uint32 phase;
- bool landoff;
- uint32 land_Timer;
-
- void Reset()
- {
- FrostAura_Timer = 2000;
- LifeDrain_Timer = 24000;
- Blizzard_Timer = 20000;
- Fly_Timer = 45000;
- Icebolt_Timer = 4000;
- land_Timer = 2000;
- Beserk_Timer = 0;
- phase = 1;
- Icebolt_Count = 0;
- landoff = false;
-
- //m_creature->ApplySpellMod(SPELL_FROST_AURA, SPELLMOD_DURATION, -1);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget())
- return;
-
- if(m_creature->getVictim() && m_creature->isAlive())
- {
- if(phase == 1)
- {
- if(FrostAura_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_AURA);
- FrostAura_Timer = 5000;
- }else FrostAura_Timer -= diff;
-
- if(LifeDrain_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_LIFE_DRAIN);
- LifeDrain_Timer = 24000;
- }else LifeDrain_Timer -= diff;
-
- if(Blizzard_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_BLIZZARD);
- Blizzard_Timer = 20000;
- }else Blizzard_Timer -= diff;
-
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 10)
- {
- if(Fly_Timer < diff)
- {
- phase = 2;
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveIdle();
- DoCast(m_creature,11010);
- m_creature->SetHover(true);
- DoCast(m_creature,18430);
- Icebolt_Timer = 4000;
- Icebolt_Count = 0;
- landoff = false;
- }else Fly_Timer -= diff;
- }
-
- if (phase == 2)
- {
- if(Icebolt_Timer < diff && Icebolt_Count < 5)
- {
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_ICEBOLT);
- Icebolt_Count ++;
- Icebolt_Timer = 4000;
- }else Icebolt_Timer -= diff;
-
- if(Icebolt_Count == 5 && !landoff)
- {
- if(FrostBreath_Timer < diff )
- {
- DoTextEmote("takes a deep breath...",NULL);
- DoCast(m_creature->getVictim(),SPELL_FROST_BREATH);
- land_Timer = 2000;
- landoff = true;
- FrostBreath_Timer = 6000;
- }else FrostBreath_Timer -= diff;
- }
-
- if(landoff)
- {
- if(land_Timer < diff)
- {
- phase = 1;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- m_creature->SetHover(false);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
- Fly_Timer = 67000;
- }else land_Timer -= diff;
- }
-
- }
-
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 11)
- {
- if (Beserk_Timer < diff)
- {
- DoTextEmote("enrages!",NULL);
- DoCast(m_creature,SPELL_BESERK);
- Beserk_Timer = 300000;
- }else Beserk_Timer -= diff;
- }
-
- if( phase!=2 && m_creature->getVictim() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- if( m_creature->isAttackReady() )
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
- }
- }
- }
-};
-
-CreatureAI* GetAI_boss_sapphiron(Creature *_Creature)
-{
- return new boss_sapphironAI (_Creature);
-}
-
-void AddSC_boss_sapphiron()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_sapphiron";
- newscript->GetAI = GetAI_boss_sapphiron;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Sapphiron
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ICEBOLT 28522
+#define SPELL_FROST_BREATH 29318
+#define SPELL_FROST_AURA 28531
+#define SPELL_LIFE_DRAIN 28542
+#define SPELL_BLIZZARD 28547
+#define SPELL_BESERK 26662
+
+struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
+{
+ boss_sapphironAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 Icebolt_Count;
+ uint32 Icebolt_Timer;
+ uint32 FrostBreath_Timer;
+ uint32 FrostAura_Timer;
+ uint32 LifeDrain_Timer;
+ uint32 Blizzard_Timer;
+ uint32 Fly_Timer;
+ uint32 Fly2_Timer;
+ uint32 Beserk_Timer;
+ uint32 phase;
+ bool landoff;
+ uint32 land_Timer;
+
+ void Reset()
+ {
+ FrostAura_Timer = 2000;
+ LifeDrain_Timer = 24000;
+ Blizzard_Timer = 20000;
+ Fly_Timer = 45000;
+ Icebolt_Timer = 4000;
+ land_Timer = 2000;
+ Beserk_Timer = 0;
+ phase = 1;
+ Icebolt_Count = 0;
+ landoff = false;
+
+ //m_creature->ApplySpellMod(SPELL_FROST_AURA, SPELLMOD_DURATION, -1);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget())
+ return;
+
+ if(m_creature->getVictim() && m_creature->isAlive())
+ {
+ if(phase == 1)
+ {
+ if(FrostAura_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROST_AURA);
+ FrostAura_Timer = 5000;
+ }else FrostAura_Timer -= diff;
+
+ if(LifeDrain_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_LIFE_DRAIN);
+ LifeDrain_Timer = 24000;
+ }else LifeDrain_Timer -= diff;
+
+ if(Blizzard_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_BLIZZARD);
+ Blizzard_Timer = 20000;
+ }else Blizzard_Timer -= diff;
+
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 10)
+ {
+ if(Fly_Timer < diff)
+ {
+ phase = 2;
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MoveIdle();
+ DoCast(m_creature,11010);
+ m_creature->SetHover(true);
+ DoCast(m_creature,18430);
+ Icebolt_Timer = 4000;
+ Icebolt_Count = 0;
+ landoff = false;
+ }else Fly_Timer -= diff;
+ }
+
+ if (phase == 2)
+ {
+ if(Icebolt_Timer < diff && Icebolt_Count < 5)
+ {
+ Unit* target = NULL;
+
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_ICEBOLT);
+ Icebolt_Count ++;
+ Icebolt_Timer = 4000;
+ }else Icebolt_Timer -= diff;
+
+ if(Icebolt_Count == 5 && !landoff)
+ {
+ if(FrostBreath_Timer < diff )
+ {
+ DoTextEmote("takes a deep breath...",NULL);
+ DoCast(m_creature->getVictim(),SPELL_FROST_BREATH);
+ land_Timer = 2000;
+ landoff = true;
+ FrostBreath_Timer = 6000;
+ }else FrostBreath_Timer -= diff;
+ }
+
+ if(landoff)
+ {
+ if(land_Timer < diff)
+ {
+ phase = 1;
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ m_creature->SetHover(false);
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
+ Fly_Timer = 67000;
+ }else land_Timer -= diff;
+ }
+
+ }
+
+ if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 11)
+ {
+ if (Beserk_Timer < diff)
+ {
+ DoTextEmote("enrages!",NULL);
+ DoCast(m_creature,SPELL_BESERK);
+ Beserk_Timer = 300000;
+ }else Beserk_Timer -= diff;
+ }
+
+ if( phase!=2 && m_creature->getVictim() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ if( m_creature->isAttackReady() )
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_sapphiron(Creature *_Creature)
+{
+ return new boss_sapphironAI (_Creature);
+}
+
+void AddSC_boss_sapphiron()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_sapphiron";
+ newscript->GetAI = GetAI_boss_sapphiron;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sir_zeliek.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sir_zeliek.cpp
index a37656ee21f..0a3ca7a951b 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sir_zeliek.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sir_zeliek.cpp
@@ -1,146 +1,146 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Sir_Zeliek
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//All horsemen
-#define SPELL_SHIELDWALL 29061
-#define SPELL_BESERK 26662
-
-// sir zeliek
-#define SPELL_MARK_OF_ZELIEK 28835
-#define SPELL_HOLY_WRATH 28883
-
-#define SAY_AGGRO "Flee, before it's too late!"
-#define SAY_TAUNT1 "Invaders, cease this foolish venture at once! Turn away while you still can!"
-#define SAY_TAUNT2 "Perhaps they will come to their senses, and run away as fast as they can!"
-#define SAY_TAUNT3 "Do not continue! Turn back while there's still time!"
-#define SAY_SPECIAL "I- I have no choice but to obey!"
-#define SAY_SLAY "Forgive me!"
-#define SAY_DEATH "It is... as it should be."
-
-#define SOUND_AGGRO 8913
-#define SOUND_TAUNT1 8917
-#define SOUND_TAUNT2 8918
-#define SOUND_TAUNT3 8919
-#define SOUND_SPECIAl 8916
-#define SOUND_SLAY 8915
-#define SOUND_DEATH 8914
-
-struct TRINITY_DLL_DECL boss_sir_zeliekAI : public ScriptedAI
-{
- boss_sir_zeliekAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mark_Timer;
- uint32 HolyWrath_Timer;
- bool ShieldWall1;
- bool ShieldWall2;
-
- void Reset()
- {
- Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
- HolyWrath_Timer = 12000; // right
- ShieldWall1 = true;
- ShieldWall2 = true;
- }
-
- void InitialYell()
- {
- if(!InCombat)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
- }
-
- void KilledUnit()
- {
- DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- InitialYell();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Mark of Zeliek
- if(Mark_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MARK_OF_ZELIEK);
- Mark_Timer = 12000;
- }else Mark_Timer -= diff;
-
- // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
- if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- {
- if(ShieldWall1)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall1 = false;
- }
- }
- if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- if(ShieldWall2)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall2 = false;
- }
- }
-
- // Holy Wrath
- if(HolyWrath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HOLY_WRATH);
- HolyWrath_Timer = 12000;
- }else HolyWrath_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_sir_zeliek(Creature *_Creature)
-{
- return new boss_sir_zeliekAI (_Creature);
-}
-
-void AddSC_boss_sir_zeliek()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_sir_zeliek";
- newscript->GetAI = GetAI_boss_sir_zeliek;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Sir_Zeliek
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//All horsemen
+#define SPELL_SHIELDWALL 29061
+#define SPELL_BESERK 26662
+
+// sir zeliek
+#define SPELL_MARK_OF_ZELIEK 28835
+#define SPELL_HOLY_WRATH 28883
+
+#define SAY_AGGRO "Flee, before it's too late!"
+#define SAY_TAUNT1 "Invaders, cease this foolish venture at once! Turn away while you still can!"
+#define SAY_TAUNT2 "Perhaps they will come to their senses, and run away as fast as they can!"
+#define SAY_TAUNT3 "Do not continue! Turn back while there's still time!"
+#define SAY_SPECIAL "I- I have no choice but to obey!"
+#define SAY_SLAY "Forgive me!"
+#define SAY_DEATH "It is... as it should be."
+
+#define SOUND_AGGRO 8913
+#define SOUND_TAUNT1 8917
+#define SOUND_TAUNT2 8918
+#define SOUND_TAUNT3 8919
+#define SOUND_SPECIAl 8916
+#define SOUND_SLAY 8915
+#define SOUND_DEATH 8914
+
+struct TRINITY_DLL_DECL boss_sir_zeliekAI : public ScriptedAI
+{
+ boss_sir_zeliekAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mark_Timer;
+ uint32 HolyWrath_Timer;
+ bool ShieldWall1;
+ bool ShieldWall2;
+
+ void Reset()
+ {
+ Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
+ HolyWrath_Timer = 12000; // right
+ ShieldWall1 = true;
+ ShieldWall2 = true;
+ }
+
+ void InitialYell()
+ {
+ if(!InCombat)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+ }
+
+ void KilledUnit()
+ {
+ DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ InitialYell();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Mark of Zeliek
+ if(Mark_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MARK_OF_ZELIEK);
+ Mark_Timer = 12000;
+ }else Mark_Timer -= diff;
+
+ // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
+ if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ {
+ if(ShieldWall1)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall1 = false;
+ }
+ }
+ if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ if(ShieldWall2)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall2 = false;
+ }
+ }
+
+ // Holy Wrath
+ if(HolyWrath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLY_WRATH);
+ HolyWrath_Timer = 12000;
+ }else HolyWrath_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_sir_zeliek(Creature *_Creature)
+{
+ return new boss_sir_zeliekAI (_Creature);
+}
+
+void AddSC_boss_sir_zeliek()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_sir_zeliek";
+ newscript->GetAI = GetAI_boss_sir_zeliek;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp
index 1936e629d56..b5b2c357597 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp
@@ -1,35 +1,35 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Stalagg
-SD%Complete: 0
-SDComment: Merge with Thaddius
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//Stalagg
-//8864 aggro - Stalagg crush you!
-//8866 slay - Stalagg Kill!
-//8865 death - Master save me...
-
-#define SPELL_WARSTOMP 28125
-#define SPELL_POWERSURGE 28134
-#define SPELL_CHAIN_LIGHTNING 28900
-
-//Not sure how to "force" crushing blows or to knock tank to the opposite platform
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Stalagg
+SD%Complete: 0
+SDComment: Merge with Thaddius
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//Stalagg
+//8864 aggro - Stalagg crush you!
+//8866 slay - Stalagg Kill!
+//8865 death - Master save me...
+
+#define SPELL_WARSTOMP 28125
+#define SPELL_POWERSURGE 28134
+#define SPELL_CHAIN_LIGHTNING 28900
+
+//Not sure how to "force" crushing blows or to knock tank to the opposite platform
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
index fe9b58c05f6..60b32700cb0 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
@@ -1,49 +1,49 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Thaddius
-SD%Complete: 0
-SDComment: Merge Feugen & Stalagg with this script
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//Thaddus
-//8873 Lamnt01 - Pleeease!
-//8874 Lamnt02 - Stop, make it stop!
-//8875 Lamnt03 - Help me! Save me!
-//8876 Lamnt04 - Please, nooo!
-//8872 greet - You are too late... I... must... OBEY!
-//8867 aggro1 - KILL!
-//8868 aggro2 - EAT YOUR BONES!
-//8869 aggro3 - BREAK YOU!
-//8871 elect - Now YOU feel pain!
-//8877 slay - You die now!
-//8870 die - Thank... you...
-
-#define SPELL_BALL_LIGHTNING 28299
-
-#define SPELL_CHARGE_POSITIVE_DMGBUFF 29659
-#define SPELL_CHARGE_POSITIVE_NEARDMG 28059
-
-#define SPELL_CHARGE_NEGATIVE_DMGBUFF 29660
-#define SPELL_CHARGE_NEGATIVE_NEARDMG 28084
-
-#define SPELL_CHAIN_LIGHTNING 28900
-
-#define SPELL_BESERK 26662
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Thaddius
+SD%Complete: 0
+SDComment: Merge Feugen & Stalagg with this script
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//Thaddus
+//8873 Lamnt01 - Pleeease!
+//8874 Lamnt02 - Stop, make it stop!
+//8875 Lamnt03 - Help me! Save me!
+//8876 Lamnt04 - Please, nooo!
+//8872 greet - You are too late... I... must... OBEY!
+//8867 aggro1 - KILL!
+//8868 aggro2 - EAT YOUR BONES!
+//8869 aggro3 - BREAK YOU!
+//8871 elect - Now YOU feel pain!
+//8877 slay - You die now!
+//8870 die - Thank... you...
+
+#define SPELL_BALL_LIGHTNING 28299
+
+#define SPELL_CHARGE_POSITIVE_DMGBUFF 29659
+#define SPELL_CHARGE_POSITIVE_NEARDMG 28059
+
+#define SPELL_CHARGE_NEGATIVE_DMGBUFF 29660
+#define SPELL_CHARGE_NEGATIVE_NEARDMG 28084
+
+#define SPELL_CHAIN_LIGHTNING 28900
+
+#define SPELL_BESERK 26662
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thane_korthazz.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thane_korthazz.cpp
index 91acfb42045..a040626258d 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thane_korthazz.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_thane_korthazz.cpp
@@ -1,147 +1,147 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Thane_Korthazz
-SD%Complete: 100
-SDComment:
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//All horsemen
-#define SPELL_SHIELDWALL 29061
-#define SPELL_BESERK 26662
-
-// thane korthazz
-#define SPELL_MARK_OF_KORTHAZZ 28832
-#define SPELL_METEOR 26558 // m_creature->getVictim() auto-area spell but with a core problem
-
-#define SAY_AGGRO "Come out and fight, ye wee ninny!"
-#define SAY_TAUNT1 "To arms, ye roustabouts! We've got company!"
-#define SAY_TAUNT2 "I heard about enough of yer sniveling. Shut yer fly trap 'afore I shut it for ye!"
-#define SAY_TAUNT3 "I'm gonna enjoy killin' these slack-jawed daffodils!"
-#define SAY_SLAY "Next time, bring more friends!"
-#define SAY_SPECIAl "I like my meat extra crispy!"
-#define SAY_DEATH "What a bloody waste this is!"
-
-#define SOUND_AGGRO 8899
-#define SOUND_TAUNT1 8903
-#define SOUND_TAUNT2 8904
-#define SOUND_TAUNT3 8905
-#define SOUND_SLAY 8901
-#define SOUND_SPECIAL 8902
-#define SOUND_DEATH 8900
-
-#define SPIRIT_OF_KORTHAZZ 16778
-
-struct TRINITY_DLL_DECL boss_thane_korthazzAI : public ScriptedAI
-{
- boss_thane_korthazzAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mark_Timer;
- uint32 Meteor_Timer;
- bool ShieldWall1;
- bool ShieldWall2;
-
- void Reset()
- {
- Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
- Meteor_Timer = 30000; // wrong
- ShieldWall1 = true;
- ShieldWall2 = true;
- }
-
- void InitialYell()
- {
- if(!InCombat)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
- }
-
- void KilledUnit()
- {
- DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- InitialYell();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Mark of Korthazz
- if(Mark_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MARK_OF_KORTHAZZ);
- Mark_Timer = 12000;
- }else Mark_Timer -= diff;
-
- // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
- if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
- {
- if(ShieldWall1)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall1 = false;
- }
- }
- if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- if(ShieldWall2)
- {
- DoCast(m_creature,SPELL_SHIELDWALL);
- ShieldWall2 = false;
- }
- }
-
- // Meteor
- if(Meteor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_METEOR);
- Meteor_Timer = 20000; // wrong
- }else Meteor_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_thane_korthazz(Creature *_Creature)
-{
- return new boss_thane_korthazzAI (_Creature);
-}
-
-void AddSC_boss_thane_korthazz()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_thane_korthazz";
- newscript->GetAI = GetAI_boss_thane_korthazz;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Thane_Korthazz
+SD%Complete: 100
+SDComment:
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
+
+//All horsemen
+#define SPELL_SHIELDWALL 29061
+#define SPELL_BESERK 26662
+
+// thane korthazz
+#define SPELL_MARK_OF_KORTHAZZ 28832
+#define SPELL_METEOR 26558 // m_creature->getVictim() auto-area spell but with a core problem
+
+#define SAY_AGGRO "Come out and fight, ye wee ninny!"
+#define SAY_TAUNT1 "To arms, ye roustabouts! We've got company!"
+#define SAY_TAUNT2 "I heard about enough of yer sniveling. Shut yer fly trap 'afore I shut it for ye!"
+#define SAY_TAUNT3 "I'm gonna enjoy killin' these slack-jawed daffodils!"
+#define SAY_SLAY "Next time, bring more friends!"
+#define SAY_SPECIAl "I like my meat extra crispy!"
+#define SAY_DEATH "What a bloody waste this is!"
+
+#define SOUND_AGGRO 8899
+#define SOUND_TAUNT1 8903
+#define SOUND_TAUNT2 8904
+#define SOUND_TAUNT3 8905
+#define SOUND_SLAY 8901
+#define SOUND_SPECIAL 8902
+#define SOUND_DEATH 8900
+
+#define SPIRIT_OF_KORTHAZZ 16778
+
+struct TRINITY_DLL_DECL boss_thane_korthazzAI : public ScriptedAI
+{
+ boss_thane_korthazzAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mark_Timer;
+ uint32 Meteor_Timer;
+ bool ShieldWall1;
+ bool ShieldWall2;
+
+ void Reset()
+ {
+ Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
+ Meteor_Timer = 30000; // wrong
+ ShieldWall1 = true;
+ ShieldWall2 = true;
+ }
+
+ void InitialYell()
+ {
+ if(!InCombat)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+ }
+
+ void KilledUnit()
+ {
+ DoYell(SAY_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ InitialYell();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Mark of Korthazz
+ if(Mark_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MARK_OF_KORTHAZZ);
+ Mark_Timer = 12000;
+ }else Mark_Timer -= diff;
+
+ // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
+ if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
+ {
+ if(ShieldWall1)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall1 = false;
+ }
+ }
+ if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ if(ShieldWall2)
+ {
+ DoCast(m_creature,SPELL_SHIELDWALL);
+ ShieldWall2 = false;
+ }
+ }
+
+ // Meteor
+ if(Meteor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_METEOR);
+ Meteor_Timer = 20000; // wrong
+ }else Meteor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_thane_korthazz(Creature *_Creature)
+{
+ return new boss_thane_korthazzAI (_Creature);
+}
+
+void AddSC_boss_thane_korthazz()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_thane_korthazz";
+ newscript->GetAI = GetAI_boss_thane_korthazz;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
index 601b0103d39..8a8675c4c1c 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Naxxramas
-SD%Complete: 0
-SDComment: Place holder
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Naxxramas
+SD%Complete: 0
+SDComment: Place holder
+SDCategory: Naxxramas
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
index 8d1b4f95b22..2d35802338e 100644
--- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
+++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
@@ -1,421 +1,421 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Netherstorm
-SD%Complete: 75
-SDComment: Quest support: 10438, 10652 (special flight paths), 10299,10321,10322,10323,10329,10330,10338,10365(Shutting Down Manaforge)
-SDCategory: Netherstorm
-EndScriptData */
-
-/* ContentData
-npc_manaforge_control_console
-go_manaforge_control_console
-npc_protectorate_nether_drake
-npc_veronia
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_manaforge_control_console
-######*/
-
-#define EMOTE_START "Warning! Emergency shutdown process initiated by $N. Shutdown will complete in two minutes."
-#define EMOTE_60 "Emergency shutdown will complete in one minute."
-#define EMOTE_30 "Emergency shutdown will complete in thirty seconds."
-#define EMOTE_10 "Emergency shutdown will complete in ten seconds."
-#define EMOTE_COMPLETE "Emergency shutdown complete."
-#define EMOTE_ABORT "Emergency shutdown aborted."
-
-#define ENTRY_BNAAR_C_CONSOLE 20209
-#define ENTRY_CORUU_C_CONSOLE 20417
-#define ENTRY_DURO_C_CONSOLE 20418
-#define ENTRY_ARA_C_CONSOLE 20440
-
-#define ENTRY_SUNFURY_TECH 20218
-#define ENTRY_SUNFURY_PROT 20436
-
-#define ENTRY_ARA_TECH 20438
-#define ENTRY_ARA_ENGI 20439
-#define ENTRY_ARA_GORKLONN 20460
-
-#define SPELL_DISABLE_VISUAL 35031
-#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this
-#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version)
-
-struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
-{
- npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Event_Timer;
- uint32 Wave_Timer;
- uint32 Phase;
- bool Wave;
- uint64 someplayer;
- uint64 goConsole;
- Creature* add;
-
- void Reset()
- {
- Event_Timer = 3000;
- Wave_Timer = 0;
- Phase = 1;
- Wave = false;
- someplayer = 0;
- goConsole = 0;
- Creature* add = NULL;
- }
-
- void Aggro(Unit *who) { return; }
-
- /*void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- //we have no way of telling the creature was hit by spell -> got aura applied after 10-12 seconds
- //then no way for the mobs to actually stop the shutdown as intended.
- if( spell->Id == SPELL_INTERRUPT_1 )
- DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL);
- }*/
-
- void JustDied(Unit* killer)
- {
- DoTextEmote(EMOTE_ABORT, NULL);
-
- if( someplayer )
- {
- Unit* p = Unit::GetUnit((*m_creature),someplayer);
- if( p && p->GetTypeId() == TYPEID_PLAYER )
- {
- switch( m_creature->GetEntry() )
- {
- case ENTRY_BNAAR_C_CONSOLE:
- ((Player*)p)->FailQuest(10299);
- ((Player*)p)->FailQuest(10329);
- break;
- case ENTRY_CORUU_C_CONSOLE:
- ((Player*)p)->FailQuest(10321);
- ((Player*)p)->FailQuest(10330);
- break;
- case ENTRY_DURO_C_CONSOLE:
- ((Player*)p)->FailQuest(10322);
- ((Player*)p)->FailQuest(10338);
- break;
- case ENTRY_ARA_C_CONSOLE:
- ((Player*)p)->FailQuest(10323);
- ((Player*)p)->FailQuest(10365);
- break;
- }
- }
- }
-
- if( goConsole )
- {
- if( GameObject* go = GameObject::GetGameObject((*m_creature),goConsole) )
- go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
- }
- }
-
- void DoWaveSpawnForCreature(Creature *creature)
- {
- switch( creature->GetEntry() )
- {
- case ENTRY_BNAAR_C_CONSOLE:
- if( rand()%2 )
- {
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
- }
- else
- {
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
- }
- Wave_Timer = 30000;
- break;
- case ENTRY_CORUU_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
- Wave_Timer = 20000;
- break;
- case ENTRY_DURO_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
- Wave_Timer = 15000;
- break;
- case ENTRY_ARA_C_CONSOLE:
- if( rand()%2 )
- {
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- }
- else
- {
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = m_creature->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- }
- Wave_Timer = 15000;
- break;
- }
- }
- void DoFinalSpawnForCreature(Creature *creature)
- {
- switch( creature->GetEntry() )
- {
- case ENTRY_BNAAR_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
- break;
- case ENTRY_CORUU_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- break;
- case ENTRY_DURO_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = m_creature->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- break;
- case ENTRY_ARA_C_CONSOLE:
- add = m_creature->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
- add = m_creature->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if( add ) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( Event_Timer < diff )
- {
- switch(Phase)
- {
- case 1:
- if( someplayer )
- {
- Unit* u = Unit::GetUnit((*m_creature),someplayer);
- if( u && u->GetTypeId() == TYPEID_PLAYER ) DoTextEmote(EMOTE_START, u);
- }
- Event_Timer = 60000;
- Wave = true;
- ++Phase;
- break;
- case 2:
- DoTextEmote(EMOTE_60, NULL);
- Event_Timer = 30000;
- ++Phase;
- break;
- case 3:
- DoTextEmote(EMOTE_30, NULL);
- Event_Timer = 20000;
- DoFinalSpawnForCreature(m_creature);
- ++Phase;
- break;
- case 4:
- DoTextEmote(EMOTE_10, NULL);
- Event_Timer = 10000;
- Wave = false;
- ++Phase;
- break;
- case 5:
- DoTextEmote(EMOTE_COMPLETE, NULL);
- if( someplayer )
- {
- Unit* u = Unit::GetUnit((*m_creature),someplayer);
- if( u && u->GetTypeId() == TYPEID_PLAYER )
- ((Player*)u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID());
- DoCast(m_creature,SPELL_DISABLE_VISUAL);
- }
- if( goConsole )
- {
- if( GameObject* go = GameObject::GetGameObject((*m_creature),goConsole) )
- go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
- }
- ++Phase;
- break;
- }
- } else Event_Timer -= diff;
-
- if( Wave )
- {
- if( Wave_Timer < diff )
- {
- DoWaveSpawnForCreature(m_creature);
- } else Wave_Timer -= diff;
- }
- }
-};
-CreatureAI* GetAI_npc_manaforge_control_console(Creature *_Creature)
-{
- return new npc_manaforge_control_consoleAI (_Creature);
-}
-
-/*######
-## go_manaforge_control_console
-######*/
-
-//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon)
-bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- Creature* manaforge;
- manaforge = NULL;
-
- switch( _GO->GetAreaId() )
- {
- case 3726: //b'naar
- if( (player->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29366,1))
- manaforge = player->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3730: //coruu
- if( (player->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29396,1))
- manaforge = player->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3734: //duro
- if( (player->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29397,1))
- manaforge = player->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3722: //ara
- if( (player->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29411,1))
- manaforge = player->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- }
-
- if( manaforge )
- {
- ((npc_manaforge_control_consoleAI*)manaforge->AI())->someplayer = player->GetGUID();
- ((npc_manaforge_control_consoleAI*)manaforge->AI())->goConsole = _GO->GetGUID();
- _GO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
- }
- return true;
-}
-
-/*######
-## npc_protectorate_nether_drake
-######*/
-
-bool GossipHello_npc_protectorate_nether_drake(Player *player, Creature *_Creature)
-{
- //On Nethery Wings
- if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778,1) )
- player->ADD_GOSSIP_ITEM(0, "Fly me to Ultris", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 152; //from drake
- nodes[1] = 153; //end at drake
- player->ActivateTaxiPathTo(nodes); //TaxiPath 627 (possibly 627+628(152->153->154->155) )
- }
- return true;
-}
-
-/*######
-## npc_veronia
-######*/
-
-bool GossipHello_npc_veronia(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- //Behind Enemy Lines
- if (player->GetQuestStatus(10652) && !player->GetQuestRewardStatus(10652))
- player->ADD_GOSSIP_ITEM(0, "Fly me to Manaforge Coruu please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_veronia(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,34905,true); //TaxiPath 606
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_netherstorm()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="go_manaforge_control_console";
- newscript->pGOHello = &GOHello_go_manaforge_control_console;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_manaforge_control_console";
- newscript->GetAI = GetAI_npc_manaforge_control_console;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_protectorate_nether_drake";
- newscript->pGossipHello = &GossipHello_npc_protectorate_nether_drake;
- newscript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_veronia";
- newscript->pGossipHello = &GossipHello_npc_veronia;
- newscript->pGossipSelect = &GossipSelect_npc_veronia;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Netherstorm
+SD%Complete: 75
+SDComment: Quest support: 10438, 10652 (special flight paths), 10299,10321,10322,10323,10329,10330,10338,10365(Shutting Down Manaforge)
+SDCategory: Netherstorm
+EndScriptData */
+
+/* ContentData
+npc_manaforge_control_console
+go_manaforge_control_console
+npc_protectorate_nether_drake
+npc_veronia
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_manaforge_control_console
+######*/
+
+#define EMOTE_START "Warning! Emergency shutdown process initiated by $N. Shutdown will complete in two minutes."
+#define EMOTE_60 "Emergency shutdown will complete in one minute."
+#define EMOTE_30 "Emergency shutdown will complete in thirty seconds."
+#define EMOTE_10 "Emergency shutdown will complete in ten seconds."
+#define EMOTE_COMPLETE "Emergency shutdown complete."
+#define EMOTE_ABORT "Emergency shutdown aborted."
+
+#define ENTRY_BNAAR_C_CONSOLE 20209
+#define ENTRY_CORUU_C_CONSOLE 20417
+#define ENTRY_DURO_C_CONSOLE 20418
+#define ENTRY_ARA_C_CONSOLE 20440
+
+#define ENTRY_SUNFURY_TECH 20218
+#define ENTRY_SUNFURY_PROT 20436
+
+#define ENTRY_ARA_TECH 20438
+#define ENTRY_ARA_ENGI 20439
+#define ENTRY_ARA_GORKLONN 20460
+
+#define SPELL_DISABLE_VISUAL 35031
+#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this
+#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version)
+
+struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
+{
+ npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Event_Timer;
+ uint32 Wave_Timer;
+ uint32 Phase;
+ bool Wave;
+ uint64 someplayer;
+ uint64 goConsole;
+ Creature* add;
+
+ void Reset()
+ {
+ Event_Timer = 3000;
+ Wave_Timer = 0;
+ Phase = 1;
+ Wave = false;
+ someplayer = 0;
+ goConsole = 0;
+ Creature* add = NULL;
+ }
+
+ void Aggro(Unit *who) { return; }
+
+ /*void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ //we have no way of telling the creature was hit by spell -> got aura applied after 10-12 seconds
+ //then no way for the mobs to actually stop the shutdown as intended.
+ if( spell->Id == SPELL_INTERRUPT_1 )
+ DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL);
+ }*/
+
+ void JustDied(Unit* killer)
+ {
+ DoTextEmote(EMOTE_ABORT, NULL);
+
+ if( someplayer )
+ {
+ Unit* p = Unit::GetUnit((*m_creature),someplayer);
+ if( p && p->GetTypeId() == TYPEID_PLAYER )
+ {
+ switch( m_creature->GetEntry() )
+ {
+ case ENTRY_BNAAR_C_CONSOLE:
+ ((Player*)p)->FailQuest(10299);
+ ((Player*)p)->FailQuest(10329);
+ break;
+ case ENTRY_CORUU_C_CONSOLE:
+ ((Player*)p)->FailQuest(10321);
+ ((Player*)p)->FailQuest(10330);
+ break;
+ case ENTRY_DURO_C_CONSOLE:
+ ((Player*)p)->FailQuest(10322);
+ ((Player*)p)->FailQuest(10338);
+ break;
+ case ENTRY_ARA_C_CONSOLE:
+ ((Player*)p)->FailQuest(10323);
+ ((Player*)p)->FailQuest(10365);
+ break;
+ }
+ }
+ }
+
+ if( goConsole )
+ {
+ if( GameObject* go = GameObject::GetGameObject((*m_creature),goConsole) )
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ }
+
+ void DoWaveSpawnForCreature(Creature *creature)
+ {
+ switch( creature->GetEntry() )
+ {
+ case ENTRY_BNAAR_C_CONSOLE:
+ if( rand()%2 )
+ {
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
+ }
+ else
+ {
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
+ }
+ Wave_Timer = 30000;
+ break;
+ case ENTRY_CORUU_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
+ Wave_Timer = 20000;
+ break;
+ case ENTRY_DURO_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
+ Wave_Timer = 15000;
+ break;
+ case ENTRY_ARA_C_CONSOLE:
+ if( rand()%2 )
+ {
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
+ }
+ else
+ {
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ add = m_creature->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ }
+ Wave_Timer = 15000;
+ break;
+ }
+ }
+ void DoFinalSpawnForCreature(Creature *creature)
+ {
+ switch( creature->GetEntry() )
+ {
+ case ENTRY_BNAAR_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
+ break;
+ case ENTRY_CORUU_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ break;
+ case ENTRY_DURO_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ add = m_creature->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ break;
+ case ENTRY_ARA_C_CONSOLE:
+ add = m_creature->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
+ add = m_creature->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if( add ) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( Event_Timer < diff )
+ {
+ switch(Phase)
+ {
+ case 1:
+ if( someplayer )
+ {
+ Unit* u = Unit::GetUnit((*m_creature),someplayer);
+ if( u && u->GetTypeId() == TYPEID_PLAYER ) DoTextEmote(EMOTE_START, u);
+ }
+ Event_Timer = 60000;
+ Wave = true;
+ ++Phase;
+ break;
+ case 2:
+ DoTextEmote(EMOTE_60, NULL);
+ Event_Timer = 30000;
+ ++Phase;
+ break;
+ case 3:
+ DoTextEmote(EMOTE_30, NULL);
+ Event_Timer = 20000;
+ DoFinalSpawnForCreature(m_creature);
+ ++Phase;
+ break;
+ case 4:
+ DoTextEmote(EMOTE_10, NULL);
+ Event_Timer = 10000;
+ Wave = false;
+ ++Phase;
+ break;
+ case 5:
+ DoTextEmote(EMOTE_COMPLETE, NULL);
+ if( someplayer )
+ {
+ Unit* u = Unit::GetUnit((*m_creature),someplayer);
+ if( u && u->GetTypeId() == TYPEID_PLAYER )
+ ((Player*)u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID());
+ DoCast(m_creature,SPELL_DISABLE_VISUAL);
+ }
+ if( goConsole )
+ {
+ if( GameObject* go = GameObject::GetGameObject((*m_creature),goConsole) )
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ ++Phase;
+ break;
+ }
+ } else Event_Timer -= diff;
+
+ if( Wave )
+ {
+ if( Wave_Timer < diff )
+ {
+ DoWaveSpawnForCreature(m_creature);
+ } else Wave_Timer -= diff;
+ }
+ }
+};
+CreatureAI* GetAI_npc_manaforge_control_console(Creature *_Creature)
+{
+ return new npc_manaforge_control_consoleAI (_Creature);
+}
+
+/*######
+## go_manaforge_control_console
+######*/
+
+//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon)
+bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ Creature* manaforge;
+ manaforge = NULL;
+
+ switch( _GO->GetAreaId() )
+ {
+ case 3726: //b'naar
+ if( (player->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
+ player->HasItemCount(29366,1))
+ manaforge = player->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3730: //coruu
+ if( (player->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
+ player->HasItemCount(29396,1))
+ manaforge = player->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3734: //duro
+ if( (player->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
+ player->HasItemCount(29397,1))
+ manaforge = player->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3722: //ara
+ if( (player->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
+ player->HasItemCount(29411,1))
+ manaforge = player->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ }
+
+ if( manaforge )
+ {
+ ((npc_manaforge_control_consoleAI*)manaforge->AI())->someplayer = player->GetGUID();
+ ((npc_manaforge_control_consoleAI*)manaforge->AI())->goConsole = _GO->GetGUID();
+ _GO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ return true;
+}
+
+/*######
+## npc_protectorate_nether_drake
+######*/
+
+bool GossipHello_npc_protectorate_nether_drake(Player *player, Creature *_Creature)
+{
+ //On Nethery Wings
+ if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778,1) )
+ player->ADD_GOSSIP_ITEM(0, "Fly me to Ultris", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 152; //from drake
+ nodes[1] = 153; //end at drake
+ player->ActivateTaxiPathTo(nodes); //TaxiPath 627 (possibly 627+628(152->153->154->155) )
+ }
+ return true;
+}
+
+/*######
+## npc_veronia
+######*/
+
+bool GossipHello_npc_veronia(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ //Behind Enemy Lines
+ if (player->GetQuestStatus(10652) && !player->GetQuestRewardStatus(10652))
+ player->ADD_GOSSIP_ITEM(0, "Fly me to Manaforge Coruu please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_veronia(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,34905,true); //TaxiPath 606
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_netherstorm()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="go_manaforge_control_console";
+ newscript->pGOHello = &GOHello_go_manaforge_control_console;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_manaforge_control_console";
+ newscript->GetAI = GetAI_npc_manaforge_control_console;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_protectorate_nether_drake";
+ newscript->pGossipHello = &GossipHello_npc_protectorate_nether_drake;
+ newscript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_veronia";
+ newscript->pGossipHello = &GossipHello_npc_veronia;
+ newscript->pGossipSelect = &GossipSelect_npc_veronia;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
index 48d013a52ad..3352713462a 100644
--- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
+++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
@@ -1,229 +1,229 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Onyxia
-SD%Complete: 50
-SDComment: Phase 2 has many errors. Recommend Rewrite of entire script.
-SDCategory: Onyxia's Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WINGBUFFET 18500
-#define SPELL_FLAMEBREATH 18435
-#define SPELL_CLEAVE 19983
-#define SPELL_TAILSWEEP 15847
-#define SPELL_KNOCK_AWAY 19633
-
-#define SPELL_ENGULFINGFLAMES 20019
-#define SPELL_DEEPBREATH 23461
-#define SPELL_FIREBALL 18392
-
-#define SPELL_BELLOWINGROAR 18431
-#define SPELL_HEATED_GROUND 22191
-
-#define SPELL_SUMMONWHELP 17646
-
-#define SAY_AGGRO "How fortuitous. Usually, I must leave my lair to feed."
-#define SAY_KILL "Learn your place mortal!"
-#define SAY_PHASE_2_TRANS "This meaningless exertion bores me. I'll incinerate you from above!"
-#define SAY_PHASE_3_TRANS "It seems you'll need another lesson!"
-#define EMOTE_BREATH "takes a deep breath..."
-
-static float MovementLocations[7][3]=
-{
- {-65.8444, -213.809, -60.2985},
- {22.87639, -217.152, -60.0548},
- {-33.5561, -182.682, -60.9457},
- {-31.4963, -250.123, -60.1278},
- {-2.78999, -181.431, -60.8962},
- {-54.9415, -232.242, -60.5555},
- {10.56655, -241.478, -60.9426},
-};
-
-static float SpawnLocations[4][3]=
-{
- {-30.127, -254.463, -89.440},
- {-30.817, -177.106, -89.258},
- {14.480, -241.560, -85.6300},
- {17.372, -190.840, -85.2810},
-};
-
-#define CREATURE_WHELP 11262
-
-struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI
-{
- boss_onyxiaAI(Creature* c) : ScriptedAI(c) {Reset();}
-
- uint32 Phase;
-
- uint32 FlameBreathTimer;
- uint32 CleaveTimer;
- uint32 TailSweepTimer;
- uint32 MovementTimer;
- uint32 EngulfingFlamesTimer;
- uint32 SummonWhelpsTimer;
- uint32 BellowingRoarTimer;
- uint32 WingBuffetTimer;
-
- void Reset()
- {
- Phase = 1;
-
- FlameBreathTimer = 20000;
- TailSweepTimer = 2000;
- CleaveTimer = 15000;
- MovementTimer = 5000;
- EngulfingFlamesTimer = 15000;
- SummonWhelpsTimer = 45000;
- BellowingRoarTimer = 30000;
- WingBuffetTimer = 17000;
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1))
- {
- Phase = 2;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoYell(SAY_PHASE_2_TRANS, LANG_UNIVERSAL, NULL);
- }
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2))
- {
- Phase = 3;
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- DoYell(SAY_PHASE_3_TRANS, LANG_UNIVERSAL, NULL);
- }
-
- if(Phase == 1 || Phase == 3)
- {
- if(FlameBreathTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
- FlameBreathTimer = 15000;
- }else FlameBreathTimer -= diff;
-
- if(TailSweepTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && !m_creature->HasInArc(M_PI, target))
- DoCast(target, SPELL_TAILSWEEP);
-
- TailSweepTimer = 10000;
- }else TailSweepTimer -= diff;
-
- if(CleaveTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
- CleaveTimer = 10000;
- }else CleaveTimer -= diff;
-
- if(WingBuffetTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
- WingBuffetTimer = 7000 + ((rand()%8)*1000);
- }else WingBuffetTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
- if(Phase == 2)
- {
- if(!m_creature->isHover())
- {
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->SetHover(true);
- }
-
- if(!m_creature->GetMotionMaster()->empty() && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE))
- m_creature->GetMotionMaster()->Clear(false);
-
- if(MovementTimer < diff)
- {
- uint32 random = rand()%8;
- if(random < 7)
- m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);
- else
- {
- DoTextEmote(EMOTE_BREATH, NULL);
- DoCast(m_creature->getVictim(), SPELL_DEEPBREATH);
- }
- MovementTimer = 25000;
- }else MovementTimer -= diff;
-
- if(EngulfingFlamesTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES);
- EngulfingFlamesTimer = 10000;
- }else EngulfingFlamesTimer -= diff;
-
- if(SummonWhelpsTimer < diff)
- {
- uint32 max = rand()%20;
- for(uint8 i = 0; i < max; ++i)
- {
- uint8 random = rand()%4;
- Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if(Whelp)
- Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- }
- SummonWhelpsTimer = 45000;
- }else SummonWhelpsTimer -= diff;
- }
-
- if(Phase == 3)
- {
- if(BellowingRoarTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
- BellowingRoarTimer = 30000;
- }else BellowingRoarTimer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_boss_onyxiaAI(Creature *_Creature)
-{
- return new boss_onyxiaAI (_Creature);
-}
-
-void AddSC_boss_onyxia()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_onyxia";
- newscript->GetAI = GetAI_boss_onyxiaAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Onyxia
+SD%Complete: 50
+SDComment: Phase 2 has many errors. Recommend Rewrite of entire script.
+SDCategory: Onyxia's Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WINGBUFFET 18500
+#define SPELL_FLAMEBREATH 18435
+#define SPELL_CLEAVE 19983
+#define SPELL_TAILSWEEP 15847
+#define SPELL_KNOCK_AWAY 19633
+
+#define SPELL_ENGULFINGFLAMES 20019
+#define SPELL_DEEPBREATH 23461
+#define SPELL_FIREBALL 18392
+
+#define SPELL_BELLOWINGROAR 18431
+#define SPELL_HEATED_GROUND 22191
+
+#define SPELL_SUMMONWHELP 17646
+
+#define SAY_AGGRO "How fortuitous. Usually, I must leave my lair to feed."
+#define SAY_KILL "Learn your place mortal!"
+#define SAY_PHASE_2_TRANS "This meaningless exertion bores me. I'll incinerate you from above!"
+#define SAY_PHASE_3_TRANS "It seems you'll need another lesson!"
+#define EMOTE_BREATH "takes a deep breath..."
+
+static float MovementLocations[7][3]=
+{
+ {-65.8444, -213.809, -60.2985},
+ {22.87639, -217.152, -60.0548},
+ {-33.5561, -182.682, -60.9457},
+ {-31.4963, -250.123, -60.1278},
+ {-2.78999, -181.431, -60.8962},
+ {-54.9415, -232.242, -60.5555},
+ {10.56655, -241.478, -60.9426},
+};
+
+static float SpawnLocations[4][3]=
+{
+ {-30.127, -254.463, -89.440},
+ {-30.817, -177.106, -89.258},
+ {14.480, -241.560, -85.6300},
+ {17.372, -190.840, -85.2810},
+};
+
+#define CREATURE_WHELP 11262
+
+struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI
+{
+ boss_onyxiaAI(Creature* c) : ScriptedAI(c) {Reset();}
+
+ uint32 Phase;
+
+ uint32 FlameBreathTimer;
+ uint32 CleaveTimer;
+ uint32 TailSweepTimer;
+ uint32 MovementTimer;
+ uint32 EngulfingFlamesTimer;
+ uint32 SummonWhelpsTimer;
+ uint32 BellowingRoarTimer;
+ uint32 WingBuffetTimer;
+
+ void Reset()
+ {
+ Phase = 1;
+
+ FlameBreathTimer = 20000;
+ TailSweepTimer = 2000;
+ CleaveTimer = 15000;
+ MovementTimer = 5000;
+ EngulfingFlamesTimer = 15000;
+ SummonWhelpsTimer = 45000;
+ BellowingRoarTimer = 30000;
+ WingBuffetTimer = 17000;
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1))
+ {
+ Phase = 2;
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoYell(SAY_PHASE_2_TRANS, LANG_UNIVERSAL, NULL);
+ }
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2))
+ {
+ Phase = 3;
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ DoYell(SAY_PHASE_3_TRANS, LANG_UNIVERSAL, NULL);
+ }
+
+ if(Phase == 1 || Phase == 3)
+ {
+ if(FlameBreathTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
+ FlameBreathTimer = 15000;
+ }else FlameBreathTimer -= diff;
+
+ if(TailSweepTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && !m_creature->HasInArc(M_PI, target))
+ DoCast(target, SPELL_TAILSWEEP);
+
+ TailSweepTimer = 10000;
+ }else TailSweepTimer -= diff;
+
+ if(CleaveTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ CleaveTimer = 10000;
+ }else CleaveTimer -= diff;
+
+ if(WingBuffetTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
+ WingBuffetTimer = 7000 + ((rand()%8)*1000);
+ }else WingBuffetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ if(Phase == 2)
+ {
+ if(!m_creature->isHover())
+ {
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ m_creature->SetHover(true);
+ }
+
+ if(!m_creature->GetMotionMaster()->empty() && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE))
+ m_creature->GetMotionMaster()->Clear(false);
+
+ if(MovementTimer < diff)
+ {
+ uint32 random = rand()%8;
+ if(random < 7)
+ m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);
+ else
+ {
+ DoTextEmote(EMOTE_BREATH, NULL);
+ DoCast(m_creature->getVictim(), SPELL_DEEPBREATH);
+ }
+ MovementTimer = 25000;
+ }else MovementTimer -= diff;
+
+ if(EngulfingFlamesTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES);
+ EngulfingFlamesTimer = 10000;
+ }else EngulfingFlamesTimer -= diff;
+
+ if(SummonWhelpsTimer < diff)
+ {
+ uint32 max = rand()%20;
+ for(uint8 i = 0; i < max; ++i)
+ {
+ uint8 random = rand()%4;
+ Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ if(Whelp)
+ Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ }
+ SummonWhelpsTimer = 45000;
+ }else SummonWhelpsTimer -= diff;
+ }
+
+ if(Phase == 3)
+ {
+ if(BellowingRoarTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ BellowingRoarTimer = 30000;
+ }else BellowingRoarTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_onyxiaAI(Creature *_Creature)
+{
+ return new boss_onyxiaAI (_Creature);
+}
+
+void AddSC_boss_onyxia()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_onyxia";
+ newscript->GetAI = GetAI_boss_onyxiaAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
index a6b4a65bfb8..cb4be0499fc 100644
--- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
+++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
@@ -1,265 +1,265 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Orgrimmar
-SD%Complete: 100
-SDComment: Quest support: 2460, 5727, 6566
-SDCategory: Orgrimmar
-EndScriptData */
-
-/* ContentData
-npc_neeru_fireblade npc_text + gossip options text missing
-npc_shenthul
-npc_thrall_warchief
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_neeru_fireblade
-######*/
-
-#define QUEST_5727 5727
-
-bool GossipHello_npc_neeru_fireblade(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0, "You may speak frankly, Neeru...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(4513, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_neeru_fireblade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "[PH] ...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(4513, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(QUEST_5727);
- break;
- }
- return true;
-}
-
-/*######
-## npc_shenthul
-######*/
-
-#define QUEST_2460 2460
-
-struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
-{
- npc_shenthulAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- bool CanTalk;
- bool CanEmote;
- uint32 Salute_Timer;
- uint32 Reset_Timer;
- uint64 playerGUID;
-
- void Reset()
- {
- CanTalk = false;
- CanEmote = false;
- Salute_Timer = 6000;
- Reset_Timer = 0;
- playerGUID = 0;
- }
-
- void Aggro(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( CanEmote )
- if( Reset_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) )
- if( temp->GetTypeId() == TYPEID_PLAYER )
- ((Player*)temp)->FailQuest(QUEST_2460);
- Reset();
- } else Reset_Timer -= diff;
-
- if( CanTalk && !CanEmote )
- if( Salute_Timer < diff )
- {
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- CanEmote = true;
- Reset_Timer = 60000;
- } else Salute_Timer -= diff;
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
-{
- return new npc_shenthulAI (_Creature);
-}
-
-bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* quest)
-{
- if( quest->GetQuestId() == QUEST_2460 )
- {
- ((npc_shenthulAI*)creature->AI())->CanTalk = true;
- ((npc_shenthulAI*)creature->AI())->playerGUID = player->GetGUID();
- }
- return true;
-}
-
-bool ReciveEmote_npc_shenthul(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
- if( ((npc_shenthulAI*)_Creature->AI())->CanEmote )
- {
- player->AreaExploredOrEventHappens(QUEST_2460);
- ((npc_shenthulAI*)_Creature->AI())->Reset();
- }
- return true;
-}
-
-/*######
-## npc_thrall_warchief
-######*/
-
-#define QUEST_6566 6566
-
-#define SPELL_CHAIN_LIGHTNING 16033
-#define SPELL_SHOCK 16034
-
-//TODO: verify abilities/timers
-struct TRINITY_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI
-{
- npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 ChainLightning_Timer;
- uint32 Shock_Timer;
-
- void Reset()
- {
- ChainLightning_Timer = 2000;
- Shock_Timer = 8000;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ChainLightning_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
- ChainLightning_Timer = 9000;
- }else ChainLightning_Timer -= diff;
-
- if( Shock_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_SHOCK);
- Shock_Timer = 15000;
- }else Shock_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_thrall_warchief(Creature *_Creature)
-{
- return new npc_thrall_warchiefAI (_Creature);
-}
-
-bool GossipHello_npc_thrall_warchief(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0, "Please share your wisdom with me, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_thrall_warchief(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "What discoveries?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(5733, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Usurper?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(5734, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(5735, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "I... I did not think of it that way, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(5736, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "I live only to serve, Warchief! My life is empty and meaningless without your guidance.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(5737, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(0, "Of course, Warchief!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(5738, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(QUEST_6566);
- break;
- }
- return true;
-}
-
-void AddSC_orgrimmar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_neeru_fireblade";
- newscript->pGossipHello = &GossipHello_npc_neeru_fireblade;
- newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_shenthul";
- newscript->GetAI = GetAI_npc_shenthul;
- newscript->pQuestAccept = &QuestAccept_npc_shenthul;
- newscript->pReceiveEmote = &ReciveEmote_npc_shenthul;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_thrall_warchief";
- newscript->GetAI = GetAI_npc_thrall_warchief;
- newscript->pGossipHello = &GossipHello_npc_thrall_warchief;
- newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Orgrimmar
+SD%Complete: 100
+SDComment: Quest support: 2460, 5727, 6566
+SDCategory: Orgrimmar
+EndScriptData */
+
+/* ContentData
+npc_neeru_fireblade npc_text + gossip options text missing
+npc_shenthul
+npc_thrall_warchief
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_neeru_fireblade
+######*/
+
+#define QUEST_5727 5727
+
+bool GossipHello_npc_neeru_fireblade(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0, "You may speak frankly, Neeru...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(4513, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_neeru_fireblade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "[PH] ...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(4513, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(QUEST_5727);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_shenthul
+######*/
+
+#define QUEST_2460 2460
+
+struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
+{
+ npc_shenthulAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ bool CanTalk;
+ bool CanEmote;
+ uint32 Salute_Timer;
+ uint32 Reset_Timer;
+ uint64 playerGUID;
+
+ void Reset()
+ {
+ CanTalk = false;
+ CanEmote = false;
+ Salute_Timer = 6000;
+ Reset_Timer = 0;
+ playerGUID = 0;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( CanEmote )
+ if( Reset_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) )
+ if( temp->GetTypeId() == TYPEID_PLAYER )
+ ((Player*)temp)->FailQuest(QUEST_2460);
+ Reset();
+ } else Reset_Timer -= diff;
+
+ if( CanTalk && !CanEmote )
+ if( Salute_Timer < diff )
+ {
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ CanEmote = true;
+ Reset_Timer = 60000;
+ } else Salute_Timer -= diff;
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
+{
+ return new npc_shenthulAI (_Creature);
+}
+
+bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* quest)
+{
+ if( quest->GetQuestId() == QUEST_2460 )
+ {
+ ((npc_shenthulAI*)creature->AI())->CanTalk = true;
+ ((npc_shenthulAI*)creature->AI())->playerGUID = player->GetGUID();
+ }
+ return true;
+}
+
+bool ReciveEmote_npc_shenthul(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
+ if( ((npc_shenthulAI*)_Creature->AI())->CanEmote )
+ {
+ player->AreaExploredOrEventHappens(QUEST_2460);
+ ((npc_shenthulAI*)_Creature->AI())->Reset();
+ }
+ return true;
+}
+
+/*######
+## npc_thrall_warchief
+######*/
+
+#define QUEST_6566 6566
+
+#define SPELL_CHAIN_LIGHTNING 16033
+#define SPELL_SHOCK 16034
+
+//TODO: verify abilities/timers
+struct TRINITY_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI
+{
+ npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 ChainLightning_Timer;
+ uint32 Shock_Timer;
+
+ void Reset()
+ {
+ ChainLightning_Timer = 2000;
+ Shock_Timer = 8000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ChainLightning_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
+ ChainLightning_Timer = 9000;
+ }else ChainLightning_Timer -= diff;
+
+ if( Shock_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHOCK);
+ Shock_Timer = 15000;
+ }else Shock_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_thrall_warchief(Creature *_Creature)
+{
+ return new npc_thrall_warchiefAI (_Creature);
+}
+
+bool GossipHello_npc_thrall_warchief(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0, "Please share your wisdom with me, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_thrall_warchief(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "What discoveries?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(5733, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Usurper?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(5734, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(5735, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "I... I did not think of it that way, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(5736, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "I live only to serve, Warchief! My life is empty and meaningless without your guidance.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(5737, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM(0, "Of course, Warchief!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ player->SEND_GOSSIP_MENU(5738, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(QUEST_6566);
+ break;
+ }
+ return true;
+}
+
+void AddSC_orgrimmar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_neeru_fireblade";
+ newscript->pGossipHello = &GossipHello_npc_neeru_fireblade;
+ newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_shenthul";
+ newscript->GetAI = GetAI_npc_shenthul;
+ newscript->pQuestAccept = &QuestAccept_npc_shenthul;
+ newscript->pReceiveEmote = &ReciveEmote_npc_shenthul;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_thrall_warchief";
+ newscript->GetAI = GetAI_npc_thrall_warchief;
+ newscript->pGossipHello = &GossipHello_npc_thrall_warchief;
+ newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
index b97971893f5..163db1c2756 100644
--- a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
+++ b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
@@ -1,140 +1,140 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Amnennar_the_coldbringer
-SD%Complete: 100
-SDComment:
-SDCategory: Razorfen Downs
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_0 "You'll never leave this place... alive."
-#define SAY_1 "Come, spirits, attend your master."
-#define SAY_SLAY "Too...easy!"
-#define SOUND_AGGRO 5825
-#define SOUND_SLAY 5826
-#define SOUND_SUMMON 5829
-
-#define SPELL_AMNENNARSWRATH 13009
-#define SPELL_FROSTBOLT 10179
-
-struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
-{
- boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 AmnenarsWrath_Timer;
- uint32 FrostBolt_Timer;
- bool Spectrals;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- AmnenarsWrath_Timer = 8000;
- FrostBolt_Timer = 1000;
- Spectrals = false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_0,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void KilledUnit()
- {
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void SummonSpectrals(Unit* victim)
- {
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(8585, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //AmnenarsWrath_Timer
- if (AmnenarsWrath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH);
- AmnenarsWrath_Timer = 12000;
- } else AmnenarsWrath_Timer -= diff;
-
- //FrostBolt_Timer
- if (FrostBolt_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_FROSTBOLT);
-
- FrostBolt_Timer = 8000;
- } else FrostBolt_Timer -= diff;
-
- if ( !Spectrals && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
- {
- DoYell(SAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON);
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- SummonSpectrals(target);
- SummonSpectrals(target);
- SummonSpectrals(target);
- Spectrals = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature *_Creature)
-{
- return new boss_amnennar_the_coldbringerAI (_Creature);
-}
-
-void AddSC_boss_amnennar_the_coldbringer()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_amnennar_the_coldbringer";
- newscript->GetAI = GetAI_boss_amnennar_the_coldbringer;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Amnennar_the_coldbringer
+SD%Complete: 100
+SDComment:
+SDCategory: Razorfen Downs
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_0 "You'll never leave this place... alive."
+#define SAY_1 "Come, spirits, attend your master."
+#define SAY_SLAY "Too...easy!"
+#define SOUND_AGGRO 5825
+#define SOUND_SLAY 5826
+#define SOUND_SUMMON 5829
+
+#define SPELL_AMNENNARSWRATH 13009
+#define SPELL_FROSTBOLT 10179
+
+struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
+{
+ boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 AmnenarsWrath_Timer;
+ uint32 FrostBolt_Timer;
+ bool Spectrals;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ AmnenarsWrath_Timer = 8000;
+ FrostBolt_Timer = 1000;
+ Spectrals = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_0,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void KilledUnit()
+ {
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void SummonSpectrals(Unit* victim)
+ {
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(8585, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //AmnenarsWrath_Timer
+ if (AmnenarsWrath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH);
+ AmnenarsWrath_Timer = 12000;
+ } else AmnenarsWrath_Timer -= diff;
+
+ //FrostBolt_Timer
+ if (FrostBolt_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_FROSTBOLT);
+
+ FrostBolt_Timer = 8000;
+ } else FrostBolt_Timer -= diff;
+
+ if ( !Spectrals && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
+ {
+ DoYell(SAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON);
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ SummonSpectrals(target);
+ SummonSpectrals(target);
+ SummonSpectrals(target);
+ Spectrals = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature *_Creature)
+{
+ return new boss_amnennar_the_coldbringerAI (_Creature);
+}
+
+void AddSC_boss_amnennar_the_coldbringer()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_amnennar_the_coldbringer";
+ newscript->GetAI = GetAI_boss_amnennar_the_coldbringer;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
index eb11ab38826..03a53d50297 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
@@ -1,107 +1,107 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ayamiss
-SD%Complete: 50
-SDComment: VERIFY SCRIPT
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-/*
-To do:
-make him fly from 70-100%
-*/
-
-#define SPELL_STINGERSPRAY 25749
-#define SPELL_POISONSTINGER 25748 //only used in phase1
-#define SPELL_SUMMONSWARMER 25844 //might be 25708
-// #define SPELL_PARALYZE 23414 doesnt work correct (core)
-
-struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI
-{
- boss_ayamissAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- Unit *pTarget;
- uint32 STINGERSPRAY_Timer;
- uint32 POISONSTINGER_Timer;
- uint32 SUMMONSWARMER_Timer;
- uint32 phase;
-
- void Reset()
- {
- pTarget = NULL;
- STINGERSPRAY_Timer = 30000;
- POISONSTINGER_Timer = 30000;
- SUMMONSWARMER_Timer = 60000;
- phase=1;
- }
-
- void Aggro(Unit *who)
- {
- pTarget = who;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //If he is 70% start phase 2
- if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- phase=2;
- }
-
- //STINGERSPRAY_Timer (only in phase2)
- if (phase==2 && STINGERSPRAY_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY);
- STINGERSPRAY_Timer = 30000;
- }else STINGERSPRAY_Timer -= diff;
-
- //POISONSTINGER_Timer (only in phase1)
- if (phase==1 && POISONSTINGER_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POISONSTINGER);
- POISONSTINGER_Timer = 30000;
- }else POISONSTINGER_Timer -= diff;
-
- //SUMMONSWARMER_Timer (only in phase1)
- if (SUMMONSWARMER_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER);
- SUMMONSWARMER_Timer = 60000;
- }else SUMMONSWARMER_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ayamiss(Creature *_Creature)
-{
- return new boss_ayamissAI (_Creature);
-}
-
-void AddSC_boss_ayamiss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ayamiss";
- newscript->GetAI = GetAI_boss_ayamiss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ayamiss
+SD%Complete: 50
+SDComment: VERIFY SCRIPT
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+/*
+To do:
+make him fly from 70-100%
+*/
+
+#define SPELL_STINGERSPRAY 25749
+#define SPELL_POISONSTINGER 25748 //only used in phase1
+#define SPELL_SUMMONSWARMER 25844 //might be 25708
+// #define SPELL_PARALYZE 23414 doesnt work correct (core)
+
+struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI
+{
+ boss_ayamissAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ Unit *pTarget;
+ uint32 STINGERSPRAY_Timer;
+ uint32 POISONSTINGER_Timer;
+ uint32 SUMMONSWARMER_Timer;
+ uint32 phase;
+
+ void Reset()
+ {
+ pTarget = NULL;
+ STINGERSPRAY_Timer = 30000;
+ POISONSTINGER_Timer = 30000;
+ SUMMONSWARMER_Timer = 60000;
+ phase=1;
+ }
+
+ void Aggro(Unit *who)
+ {
+ pTarget = who;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //If he is 70% start phase 2
+ if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ phase=2;
+ }
+
+ //STINGERSPRAY_Timer (only in phase2)
+ if (phase==2 && STINGERSPRAY_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY);
+ STINGERSPRAY_Timer = 30000;
+ }else STINGERSPRAY_Timer -= diff;
+
+ //POISONSTINGER_Timer (only in phase1)
+ if (phase==1 && POISONSTINGER_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POISONSTINGER);
+ POISONSTINGER_Timer = 30000;
+ }else POISONSTINGER_Timer -= diff;
+
+ //SUMMONSWARMER_Timer (only in phase1)
+ if (SUMMONSWARMER_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER);
+ SUMMONSWARMER_Timer = 60000;
+ }else SUMMONSWARMER_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ayamiss(Creature *_Creature)
+{
+ return new boss_ayamissAI (_Creature);
+}
+
+void AddSC_boss_ayamiss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ayamiss";
+ newscript->GetAI = GetAI_boss_ayamiss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
index 55383d1a501..295b4aec1c3 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Buru
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Buru
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
index 08bc6e9d658..3a287d8b6ae 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kurinnaxx
-SD%Complete: 100
-SDComment: VERIFY SCRIPT AND SQL
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MORTALWOUND 25646
-#define SPELL_SANDTRAP 25656
-#define SPELL_ENRAGE 28798
-
-struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI
-{
- boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- Unit *pTarget;
- uint32 MORTALWOUND_Timer;
- uint32 SANDTRAP_Timer;
- uint32 i;
-
- void Reset()
- {
- i=0;
- pTarget = NULL;
- MORTALWOUND_Timer = 30000;
- SANDTRAP_Timer = 30000;
- }
-
- void Aggro(Unit *who)
- {
- pTarget = who;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <30% cast enrage
- if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- i=1;
- DoCast(m_creature->getVictim(),SPELL_ENRAGE);
- }
-
- //MORTALWOUND_Timer
- if (MORTALWOUND_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALWOUND);
- MORTALWOUND_Timer = 30000;
- }else MORTALWOUND_Timer -= diff;
-
- //SANDTRAP_Timer
- if (SANDTRAP_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SANDTRAP);
- SANDTRAP_Timer = 30000;
- }else SANDTRAP_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_kurinnaxx(Creature *_Creature)
-{
- return new boss_kurinnaxxAI (_Creature);
-}
-
-void AddSC_boss_kurinnaxx()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kurinnaxx";
- newscript->GetAI = GetAI_boss_kurinnaxx;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kurinnaxx
+SD%Complete: 100
+SDComment: VERIFY SCRIPT AND SQL
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MORTALWOUND 25646
+#define SPELL_SANDTRAP 25656
+#define SPELL_ENRAGE 28798
+
+struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI
+{
+ boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ Unit *pTarget;
+ uint32 MORTALWOUND_Timer;
+ uint32 SANDTRAP_Timer;
+ uint32 i;
+
+ void Reset()
+ {
+ i=0;
+ pTarget = NULL;
+ MORTALWOUND_Timer = 30000;
+ SANDTRAP_Timer = 30000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ pTarget = who;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <30% cast enrage
+ if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ i=1;
+ DoCast(m_creature->getVictim(),SPELL_ENRAGE);
+ }
+
+ //MORTALWOUND_Timer
+ if (MORTALWOUND_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALWOUND);
+ MORTALWOUND_Timer = 30000;
+ }else MORTALWOUND_Timer -= diff;
+
+ //SANDTRAP_Timer
+ if (SANDTRAP_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SANDTRAP);
+ SANDTRAP_Timer = 30000;
+ }else SANDTRAP_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_kurinnaxx(Creature *_Creature)
+{
+ return new boss_kurinnaxxAI (_Creature);
+}
+
+void AddSC_boss_kurinnaxx()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kurinnaxx";
+ newscript->GetAI = GetAI_boss_kurinnaxx;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
index e117aa17ddb..836dd3f8065 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
@@ -1,117 +1,117 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Moam
-SD%Complete: 100
-SDComment: VERIFY SCRIPT AND SQL
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_TRAMPLE 15550
-#define SPELL_DRAINMANA 27256
-#define SPELL_ARCANEERUPTION 25672
-#define SPELL_SUMMONMANA 25681
-#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep
-
-#define SAY_MANA "moam bristles with energy!"
-
-struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI
-{
- boss_moamAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- Unit *pTarget;
- uint32 TRAMPLE_Timer;
- uint32 DRAINMANA_Timer;
- uint32 SUMMONMANA_Timer;
- uint32 i;
- uint32 j;
-
- void Reset()
- {
- i=0;
- j=0;
- pTarget = NULL;
- TRAMPLE_Timer = 30000;
- DRAINMANA_Timer = 30000;
- }
-
- void Aggro(Unit *who)
- {
- pTarget = who;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are 100%MANA cast Arcane Erruption
- //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION);
- DoYell(SAY_MANA,LANG_UNIVERSAL,NULL);
- }
-
- //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep
- //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- i=1;
- DoCast(m_creature->getVictim(),SPELL_SUMMONMANA);
- DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP);
- }
-
- //SUMMONMANA_Timer
- if (i==1 && SUMMONMANA_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUMMONMANA);
- SUMMONMANA_Timer = 90000;
- }else SUMMONMANA_Timer -= diff;
-
- //TRAMPLE_Timer
- if (TRAMPLE_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
- j=1;
-
- TRAMPLE_Timer = 30000;
- }else TRAMPLE_Timer -= diff;
-
- //DRAINMANA_Timer
- if (DRAINMANA_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DRAINMANA);
- DRAINMANA_Timer = 30000;
- }else DRAINMANA_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_moam(Creature *_Creature)
-{
- return new boss_moamAI (_Creature);
-}
-
-void AddSC_boss_moam()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_moam";
- newscript->GetAI = GetAI_boss_moam;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Moam
+SD%Complete: 100
+SDComment: VERIFY SCRIPT AND SQL
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_TRAMPLE 15550
+#define SPELL_DRAINMANA 27256
+#define SPELL_ARCANEERUPTION 25672
+#define SPELL_SUMMONMANA 25681
+#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep
+
+#define SAY_MANA "moam bristles with energy!"
+
+struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI
+{
+ boss_moamAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ Unit *pTarget;
+ uint32 TRAMPLE_Timer;
+ uint32 DRAINMANA_Timer;
+ uint32 SUMMONMANA_Timer;
+ uint32 i;
+ uint32 j;
+
+ void Reset()
+ {
+ i=0;
+ j=0;
+ pTarget = NULL;
+ TRAMPLE_Timer = 30000;
+ DRAINMANA_Timer = 30000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ pTarget = who;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are 100%MANA cast Arcane Erruption
+ //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION);
+ DoYell(SAY_MANA,LANG_UNIVERSAL,NULL);
+ }
+
+ //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep
+ //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ i=1;
+ DoCast(m_creature->getVictim(),SPELL_SUMMONMANA);
+ DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP);
+ }
+
+ //SUMMONMANA_Timer
+ if (i==1 && SUMMONMANA_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUMMONMANA);
+ SUMMONMANA_Timer = 90000;
+ }else SUMMONMANA_Timer -= diff;
+
+ //TRAMPLE_Timer
+ if (TRAMPLE_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
+ j=1;
+
+ TRAMPLE_Timer = 30000;
+ }else TRAMPLE_Timer -= diff;
+
+ //DRAINMANA_Timer
+ if (DRAINMANA_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DRAINMANA);
+ DRAINMANA_Timer = 30000;
+ }else DRAINMANA_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_moam(Creature *_Creature)
+{
+ return new boss_moamAI (_Creature);
+}
+
+void AddSC_boss_moam()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_moam";
+ newscript->GetAI = GetAI_boss_moam;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
index ad62debf57a..a86b080a3fe 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
@@ -1,36 +1,36 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ossirian
-SD%Complete: 0
-SDComment: Place holder
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-//Ossirian
-//8593 I am rejuvinated!
-//8594 I have... failed
-//8595 My powers are renewed!
-//8596 My powers return!
-//8597 Protect the city at all costs!
-//8598 Sands of the desert rise and block out the sun!
-//8599 The walls have been breached!
-//8600 To your posts. Defend the city.
-//8601 Tresspassers will be terminated.
-//8602 You are terminated.
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ossirian
+SD%Complete: 0
+SDComment: Place holder
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+//Ossirian
+//8593 I am rejuvinated!
+//8594 I have... failed
+//8595 My powers are renewed!
+//8596 My powers return!
+//8597 Protect the city at all costs!
+//8598 Sands of the desert rise and block out the sun!
+//8599 The walls have been breached!
+//8600 To your posts. Defend the city.
+//8601 Tresspassers will be terminated.
+//8602 You are terminated.
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
index 0d6a486a41e..4376fa515df 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
@@ -1,42 +1,42 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Rajaxx
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-//Rajaxx
-//8603 Attack and make them pay dearly!
-//8604 Breath your last!
-//8605 Crush them! Drive them out!
-//8606 Do not hesitate! Destroy them!
-//8613 Warriors! Captians! Continue the fight...
-//8614 You are not worth my time $N!
-//8612 The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!
-//8610 No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!
-//8608 Fear is for the enemy! Fear and death!
-//8611 Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!
-//8607 Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!
-//8609 Impudent fool! I will kill you myself!
-
-//Andorov - no sound
-//"Remember, Rajaxx, when I said I'd kill you last? I lied..."
-//"They come now. Try not to get yourself killed, young blood."
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Rajaxx
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+//Rajaxx
+//8603 Attack and make them pay dearly!
+//8604 Breath your last!
+//8605 Crush them! Drive them out!
+//8606 Do not hesitate! Destroy them!
+//8613 Warriors! Captians! Continue the fight...
+//8614 You are not worth my time $N!
+//8612 The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!
+//8610 No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!
+//8608 Fear is for the enemy! Fear and death!
+//8611 Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!
+//8607 Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!
+//8609 Impudent fool! I will kill you myself!
+
+//Andorov - no sound
+//"Remember, Rajaxx, when I said I'd kill you last? I lied..."
+//"They come now. Try not to get yourself killed, young blood."
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
index 627932c9173..825024f17be 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Ruins_of_Ahnqiraj
-SD%Complete: 0
-SDComment: Place holder
-SDCategory: Ruins of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Ruins_of_Ahnqiraj
+SD%Complete: 0
+SDComment: Place holder
+SDCategory: Ruins of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
index b4f0619e40b..50764c4d022 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
@@ -1,171 +1,171 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Arcanist_Doan
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_POLYMORPH 12826
-#define SPELL_AOESILENCE 8988
-#define SPELL_ARCANEEXPLOSION3 8438
-#define SPELL_ARCANEEXPLOSION4 8439
-#define SPELL_FIREAOE 9435
-#define SPELL_BLINK 1953
-#define SPELL_FIREBALL 21162
-#define SPELL_MANASHIELD4 10191
-#define SPELL_ARCANEBUBBLE 9438
-
-#define SAY_AGGRO "You will not defile these mysteries!"
-#define SAY_SPECIALAE "Burn in righteous fire!"
-
-#define SOUND_AGGRO 5842
-#define SOUND_SPECIALAE 5843
-
-struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI
-{
- boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FullAOE_Timer;
- uint32 Polymorph_Timer;
- uint32 Yell_Timer;
- uint32 ArcaneBubble_Timer;
- uint32 AoESilence_Timer;
- uint32 ArcaneExplosion3_Timer;
- uint32 ArcaneExplosion4_Timer;
- uint32 Blink_Timer;
- uint32 Fireball_Timer;
- uint32 ManaShield4_Timer;
-
- void Reset()
- {
- FullAOE_Timer = 5000;
- Polymorph_Timer = 1;
- Yell_Timer = 2000;
- ArcaneBubble_Timer = 3000;
- AoESilence_Timer = 20000;
- ArcaneExplosion3_Timer = 10000;
- ArcaneExplosion4_Timer = 10000;
- Blink_Timer = 40000;
- Fireball_Timer = 6000;
- ManaShield4_Timer = 70000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <50% hp cast Arcane Bubble and start casting SPECIAL FIRE AOE
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- if (Polymorph_Timer < diff)
- {
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_POLYMORPH);
- Polymorph_Timer = 40000;
- }else Polymorph_Timer -= diff;
-
- if (Yell_Timer < diff)
- {
- DoYell(SAY_SPECIALAE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPECIALAE);
- Yell_Timer = 40000;
- }else Yell_Timer -= diff;
-
- if (ArcaneBubble_Timer < diff)
- {
- DoCast(m_creature,SPELL_ARCANEBUBBLE);
- ArcaneBubble_Timer = 40000;
- }else ArcaneBubble_Timer -= diff;
-
- if (FullAOE_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREAOE);
- FullAOE_Timer = 40000;
- }else FullAOE_Timer -= diff;
- }
-
- //AoESilence_Timer
- if (AoESilence_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_AOESILENCE);
- AoESilence_Timer = 30000;
- }else AoESilence_Timer -= diff;
-
- //ArcaneExplosion3_Timer
- if (ArcaneExplosion3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION3);
- ArcaneExplosion3_Timer = 8000;
- }else ArcaneExplosion3_Timer -= diff;
-
- //ArcaneExplosion4_Timer
- if (ArcaneExplosion4_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION4);
- ArcaneExplosion4_Timer = 10000;
- }else ArcaneExplosion4_Timer -= diff;
-
- //Blink_Timer
- if (Blink_Timer < diff)
- {
- DoCast(m_creature,SPELL_BLINK);
- Blink_Timer = 30000;
- }else Blink_Timer -= diff;
-
- //Fireball_Timer
- if (Fireball_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALL);
- Fireball_Timer = 12000;
- }else Fireball_Timer -= diff;
-
- //ManaShiled4_Timer
- if (ManaShield4_Timer < diff)
- {
- DoCast(m_creature,SPELL_MANASHIELD4);
- ManaShield4_Timer = 70000;
- }else ManaShield4_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_arcanist_doan(Creature *_Creature)
-{
- return new boss_arcanist_doanAI (_Creature);
-}
-
-void AddSC_boss_arcanist_doan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_arcanist_doan";
- newscript->GetAI = GetAI_boss_arcanist_doan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Arcanist_Doan
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_POLYMORPH 12826
+#define SPELL_AOESILENCE 8988
+#define SPELL_ARCANEEXPLOSION3 8438
+#define SPELL_ARCANEEXPLOSION4 8439
+#define SPELL_FIREAOE 9435
+#define SPELL_BLINK 1953
+#define SPELL_FIREBALL 21162
+#define SPELL_MANASHIELD4 10191
+#define SPELL_ARCANEBUBBLE 9438
+
+#define SAY_AGGRO "You will not defile these mysteries!"
+#define SAY_SPECIALAE "Burn in righteous fire!"
+
+#define SOUND_AGGRO 5842
+#define SOUND_SPECIALAE 5843
+
+struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI
+{
+ boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FullAOE_Timer;
+ uint32 Polymorph_Timer;
+ uint32 Yell_Timer;
+ uint32 ArcaneBubble_Timer;
+ uint32 AoESilence_Timer;
+ uint32 ArcaneExplosion3_Timer;
+ uint32 ArcaneExplosion4_Timer;
+ uint32 Blink_Timer;
+ uint32 Fireball_Timer;
+ uint32 ManaShield4_Timer;
+
+ void Reset()
+ {
+ FullAOE_Timer = 5000;
+ Polymorph_Timer = 1;
+ Yell_Timer = 2000;
+ ArcaneBubble_Timer = 3000;
+ AoESilence_Timer = 20000;
+ ArcaneExplosion3_Timer = 10000;
+ ArcaneExplosion4_Timer = 10000;
+ Blink_Timer = 40000;
+ Fireball_Timer = 6000;
+ ManaShield4_Timer = 70000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <50% hp cast Arcane Bubble and start casting SPECIAL FIRE AOE
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ if (Polymorph_Timer < diff)
+ {
+ Unit* target = NULL;
+
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_POLYMORPH);
+ Polymorph_Timer = 40000;
+ }else Polymorph_Timer -= diff;
+
+ if (Yell_Timer < diff)
+ {
+ DoYell(SAY_SPECIALAE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPECIALAE);
+ Yell_Timer = 40000;
+ }else Yell_Timer -= diff;
+
+ if (ArcaneBubble_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ARCANEBUBBLE);
+ ArcaneBubble_Timer = 40000;
+ }else ArcaneBubble_Timer -= diff;
+
+ if (FullAOE_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREAOE);
+ FullAOE_Timer = 40000;
+ }else FullAOE_Timer -= diff;
+ }
+
+ //AoESilence_Timer
+ if (AoESilence_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_AOESILENCE);
+ AoESilence_Timer = 30000;
+ }else AoESilence_Timer -= diff;
+
+ //ArcaneExplosion3_Timer
+ if (ArcaneExplosion3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION3);
+ ArcaneExplosion3_Timer = 8000;
+ }else ArcaneExplosion3_Timer -= diff;
+
+ //ArcaneExplosion4_Timer
+ if (ArcaneExplosion4_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION4);
+ ArcaneExplosion4_Timer = 10000;
+ }else ArcaneExplosion4_Timer -= diff;
+
+ //Blink_Timer
+ if (Blink_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BLINK);
+ Blink_Timer = 30000;
+ }else Blink_Timer -= diff;
+
+ //Fireball_Timer
+ if (Fireball_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALL);
+ Fireball_Timer = 12000;
+ }else Fireball_Timer -= diff;
+
+ //ManaShiled4_Timer
+ if (ManaShield4_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_MANASHIELD4);
+ ManaShield4_Timer = 70000;
+ }else ManaShield4_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_arcanist_doan(Creature *_Creature)
+{
+ return new boss_arcanist_doanAI (_Creature);
+}
+
+void AddSC_boss_arcanist_doan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_arcanist_doan";
+ newscript->GetAI = GetAI_boss_arcanist_doan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
index c25b2217298..4ea395a8038 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
@@ -1,97 +1,97 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Azshir_the_Sleepless
-SD%Complete: 80
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CALLOFTHEGRAVE 17831
-#define SPELL_TERRIFY 7399
-#define SPELL_SOULSIPHON 7290
-
-struct TRINITY_DLL_DECL boss_azshir_the_sleeplessAI : public ScriptedAI
-{
- boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SoulSiphon_Timer;
- uint32 CallOftheGrave_Timer;
- uint32 Terrify_Timer;
-
- void Reset()
- {
- SoulSiphon_Timer = 1;
- CallOftheGrave_Timer = 30000;
- Terrify_Timer = 20000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <50% hp cast Soul Siphon rank 1
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //SoulSiphon_Timer
- if (SoulSiphon_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SOULSIPHON);
- return;
-
- SoulSiphon_Timer = 20000;
- }else SoulSiphon_Timer -= diff;
- }
-
- //CallOfTheGrave_Timer
- if (CallOftheGrave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE);
- CallOftheGrave_Timer = 30000;
- }else CallOftheGrave_Timer -= diff;
-
- //Terrify_Timer
- if (Terrify_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TERRIFY);
- Terrify_Timer = 20000;
- }else Terrify_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_azshir_the_sleepless(Creature *_Creature)
-{
- return new boss_azshir_the_sleeplessAI (_Creature);
-}
-
-void AddSC_boss_azshir_the_sleepless()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_azshir_the_sleepless";
- newscript->GetAI = GetAI_boss_azshir_the_sleepless;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Azshir_the_Sleepless
+SD%Complete: 80
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CALLOFTHEGRAVE 17831
+#define SPELL_TERRIFY 7399
+#define SPELL_SOULSIPHON 7290
+
+struct TRINITY_DLL_DECL boss_azshir_the_sleeplessAI : public ScriptedAI
+{
+ boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SoulSiphon_Timer;
+ uint32 CallOftheGrave_Timer;
+ uint32 Terrify_Timer;
+
+ void Reset()
+ {
+ SoulSiphon_Timer = 1;
+ CallOftheGrave_Timer = 30000;
+ Terrify_Timer = 20000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <50% hp cast Soul Siphon rank 1
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //SoulSiphon_Timer
+ if (SoulSiphon_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SOULSIPHON);
+ return;
+
+ SoulSiphon_Timer = 20000;
+ }else SoulSiphon_Timer -= diff;
+ }
+
+ //CallOfTheGrave_Timer
+ if (CallOftheGrave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE);
+ CallOftheGrave_Timer = 30000;
+ }else CallOftheGrave_Timer -= diff;
+
+ //Terrify_Timer
+ if (Terrify_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TERRIFY);
+ Terrify_Timer = 20000;
+ }else Terrify_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_azshir_the_sleepless(Creature *_Creature)
+{
+ return new boss_azshir_the_sleeplessAI (_Creature);
+}
+
+void AddSC_boss_azshir_the_sleepless()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_azshir_the_sleepless";
+ newscript->GetAI = GetAI_boss_azshir_the_sleepless;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
index c55050fc69e..9fa5bee9714 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
@@ -1,136 +1,136 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Bloodmage_Thalnos
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTNOVA2 865
-#define SPELL_FLAMESHOCK3 8053
-#define SPELL_SHADOWBOLT5 1106
-#define SPELL_FLAMESPIKE 8814
-#define SPELL_FIRENOVA 16079
-
-#define SAY_AGGRO "We hunger for vengeance."
-#define SAY_HEALTH "No rest... for the angry dead!"
-#define SAY_DEATH "More... More souls!"
-
-#define SOUND_AGGRO 5844
-#define SOUND_HEALTH 5846
-#define SOUND_DEATH 5845
-
-struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI
-{
- boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FrostNova2_Timer;
- uint32 FlameShock3_Timer;
- uint32 ShadowBolt5_Timer;
- uint32 FlameSpike_Timer;
- uint32 FireNova_Timer;
- uint32 Yell_Timer;
-
- void Reset()
- {
- Yell_Timer = 1;
- FrostNova2_Timer = 10000;
- FlameShock3_Timer = 15000;
- ShadowBolt5_Timer = 20000;
- FlameSpike_Timer = 20000;
- FireNova_Timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <35% hp
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 35)
- {
- Yell_Timer -= diff;
-
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH);
- Yell_Timer = 900000;
- }
- }
-
- //FrostNova2_Timer
- if (FrostNova2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA2);
- FrostNova2_Timer = 10000;
- }else FrostNova2_Timer -= diff;
-
- //FlameShock3_Timer
- if (FlameShock3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK3);
- FlameShock3_Timer = 15000;
- }else FlameShock3_Timer -= diff;
-
- //ShadowBolt5_Timer
- if (ShadowBolt5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT5);
- ShadowBolt5_Timer = 20000;
- }else ShadowBolt5_Timer -= diff;
-
- //FlameSpike_Timer
- if (FlameSpike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMESPIKE);
- FlameSpike_Timer = 30000;
- }else FlameSpike_Timer -= diff;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 20000;
- }else FireNova_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_bloodmage_thalnos(Creature *_Creature)
-{
- return new boss_bloodmage_thalnosAI (_Creature);
-}
-
-void AddSC_boss_bloodmage_thalnos()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_bloodmage_thalnos";
- newscript->GetAI = GetAI_boss_bloodmage_thalnos;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Bloodmage_Thalnos
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTNOVA2 865
+#define SPELL_FLAMESHOCK3 8053
+#define SPELL_SHADOWBOLT5 1106
+#define SPELL_FLAMESPIKE 8814
+#define SPELL_FIRENOVA 16079
+
+#define SAY_AGGRO "We hunger for vengeance."
+#define SAY_HEALTH "No rest... for the angry dead!"
+#define SAY_DEATH "More... More souls!"
+
+#define SOUND_AGGRO 5844
+#define SOUND_HEALTH 5846
+#define SOUND_DEATH 5845
+
+struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI
+{
+ boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FrostNova2_Timer;
+ uint32 FlameShock3_Timer;
+ uint32 ShadowBolt5_Timer;
+ uint32 FlameSpike_Timer;
+ uint32 FireNova_Timer;
+ uint32 Yell_Timer;
+
+ void Reset()
+ {
+ Yell_Timer = 1;
+ FrostNova2_Timer = 10000;
+ FlameShock3_Timer = 15000;
+ ShadowBolt5_Timer = 20000;
+ FlameSpike_Timer = 20000;
+ FireNova_Timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <35% hp
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 35)
+ {
+ Yell_Timer -= diff;
+
+ if (Yell_Timer < diff)
+ {
+ DoYell(SAY_HEALTH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HEALTH);
+ Yell_Timer = 900000;
+ }
+ }
+
+ //FrostNova2_Timer
+ if (FrostNova2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTNOVA2);
+ FrostNova2_Timer = 10000;
+ }else FrostNova2_Timer -= diff;
+
+ //FlameShock3_Timer
+ if (FlameShock3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK3);
+ FlameShock3_Timer = 15000;
+ }else FlameShock3_Timer -= diff;
+
+ //ShadowBolt5_Timer
+ if (ShadowBolt5_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT5);
+ ShadowBolt5_Timer = 20000;
+ }else ShadowBolt5_Timer -= diff;
+
+ //FlameSpike_Timer
+ if (FlameSpike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMESPIKE);
+ FlameSpike_Timer = 30000;
+ }else FlameSpike_Timer -= diff;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 20000;
+ }else FireNova_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_bloodmage_thalnos(Creature *_Creature)
+{
+ return new boss_bloodmage_thalnosAI (_Creature);
+}
+
+void AddSC_boss_bloodmage_thalnos()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_bloodmage_thalnos";
+ newscript->GetAI = GetAI_boss_bloodmage_thalnos;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
index da79d293395..de1fd991c33 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
@@ -1,197 +1,197 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Herod
-SD%Complete: 90
-SDComment: Missing adds spawn at death
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_RUSHINGCHARGE 32021
-#define SPELL_RUSHINGCHARGE1 6268
-
-#define SPELL_CLEAVE 11608
-#define SPELL_WHIRLWIND 8989
-#define SPELL_SUNDERARMOR 16145
-#define SPELL_REND 21949
-#define SPELL_THUNDERCLAP 15588
-#define SPELL_SLAM 11430
-#define SPELL_BERSERKERSTANCE 2458
-#define SPELL_ENRAGE 28747
-#define SPELL_FIREBALL11 10151
-#define SPELL_CONEOFCOLD5 10161
-
-#define SAY_AGGRO "Ah, I have been waiting for a real challenge!"
-#define SAY_WHIRLWIND "Blades of Light!"
-#define SAY_ENRAGE "Light, give me strength!"
-#define SAY_DEATH "Hah, is that all?"
-
-#define SOUND_AGGRO 5830
-#define SOUND_WHIRLWIND 5832
-#define SOUND_ENRAGE 5833
-#define SOUND_DEATH 5831
-
-struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI
-{
- boss_herodAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Yell_Timer;
- uint32 Enrage_Timer;
- uint32 Cleave_Timer;
- uint32 Whirlwind_Timer;
- uint32 SunderArmor_Timer;
- uint32 Rend_Timer;
- uint32 ThunderClap_Timer;
- uint32 Slam_Timer;
- uint32 Fireball11_Timer;
- uint32 ConeOfCold5_Timer;
-
- void Reset()
- {
- Yell_Timer = 58000;
- Whirlwind_Timer = 60000;
- Enrage_Timer = 0;
- Cleave_Timer = 15000;
- SunderArmor_Timer = 40000;
- Rend_Timer = 25000;
- ThunderClap_Timer = 25000;
- Slam_Timer = 20000;
- Fireball11_Timer = 30000;
- ConeOfCold5_Timer = 40000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
-
- //Activate Berserker Stance
- DoCast(m_creature,SPELL_BERSERKERSTANCE);
-
- //Switch between 2 different charge methods
- switch (rand()%2)
- {
- case 0:
- DoCast(m_creature,SPELL_RUSHINGCHARGE);
- break;
- case 1:
- DoCast(m_creature,SPELL_RUSHINGCHARGE1);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <10% hp goes Enraged
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff)
- {
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ENRAGE);
-
- DoCast(m_creature,SPELL_ENRAGE);
-
- //Shouldn't cast this agian
- Enrage_Timer = diff;
- }
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 15000;
- }else Cleave_Timer -= diff;
-
- //Yelling and Whirlwind casting
- if (Yell_Timer < diff)
- {
- //Say Whirlwind monologe
- DoYell(SAY_WHIRLWIND,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_WHIRLWIND);
-
- Yell_Timer = 30000;
- }else Yell_Timer -= diff;
-
- if (Whirlwind_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
- Whirlwind_Timer = 30000;
- }else Whirlwind_Timer -= diff;
-
- //SunderArmor_Timer
- if (SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
- SunderArmor_Timer = 40000;
- }else SunderArmor_Timer -= diff;
-
- //Rend_Timer
- if (Rend_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REND);
- Rend_Timer = 25000;
- }else Rend_Timer -= diff;
-
- //ThunderClap_Timer
- if (ThunderClap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- ThunderClap_Timer = 20000;
- }else ThunderClap_Timer -= diff;
-
- //Slam_Timer
- if (Slam_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLAM);
- Slam_Timer = 20000;
- }else Slam_Timer -= diff;
-
- //Fireball11_Timer
- if (Fireball11_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALL11);
- Fireball11_Timer = 30000;
- }else Fireball11_Timer -= diff;
-
- //ConeOfCold5_Timer
- if (ConeOfCold5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONEOFCOLD5);
- ConeOfCold5_Timer = 40000;
- }else ConeOfCold5_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_herod(Creature *_Creature)
-{
- return new boss_herodAI (_Creature);
-}
-
-void AddSC_boss_herod()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_herod";
- newscript->GetAI = GetAI_boss_herod;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Herod
+SD%Complete: 90
+SDComment: Missing adds spawn at death
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_RUSHINGCHARGE 32021
+#define SPELL_RUSHINGCHARGE1 6268
+
+#define SPELL_CLEAVE 11608
+#define SPELL_WHIRLWIND 8989
+#define SPELL_SUNDERARMOR 16145
+#define SPELL_REND 21949
+#define SPELL_THUNDERCLAP 15588
+#define SPELL_SLAM 11430
+#define SPELL_BERSERKERSTANCE 2458
+#define SPELL_ENRAGE 28747
+#define SPELL_FIREBALL11 10151
+#define SPELL_CONEOFCOLD5 10161
+
+#define SAY_AGGRO "Ah, I have been waiting for a real challenge!"
+#define SAY_WHIRLWIND "Blades of Light!"
+#define SAY_ENRAGE "Light, give me strength!"
+#define SAY_DEATH "Hah, is that all?"
+
+#define SOUND_AGGRO 5830
+#define SOUND_WHIRLWIND 5832
+#define SOUND_ENRAGE 5833
+#define SOUND_DEATH 5831
+
+struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI
+{
+ boss_herodAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Yell_Timer;
+ uint32 Enrage_Timer;
+ uint32 Cleave_Timer;
+ uint32 Whirlwind_Timer;
+ uint32 SunderArmor_Timer;
+ uint32 Rend_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 Slam_Timer;
+ uint32 Fireball11_Timer;
+ uint32 ConeOfCold5_Timer;
+
+ void Reset()
+ {
+ Yell_Timer = 58000;
+ Whirlwind_Timer = 60000;
+ Enrage_Timer = 0;
+ Cleave_Timer = 15000;
+ SunderArmor_Timer = 40000;
+ Rend_Timer = 25000;
+ ThunderClap_Timer = 25000;
+ Slam_Timer = 20000;
+ Fireball11_Timer = 30000;
+ ConeOfCold5_Timer = 40000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+
+ //Activate Berserker Stance
+ DoCast(m_creature,SPELL_BERSERKERSTANCE);
+
+ //Switch between 2 different charge methods
+ switch (rand()%2)
+ {
+ case 0:
+ DoCast(m_creature,SPELL_RUSHINGCHARGE);
+ break;
+ case 1:
+ DoCast(m_creature,SPELL_RUSHINGCHARGE1);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <10% hp goes Enraged
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff)
+ {
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ENRAGE);
+
+ DoCast(m_creature,SPELL_ENRAGE);
+
+ //Shouldn't cast this agian
+ Enrage_Timer = diff;
+ }
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 15000;
+ }else Cleave_Timer -= diff;
+
+ //Yelling and Whirlwind casting
+ if (Yell_Timer < diff)
+ {
+ //Say Whirlwind monologe
+ DoYell(SAY_WHIRLWIND,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WHIRLWIND);
+
+ Yell_Timer = 30000;
+ }else Yell_Timer -= diff;
+
+ if (Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
+ Whirlwind_Timer = 30000;
+ }else Whirlwind_Timer -= diff;
+
+ //SunderArmor_Timer
+ if (SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 40000;
+ }else SunderArmor_Timer -= diff;
+
+ //Rend_Timer
+ if (Rend_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REND);
+ Rend_Timer = 25000;
+ }else Rend_Timer -= diff;
+
+ //ThunderClap_Timer
+ if (ThunderClap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 20000;
+ }else ThunderClap_Timer -= diff;
+
+ //Slam_Timer
+ if (Slam_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLAM);
+ Slam_Timer = 20000;
+ }else Slam_Timer -= diff;
+
+ //Fireball11_Timer
+ if (Fireball11_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALL11);
+ Fireball11_Timer = 30000;
+ }else Fireball11_Timer -= diff;
+
+ //ConeOfCold5_Timer
+ if (ConeOfCold5_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONEOFCOLD5);
+ ConeOfCold5_Timer = 40000;
+ }else ConeOfCold5_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_herod(Creature *_Creature)
+{
+ return new boss_herodAI (_Creature);
+}
+
+void AddSC_boss_herod()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_herod";
+ newscript->GetAI = GetAI_boss_herod;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
index 498409a0baf..5742214e31d 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
@@ -1,132 +1,132 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_Inquisitor_Faribanks
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLEEP2 1090
-#define SPELL_CURSEOFBLOOD 16098
-#define SPELL_SMITE 6060
-#define SPELL_SHADOWWORDPAIN 2767
-#define SPELL_FLASHHEAL4 9474
-#define SPELL_RENEW6 6078
-#define SPELL_DEVOURINGPLAGUE3 19277
-#define SPELL_MINDBLAST5 8105
-
-struct TRINITY_DLL_DECL boss_high_inquisitor_fairbanksAI : public ScriptedAI
-{
- boss_high_inquisitor_fairbanksAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Healing_Timer;
- uint32 Sleep2_Timer;
- uint32 Smite_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 CurseOfBlood_Timer;
- uint32 DevouringPlague3_Timer;
- uint32 MindBlast5_Timer;
-
- void Reset()
- {
- Healing_Timer = 300;
- Sleep2_Timer = 45000;
- Smite_Timer = 30000;
- ShadowWordPain_Timer = 30000;
- CurseOfBlood_Timer = 45000;
- DevouringPlague3_Timer = 60000;
- MindBlast5_Timer = 20000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <45% hp cast Renew rank 6 or Flash heal rank 4
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 45 && !m_creature->IsNonMeleeSpellCasted(false) && Healing_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_RENEW6 || SPELL_FLASHHEAL4);
- Healing_Timer = 30000;
- }else Healing_Timer -= diff;
-
- //Sleep2_Timer
- if (Sleep2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLEEP2);
- Sleep2_Timer = 45000;
- }else Sleep2_Timer -= diff;
-
- //Smite_Timer
- if (Smite_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SMITE);
- Smite_Timer = 20000;
- }else Smite_Timer -= diff;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 30000;
- }else ShadowWordPain_Timer -= diff;
-
- //CurseOfBlood_Timer
- if (CurseOfBlood_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
- CurseOfBlood_Timer = 25000;
- }else CurseOfBlood_Timer -= diff;
-
- //DevouringPlague3_Timer
- if (DevouringPlague3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DEVOURINGPLAGUE3);
- DevouringPlague3_Timer = 35000;
- }else DevouringPlague3_Timer -= diff;
-
- //MindBlast5_Timer
- if (MindBlast5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST5);
- MindBlast5_Timer = 30000;
- }else MindBlast5_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_high_inquisitor_fairbanks(Creature *_Creature)
-{
- return new boss_high_inquisitor_fairbanksAI (_Creature);
-}
-
-void AddSC_boss_high_inquisitor_fairbanks()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_high_inquisitor_fairbanks";
- newscript->GetAI = GetAI_boss_high_inquisitor_fairbanks;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_Inquisitor_Faribanks
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLEEP2 1090
+#define SPELL_CURSEOFBLOOD 16098
+#define SPELL_SMITE 6060
+#define SPELL_SHADOWWORDPAIN 2767
+#define SPELL_FLASHHEAL4 9474
+#define SPELL_RENEW6 6078
+#define SPELL_DEVOURINGPLAGUE3 19277
+#define SPELL_MINDBLAST5 8105
+
+struct TRINITY_DLL_DECL boss_high_inquisitor_fairbanksAI : public ScriptedAI
+{
+ boss_high_inquisitor_fairbanksAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Healing_Timer;
+ uint32 Sleep2_Timer;
+ uint32 Smite_Timer;
+ uint32 ShadowWordPain_Timer;
+ uint32 CurseOfBlood_Timer;
+ uint32 DevouringPlague3_Timer;
+ uint32 MindBlast5_Timer;
+
+ void Reset()
+ {
+ Healing_Timer = 300;
+ Sleep2_Timer = 45000;
+ Smite_Timer = 30000;
+ ShadowWordPain_Timer = 30000;
+ CurseOfBlood_Timer = 45000;
+ DevouringPlague3_Timer = 60000;
+ MindBlast5_Timer = 20000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <45% hp cast Renew rank 6 or Flash heal rank 4
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 45 && !m_creature->IsNonMeleeSpellCasted(false) && Healing_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_RENEW6 || SPELL_FLASHHEAL4);
+ Healing_Timer = 30000;
+ }else Healing_Timer -= diff;
+
+ //Sleep2_Timer
+ if (Sleep2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLEEP2);
+ Sleep2_Timer = 45000;
+ }else Sleep2_Timer -= diff;
+
+ //Smite_Timer
+ if (Smite_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SMITE);
+ Smite_Timer = 20000;
+ }else Smite_Timer -= diff;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 30000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //CurseOfBlood_Timer
+ if (CurseOfBlood_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
+ CurseOfBlood_Timer = 25000;
+ }else CurseOfBlood_Timer -= diff;
+
+ //DevouringPlague3_Timer
+ if (DevouringPlague3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DEVOURINGPLAGUE3);
+ DevouringPlague3_Timer = 35000;
+ }else DevouringPlague3_Timer -= diff;
+
+ //MindBlast5_Timer
+ if (MindBlast5_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST5);
+ MindBlast5_Timer = 30000;
+ }else MindBlast5_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_high_inquisitor_fairbanks(Creature *_Creature)
+{
+ return new boss_high_inquisitor_fairbanksAI (_Creature);
+}
+
+void AddSC_boss_high_inquisitor_fairbanks()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_high_inquisitor_fairbanks";
+ newscript->GetAI = GetAI_boss_high_inquisitor_fairbanks;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_whitemane.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_whitemane.cpp
index 9eb482a6c18..97fbce31b01 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_whitemane.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_whitemane.cpp
@@ -1,177 +1,177 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_Inquistor_Whitmane
-SD%Complete: 50
-SDComment: Missing connection with commander mograine
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_DEEPSLEEP 9256
-#define SPELL_SCARLETRESURRECTION 9232
-
-#define SPELL_CRUSADERSTRIKE 17281
-#define SPELL_HAMMEROFJUSTICE 13005
-#define SPELL_HOLYSMITE6 9481
-#define SPELL_HOLYFIRE5 15265
-#define SPELL_MINDBLAST6 8106
-
-#define SPELL_POWERWORDSHIELD 6065
-
-#define SPELL_RENEW 6078
-#define SPELL_FLASHHEAL6 10916
-
-#define SAY_AGGRO "There is no escape for you. The Crusade shall destroy all who carry the Scourge's taint."
-#define SAY_SPAWN "What, Mograine has fallen? You shall pay for this treachery! "
-#define SAY_RES "Arise, my champion!"
-#define SAY_DEATH "The Light has spoken!"
-
-//#define SOUND_AGGRO
-#define SOUND_RES 5840
-#define SOUND_SPAWN 5838
-#define SOUND_DEATH 5839
-
-struct TRINITY_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI
-{
- boss_high_inquisitor_whitemaneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Healing_Timer;
- uint32 Renew_Timer;
- uint32 PowerWordShield_Timer;
- uint32 CrusaderStrike_Timer;
- uint32 HammerOfJustice_Timer;
- uint32 HolySmite6_Timer;
- uint32 HolyFire5_Timer;
- uint32 MindBlast6_Timer;
-
- void Reset()
- {
- Healing_Timer = 0;
- Renew_Timer= 0;
- PowerWordShield_Timer = 2000;
- CrusaderStrike_Timer = 12000;
- HammerOfJustice_Timer = 18000;
- HolySmite6_Timer = 10000;
- HolyFire5_Timer = 20000;
- MindBlast6_Timer = 6000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- /*
- //This is going to be a routine to make the resurrection event...
- if (m_creature->isAlive && m_creature->isAlive)
- {
- m_creature->Relocate(1163.113370,1398.856812,32.527786,3.171014);
-
- DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPAWN);
- DoCast(m_creature->getVictim(),SPELL_DEEPSLEEP);
- DoCast(m-creature->GetGUID(51117),SPELL_SCARLETRESURRECTION)
- }
- */
-
- //If we are <75% hp cast healing spells at self and Mograine
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 75 )
- {
- if (Healing_Timer < diff)
- {
- DoCast(m_creature,SPELL_FLASHHEAL6);
- return;
-
- //22-32 seconds until we should cast this agian
- Healing_Timer = 22000 + rand()%10000;
- }else Healing_Timer -= diff;
- }
-
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30)
- {
- if (Renew_Timer < diff)
- {
- DoCast(m_creature,SPELL_RENEW);
- Renew_Timer = 30000;
- }else Renew_Timer -= diff;
- }
-
- //PowerWordShield_Timer
- if (PowerWordShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_POWERWORDSHIELD);
- PowerWordShield_Timer = 25000;
- }else PowerWordShield_Timer -= diff;
-
- //CrusaderStrike_Timer
- if (CrusaderStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE);
- CrusaderStrike_Timer = 15000;
- }else CrusaderStrike_Timer -= diff;
-
- //HammerOfJustice_Timer
- if (HammerOfJustice_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE);
- HammerOfJustice_Timer = 12000;
- }else HammerOfJustice_Timer -= diff;
-
- //HolySmite6_Timer
- if (HolySmite6_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HOLYSMITE6);
- HolySmite6_Timer = 10000;
- }else HolySmite6_Timer -= diff;
-
- //HolyFire5_Timer
- if (HolyFire5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HOLYFIRE5);
- HolyFire5_Timer = 15000;
- }else HolyFire5_Timer -= diff;
-
- //MindBlast6_Timer
- if (MindBlast6_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST6);
- MindBlast6_Timer = 8000;
- }else MindBlast6_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_high_inquisitor_whitemane(Creature *_Creature)
-{
- return new boss_high_inquisitor_whitemaneAI (_Creature);
-}
-
-void AddSC_boss_high_inquisitor_whitemane()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_high_inquisitor_whitemane";
- newscript->GetAI = GetAI_boss_high_inquisitor_whitemane;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_Inquistor_Whitmane
+SD%Complete: 50
+SDComment: Missing connection with commander mograine
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_DEEPSLEEP 9256
+#define SPELL_SCARLETRESURRECTION 9232
+
+#define SPELL_CRUSADERSTRIKE 17281
+#define SPELL_HAMMEROFJUSTICE 13005
+#define SPELL_HOLYSMITE6 9481
+#define SPELL_HOLYFIRE5 15265
+#define SPELL_MINDBLAST6 8106
+
+#define SPELL_POWERWORDSHIELD 6065
+
+#define SPELL_RENEW 6078
+#define SPELL_FLASHHEAL6 10916
+
+#define SAY_AGGRO "There is no escape for you. The Crusade shall destroy all who carry the Scourge's taint."
+#define SAY_SPAWN "What, Mograine has fallen? You shall pay for this treachery! "
+#define SAY_RES "Arise, my champion!"
+#define SAY_DEATH "The Light has spoken!"
+
+//#define SOUND_AGGRO
+#define SOUND_RES 5840
+#define SOUND_SPAWN 5838
+#define SOUND_DEATH 5839
+
+struct TRINITY_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI
+{
+ boss_high_inquisitor_whitemaneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Healing_Timer;
+ uint32 Renew_Timer;
+ uint32 PowerWordShield_Timer;
+ uint32 CrusaderStrike_Timer;
+ uint32 HammerOfJustice_Timer;
+ uint32 HolySmite6_Timer;
+ uint32 HolyFire5_Timer;
+ uint32 MindBlast6_Timer;
+
+ void Reset()
+ {
+ Healing_Timer = 0;
+ Renew_Timer= 0;
+ PowerWordShield_Timer = 2000;
+ CrusaderStrike_Timer = 12000;
+ HammerOfJustice_Timer = 18000;
+ HolySmite6_Timer = 10000;
+ HolyFire5_Timer = 20000;
+ MindBlast6_Timer = 6000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ /*
+ //This is going to be a routine to make the resurrection event...
+ if (m_creature->isAlive && m_creature->isAlive)
+ {
+ m_creature->Relocate(1163.113370,1398.856812,32.527786,3.171014);
+
+ DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPAWN);
+ DoCast(m_creature->getVictim(),SPELL_DEEPSLEEP);
+ DoCast(m-creature->GetGUID(51117),SPELL_SCARLETRESURRECTION)
+ }
+ */
+
+ //If we are <75% hp cast healing spells at self and Mograine
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 75 )
+ {
+ if (Healing_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FLASHHEAL6);
+ return;
+
+ //22-32 seconds until we should cast this agian
+ Healing_Timer = 22000 + rand()%10000;
+ }else Healing_Timer -= diff;
+ }
+
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30)
+ {
+ if (Renew_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_RENEW);
+ Renew_Timer = 30000;
+ }else Renew_Timer -= diff;
+ }
+
+ //PowerWordShield_Timer
+ if (PowerWordShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_POWERWORDSHIELD);
+ PowerWordShield_Timer = 25000;
+ }else PowerWordShield_Timer -= diff;
+
+ //CrusaderStrike_Timer
+ if (CrusaderStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE);
+ CrusaderStrike_Timer = 15000;
+ }else CrusaderStrike_Timer -= diff;
+
+ //HammerOfJustice_Timer
+ if (HammerOfJustice_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE);
+ HammerOfJustice_Timer = 12000;
+ }else HammerOfJustice_Timer -= diff;
+
+ //HolySmite6_Timer
+ if (HolySmite6_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLYSMITE6);
+ HolySmite6_Timer = 10000;
+ }else HolySmite6_Timer -= diff;
+
+ //HolyFire5_Timer
+ if (HolyFire5_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLYFIRE5);
+ HolyFire5_Timer = 15000;
+ }else HolyFire5_Timer -= diff;
+
+ //MindBlast6_Timer
+ if (MindBlast6_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST6);
+ MindBlast6_Timer = 8000;
+ }else MindBlast6_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_high_inquisitor_whitemane(Creature *_Creature)
+{
+ return new boss_high_inquisitor_whitemaneAI (_Creature);
+}
+
+void AddSC_boss_high_inquisitor_whitemane()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_high_inquisitor_whitemane";
+ newscript->GetAI = GetAI_boss_high_inquisitor_whitemane;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
index 4547749d749..6353f600460 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
@@ -1,78 +1,78 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Houndmaster_Loksey
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SUMMONSCARLETHOUND 17164
-#define SPELL_ENRAGE 28747
-
-#define SAY_AGGRO "Release the hounds!"
-#define SOUND_AGGRO 5841
-
-struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI
-{
- boss_houndmaster_lokseyAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Enrage_Timer;
-
- void Reset()
- {
- Enrage_Timer = 6000000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
-
- DoCast(m_creature,SPELL_SUMMONSCARLETHOUND);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <10% hp cast healing spells at self and Mograine
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 900000;
- }else Enrage_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_houndmaster_loksey(Creature *_Creature)
-{
- return new boss_houndmaster_lokseyAI (_Creature);
-}
-
-void AddSC_boss_houndmaster_loksey()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_houndmaster_loksey";
- newscript->GetAI = GetAI_boss_houndmaster_loksey;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Houndmaster_Loksey
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SUMMONSCARLETHOUND 17164
+#define SPELL_ENRAGE 28747
+
+#define SAY_AGGRO "Release the hounds!"
+#define SOUND_AGGRO 5841
+
+struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI
+{
+ boss_houndmaster_lokseyAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Enrage_Timer;
+
+ void Reset()
+ {
+ Enrage_Timer = 6000000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+
+ DoCast(m_creature,SPELL_SUMMONSCARLETHOUND);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <10% hp cast healing spells at self and Mograine
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 900000;
+ }else Enrage_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_houndmaster_loksey(Creature *_Creature)
+{
+ return new boss_houndmaster_lokseyAI (_Creature);
+}
+
+void AddSC_boss_houndmaster_loksey()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_houndmaster_loksey";
+ newscript->GetAI = GetAI_boss_houndmaster_loksey;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
index 31b3ff206b6..ede58d0997e 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
@@ -1,113 +1,113 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Interrogator_Vishas
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_POWERWORDSHIELD 6065
-
-#define SAY_AGGRO "Tell me... tell me everything!"
-#define SAY_HEALTH1 "Naughty secrets"
-#define SAY_HEALTH2 "I'll rip the secrets from your flesh!"
-#define SAY_DEATH "Purged by pain!"
-
-#define SOUND_AGGRO 5847
-#define SOUND_HEALTH1 5849
-#define SOUND_HEALTH2 5850
-#define SOUND_DEATH 5848
-
-struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI
-{
- boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Yell_Timer;
- uint32 PowerWordShield_Timer;
-
- void Reset()
- {
- Yell_Timer = 6000000;
- PowerWordShield_Timer = 60000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are low on hp Do sayings
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 60 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Yell_Timer
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH1);
- return;
-
- //60 seconds until we should cast this agian
- Yell_Timer = 60000;
- }else Yell_Timer -= diff;
- }
-
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Yell_Timer
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH2);
- return;
-
- //60 seconds until we should cast this agian
- Yell_Timer = 6000000;
- }else Yell_Timer -= diff;
- }
-
- //PowerWordShield_Timer
- if (PowerWordShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_POWERWORDSHIELD);
- PowerWordShield_Timer = 60000;
- }else PowerWordShield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_interrogator_vishas(Creature *_Creature)
-{
- return new boss_interrogator_vishasAI (_Creature);
-}
-
-void AddSC_boss_interrogator_vishas()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_interrogator_vishas";
- newscript->GetAI = GetAI_boss_interrogator_vishas;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Interrogator_Vishas
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_POWERWORDSHIELD 6065
+
+#define SAY_AGGRO "Tell me... tell me everything!"
+#define SAY_HEALTH1 "Naughty secrets"
+#define SAY_HEALTH2 "I'll rip the secrets from your flesh!"
+#define SAY_DEATH "Purged by pain!"
+
+#define SOUND_AGGRO 5847
+#define SOUND_HEALTH1 5849
+#define SOUND_HEALTH2 5850
+#define SOUND_DEATH 5848
+
+struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI
+{
+ boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Yell_Timer;
+ uint32 PowerWordShield_Timer;
+
+ void Reset()
+ {
+ Yell_Timer = 6000000;
+ PowerWordShield_Timer = 60000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are low on hp Do sayings
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 60 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Yell_Timer
+ if (Yell_Timer < diff)
+ {
+ DoYell(SAY_HEALTH1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HEALTH1);
+ return;
+
+ //60 seconds until we should cast this agian
+ Yell_Timer = 60000;
+ }else Yell_Timer -= diff;
+ }
+
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Yell_Timer
+ if (Yell_Timer < diff)
+ {
+ DoYell(SAY_HEALTH2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HEALTH2);
+ return;
+
+ //60 seconds until we should cast this agian
+ Yell_Timer = 6000000;
+ }else Yell_Timer -= diff;
+ }
+
+ //PowerWordShield_Timer
+ if (PowerWordShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_POWERWORDSHIELD);
+ PowerWordShield_Timer = 60000;
+ }else PowerWordShield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_interrogator_vishas(Creature *_Creature)
+{
+ return new boss_interrogator_vishasAI (_Creature);
+}
+
+void AddSC_boss_interrogator_vishas()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_interrogator_vishas";
+ newscript->GetAI = GetAI_boss_interrogator_vishas;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scarlet_commander_mograine.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scarlet_commander_mograine.cpp
index f76888e23c8..5e87b1a2b77 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scarlet_commander_mograine.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scarlet_commander_mograine.cpp
@@ -1,160 +1,160 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Scarlet_Commander_Mograine
-SD%Complete: 100
-SDComment: Missing revive
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_DIVINESHIELD2 1020
-#define SPELL_CRUSADERSTRIKE5 35395
-#define SPELL_HAMMEROFJUSTICE3 5589
-#define SPELL_HOLYLIGHT6 3472
-#define SPELL_CONSECRATION3 20922
-#define SPELL_BLESSINGOFWISDOM 1044
-#define SPELL_RETRIBUTIONAURA3 10299
-#define SPELL_BLESSINGOFPROTECTION3 10278
-#define SPELL_FLASHHEAL6 10916
-
-#define SAY_AGGRO "Infidels! They must be purified!"
-#define SAY_RES "At your side, milady!"
-#define SAY_DEATH "Unworthy!"
-
-#define SOUND_AGGRO 5835
-#define SOUND_RES 5837
-#define SOUND_DEATH 5836
-
-struct TRINITY_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI
-{
- boss_scarlet_commander_mograineAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Heal_Timer;
- uint32 DivineShield2_Timer;
- uint32 CrusaderStrike5_Timer;
- uint32 HammerOfJustice3_Timer;
- uint32 Consecration3_Timer;
- uint32 BlessingOfWisdom_Timer;
- uint32 BlessingOfProtection3_Timer;
-
- void Reset()
- {
- Heal_Timer = 80000;
- DivineShield2_Timer = 60000;
- CrusaderStrike5_Timer = 20000;
- HammerOfJustice3_Timer = 80000;
- Consecration3_Timer = 30000;
- BlessingOfWisdom_Timer = 45000;
- BlessingOfProtection3_Timer = 45000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- DoCast(m_creature,SPELL_RETRIBUTIONAURA3);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <50% hp cast Arcane Bubble and start casting SPECIAL Arcane Explosion
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //heal_Timer
- if (Heal_Timer < diff)
- {
- //Switch between 2 different charge methods
- switch (rand()%2)
- {
- case 0:
- DoCast(m_creature,SPELL_HOLYLIGHT6);
- break;
- case 1:
- DoCast(m_creature,SPELL_FLASHHEAL6);
- break;
- }
- return;
-
- //60 seconds until we should cast this agian
- Heal_Timer = 60000;
- }else Heal_Timer -= diff;
- }
-
- //DivineShield2_Timer
- if (DivineShield2_Timer < diff)
- {
- DoCast(m_creature,SPELL_DIVINESHIELD2);
- DivineShield2_Timer = 60000;
- }else DivineShield2_Timer -= diff;
-
- //CrusaderStrike5_Timer
- if (CrusaderStrike5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE5);
- CrusaderStrike5_Timer = 20000;
- }else CrusaderStrike5_Timer -= diff;
-
- //HammerOfJustice3_Timer
- if (HammerOfJustice3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE3);
- HammerOfJustice3_Timer = 30000;
- }else HammerOfJustice3_Timer -= diff;
-
- //Consecration3_Timer
- if (Consecration3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONSECRATION3);
- Consecration3_Timer = 20000;
- }else Consecration3_Timer -= diff;
-
- //BlessingOfWisdom_Timer
- if (BlessingOfWisdom_Timer < diff)
- {
- DoCast(m_creature,SPELL_BLESSINGOFWISDOM);
- BlessingOfWisdom_Timer = 45000;
- }else BlessingOfWisdom_Timer -= diff;
-
- //BlessingOfProtection3_Timer
- if (BlessingOfProtection3_Timer < diff)
- {
- DoCast(m_creature,SPELL_BLESSINGOFPROTECTION3);
- BlessingOfProtection3_Timer = 50000;
- }else BlessingOfProtection3_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_scarlet_commander_mograine(Creature *_Creature)
-{
- return new boss_scarlet_commander_mograineAI (_Creature);
-}
-
-void AddSC_boss_scarlet_commander_mograine()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_scarlet_commander_mograine";
- newscript->GetAI = GetAI_boss_scarlet_commander_mograine;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Scarlet_Commander_Mograine
+SD%Complete: 100
+SDComment: Missing revive
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_DIVINESHIELD2 1020
+#define SPELL_CRUSADERSTRIKE5 35395
+#define SPELL_HAMMEROFJUSTICE3 5589
+#define SPELL_HOLYLIGHT6 3472
+#define SPELL_CONSECRATION3 20922
+#define SPELL_BLESSINGOFWISDOM 1044
+#define SPELL_RETRIBUTIONAURA3 10299
+#define SPELL_BLESSINGOFPROTECTION3 10278
+#define SPELL_FLASHHEAL6 10916
+
+#define SAY_AGGRO "Infidels! They must be purified!"
+#define SAY_RES "At your side, milady!"
+#define SAY_DEATH "Unworthy!"
+
+#define SOUND_AGGRO 5835
+#define SOUND_RES 5837
+#define SOUND_DEATH 5836
+
+struct TRINITY_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI
+{
+ boss_scarlet_commander_mograineAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Heal_Timer;
+ uint32 DivineShield2_Timer;
+ uint32 CrusaderStrike5_Timer;
+ uint32 HammerOfJustice3_Timer;
+ uint32 Consecration3_Timer;
+ uint32 BlessingOfWisdom_Timer;
+ uint32 BlessingOfProtection3_Timer;
+
+ void Reset()
+ {
+ Heal_Timer = 80000;
+ DivineShield2_Timer = 60000;
+ CrusaderStrike5_Timer = 20000;
+ HammerOfJustice3_Timer = 80000;
+ Consecration3_Timer = 30000;
+ BlessingOfWisdom_Timer = 45000;
+ BlessingOfProtection3_Timer = 45000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoCast(m_creature,SPELL_RETRIBUTIONAURA3);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <50% hp cast Arcane Bubble and start casting SPECIAL Arcane Explosion
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //heal_Timer
+ if (Heal_Timer < diff)
+ {
+ //Switch between 2 different charge methods
+ switch (rand()%2)
+ {
+ case 0:
+ DoCast(m_creature,SPELL_HOLYLIGHT6);
+ break;
+ case 1:
+ DoCast(m_creature,SPELL_FLASHHEAL6);
+ break;
+ }
+ return;
+
+ //60 seconds until we should cast this agian
+ Heal_Timer = 60000;
+ }else Heal_Timer -= diff;
+ }
+
+ //DivineShield2_Timer
+ if (DivineShield2_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DIVINESHIELD2);
+ DivineShield2_Timer = 60000;
+ }else DivineShield2_Timer -= diff;
+
+ //CrusaderStrike5_Timer
+ if (CrusaderStrike5_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE5);
+ CrusaderStrike5_Timer = 20000;
+ }else CrusaderStrike5_Timer -= diff;
+
+ //HammerOfJustice3_Timer
+ if (HammerOfJustice3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE3);
+ HammerOfJustice3_Timer = 30000;
+ }else HammerOfJustice3_Timer -= diff;
+
+ //Consecration3_Timer
+ if (Consecration3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONSECRATION3);
+ Consecration3_Timer = 20000;
+ }else Consecration3_Timer -= diff;
+
+ //BlessingOfWisdom_Timer
+ if (BlessingOfWisdom_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BLESSINGOFWISDOM);
+ BlessingOfWisdom_Timer = 45000;
+ }else BlessingOfWisdom_Timer -= diff;
+
+ //BlessingOfProtection3_Timer
+ if (BlessingOfProtection3_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BLESSINGOFPROTECTION3);
+ BlessingOfProtection3_Timer = 50000;
+ }else BlessingOfProtection3_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_scarlet_commander_mograine(Creature *_Creature)
+{
+ return new boss_scarlet_commander_mograineAI (_Creature);
+}
+
+void AddSC_boss_scarlet_commander_mograine()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_scarlet_commander_mograine";
+ newscript->GetAI = GetAI_boss_scarlet_commander_mograine;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
index 89f90383111..1f9e3fb2487 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
@@ -1,100 +1,100 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Scorn
-SD%Complete: 100
-SDComment:
-SDCategory: Scarlet Monastery
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_LICHSLAP 28873
-#define SPELL_FROSTBOLTVOLLEY 8398
-#define SPELL_MINDFLAY 17313
-#define SPELL_FROSTNOVA 15531
-
-struct TRINITY_DLL_DECL boss_scornAI : public ScriptedAI
-{
- boss_scornAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 LichSlap_Timer;
- uint32 FrostboltVolley_Timer;
- uint32 MindFlay_Timer;
- uint32 FrostNova_Timer;
-
- void Reset()
- {
- LichSlap_Timer = 45000;
- FrostboltVolley_Timer = 30000;
- MindFlay_Timer = 30000;
- FrostNova_Timer = 30000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //LichSlap_Timer
- if (LichSlap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_LICHSLAP);
- LichSlap_Timer = 45000;
- }else LichSlap_Timer -= diff;
-
- //FrostboltVolley_Timer
- if (FrostboltVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLTVOLLEY);
- FrostboltVolley_Timer = 20000;
- }else FrostboltVolley_Timer -= diff;
-
- //MindFlay_Timer
- if (MindFlay_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDFLAY);
- MindFlay_Timer = 20000;
- }else MindFlay_Timer -= diff;
-
- //FrostNova_Timer
- if (FrostNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
- FrostNova_Timer = 15000;
- }else FrostNova_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_scorn(Creature *_Creature)
-{
- return new boss_scornAI (_Creature);
-}
-
-void AddSC_boss_scorn()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_scorn";
- newscript->GetAI = GetAI_boss_scorn;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Scorn
+SD%Complete: 100
+SDComment:
+SDCategory: Scarlet Monastery
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_LICHSLAP 28873
+#define SPELL_FROSTBOLTVOLLEY 8398
+#define SPELL_MINDFLAY 17313
+#define SPELL_FROSTNOVA 15531
+
+struct TRINITY_DLL_DECL boss_scornAI : public ScriptedAI
+{
+ boss_scornAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 LichSlap_Timer;
+ uint32 FrostboltVolley_Timer;
+ uint32 MindFlay_Timer;
+ uint32 FrostNova_Timer;
+
+ void Reset()
+ {
+ LichSlap_Timer = 45000;
+ FrostboltVolley_Timer = 30000;
+ MindFlay_Timer = 30000;
+ FrostNova_Timer = 30000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //LichSlap_Timer
+ if (LichSlap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_LICHSLAP);
+ LichSlap_Timer = 45000;
+ }else LichSlap_Timer -= diff;
+
+ //FrostboltVolley_Timer
+ if (FrostboltVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLTVOLLEY);
+ FrostboltVolley_Timer = 20000;
+ }else FrostboltVolley_Timer -= diff;
+
+ //MindFlay_Timer
+ if (MindFlay_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDFLAY);
+ MindFlay_Timer = 20000;
+ }else MindFlay_Timer -= diff;
+
+ //FrostNova_Timer
+ if (FrostNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
+ FrostNova_Timer = 15000;
+ }else FrostNova_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_scorn(Creature *_Creature)
+{
+ return new boss_scornAI (_Creature);
+}
+
+void AddSC_boss_scorn()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_scorn";
+ newscript->GetAI = GetAI_boss_scorn;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
index 8c4ce20610a..f67bf9fe594 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
@@ -1,192 +1,192 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Darkmaster_Gandling
-SD%Complete: 99
-SDComment: Doors missing in instance script.
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ARCANEMISSILES 22272
-#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either.
-#define SPELL_CURSE 18702
-
-#define ADD_1X 170.205
-#define ADD_1Y 99.413
-#define ADD_1Z 104.733
-#define ADD_1O 3.16
-
-#define ADD_2X 170.813
-#define ADD_2Y 97.857
-#define ADD_2Z 104.713
-#define ADD_2O 3.16
-
-#define ADD_3X 170.720
-#define ADD_3Y 100.900
-#define ADD_3Z 104.739
-#define ADD_3O 3.16
-
-#define ADD_4X 171.866
-#define ADD_4Y 99.373
-#define ADD_4Z 104.732
-#define ADD_4O 3.16
-
-struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
-{
- boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ArcaneMissiles_Timer;
- uint32 ShadowShield_Timer;
- uint32 Curse_Timer;
- uint32 Teleport_Timer;
- Creature *Summoned;
-
- void Reset()
- {
- ArcaneMissiles_Timer = 4500;
- ShadowShield_Timer = 12000;
- Curse_Timer = 2000;
- Teleport_Timer = 16000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ArcaneMissiles_Timer
- if (ArcaneMissiles_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEMISSILES);
- ArcaneMissiles_Timer = 8000;
- }else ArcaneMissiles_Timer -= diff;
-
- //ShadowShield_Timer
- if (ShadowShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWSHIELD);
- ShadowShield_Timer = 14000 + rand()%14000;
- }else ShadowShield_Timer -= diff;
-
- //Curse_Timer
- if (Curse_Timer < diff)
- {
- DoCast(m_creature->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(Teleport_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- {
- if(m_creature->getThreatManager().getThreat(target))
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
-
- switch(rand()%6)
- {
- case 0:
- DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149);
- Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- case 1:
- DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608);
- Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- case 2:
- DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043);
- Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- case 3:
- DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149);
- Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- case 4:
- DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608);
- Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- case 5:
- DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043);
- Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- break;
- }
- }
- Teleport_Timer = 20000 + rand()%15000;
- }else Teleport_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_darkmaster_gandling(Creature *_Creature)
-{
- return new boss_darkmaster_gandlingAI (_Creature);
-}
-
-void AddSC_boss_darkmaster_gandling()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_darkmaster_gandling";
- newscript->GetAI = GetAI_boss_darkmaster_gandling;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Darkmaster_Gandling
+SD%Complete: 99
+SDComment: Doors missing in instance script.
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ARCANEMISSILES 22272
+#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either.
+#define SPELL_CURSE 18702
+
+#define ADD_1X 170.205
+#define ADD_1Y 99.413
+#define ADD_1Z 104.733
+#define ADD_1O 3.16
+
+#define ADD_2X 170.813
+#define ADD_2Y 97.857
+#define ADD_2Z 104.713
+#define ADD_2O 3.16
+
+#define ADD_3X 170.720
+#define ADD_3Y 100.900
+#define ADD_3Z 104.739
+#define ADD_3O 3.16
+
+#define ADD_4X 171.866
+#define ADD_4Y 99.373
+#define ADD_4Z 104.732
+#define ADD_4O 3.16
+
+struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
+{
+ boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ArcaneMissiles_Timer;
+ uint32 ShadowShield_Timer;
+ uint32 Curse_Timer;
+ uint32 Teleport_Timer;
+ Creature *Summoned;
+
+ void Reset()
+ {
+ ArcaneMissiles_Timer = 4500;
+ ShadowShield_Timer = 12000;
+ Curse_Timer = 2000;
+ Teleport_Timer = 16000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ArcaneMissiles_Timer
+ if (ArcaneMissiles_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEMISSILES);
+ ArcaneMissiles_Timer = 8000;
+ }else ArcaneMissiles_Timer -= diff;
+
+ //ShadowShield_Timer
+ if (ShadowShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWSHIELD);
+ ShadowShield_Timer = 14000 + rand()%14000;
+ }else ShadowShield_Timer -= diff;
+
+ //Curse_Timer
+ if (Curse_Timer < diff)
+ {
+ DoCast(m_creature->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(Teleport_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(m_creature->getThreatManager().getThreat(target))
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+
+ switch(rand()%6)
+ {
+ case 0:
+ DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149);
+ Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ case 1:
+ DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608);
+ Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ case 2:
+ DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043);
+ Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ case 3:
+ DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149);
+ Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ case 4:
+ DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608);
+ Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ case 5:
+ DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043);
+ Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ break;
+ }
+ }
+ Teleport_Timer = 20000 + rand()%15000;
+ }else Teleport_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_darkmaster_gandling(Creature *_Creature)
+{
+ return new boss_darkmaster_gandlingAI (_Creature);
+}
+
+void AddSC_boss_darkmaster_gandling()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_darkmaster_gandling";
+ newscript->GetAI = GetAI_boss_darkmaster_gandling;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
index b5d87076ba6..747ec039363 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
@@ -1,59 +1,59 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Death_knight_darkreaver
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-struct TRINITY_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI
-{
- boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (m_creature->GetHealth() <= damage)
- {
- m_creature->CastSpell(m_creature,23261,true); //Summon Darkreaver's Fallen Charger
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-};
-CreatureAI* GetAI_boss_death_knight_darkreaver(Creature *_Creature)
-{
- return new boss_death_knight_darkreaverAI (_Creature);
-}
-
-void AddSC_boss_death_knight_darkreaver()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_death_knight_darkreaver";
- newscript->GetAI = GetAI_boss_death_knight_darkreaver;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Death_knight_darkreaver
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+struct TRINITY_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI
+{
+ boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (m_creature->GetHealth() <= damage)
+ {
+ m_creature->CastSpell(m_creature,23261,true); //Summon Darkreaver's Fallen Charger
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+};
+CreatureAI* GetAI_boss_death_knight_darkreaver(Creature *_Creature)
+{
+ return new boss_death_knight_darkreaverAI (_Creature);
+}
+
+void AddSC_boss_death_knight_darkreaver()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_death_knight_darkreaver";
+ newscript->GetAI = GetAI_boss_death_knight_darkreaver;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
index 4976f787133..484a27dca98 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
@@ -1,108 +1,108 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doctor_Theolen_Krastinov
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_REND 18106
-#define SPELL_CLEAVE 15584
-#define SPELL_FRENZY 28371
-
-struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
-{
- boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Rend_Timer;
- uint32 Cleave_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- Rend_Timer = 8000;
- Cleave_Timer = 9000;
- Frenzy_Timer =0;
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Rend_Timer
- if (Rend_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REND);
- Rend_Timer = 10000;
- }else Rend_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- //Frenzy_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 )
- {
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
-
- Frenzy_Timer = 8000;
- }else Frenzy_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_theolenkrastinov(Creature *_Creature)
-{
- return new boss_theolenkrastinovAI (_Creature);
-}
-
-void AddSC_boss_theolenkrastinov()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doctor_theolen_krastinov";
- newscript->GetAI = GetAI_boss_theolenkrastinov;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doctor_Theolen_Krastinov
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_REND 18106
+#define SPELL_CLEAVE 15584
+#define SPELL_FRENZY 28371
+
+struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
+{
+ boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Rend_Timer;
+ uint32 Cleave_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ Rend_Timer = 8000;
+ Cleave_Timer = 9000;
+ Frenzy_Timer =0;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Rend_Timer
+ if (Rend_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REND);
+ Rend_Timer = 10000;
+ }else Rend_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ //Frenzy_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 )
+ {
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote("goes into a killing frenzy!",NULL);
+
+ Frenzy_Timer = 8000;
+ }else Frenzy_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_theolenkrastinov(Creature *_Creature)
+{
+ return new boss_theolenkrastinovAI (_Creature);
+}
+
+void AddSC_boss_theolenkrastinov()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doctor_theolen_krastinov";
+ newscript->GetAI = GetAI_boss_theolenkrastinov;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
index 70d64a9ad1e..1edae02fcf3 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
@@ -1,116 +1,116 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Illucia_Barov
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_CURSEOFAGONY 18671
-#define SPELL_SHADOWSHOCK 20603
-#define SPELL_SILENCE 15487
-#define SPELL_FEAR 6215
-
-struct TRINITY_DLL_DECL boss_illuciabarovAI : public ScriptedAI
-{
- boss_illuciabarovAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CurseOfAgony_Timer;
- uint32 ShadowShock_Timer;
- uint32 Silence_Timer;
- uint32 Fear_Timer;
-
- void Reset()
- {
- CurseOfAgony_Timer = 18000;
- ShadowShock_Timer = 9000;
- Silence_Timer = 5000;
- Fear_Timer = 30000;
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //CurseOfAgony_Timer
- if (CurseOfAgony_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFAGONY);
- CurseOfAgony_Timer = 30000;
- }else CurseOfAgony_Timer -= diff;
-
- //ShadowShock_Timer
- if (ShadowShock_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SHADOWSHOCK);
-
- ShadowShock_Timer = 12000;
- }else ShadowShock_Timer -= diff;
-
- //Silence_Timer
- if (Silence_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SILENCE);
- Silence_Timer = 14000;
- }else Silence_Timer -= diff;
-
- //Fear_Timer
- if (Fear_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FEAR);
- Fear_Timer = 30000;
- }else Fear_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_illuciabarov(Creature *_Creature)
-{
- return new boss_illuciabarovAI (_Creature);
-}
-
-void AddSC_boss_illuciabarov()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_illucia_barov";
- newscript->GetAI = GetAI_boss_illuciabarov;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Illucia_Barov
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_CURSEOFAGONY 18671
+#define SPELL_SHADOWSHOCK 20603
+#define SPELL_SILENCE 15487
+#define SPELL_FEAR 6215
+
+struct TRINITY_DLL_DECL boss_illuciabarovAI : public ScriptedAI
+{
+ boss_illuciabarovAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CurseOfAgony_Timer;
+ uint32 ShadowShock_Timer;
+ uint32 Silence_Timer;
+ uint32 Fear_Timer;
+
+ void Reset()
+ {
+ CurseOfAgony_Timer = 18000;
+ ShadowShock_Timer = 9000;
+ Silence_Timer = 5000;
+ Fear_Timer = 30000;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //CurseOfAgony_Timer
+ if (CurseOfAgony_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFAGONY);
+ CurseOfAgony_Timer = 30000;
+ }else CurseOfAgony_Timer -= diff;
+
+ //ShadowShock_Timer
+ if (ShadowShock_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SHADOWSHOCK);
+
+ ShadowShock_Timer = 12000;
+ }else ShadowShock_Timer -= diff;
+
+ //Silence_Timer
+ if (Silence_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SILENCE);
+ Silence_Timer = 14000;
+ }else Silence_Timer -= diff;
+
+ //Fear_Timer
+ if (Fear_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+ Fear_Timer = 30000;
+ }else Fear_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_illuciabarov(Creature *_Creature)
+{
+ return new boss_illuciabarovAI (_Creature);
+}
+
+void AddSC_boss_illuciabarov()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_illucia_barov";
+ newscript->GetAI = GetAI_boss_illuciabarov;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
index c085d3b9bd5..705b2835843 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
@@ -1,152 +1,152 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_instructormalicia
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_CALLOFGRAVES 17831
-#define SPELL_CORRUPTION 11672
-#define SPELL_FLASHHEAL 10917
-#define SPELL_RENEW 10929
-#define SPELL_HEALINGTOUCH 9889
-
-struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI
-{
- boss_instructormaliciaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CallOfGraves_Timer;
- uint32 Corruption_Timer;
- uint32 FlashHeal_Timer;
- uint32 Renew_Timer;
- uint32 HealingTouch_Timer;
- uint32 FlashCounter;
- uint32 TouchCounter;
-
- void Reset()
- {
- CallOfGraves_Timer = 4000;
- Corruption_Timer = 8000;
- FlashHeal_Timer = 38000;
- Renew_Timer = 32000;
- HealingTouch_Timer = 45000;
- FlashCounter = 0;
- TouchCounter = 0;
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //CallOfGraves_Timer
- if (CallOfGraves_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CALLOFGRAVES);
- CallOfGraves_Timer = 65000;
- }else CallOfGraves_Timer -= diff;
-
- //Corruption_Timer
- if (Corruption_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_CORRUPTION);
-
- Corruption_Timer = 24000;
- }else Corruption_Timer -= diff;
-
- //Renew_Timer
- if (Renew_Timer < diff)
- {
- DoCast(m_creature, SPELL_RENEW);
- Renew_Timer = 10000;
- }else Renew_Timer -= diff;
-
- //FlashHeal_Timer
- if (FlashHeal_Timer < diff)
- {
- DoCast(m_creature,SPELL_FLASHHEAL);
-
- //5 Flashheals will be casted
- if (FlashCounter < 2)
- {
- FlashHeal_Timer = 5000;
- FlashCounter++;
- }
- else
- {
- FlashCounter=0;
- FlashHeal_Timer = 30000;
- }
- }else FlashHeal_Timer -= diff;
-
- //HealingTouch_Timer
- if (HealingTouch_Timer < diff)
- {
- DoCast(m_creature,SPELL_HEALINGTOUCH);
-
- //3 Healingtouchs will be casted
- if (HealingTouch_Timer < 2)
- {
- HealingTouch_Timer = 5500;
- TouchCounter++;
- }
- else
- {
- TouchCounter=0;
- HealingTouch_Timer = 30000;
- }
- }else HealingTouch_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_instructormalicia(Creature *_Creature)
-{
- return new boss_instructormaliciaAI (_Creature);
-}
-
-void AddSC_boss_instructormalicia()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_instructor_malicia";
- newscript->GetAI = GetAI_boss_instructormalicia;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_instructormalicia
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_CALLOFGRAVES 17831
+#define SPELL_CORRUPTION 11672
+#define SPELL_FLASHHEAL 10917
+#define SPELL_RENEW 10929
+#define SPELL_HEALINGTOUCH 9889
+
+struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI
+{
+ boss_instructormaliciaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CallOfGraves_Timer;
+ uint32 Corruption_Timer;
+ uint32 FlashHeal_Timer;
+ uint32 Renew_Timer;
+ uint32 HealingTouch_Timer;
+ uint32 FlashCounter;
+ uint32 TouchCounter;
+
+ void Reset()
+ {
+ CallOfGraves_Timer = 4000;
+ Corruption_Timer = 8000;
+ FlashHeal_Timer = 38000;
+ Renew_Timer = 32000;
+ HealingTouch_Timer = 45000;
+ FlashCounter = 0;
+ TouchCounter = 0;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //CallOfGraves_Timer
+ if (CallOfGraves_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CALLOFGRAVES);
+ CallOfGraves_Timer = 65000;
+ }else CallOfGraves_Timer -= diff;
+
+ //Corruption_Timer
+ if (Corruption_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_CORRUPTION);
+
+ Corruption_Timer = 24000;
+ }else Corruption_Timer -= diff;
+
+ //Renew_Timer
+ if (Renew_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_RENEW);
+ Renew_Timer = 10000;
+ }else Renew_Timer -= diff;
+
+ //FlashHeal_Timer
+ if (FlashHeal_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FLASHHEAL);
+
+ //5 Flashheals will be casted
+ if (FlashCounter < 2)
+ {
+ FlashHeal_Timer = 5000;
+ FlashCounter++;
+ }
+ else
+ {
+ FlashCounter=0;
+ FlashHeal_Timer = 30000;
+ }
+ }else FlashHeal_Timer -= diff;
+
+ //HealingTouch_Timer
+ if (HealingTouch_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_HEALINGTOUCH);
+
+ //3 Healingtouchs will be casted
+ if (HealingTouch_Timer < 2)
+ {
+ HealingTouch_Timer = 5500;
+ TouchCounter++;
+ }
+ else
+ {
+ TouchCounter=0;
+ HealingTouch_Timer = 30000;
+ }
+ }else HealingTouch_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_instructormalicia(Creature *_Creature)
+{
+ return new boss_instructormaliciaAI (_Creature);
+}
+
+void AddSC_boss_instructormalicia()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_instructor_malicia";
+ newscript->GetAI = GetAI_boss_instructormalicia;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
index bfcf20729aa..e25f274c66a 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
@@ -1,208 +1,208 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_jandicebarov
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CURSEOFBLOOD 24673
-//#define SPELL_ILLUSION 17773
-
-//Spells of Illusion of Jandice Barov
-#define SPELL_CLEAVE 15584
-
-struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI
-{
- boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CurseOfBlood_Timer;
- uint32 Illusion_Timer;
- //uint32 Illusioncounter;
- uint32 Invisible_Timer;
- bool Invisible;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- CurseOfBlood_Timer = 15000;
- Illusion_Timer = 30000;
- Invisible_Timer = 3000; //Too much too low?
- Invisible = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonIllusions(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (Invisible && Invisible_Timer < diff)
- {
- //Become visible again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //Jandice Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11073);
- Invisible = false;
- } else if (Invisible)
- {
- Invisible_Timer -= diff;
- //Do nothing while invisible
- return;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //CurseOfBlood_Timer
- if (CurseOfBlood_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
- CurseOfBlood_Timer = 30000;
- }else CurseOfBlood_Timer -= diff;
-
- //Illusion_Timer
- if (!Invisible && Illusion_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Invisible Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
-
- //Summon 10 Illusions attacking random gamers
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonIllusions(target);
- }
- Invisible = true;
- Invisible_Timer = 3000;
-
- Illusion_Timer = 25000;
- }else Illusion_Timer -= diff;
-
- // //Illusion_Timer
- // if (Illusion_Timer < diff)
- // {
- // //Cast
- // DoCast(m_creature->getVictim(),SPELL_ILLUSION);
- //
- // //3 Illusion will be summoned
- // if (Illusioncounter < 3)
- // {
- // Illusion_Timer = 500;
- // Illusioncounter++;
- // }
- // else {
- // Illusion_Timer = 15000;
- // Illusioncounter=0;
- // }
- //
- // }else Illusion_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-// Illusion of Jandice Barov Script
-
-struct TRINITY_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI
-{
- mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cleave_Timer;
-
- void Reset()
- {
- Cleave_Timer = 4000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 5000 + rand()%3000;
- }else Cleave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_jandicebarov(Creature *_Creature)
-{
- return new boss_jandicebarovAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_illusionofjandicebarov(Creature *_Creature)
-{
- return new mob_illusionofjandicebarovAI (_Creature);
-}
-
-void AddSC_boss_jandicebarov()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_jandice_barov";
- newscript->GetAI = GetAI_boss_jandicebarov;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_illusionofjandicebarov";
- newscript->GetAI = GetAI_mob_illusionofjandicebarov;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_jandicebarov
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CURSEOFBLOOD 24673
+//#define SPELL_ILLUSION 17773
+
+//Spells of Illusion of Jandice Barov
+#define SPELL_CLEAVE 15584
+
+struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI
+{
+ boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CurseOfBlood_Timer;
+ uint32 Illusion_Timer;
+ //uint32 Illusioncounter;
+ uint32 Invisible_Timer;
+ bool Invisible;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ CurseOfBlood_Timer = 15000;
+ Illusion_Timer = 30000;
+ Invisible_Timer = 3000; //Too much too low?
+ Invisible = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonIllusions(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (Invisible && Invisible_Timer < diff)
+ {
+ //Become visible again
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //Jandice Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11073);
+ Invisible = false;
+ } else if (Invisible)
+ {
+ Invisible_Timer -= diff;
+ //Do nothing while invisible
+ return;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //CurseOfBlood_Timer
+ if (CurseOfBlood_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
+ CurseOfBlood_Timer = 30000;
+ }else CurseOfBlood_Timer -= diff;
+
+ //Illusion_Timer
+ if (!Invisible && Illusion_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Invisible Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
+
+ //Summon 10 Illusions attacking random gamers
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonIllusions(target);
+ }
+ Invisible = true;
+ Invisible_Timer = 3000;
+
+ Illusion_Timer = 25000;
+ }else Illusion_Timer -= diff;
+
+ // //Illusion_Timer
+ // if (Illusion_Timer < diff)
+ // {
+ // //Cast
+ // DoCast(m_creature->getVictim(),SPELL_ILLUSION);
+ //
+ // //3 Illusion will be summoned
+ // if (Illusioncounter < 3)
+ // {
+ // Illusion_Timer = 500;
+ // Illusioncounter++;
+ // }
+ // else {
+ // Illusion_Timer = 15000;
+ // Illusioncounter=0;
+ // }
+ //
+ // }else Illusion_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+// Illusion of Jandice Barov Script
+
+struct TRINITY_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI
+{
+ mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cleave_Timer;
+
+ void Reset()
+ {
+ Cleave_Timer = 4000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 5000 + rand()%3000;
+ }else Cleave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_jandicebarov(Creature *_Creature)
+{
+ return new boss_jandicebarovAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_illusionofjandicebarov(Creature *_Creature)
+{
+ return new mob_illusionofjandicebarovAI (_Creature);
+}
+
+void AddSC_boss_jandicebarov()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_jandice_barov";
+ newscript->GetAI = GetAI_boss_jandicebarov;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_illusionofjandicebarov";
+ newscript->GetAI = GetAI_mob_illusionofjandicebarov;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
index cafa783f577..b3cc6fd0530 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
@@ -1,155 +1,155 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kormok
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLTVOLLEY 20741
-#define SPELL_BONESHIELD 27688
-
-struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI
-{
- boss_kormokAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 BoneShield_Timer;
- uint32 Minion_Timer;
- uint32 Mage_Timer;
- bool Mages;
- int Rand1;
- int Rand1X;
- int Rand1Y;
- int Rand2;
- int Rand2X;
- int Rand2Y;
- Creature* SummonedMinions;
- Creature* SummonedMages;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- BoneShield_Timer = 2000;
- Minion_Timer = 15000;
- Mage_Timer = 0;
- Mages = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonMinion(Unit* victim)
- {
- Rand1 = rand()%8;
- switch (rand()%2)
- {
- case 0: Rand1X = 0 - Rand1; break;
- case 1: Rand1X = 0 + Rand1; break;
- }
- Rand1 = 0;
- Rand1 = rand()%8;
- switch (rand()%2)
- {
- case 0: Rand1Y = 0 - Rand1; break;
- case 1: Rand1Y = 0 + Rand1; break;
- }
- Rand1 = 0;
- SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- ((CreatureAI*)SummonedMinions->AI())->AttackStart(victim);
- }
-
- void SummonMages(Unit* victim)
- {
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2X = 0 - Rand2; break;
- case 1: Rand2X = 0 + Rand2; break;
- }
- Rand2 = 0;
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2Y = 0 - Rand2; break;
- case 1: Rand2Y = 0 + Rand2; break;
- }
- Rand2 = 0;
- SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- ((CreatureAI*)SummonedMages->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
- ShadowVolley_Timer = 15000;
- }else ShadowVolley_Timer -= diff;
-
- //BoneShield_Timer
- if (BoneShield_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BONESHIELD);
- BoneShield_Timer = 45000;
- }else BoneShield_Timer -= diff;
-
- //Minion_Timer
- if (Minion_Timer < diff)
- {
- //Cast
- SummonMinion(m_creature->getVictim());
- SummonMinion(m_creature->getVictim());
- SummonMinion(m_creature->getVictim());
- SummonMinion(m_creature->getVictim());
-
- Minion_Timer = 12000;
- }else Minion_Timer -= diff;
-
- //Summon 2 Bone Mages
- if ( !Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 )
- {
- //Cast
- SummonMages(m_creature->getVictim());
- SummonMages(m_creature->getVictim());
- Mages = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_kormok(Creature *_Creature)
-{
- return new boss_kormokAI (_Creature);
-}
-
-void AddSC_boss_kormok()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kormok";
- newscript->GetAI = GetAI_boss_kormok;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kormok
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLTVOLLEY 20741
+#define SPELL_BONESHIELD 27688
+
+struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI
+{
+ boss_kormokAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 BoneShield_Timer;
+ uint32 Minion_Timer;
+ uint32 Mage_Timer;
+ bool Mages;
+ int Rand1;
+ int Rand1X;
+ int Rand1Y;
+ int Rand2;
+ int Rand2X;
+ int Rand2Y;
+ Creature* SummonedMinions;
+ Creature* SummonedMages;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 10000;
+ BoneShield_Timer = 2000;
+ Minion_Timer = 15000;
+ Mage_Timer = 0;
+ Mages = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonMinion(Unit* victim)
+ {
+ Rand1 = rand()%8;
+ switch (rand()%2)
+ {
+ case 0: Rand1X = 0 - Rand1; break;
+ case 1: Rand1X = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ Rand1 = rand()%8;
+ switch (rand()%2)
+ {
+ case 0: Rand1Y = 0 - Rand1; break;
+ case 1: Rand1Y = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ ((CreatureAI*)SummonedMinions->AI())->AttackStart(victim);
+ }
+
+ void SummonMages(Unit* victim)
+ {
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2X = 0 - Rand2; break;
+ case 1: Rand2X = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2Y = 0 - Rand2; break;
+ case 1: Rand2Y = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ ((CreatureAI*)SummonedMages->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
+ ShadowVolley_Timer = 15000;
+ }else ShadowVolley_Timer -= diff;
+
+ //BoneShield_Timer
+ if (BoneShield_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BONESHIELD);
+ BoneShield_Timer = 45000;
+ }else BoneShield_Timer -= diff;
+
+ //Minion_Timer
+ if (Minion_Timer < diff)
+ {
+ //Cast
+ SummonMinion(m_creature->getVictim());
+ SummonMinion(m_creature->getVictim());
+ SummonMinion(m_creature->getVictim());
+ SummonMinion(m_creature->getVictim());
+
+ Minion_Timer = 12000;
+ }else Minion_Timer -= diff;
+
+ //Summon 2 Bone Mages
+ if ( !Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 )
+ {
+ //Cast
+ SummonMages(m_creature->getVictim());
+ SummonMages(m_creature->getVictim());
+ Mages = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_kormok(Creature *_Creature)
+{
+ return new boss_kormokAI (_Creature);
+}
+
+void AddSC_boss_kormok()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kormok";
+ newscript->GetAI = GetAI_boss_kormok;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
index 888e1f55ea9..49f3f733949 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
@@ -1,98 +1,98 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Lord_Alexei_Barov
-SD%Complete: 100
-SDComment: aura applied/defined in database
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_IMMOLATE 20294 // Old ID was 15570
-#define SPELL_VEILOFSHADOW 17820
-
-struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI
-{
- boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Immolate_Timer;
- uint32 VeilofShadow_Timer;
-
- void Reset()
- {
- Immolate_Timer = 7000;
- VeilofShadow_Timer = 15000;
-
- m_creature->LoadCreaturesAddon();
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_IMMOLATE);
-
- Immolate_Timer = 12000;
- }else Immolate_Timer -= diff;
-
- //VeilofShadow_Timer
- if (VeilofShadow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
- VeilofShadow_Timer = 20000;
- }else VeilofShadow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_lordalexeibarov(Creature *_Creature)
-{
- return new boss_lordalexeibarovAI (_Creature);
-}
-
-void AddSC_boss_lordalexeibarov()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_lord_alexei_barov";
- newscript->GetAI = GetAI_boss_lordalexeibarov;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Lord_Alexei_Barov
+SD%Complete: 100
+SDComment: aura applied/defined in database
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_IMMOLATE 20294 // Old ID was 15570
+#define SPELL_VEILOFSHADOW 17820
+
+struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI
+{
+ boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Immolate_Timer;
+ uint32 VeilofShadow_Timer;
+
+ void Reset()
+ {
+ Immolate_Timer = 7000;
+ VeilofShadow_Timer = 15000;
+
+ m_creature->LoadCreaturesAddon();
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_IMMOLATE);
+
+ Immolate_Timer = 12000;
+ }else Immolate_Timer -= diff;
+
+ //VeilofShadow_Timer
+ if (VeilofShadow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
+ VeilofShadow_Timer = 20000;
+ }else VeilofShadow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_lordalexeibarov(Creature *_Creature)
+{
+ return new boss_lordalexeibarovAI (_Creature);
+}
+
+void AddSC_boss_lordalexeibarov()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_lord_alexei_barov";
+ newscript->GetAI = GetAI_boss_lordalexeibarov;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
index 153c776e050..d17d2036d91 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
@@ -1,113 +1,113 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Lorekeeper_Polkelt
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_VOLATILEINFECTION 24928
-#define SPELL_DARKPLAGUE 18270
-#define SPELL_CORROSIVEACID 23313
-#define SPELL_NOXIOUSCATALYST 18151
-
-struct TRINITY_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI
-{
- boss_lorekeeperpolkeltAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 VolatileInfection_Timer;
- uint32 Darkplague_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 NoxiousCatalyst_Timer;
-
- void Reset()
- {
- VolatileInfection_Timer = 38000;
- Darkplague_Timer = 8000;
- CorrosiveAcid_Timer = 45000;
- NoxiousCatalyst_Timer = 35000;
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //VolatileInfection_Timer
- if (VolatileInfection_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
- VolatileInfection_Timer = 32000;
- }else VolatileInfection_Timer -= diff;
-
- //Darkplague_Timer
- if (Darkplague_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DARKPLAGUE);
- Darkplague_Timer = 8000;
- }else Darkplague_Timer -= diff;
-
- //CorrosiveAcid_Timer
- if (CorrosiveAcid_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORROSIVEACID);
- CorrosiveAcid_Timer = 25000;
- }else CorrosiveAcid_Timer -= diff;
-
- //NoxiousCatalyst_Timer
- if (NoxiousCatalyst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSCATALYST);
- NoxiousCatalyst_Timer = 38000;
- }else NoxiousCatalyst_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature *_Creature)
-{
- return new boss_lorekeeperpolkeltAI (_Creature);
-}
-
-void AddSC_boss_lorekeeperpolkelt()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_lorekeeper_polkelt";
- newscript->GetAI = GetAI_boss_lorekeeperpolkelt;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Lorekeeper_Polkelt
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_VOLATILEINFECTION 24928
+#define SPELL_DARKPLAGUE 18270
+#define SPELL_CORROSIVEACID 23313
+#define SPELL_NOXIOUSCATALYST 18151
+
+struct TRINITY_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI
+{
+ boss_lorekeeperpolkeltAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 VolatileInfection_Timer;
+ uint32 Darkplague_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 NoxiousCatalyst_Timer;
+
+ void Reset()
+ {
+ VolatileInfection_Timer = 38000;
+ Darkplague_Timer = 8000;
+ CorrosiveAcid_Timer = 45000;
+ NoxiousCatalyst_Timer = 35000;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //VolatileInfection_Timer
+ if (VolatileInfection_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
+ VolatileInfection_Timer = 32000;
+ }else VolatileInfection_Timer -= diff;
+
+ //Darkplague_Timer
+ if (Darkplague_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DARKPLAGUE);
+ Darkplague_Timer = 8000;
+ }else Darkplague_Timer -= diff;
+
+ //CorrosiveAcid_Timer
+ if (CorrosiveAcid_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORROSIVEACID);
+ CorrosiveAcid_Timer = 25000;
+ }else CorrosiveAcid_Timer -= diff;
+
+ //NoxiousCatalyst_Timer
+ if (NoxiousCatalyst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSCATALYST);
+ NoxiousCatalyst_Timer = 38000;
+ }else NoxiousCatalyst_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature *_Creature)
+{
+ return new boss_lorekeeperpolkeltAI (_Creature);
+}
+
+void AddSC_boss_lorekeeperpolkelt()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_lorekeeper_polkelt";
+ newscript->GetAI = GetAI_boss_lorekeeperpolkelt;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
index 0bdfed8109b..0ea243c2d08 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
@@ -1,125 +1,125 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ras_Frostwhisper
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTBOLT 21369
-#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself
-#define SPELL_FREEZE 18763
-#define SPELL_FEAR 26070
-#define SPELL_CHILLNOVA 18099
-#define SPELL_FROSTVOLLEY 8398
-
-struct TRINITY_DLL_DECL boss_rasfrostAI : public ScriptedAI
-{
- boss_rasfrostAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 IceArmor_Timer;
- uint32 Frostbolt_Timer;
- uint32 Freeze_Timer;
- uint32 Fear_Timer;
- uint32 ChillNova_Timer;
- uint32 FrostVolley_Timer;
-
- void Reset()
- {
- IceArmor_Timer = 2000;
- Frostbolt_Timer = 8000;
- ChillNova_Timer = 12000;
- Freeze_Timer = 18000;
- FrostVolley_Timer = 24000;
- Fear_Timer = 45000;
-
- m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //IceArmor_Timer
- if (IceArmor_Timer < diff)
- {
- DoCast(m_creature, SPELL_ICEARMOR);
- IceArmor_Timer = 180000;
- }else IceArmor_Timer -= diff;
-
- //Frostbolt_Timer
- if (Frostbolt_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_FROSTBOLT);
-
- Frostbolt_Timer = 8000;
- }else Frostbolt_Timer -= diff;
-
- //Freeze_Timer
- if (Freeze_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FREEZE);
- Freeze_Timer = 24000;
- }else Freeze_Timer -= diff;
-
- //Fear_Timer
- if (Fear_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FEAR);
- Fear_Timer = 30000;
- }else Fear_Timer -= diff;
-
- //ChillNova_Timer
- if (ChillNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CHILLNOVA);
- ChillNova_Timer = 14000;
- }else ChillNova_Timer -= diff;
-
- //FrostVolley_Timer
- if (FrostVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTVOLLEY);
- FrostVolley_Timer = 15000;
- }else FrostVolley_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_rasfrost(Creature *_Creature)
-{
- return new boss_rasfrostAI (_Creature);
-}
-
-void AddSC_boss_rasfrost()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_boss_ras_frostwhisper";
- newscript->GetAI = GetAI_boss_rasfrost;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ras_Frostwhisper
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTBOLT 21369
+#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself
+#define SPELL_FREEZE 18763
+#define SPELL_FEAR 26070
+#define SPELL_CHILLNOVA 18099
+#define SPELL_FROSTVOLLEY 8398
+
+struct TRINITY_DLL_DECL boss_rasfrostAI : public ScriptedAI
+{
+ boss_rasfrostAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 IceArmor_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 Freeze_Timer;
+ uint32 Fear_Timer;
+ uint32 ChillNova_Timer;
+ uint32 FrostVolley_Timer;
+
+ void Reset()
+ {
+ IceArmor_Timer = 2000;
+ Frostbolt_Timer = 8000;
+ ChillNova_Timer = 12000;
+ Freeze_Timer = 18000;
+ FrostVolley_Timer = 24000;
+ Fear_Timer = 45000;
+
+ m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //IceArmor_Timer
+ if (IceArmor_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_ICEARMOR);
+ IceArmor_Timer = 180000;
+ }else IceArmor_Timer -= diff;
+
+ //Frostbolt_Timer
+ if (Frostbolt_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_FROSTBOLT);
+
+ Frostbolt_Timer = 8000;
+ }else Frostbolt_Timer -= diff;
+
+ //Freeze_Timer
+ if (Freeze_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FREEZE);
+ Freeze_Timer = 24000;
+ }else Freeze_Timer -= diff;
+
+ //Fear_Timer
+ if (Fear_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+ Fear_Timer = 30000;
+ }else Fear_Timer -= diff;
+
+ //ChillNova_Timer
+ if (ChillNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHILLNOVA);
+ ChillNova_Timer = 14000;
+ }else ChillNova_Timer -= diff;
+
+ //FrostVolley_Timer
+ if (FrostVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTVOLLEY);
+ FrostVolley_Timer = 15000;
+ }else FrostVolley_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_rasfrost(Creature *_Creature)
+{
+ return new boss_rasfrostAI (_Creature);
+}
+
+void AddSC_boss_rasfrost()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_boss_ras_frostwhisper";
+ newscript->GetAI = GetAI_boss_rasfrost;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
index 9192452fcaf..f27e8aa458f 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
@@ -1,118 +1,118 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_the_ravenian
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-#define SPELL_TRAMPLE 15550
-#define SPELL_CLEAVE 20691
-#define SPELL_SUNDERINCLEAVE 25174
-#define SPELL_KNOCKAWAY 10101
-
-#define SAY_AGGRO1 "Mine! Mine! Mine! Gizlock is the ruler of this domain! You shall never reveal my presence!"
-
-struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
-{
- boss_theravenianAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Trample_Timer;
- uint32 Cleave_Timer;
- uint32 SunderingCleave_Timer;
- uint32 KnockAway_Timer;
- bool HasYelled;
-
- void Reset()
- {
- Trample_Timer = 24000;
- Cleave_Timer = 15000;
- SunderingCleave_Timer = 40000;
- KnockAway_Timer = 32000;
- HasYelled = false;
- }
-
- void JustDied(Unit *killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- {
- pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
-
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
- m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Trample_Timer
- if (Trample_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
- Trample_Timer = 10000;
- }else Trample_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //SunderingCleave_Timer
- if (SunderingCleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERINCLEAVE);
- SunderingCleave_Timer = 20000;
- }else SunderingCleave_Timer -= diff;
-
- //KnockAway_Timer
- if (KnockAway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- KnockAway_Timer = 12000;
- }else KnockAway_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_theravenian(Creature *_Creature)
-{
- return new boss_theravenianAI (_Creature);
-}
-
-void AddSC_boss_theravenian()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_the_ravenian";
- newscript->GetAI = GetAI_boss_theravenian;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_the_ravenian
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+#define SPELL_TRAMPLE 15550
+#define SPELL_CLEAVE 20691
+#define SPELL_SUNDERINCLEAVE 25174
+#define SPELL_KNOCKAWAY 10101
+
+#define SAY_AGGRO1 "Mine! Mine! Mine! Gizlock is the ruler of this domain! You shall never reveal my presence!"
+
+struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
+{
+ boss_theravenianAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Trample_Timer;
+ uint32 Cleave_Timer;
+ uint32 SunderingCleave_Timer;
+ uint32 KnockAway_Timer;
+ bool HasYelled;
+
+ void Reset()
+ {
+ Trample_Timer = 24000;
+ Cleave_Timer = 15000;
+ SunderingCleave_Timer = 40000;
+ KnockAway_Timer = 32000;
+ HasYelled = false;
+ }
+
+ void JustDied(Unit *killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
+
+ if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Trample_Timer
+ if (Trample_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
+ Trample_Timer = 10000;
+ }else Trample_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //SunderingCleave_Timer
+ if (SunderingCleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERINCLEAVE);
+ SunderingCleave_Timer = 20000;
+ }else SunderingCleave_Timer -= diff;
+
+ //KnockAway_Timer
+ if (KnockAway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ KnockAway_Timer = 12000;
+ }else KnockAway_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_theravenian(Creature *_Creature)
+{
+ return new boss_theravenianAI (_Creature);
+}
+
+void AddSC_boss_theravenian()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_the_ravenian";
+ newscript->GetAI = GetAI_boss_theravenian;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
index 70ff1733d31..954ee3b4eba 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
@@ -1,95 +1,95 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vectus
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIRESHIELD 19626
-#define SPELL_BLASTWAVE 13021
-#define SPELL_FRENZY 28371
-
-struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI
-{
- boss_vectusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireShield_Timer;
- uint32 BlastWave_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- FireShield_Timer = 2000;
- BlastWave_Timer = 14000;
- Frenzy_Timer = 0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //FireShield_Timer
- if (FireShield_Timer < diff)
- {
- DoCast(m_creature, SPELL_FIRESHIELD);
- FireShield_Timer = 90000;
- }else FireShield_Timer -= diff;
-
- //BlastWave_Timer
- if (BlastWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- BlastWave_Timer = 12000;
- }else BlastWave_Timer -= diff;
-
- //Frenzy_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
- {
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
-
- Frenzy_Timer = 24000;
- }else Frenzy_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_vectus(Creature *_Creature)
-{
- return new boss_vectusAI (_Creature);
-}
-
-void AddSC_boss_vectus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_vectus";
- newscript->GetAI = GetAI_boss_vectus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vectus
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIRESHIELD 19626
+#define SPELL_BLASTWAVE 13021
+#define SPELL_FRENZY 28371
+
+struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI
+{
+ boss_vectusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireShield_Timer;
+ uint32 BlastWave_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ FireShield_Timer = 2000;
+ BlastWave_Timer = 14000;
+ Frenzy_Timer = 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //FireShield_Timer
+ if (FireShield_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_FIRESHIELD);
+ FireShield_Timer = 90000;
+ }else FireShield_Timer -= diff;
+
+ //BlastWave_Timer
+ if (BlastWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ BlastWave_Timer = 12000;
+ }else BlastWave_Timer -= diff;
+
+ //Frenzy_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
+ {
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote("goes into a killing frenzy!",NULL);
+
+ Frenzy_Timer = 24000;
+ }else Frenzy_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_vectus(Creature *_Creature)
+{
+ return new boss_vectusAI (_Creature);
+}
+
+void AddSC_boss_vectus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_vectus";
+ newscript->GetAI = GetAI_boss_vectus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
index cbeab113b85..a4023315e01 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
+++ b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
@@ -1,15 +1,15 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SCHOLOMANCE_H
-#define DEF_SCHOLOMANCE_H
-
-#define DATA_CANSPAWNGANDLING 1
-#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2
-#define DATA_INSTRUCTORMALICIA_DEATH 3
-#define DATA_LADYILLUCIABAROV_DEATH 4
-#define DATA_LORDALEXEIBAROV_DEATH 5
-#define DATA_LOREKEEPERPOLKELT_DEATH 6
-#define DATA_THERAVENIAN_DEATH 7
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SCHOLOMANCE_H
+#define DEF_SCHOLOMANCE_H
+
+#define DATA_CANSPAWNGANDLING 1
+#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2
+#define DATA_INSTRUCTORMALICIA_DEATH 3
+#define DATA_LADYILLUCIABAROV_DEATH 4
+#define DATA_LORDALEXEIBAROV_DEATH 5
+#define DATA_LOREKEEPERPOLKELT_DEATH 6
+#define DATA_THERAVENIAN_DEATH 7
+#endif
diff --git a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
index e359fcd9408..a48537068f8 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
@@ -1,102 +1,102 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Scholomance
-SD%Complete: 100
-SDComment:
-SDCategory: Scholomance
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_scholomance.h"
-
-struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
-{
- instance_scholomance(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
- bool IsBossDied[6];
-
- void Initialize()
- {
- IsBossDied[0] = false;
- IsBossDied[1] = false;
- IsBossDied[2] = false;
- IsBossDied[3] = false;
- IsBossDied[4] = false;
- IsBossDied[5] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- //not active in scholomance
- return false;
- }
-
- uint32 GetData(uint32 type)
- {
- if(type == DATA_CANSPAWNGANDLING)
- if(IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
- return 1;
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_LORDALEXEIBAROV_DEATH:
- IsBossDied[0] = true;
- break;
-
- case DATA_DOCTORTHEOLENKRASTINOV_DEATH:
- IsBossDied[1] = true;
- break;
-
- case DATA_THERAVENIAN_DEATH:
- IsBossDied[2] = true;
- break;
-
- case DATA_LOREKEEPERPOLKELT_DEATH:
- IsBossDied[3] = true;
- break;
-
- case DATA_INSTRUCTORMALICIA_DEATH:
- IsBossDied[4] = true;
- break;
-
- case DATA_LADYILLUCIABAROV_DEATH:
- IsBossDied[5] = true;
- break;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_scholomance(Map* map)
-{
- return new instance_scholomance(map);
-}
-
-void AddSC_instance_scholomance()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_scholomance";
- newscript->GetInstanceData = GetInstanceData_instance_scholomance;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Scholomance
+SD%Complete: 100
+SDComment:
+SDCategory: Scholomance
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_scholomance.h"
+
+struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
+{
+ instance_scholomance(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
+ bool IsBossDied[6];
+
+ void Initialize()
+ {
+ IsBossDied[0] = false;
+ IsBossDied[1] = false;
+ IsBossDied[2] = false;
+ IsBossDied[3] = false;
+ IsBossDied[4] = false;
+ IsBossDied[5] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ //not active in scholomance
+ return false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ if(type == DATA_CANSPAWNGANDLING)
+ if(IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
+ return 1;
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_LORDALEXEIBAROV_DEATH:
+ IsBossDied[0] = true;
+ break;
+
+ case DATA_DOCTORTHEOLENKRASTINOV_DEATH:
+ IsBossDied[1] = true;
+ break;
+
+ case DATA_THERAVENIAN_DEATH:
+ IsBossDied[2] = true;
+ break;
+
+ case DATA_LOREKEEPERPOLKELT_DEATH:
+ IsBossDied[3] = true;
+ break;
+
+ case DATA_INSTRUCTORMALICIA_DEATH:
+ IsBossDied[4] = true;
+ break;
+
+ case DATA_LADYILLUCIABAROV_DEATH:
+ IsBossDied[5] = true;
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_scholomance(Map* map)
+{
+ return new instance_scholomance(map);
+}
+
+void AddSC_instance_scholomance()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_scholomance";
+ newscript->GetInstanceData = GetInstanceData_instance_scholomance;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
index 64b9e6e8104..7a9ef1a5449 100644
--- a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
+++ b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
@@ -1,159 +1,159 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Searing_Gorge
-SD%Complete: 80
-SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core.
-SDCategory: Searing Gorge
-EndScriptData */
-
-/* ContentData
-npc_kalaran_windblade
-npc_lothos_riftwaker
-npc_zamael_lunthistle
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_kalaran_windblade
-######*/
-
-bool GossipHello_npc_kalaran_windblade(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(3441) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Tell me what drives this vengance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_kalaran_windblade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "Continue please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(1954, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Let me confer with my colleagues", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1955, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3441);
- break;
- }
- return true;
-}
-
-/*######
-## npc_lothos_riftwaker
-######*/
-
-bool GossipHello_npc_lothos_riftwaker(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestRewardStatus(7487) || player->GetQuestRewardStatus(7848))
- player->ADD_GOSSIP_ITEM(0, "Teleport me to the Molten Core", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lothos_riftwaker(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->TeleportTo(409, 1096, -467, -104.6, 3.64);
- }
-
- return true;
-}
-
-/*######
-## npc_zamael_lunthistle
-######*/
-
-bool GossipHello_npc_zamael_lunthistle(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(1920, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_zamael_lunthistle(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "Please continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(1921, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Goodbye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1922, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3377);
- break;
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_searing_gorge()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_kalaran_windblade";
- newscript->pGossipHello = &GossipHello_npc_kalaran_windblade;
- newscript->pGossipSelect = &GossipSelect_npc_kalaran_windblade;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lothos_riftwaker";
- newscript->pGossipHello = &GossipHello_npc_lothos_riftwaker;
- newscript->pGossipSelect = &GossipSelect_npc_lothos_riftwaker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_zamael_lunthistle";
- newscript->pGossipHello = &GossipHello_npc_zamael_lunthistle;
- newscript->pGossipSelect = &GossipSelect_npc_zamael_lunthistle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Searing_Gorge
+SD%Complete: 80
+SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core.
+SDCategory: Searing Gorge
+EndScriptData */
+
+/* ContentData
+npc_kalaran_windblade
+npc_lothos_riftwaker
+npc_zamael_lunthistle
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_kalaran_windblade
+######*/
+
+bool GossipHello_npc_kalaran_windblade(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(3441) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Tell me what drives this vengance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_kalaran_windblade(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "Continue please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(1954, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Let me confer with my colleagues", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(1955, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(3441);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_lothos_riftwaker
+######*/
+
+bool GossipHello_npc_lothos_riftwaker(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestRewardStatus(7487) || player->GetQuestRewardStatus(7848))
+ player->ADD_GOSSIP_ITEM(0, "Teleport me to the Molten Core", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lothos_riftwaker(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->TeleportTo(409, 1096, -467, -104.6, 3.64);
+ }
+
+ return true;
+}
+
+/*######
+## npc_zamael_lunthistle
+######*/
+
+bool GossipHello_npc_zamael_lunthistle(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(1920, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_zamael_lunthistle(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "Please continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(1921, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Goodbye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(1922, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(3377);
+ break;
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_searing_gorge()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_kalaran_windblade";
+ newscript->pGossipHello = &GossipHello_npc_kalaran_windblade;
+ newscript->pGossipSelect = &GossipSelect_npc_kalaran_windblade;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lothos_riftwaker";
+ newscript->pGossipHello = &GossipHello_npc_lothos_riftwaker;
+ newscript->pGossipSelect = &GossipSelect_npc_lothos_riftwaker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_zamael_lunthistle";
+ newscript->pGossipHello = &GossipHello_npc_zamael_lunthistle;
+ newscript->pGossipSelect = &GossipSelect_npc_zamael_lunthistle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
index b49e7623257..7ece07f0231 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
@@ -1,12 +1,12 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SHADOWFANG_H
-#define DEF_SHADOWFANG_H
-
-#define TYPE_FREE_NPC 1
-#define TYPE_RETHILGORE 2
-#define TYPE_FENRUS 3
-#define TYPE_NANDOS 4
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SHADOWFANG_H
+#define DEF_SHADOWFANG_H
+
+#define TYPE_FREE_NPC 1
+#define TYPE_RETHILGORE 2
+#define TYPE_FENRUS 3
+#define TYPE_NANDOS 4
+#endif
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
index 30aded0c47b..dfae8457abc 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
@@ -1,152 +1,152 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Shadowfang_Keep
-SD%Complete: 75
-SDComment: TODO: check what other parts would require additional code (ex: make sure door are in open state if boss dead)
-SDCategory: Shadowfang Keep
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadowfang_keep.h"
-
-#define ENCOUNTERS 4
-
-//#define ENTRY_BOSS_RETHILGORE 3914
-//#define ENTRY_BOSS_FENRUS 4274
-//#define ENTRY_BOSS_NANDOS 3927
-
-#define ENTRY_COURTYARD_DOOR 18895 //door to open when talking to NPC's
-#define ENTRY_SORCERER_DOOR 18972 //door to open when Fenrus the Devourer
-#define ENTRY_ARUGAL_DOOR 18971 //door to open when Wolf Master Nandos
-
-struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
-{
- instance_shadowfang_keep(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
-
- /*uint64 RethilgoreGUID;
- uint64 FenrusGUID;
- uint64 NandosGUID;*/
-
- GameObject *DoorCourtyard;
- GameObject *DoorSorcerer;
- GameObject *DoorArugal;
-
- void Initialize()
- {
- /*RethilgoreGUID = 0;
- FenrusGUID = 0;
- NandosGUID = 0;*/
-
- DoorCourtyard = NULL;
- DoorSorcerer = NULL;
- DoorArugal = NULL;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case ENTRY_COURTYARD_DOOR: DoorCourtyard = go; break;
- case ENTRY_SORCERER_DOOR: DoorSorcerer = go; break;
- case ENTRY_ARUGAL_DOOR: DoorArugal = go; break;
- }
- }
-
- /*void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case ENTRY_BOSS_RETHILGORE:
- RethilgoreGUID = creature->GetGUID();
- break;
- case ENTRY_BOSS_FENRUS:
- FenrusGUID = creature->GetGUID();
- break;
- case ENTRY_BOSS_NANDOS:
- NandosGUID = creature->GetGUID();
- break;
- }
- }*/
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_FREE_NPC:
- if(data == DONE)
- {
- if(DoorCourtyard)
- DoorCourtyard->UseDoorOrButton();
- }
- Encounter[0] = data;
- break;
- case TYPE_RETHILGORE:
- Encounter[1] = data;
- break;
- case TYPE_FENRUS:
- if(data == DONE)
- {
- if(DoorSorcerer)
- DoorSorcerer->UseDoorOrButton();
- }
- Encounter[2] = data;
- break;
- case TYPE_NANDOS:
- if(data == DONE)
- {
- if(DoorArugal)
- DoorArugal->UseDoorOrButton();
- }
- Encounter[3] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case TYPE_FREE_NPC:
- return Encounter[0];
- case TYPE_RETHILGORE:
- return Encounter[1];
- case TYPE_FENRUS:
- return Encounter[2];
- case TYPE_NANDOS:
- return Encounter[3];
- }
- return 0;
- }
-
-};
-
-InstanceData* GetInstanceData_instance_shadowfang_keep(Map* map)
-{
- return new instance_shadowfang_keep(map);
-}
-
-void AddSC_instance_shadowfang_keep()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_shadowfang_keep";
- newscript->GetInstanceData = GetInstanceData_instance_shadowfang_keep;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Shadowfang_Keep
+SD%Complete: 75
+SDComment: TODO: check what other parts would require additional code (ex: make sure door are in open state if boss dead)
+SDCategory: Shadowfang Keep
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadowfang_keep.h"
+
+#define ENCOUNTERS 4
+
+//#define ENTRY_BOSS_RETHILGORE 3914
+//#define ENTRY_BOSS_FENRUS 4274
+//#define ENTRY_BOSS_NANDOS 3927
+
+#define ENTRY_COURTYARD_DOOR 18895 //door to open when talking to NPC's
+#define ENTRY_SORCERER_DOOR 18972 //door to open when Fenrus the Devourer
+#define ENTRY_ARUGAL_DOOR 18971 //door to open when Wolf Master Nandos
+
+struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
+{
+ instance_shadowfang_keep(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+
+ /*uint64 RethilgoreGUID;
+ uint64 FenrusGUID;
+ uint64 NandosGUID;*/
+
+ GameObject *DoorCourtyard;
+ GameObject *DoorSorcerer;
+ GameObject *DoorArugal;
+
+ void Initialize()
+ {
+ /*RethilgoreGUID = 0;
+ FenrusGUID = 0;
+ NandosGUID = 0;*/
+
+ DoorCourtyard = NULL;
+ DoorSorcerer = NULL;
+ DoorArugal = NULL;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case ENTRY_COURTYARD_DOOR: DoorCourtyard = go; break;
+ case ENTRY_SORCERER_DOOR: DoorSorcerer = go; break;
+ case ENTRY_ARUGAL_DOOR: DoorArugal = go; break;
+ }
+ }
+
+ /*void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case ENTRY_BOSS_RETHILGORE:
+ RethilgoreGUID = creature->GetGUID();
+ break;
+ case ENTRY_BOSS_FENRUS:
+ FenrusGUID = creature->GetGUID();
+ break;
+ case ENTRY_BOSS_NANDOS:
+ NandosGUID = creature->GetGUID();
+ break;
+ }
+ }*/
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_FREE_NPC:
+ if(data == DONE)
+ {
+ if(DoorCourtyard)
+ DoorCourtyard->UseDoorOrButton();
+ }
+ Encounter[0] = data;
+ break;
+ case TYPE_RETHILGORE:
+ Encounter[1] = data;
+ break;
+ case TYPE_FENRUS:
+ if(data == DONE)
+ {
+ if(DoorSorcerer)
+ DoorSorcerer->UseDoorOrButton();
+ }
+ Encounter[2] = data;
+ break;
+ case TYPE_NANDOS:
+ if(data == DONE)
+ {
+ if(DoorArugal)
+ DoorArugal->UseDoorOrButton();
+ }
+ Encounter[3] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case TYPE_FREE_NPC:
+ return Encounter[0];
+ case TYPE_RETHILGORE:
+ return Encounter[1];
+ case TYPE_FENRUS:
+ return Encounter[2];
+ case TYPE_NANDOS:
+ return Encounter[3];
+ }
+ return 0;
+ }
+
+};
+
+InstanceData* GetInstanceData_instance_shadowfang_keep(Map* map)
+{
+ return new instance_shadowfang_keep(map);
+}
+
+void AddSC_instance_shadowfang_keep()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_shadowfang_keep";
+ newscript->GetInstanceData = GetInstanceData_instance_shadowfang_keep;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
index 0daf14091cc..65e1eaea8ba 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
@@ -1,117 +1,117 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Shadowfang_Keep
-SD%Complete: 75
-SDComment: npc_shadowfang_prisoner using escortAI for movement to door. Might need additional code in case being attacked. Add proper texts/say().
-SDCategory: Shadowfang Keep
-EndScriptData */
-
-/* ContentData
-npc_shadowfang_prisoner
-EndContentData */
-
-#include "precompiled.h"
-#include "../../npc/npc_escortAI.h"
-#include "def_shadowfang_keep.h"
-
-/*######
-## npc_shadowfang_prisoner
-######*/
-
-struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI
-{
- npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- void WaypointReached(uint32 i)
- {
- if( pInstance && i == 6)
- {
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
- m_creature->Say("Thanks for freeing me, I'll open this door for you, then I will get out of here.", LANG_UNIVERSAL, 0);
- pInstance->SetData(TYPE_FREE_NPC, DONE);
- }
- }
-
- void Reset() {}
- void Aggro(Unit* who) {}
-};
-
-CreatureAI* GetAI_npc_shadowfang_prisoner(Creature *_Creature)
-{
- npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(_Creature);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if( eCreature==3849) //adamant
- prisonerAI->AddWaypoint(0, -254.47, 2117.48, 81.17);
- if( eCreature==3850) //ashcrombe
- prisonerAI->AddWaypoint(0, -252.35, 2126.71, 81.17);
-
- prisonerAI->AddWaypoint(1, -253.63, 2131.27, 81.28);
- prisonerAI->AddWaypoint(2, -249.66, 2142.45, 87.01);
- prisonerAI->AddWaypoint(3, -248.08, 2143.68, 87.01);
- prisonerAI->AddWaypoint(4, -238.87, 2139.93, 87.01);
- prisonerAI->AddWaypoint(5, -235.47, 2149.18, 90.59);
- prisonerAI->AddWaypoint(6, -239.89, 2156.06, 90.62, 20000);
-
- return (CreatureAI*)prisonerAI;
-}
-
-bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
-
- if( pInstance && !pInstance->GetData(TYPE_FREE_NPC) && pInstance->GetData(TYPE_RETHILGORE) == DONE )
- player->ADD_GOSSIP_ITEM( 0, "Thanks, I'll follow you to the door.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_shadowfang_keep()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_shadowfang_prisoner";
- newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner;
- newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner;
- newscript->GetAI = GetAI_npc_shadowfang_prisoner;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Shadowfang_Keep
+SD%Complete: 75
+SDComment: npc_shadowfang_prisoner using escortAI for movement to door. Might need additional code in case being attacked. Add proper texts/say().
+SDCategory: Shadowfang Keep
+EndScriptData */
+
+/* ContentData
+npc_shadowfang_prisoner
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+#include "def_shadowfang_keep.h"
+
+/*######
+## npc_shadowfang_prisoner
+######*/
+
+struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI
+{
+ npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ void WaypointReached(uint32 i)
+ {
+ if( pInstance && i == 6)
+ {
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
+ m_creature->Say("Thanks for freeing me, I'll open this door for you, then I will get out of here.", LANG_UNIVERSAL, 0);
+ pInstance->SetData(TYPE_FREE_NPC, DONE);
+ }
+ }
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+};
+
+CreatureAI* GetAI_npc_shadowfang_prisoner(Creature *_Creature)
+{
+ npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(_Creature);
+
+ uint32 eCreature = _Creature->GetEntry();
+
+ if( eCreature==3849) //adamant
+ prisonerAI->AddWaypoint(0, -254.47, 2117.48, 81.17);
+ if( eCreature==3850) //ashcrombe
+ prisonerAI->AddWaypoint(0, -252.35, 2126.71, 81.17);
+
+ prisonerAI->AddWaypoint(1, -253.63, 2131.27, 81.28);
+ prisonerAI->AddWaypoint(2, -249.66, 2142.45, 87.01);
+ prisonerAI->AddWaypoint(3, -248.08, 2143.68, 87.01);
+ prisonerAI->AddWaypoint(4, -238.87, 2139.93, 87.01);
+ prisonerAI->AddWaypoint(5, -235.47, 2149.18, 90.59);
+ prisonerAI->AddWaypoint(6, -239.89, 2156.06, 90.62, 20000);
+
+ return (CreatureAI*)prisonerAI;
+}
+
+bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+
+ if( pInstance && !pInstance->GetData(TYPE_FREE_NPC) && pInstance->GetData(TYPE_RETHILGORE) == DONE )
+ player->ADD_GOSSIP_ITEM( 0, "Thanks, I'll follow you to the door.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_shadowfang_keep()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_shadowfang_prisoner";
+ newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner;
+ newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner;
+ newscript->GetAI = GetAI_npc_shadowfang_prisoner;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
index 61856f837f5..e364c6fefe8 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
@@ -1,211 +1,211 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doomwalker
-SD%Complete: 100
-SDComment:
-SDCategory: Shadowmoon Valley
-EndScriptData */
-
-#include "precompiled.h"
-
-//--------------------------------------
-//Spells
-#define SPELL_SUNDER_ARMOR 30901
-
-#define SPELL_CHAIN_LIGHTNING 33665
-
-#define SPELL_OVERRUN 32636
-#define SAY_OVERRUN_1 "Trajectory locked."
-#define SOUND_OVERRUN_1 11347
-#define SAY_OVERRUN_2 "Engage maximum speed."
-#define SOUND_OVERRUN_2 11348
-
-#define SPELL_ENRAGE 34624
-
-#define SPELL_MARK_DEATH 37128
-
-#define SPELL_EARTHQUAKE 32686
-#define SAY_EARTHQUAKE_1 "Tectonic disruption commencing."
-#define SOUND_EARTHQUAKE_1 11345
-#define SAY_EARTHQUAKE_2 "Magnitude set. Release."
-#define SOUND_EARTHQUAKE_2 11346
-
-#define SAY_AGGRO "Do not proceed. You will be eliminated!"
-#define SOUND_AGGRO 11344
-
-#define SAY_SLAY_1 "Threat level zero."
-#define SOUND_SLAY_1 11349
-#define SAY_SLAY_2 "Directive accomplished."
-#define SOUND_SLAY_2 11350
-#define SAY_SLAY_3 "Target exterminated."
-#define SOUND_SLAY_3 11351
-
-#define SAY_DEATH "System failure in five... four..."
-#define SOUND_DEATH 11352
-
-struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI
-{
- boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Chain_Timer;
- uint32 Enrage_Timer;
- uint32 Overrun_Timer;
- uint32 Quake_Timer;
- uint32 Armor_Timer;
-
- bool InEnrage;
-
- void Reset()
- {
- Enrage_Timer = 0;
- Armor_Timer = 10000;
- Chain_Timer = 20000;
- Quake_Timer = 60000;
- Overrun_Timer = 120000;
-
- InEnrage = false;
- }
-
- void KilledUnit(Unit* Victim)
- {
- if(rand()%5)
- return;
-
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
- break;
- case 2:
- DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY_3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- //when hp <= 20% gain enrage
- if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)
- {
- if(Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 6000;
- InEnrage = true;
- }else Enrage_Timer -= diff;
- }
-
- //Spell Overrun
- if (Overrun_Timer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_OVERRUN_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_OVERRUN_1);
- break;
- case 1:
- DoYell(SAY_OVERRUN_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_OVERRUN_2);
- break;
- }
- DoCast(m_creature->getVictim(),SPELL_OVERRUN);
- Overrun_Timer = (30 + rand()% 40) * 1000; //30-70sec cooldown
-
- }else Overrun_Timer -= diff;
-
- //Spell Earthquake
- if (Quake_Timer < diff)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_EARTHQUAKE_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_1);
- break;
- case 1:
- DoYell(SAY_EARTHQUAKE_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_2);
- break;
- }
- if(InEnrage)
- {
- m_creature->RemoveAura(SPELL_ENRAGE, 0);//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
- }
- DoCast(m_creature,SPELL_EARTHQUAKE);
- Quake_Timer = (70 + rand()% 30) * 1000; //70-100sec cooldown
- }else Quake_Timer -= diff;
-
- //Spell Chain Lightning
- if (Chain_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
- Chain_Timer = (50 + rand()% 50) * 1000; //50-100sec cooldown
- }else Chain_Timer -= diff;
-
- //Spell Sunder Armor
- if (Armor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR);
- Armor_Timer = (15 + rand()% 7) * 1000; //15-23sec cooldown about 70 proc to stack
- }else Armor_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-CreatureAI* GetAI_boss_doomwalker(Creature *_Creature)
-{
- return new boss_doomwalkerAI (_Creature);
-}
-
-void AddSC_boss_doomwalker()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doomwalker";
- newscript->GetAI = GetAI_boss_doomwalker;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doomwalker
+SD%Complete: 100
+SDComment:
+SDCategory: Shadowmoon Valley
+EndScriptData */
+
+#include "precompiled.h"
+
+//--------------------------------------
+//Spells
+#define SPELL_SUNDER_ARMOR 30901
+
+#define SPELL_CHAIN_LIGHTNING 33665
+
+#define SPELL_OVERRUN 32636
+#define SAY_OVERRUN_1 "Trajectory locked."
+#define SOUND_OVERRUN_1 11347
+#define SAY_OVERRUN_2 "Engage maximum speed."
+#define SOUND_OVERRUN_2 11348
+
+#define SPELL_ENRAGE 34624
+
+#define SPELL_MARK_DEATH 37128
+
+#define SPELL_EARTHQUAKE 32686
+#define SAY_EARTHQUAKE_1 "Tectonic disruption commencing."
+#define SOUND_EARTHQUAKE_1 11345
+#define SAY_EARTHQUAKE_2 "Magnitude set. Release."
+#define SOUND_EARTHQUAKE_2 11346
+
+#define SAY_AGGRO "Do not proceed. You will be eliminated!"
+#define SOUND_AGGRO 11344
+
+#define SAY_SLAY_1 "Threat level zero."
+#define SOUND_SLAY_1 11349
+#define SAY_SLAY_2 "Directive accomplished."
+#define SOUND_SLAY_2 11350
+#define SAY_SLAY_3 "Target exterminated."
+#define SOUND_SLAY_3 11351
+
+#define SAY_DEATH "System failure in five... four..."
+#define SOUND_DEATH 11352
+
+struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI
+{
+ boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Chain_Timer;
+ uint32 Enrage_Timer;
+ uint32 Overrun_Timer;
+ uint32 Quake_Timer;
+ uint32 Armor_Timer;
+
+ bool InEnrage;
+
+ void Reset()
+ {
+ Enrage_Timer = 0;
+ Armor_Timer = 10000;
+ Chain_Timer = 20000;
+ Quake_Timer = 60000;
+ Overrun_Timer = 120000;
+
+ InEnrage = false;
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if(rand()%5)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ //when hp <= 20% gain enrage
+ if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)
+ {
+ if(Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enrage_Timer = 6000;
+ InEnrage = true;
+ }else Enrage_Timer -= diff;
+ }
+
+ //Spell Overrun
+ if (Overrun_Timer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_OVERRUN_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_OVERRUN_1);
+ break;
+ case 1:
+ DoYell(SAY_OVERRUN_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_OVERRUN_2);
+ break;
+ }
+ DoCast(m_creature->getVictim(),SPELL_OVERRUN);
+ Overrun_Timer = (30 + rand()% 40) * 1000; //30-70sec cooldown
+
+ }else Overrun_Timer -= diff;
+
+ //Spell Earthquake
+ if (Quake_Timer < diff)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_EARTHQUAKE_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_1);
+ break;
+ case 1:
+ DoYell(SAY_EARTHQUAKE_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_2);
+ break;
+ }
+ if(InEnrage)
+ {
+ m_creature->RemoveAura(SPELL_ENRAGE, 0);//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
+ }
+ DoCast(m_creature,SPELL_EARTHQUAKE);
+ Quake_Timer = (70 + rand()% 30) * 1000; //70-100sec cooldown
+ }else Quake_Timer -= diff;
+
+ //Spell Chain Lightning
+ if (Chain_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
+ Chain_Timer = (50 + rand()% 50) * 1000; //50-100sec cooldown
+ }else Chain_Timer -= diff;
+
+ //Spell Sunder Armor
+ if (Armor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR);
+ Armor_Timer = (15 + rand()% 7) * 1000; //15-23sec cooldown about 70 proc to stack
+ }else Armor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_doomwalker(Creature *_Creature)
+{
+ return new boss_doomwalkerAI (_Creature);
+}
+
+void AddSC_boss_doomwalker()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doomwalker";
+ newscript->GetAI = GetAI_boss_doomwalker;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
index 9554db86681..04c36bef4c2 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -1,748 +1,748 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Shadowmoon_Valley
-SD%Complete: 100
-SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm
-SDCategory: Shadowmoon Valley
-EndScriptData */
-
-/* ContentData
-mob_mature_netherwing_drake
-mob_enslaved_netherwing_drake
-npc_drake_dealer_hurlunk
-npc_invis_legion_teleporter
-npcs_flanis_swiftwing_and_kagrosh
-npc_murkblood_overseer
-npc_neltharaku
-npc_karynaku
-npc_oronok_tornheart
-EndContentData */
-
-#include "precompiled.h"
-
-/*#####
-# mob_mature_netherwing_drake
-#####*/
-
-#define SPELL_PLACE_CARCASS 38439
-#define SPELL_JUST_EATEN 38502
-#define SPELL_NETHER_BREATH 38467
-
-#define SAY_JUST_EATEN "Thank you, mortal."
-
-struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
-{
- mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- PlayerGUID = 0;
- }
-
- uint64 PlayerGUID;
-
- bool IsEating;
- bool Evade;
-
- uint32 ResetTimer;
- uint32 CastTimer;
- uint32 EatTimer;
-
- void Reset()
- {
- IsEating = false;
- Evade = false;
-
- ResetTimer = 120000;
- EatTimer = 5000;
- CastTimer = 5000;
- }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void SpellHit(Unit* caster, const SpellEntry* spell)
- {
- if(!caster)
- return;
-
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN, 0) && !PlayerGUID)
- {
- float PlayerX, PlayerY, PlayerZ;
- caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->MovePoint(1, PlayerX, PlayerY, PlayerZ);
- PlayerGUID = caster->GetGUID();
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- if(id == 1)
- {
- IsEating = true;
- EatTimer = 5000;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(IsEating)
- if(EatTimer < diff)
- {
- IsEating = false;
- DoCast(m_creature, SPELL_JUST_EATEN);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- DoSay(SAY_JUST_EATEN, LANG_DRACONIC, NULL);
- if(PlayerGUID)
- {
- Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
- if(plr && plr->GetQuestStatus(10804) == QUEST_STATUS_INCOMPLETE)
- {
- plr->KilledMonster(22131, m_creature->GetGUID());
- Evade = true;
- PlayerGUID = 0;
- }
- }
- }else EatTimer -= diff;
-
- if(Evade)
- if(ResetTimer < diff)
- EnterEvadeMode();
- else ResetTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(CastTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
- CastTimer = 5000;
- }else CastTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_mature_netherwing_drake(Creature *_creature)
-{
- return new mob_mature_netherwing_drakeAI(_creature);
-}
-
-/*###
-# mob_enslaved_netherwing_drake
-####*/
-
-#define FACTION_DEFAULT 62
-#define FACTION_FRIENDLY 1840 // Not sure if this is correct, it was taken off of Mordenai.
-
-#define SPELL_HIT_FORCE_OF_NELTHARAKU 38762
-#define SPELL_FORCE_OF_NELTHARAKU 38775
-
-#define CREATURE_DRAGONMAW_SUBJUGATOR 21718
-#define CREATURE_ESCAPE_DUMMY 22317
-
-struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
-{
- mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- PlayerGUID = 0;
- Tapped = false;
- }
-
- uint64 PlayerGUID;
- uint32 FlyTimer;
- bool Tapped;
-
- void Reset()
- {
- if(!Tapped)
- m_creature->setFaction(FACTION_DEFAULT);
-
- FlyTimer = 10000;
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->SetVisibility(VISIBILITY_ON);
- }
-
- void Aggro(Unit* who) { }
-
- Creature* SelectCreatureInGrid(uint32 entry, float range)
- {
- Creature* pCreature = NULL;
-
- // Time for some omg mind blowing code to search for creature
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
-
- TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap()));
-
- return pCreature;
- }
-
- void SpellHit(Unit* caster, const SpellEntry* spell)
- {
- if(!caster)
- return;
-
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped)
- {
- Tapped = true;
- PlayerGUID = caster->GetGUID();
-
- m_creature->setFaction(FACTION_FRIENDLY);
- DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
-
- Creature* Dragonmaw = SelectCreatureInGrid(CREATURE_DRAGONMAW_SUBJUGATOR, 50);
-
- if(Dragonmaw)
- {
- m_creature->AddThreat(Dragonmaw, 100000.0f);
- AttackStart(Dragonmaw);
- }
-
- HostilReference* ref = m_creature->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
- if(ref)
- ref->removeReference();
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- if(id == 1)
- {
- if(PlayerGUID)
- {
- Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
- if(plr)
- DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
-
- PlayerGUID = 0;
- }
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- {
- if(Tapped)
- if(FlyTimer < diff)
- {
- Tapped = false;
- if(PlayerGUID)
- {
- Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
- if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
- {
- plr->KilledMonster(22316, m_creature->GetGUID());
- /*
- float x,y,z;
- m_creature->GetPosition(x,y,z);
-
- float dx,dy,dz;
- m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz);
- dz += 20; // so it's in the air, not ground*/
-
- float dx, dy, dz;
-
- Creature* EscapeDummy = SelectCreatureInGrid(CREATURE_ESCAPE_DUMMY, 30);
- if(EscapeDummy)
- EscapeDummy->GetPosition(dx, dy, dz);
- else
- {
- m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz);
- dz += 25;
- }
-
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz);
- }
- }
- }else FlyTimer -= diff;
- return;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* _Creature)
-{
- return new mob_enslaved_netherwing_drakeAI(_Creature);
-}
-
-/*#####
-# mob_dragonmaw_peon
-#####*/
-
-struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI
-{
- mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 PlayerGUID;
- bool Tapped;
- uint32 PoisonTimer;
-
- void Reset()
- {
- PlayerGUID = 0;
- Tapped = false;
- PoisonTimer = 0;
- }
-
- void Aggro(Unit* who) { }
-
- void SpellHit(Unit* caster, const SpellEntry* spell)
- {
- if(!caster)
- return;
-
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped)
- {
- PlayerGUID = caster->GetGUID();
-
- Tapped = true;
- float x, y, z;
- caster->GetClosePoint(x, y, z, m_creature->GetObjectSize());
-
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- if(id)
- {
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
- PoisonTimer = 15000;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(PoisonTimer)
- if(PoisonTimer <= diff)
- {
- if(PlayerGUID)
- {
- Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
- if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
- plr->KilledMonster(23209, m_creature->GetGUID());
- }
- PoisonTimer = 0;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else PoisonTimer -= diff;
- }
-};
-
-/*######
-## npc_drake_dealer_hurlunk
-######*/
-
-bool GossipHello_npc_drake_dealer_hurlunk(Player *player, Creature *_Creature)
-{
- if (_Creature->isVendor() && player->GetReputationRank(1015) == REP_EXALTED)
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_drake_dealer_hurlunk(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-## npc_invis_legion_teleporter
-######*/
-
-#define SPELL_TELE_A_TO 37387
-#define SPELL_TELE_H_TO 37389
-
-struct TRINITY_DLL_DECL npc_invis_legion_teleporterAI : public ScriptedAI
-{
- npc_invis_legion_teleporterAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 PlayerGuid;
- uint32 TeleTimer;
-
- void Reset()
- {
- PlayerGuid=0;
- TeleTimer = 5000;
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || who->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance(who)<4)
- {
- if (who->isAlive() || !who->isInCombat())
- PlayerGuid = who->GetGUID();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(TeleTimer < diff)
- {
- if(PlayerGuid)
- {
- Player* player = ((Player*)Unit::GetUnit((*m_creature), PlayerGuid));
-
- if(m_creature->GetDistance(player)<3)
- {
- if(player->GetTeam()== ALLIANCE && player->GetQuestRewardStatus(10589))
- player->CastSpell(player,SPELL_TELE_A_TO,false);
- if(player->GetTeam()== HORDE && player->GetQuestRewardStatus(10604))
- player->CastSpell(player,SPELL_TELE_H_TO,false);
- }
- PlayerGuid=0;
- }
- TeleTimer = 5000;
- }else TeleTimer -= diff;
- }
-};
-CreatureAI* GetAI_npc_invis_legion_teleporter(Creature *_Creature)
-{
- return new npc_invis_legion_teleporterAI (_Creature);
-}
-
-/*######
-## npc_flanis_swiftwing_and_kagrosh
-######*/
-
-bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30658,1,true))
- player->ADD_GOSSIP_ITEM( 0, "Take Flanis's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- if (player->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30659,1,true))
- player->ADD_GOSSIP_ITEM( 0, "Take Kagrosh's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 30658, 1, false);
- if( msg == EQUIP_ERR_OK )
- {
- player->StoreNewItem( dest, 30658, 1, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 30659, 1, false);
- if( msg == EQUIP_ERR_OK )
- {
- player->StoreNewItem( dest, 30659, 1, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- return true;
-}
-
-/*######
-## npc_murkblood_overseer
-######*/
-
-#define QUEST_11082 11082
-
-bool GossipHello_npc_murkblood_overseer(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "I am here for you, overseer.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_murkblood_overseer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "How dare you question an overseer of the Dragonmaw!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Who speaks of me? What are you talking about, broken?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "Continue please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Who are these bidders?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "Well... yes.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
- _Creature->CastSpell(player,41121,false);
- player->AreaExploredOrEventHappens(QUEST_11082);
- break;
- }
- return true;
-}
-
-/*######
-## npc_neltharaku
-######*/
-
-bool GossipHello_npc_neltharaku(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "I am listening, dragon", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10613, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_neltharaku(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "But you are dragons! How could orcs do this to you?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(10614, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Your mate?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(10615, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "I have battled many beasts, dragon. I will help you.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(10616, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(10814);
- break;
- }
- return true;
-}
-
-/*######
-## npc_oronok
-######*/
-
-#define GOSSIP_ORONOK1 "I am ready to hear your story, Oronok."
-#define GOSSIP_ORONOK2 "How do I find the cipher?"
-#define GOSSIP_ORONOK3 "How do you know all of this?"
-#define GOSSIP_ORONOK4 "Yet what? What is it, Oronok?"
-#define GOSSIP_ORONOK5 "Continue, please."
-#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?"
-#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok."
-
-bool GossipHello_npc_oronok_tornheart(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (player->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(10312, _Creature->GetGUID());
- }else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_oronok_tornheart(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(10313, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(10314, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(10315, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(10316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(10317, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(10318, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(10519);
- break;
- }
- return true;
-}
-
-/*####
-# npc_karynaku
-####*/
-
-bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* quest)
-{
- if(quest->GetQuestId() == 10870) // Ally of the Netherwing
- {
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 161; // From Karynaku
- nodes[1] = 162; // To Mordenai
- error_log("SD2: Player %s started quest 10870 which has disabled taxi node, need to be fixed in core", player->GetName());
- //player->ActivateTaxiPathTo(nodes, 20811);
- }
-
- return true;
-}
-
-void AddSC_shadowmoon_valley()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_mature_netherwing_drake";
- newscript->GetAI = GetAI_mob_mature_netherwing_drake;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_enslaved_netherwing_drake";
- newscript->GetAI = GetAI_mob_enslaved_netherwing_drake;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_drake_dealer_hurlunk";
- newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk;
- newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_invis_legion_teleporter";
- newscript->GetAI = GetAI_npc_invis_legion_teleporter;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npcs_flanis_swiftwing_and_kagrosh";
- newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh;
- newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_murkblood_overseer";
- newscript->pGossipHello = &GossipHello_npc_murkblood_overseer;
- newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_neltharaku";
- newscript->pGossipHello = &GossipHello_npc_neltharaku;
- newscript->pGossipSelect = &GossipSelect_npc_neltharaku;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_karynaku";
- newscript->pQuestAccept = &QuestAccept_npc_karynaku;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_oronok_tornheart";
- newscript->pGossipHello = &GossipHello_npc_oronok_tornheart;
- newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Shadowmoon_Valley
+SD%Complete: 100
+SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm
+SDCategory: Shadowmoon Valley
+EndScriptData */
+
+/* ContentData
+mob_mature_netherwing_drake
+mob_enslaved_netherwing_drake
+npc_drake_dealer_hurlunk
+npc_invis_legion_teleporter
+npcs_flanis_swiftwing_and_kagrosh
+npc_murkblood_overseer
+npc_neltharaku
+npc_karynaku
+npc_oronok_tornheart
+EndContentData */
+
+#include "precompiled.h"
+
+/*#####
+# mob_mature_netherwing_drake
+#####*/
+
+#define SPELL_PLACE_CARCASS 38439
+#define SPELL_JUST_EATEN 38502
+#define SPELL_NETHER_BREATH 38467
+
+#define SAY_JUST_EATEN "Thank you, mortal."
+
+struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
+{
+ mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ PlayerGUID = 0;
+ }
+
+ uint64 PlayerGUID;
+
+ bool IsEating;
+ bool Evade;
+
+ uint32 ResetTimer;
+ uint32 CastTimer;
+ uint32 EatTimer;
+
+ void Reset()
+ {
+ IsEating = false;
+ Evade = false;
+
+ ResetTimer = 120000;
+ EatTimer = 5000;
+ CastTimer = 5000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if(!caster)
+ return;
+
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN, 0) && !PlayerGUID)
+ {
+ float PlayerX, PlayerY, PlayerZ;
+ caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->GetMotionMaster()->MovePoint(1, PlayerX, PlayerY, PlayerZ);
+ PlayerGUID = caster->GetGUID();
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ if(id == 1)
+ {
+ IsEating = true;
+ EatTimer = 5000;
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(IsEating)
+ if(EatTimer < diff)
+ {
+ IsEating = false;
+ DoCast(m_creature, SPELL_JUST_EATEN);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ DoSay(SAY_JUST_EATEN, LANG_DRACONIC, NULL);
+ if(PlayerGUID)
+ {
+ Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
+ if(plr && plr->GetQuestStatus(10804) == QUEST_STATUS_INCOMPLETE)
+ {
+ plr->KilledMonster(22131, m_creature->GetGUID());
+ Evade = true;
+ PlayerGUID = 0;
+ }
+ }
+ }else EatTimer -= diff;
+
+ if(Evade)
+ if(ResetTimer < diff)
+ EnterEvadeMode();
+ else ResetTimer -= diff;
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(CastTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
+ CastTimer = 5000;
+ }else CastTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_mature_netherwing_drake(Creature *_creature)
+{
+ return new mob_mature_netherwing_drakeAI(_creature);
+}
+
+/*###
+# mob_enslaved_netherwing_drake
+####*/
+
+#define FACTION_DEFAULT 62
+#define FACTION_FRIENDLY 1840 // Not sure if this is correct, it was taken off of Mordenai.
+
+#define SPELL_HIT_FORCE_OF_NELTHARAKU 38762
+#define SPELL_FORCE_OF_NELTHARAKU 38775
+
+#define CREATURE_DRAGONMAW_SUBJUGATOR 21718
+#define CREATURE_ESCAPE_DUMMY 22317
+
+struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
+{
+ mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ PlayerGUID = 0;
+ Tapped = false;
+ }
+
+ uint64 PlayerGUID;
+ uint32 FlyTimer;
+ bool Tapped;
+
+ void Reset()
+ {
+ if(!Tapped)
+ m_creature->setFaction(FACTION_DEFAULT);
+
+ FlyTimer = 10000;
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->SetVisibility(VISIBILITY_ON);
+ }
+
+ void Aggro(Unit* who) { }
+
+ Creature* SelectCreatureInGrid(uint32 entry, float range)
+ {
+ Creature* pCreature = NULL;
+
+ // Time for some omg mind blowing code to search for creature
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
+
+ TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap()));
+
+ return pCreature;
+ }
+
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if(!caster)
+ return;
+
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped)
+ {
+ Tapped = true;
+ PlayerGUID = caster->GetGUID();
+
+ m_creature->setFaction(FACTION_FRIENDLY);
+ DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
+
+ Creature* Dragonmaw = SelectCreatureInGrid(CREATURE_DRAGONMAW_SUBJUGATOR, 50);
+
+ if(Dragonmaw)
+ {
+ m_creature->AddThreat(Dragonmaw, 100000.0f);
+ AttackStart(Dragonmaw);
+ }
+
+ HostilReference* ref = m_creature->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
+ if(ref)
+ ref->removeReference();
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ if(id == 1)
+ {
+ if(PlayerGUID)
+ {
+ Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
+ if(plr)
+ DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
+
+ PlayerGUID = 0;
+ }
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ {
+ if(Tapped)
+ if(FlyTimer < diff)
+ {
+ Tapped = false;
+ if(PlayerGUID)
+ {
+ Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
+ if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
+ {
+ plr->KilledMonster(22316, m_creature->GetGUID());
+ /*
+ float x,y,z;
+ m_creature->GetPosition(x,y,z);
+
+ float dx,dy,dz;
+ m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz);
+ dz += 20; // so it's in the air, not ground*/
+
+ float dx, dy, dz;
+
+ Creature* EscapeDummy = SelectCreatureInGrid(CREATURE_ESCAPE_DUMMY, 30);
+ if(EscapeDummy)
+ EscapeDummy->GetPosition(dx, dy, dz);
+ else
+ {
+ m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz);
+ dz += 25;
+ }
+
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz);
+ }
+ }
+ }else FlyTimer -= diff;
+ return;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* _Creature)
+{
+ return new mob_enslaved_netherwing_drakeAI(_Creature);
+}
+
+/*#####
+# mob_dragonmaw_peon
+#####*/
+
+struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI
+{
+ mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 PlayerGUID;
+ bool Tapped;
+ uint32 PoisonTimer;
+
+ void Reset()
+ {
+ PlayerGUID = 0;
+ Tapped = false;
+ PoisonTimer = 0;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if(!caster)
+ return;
+
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped)
+ {
+ PlayerGUID = caster->GetGUID();
+
+ Tapped = true;
+ float x, y, z;
+ caster->GetClosePoint(x, y, z, m_creature->GetObjectSize());
+
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ if(id)
+ {
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
+ PoisonTimer = 15000;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(PoisonTimer)
+ if(PoisonTimer <= diff)
+ {
+ if(PlayerGUID)
+ {
+ Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
+ if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
+ plr->KilledMonster(23209, m_creature->GetGUID());
+ }
+ PoisonTimer = 0;
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else PoisonTimer -= diff;
+ }
+};
+
+/*######
+## npc_drake_dealer_hurlunk
+######*/
+
+bool GossipHello_npc_drake_dealer_hurlunk(Player *player, Creature *_Creature)
+{
+ if (_Creature->isVendor() && player->GetReputationRank(1015) == REP_EXALTED)
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_drake_dealer_hurlunk(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+## npc_invis_legion_teleporter
+######*/
+
+#define SPELL_TELE_A_TO 37387
+#define SPELL_TELE_H_TO 37389
+
+struct TRINITY_DLL_DECL npc_invis_legion_teleporterAI : public ScriptedAI
+{
+ npc_invis_legion_teleporterAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 PlayerGuid;
+ uint32 TeleTimer;
+
+ void Reset()
+ {
+ PlayerGuid=0;
+ TeleTimer = 5000;
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(who->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance(who)<4)
+ {
+ if (who->isAlive() || !who->isInCombat())
+ PlayerGuid = who->GetGUID();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(TeleTimer < diff)
+ {
+ if(PlayerGuid)
+ {
+ Player* player = ((Player*)Unit::GetUnit((*m_creature), PlayerGuid));
+
+ if(m_creature->GetDistance(player)<3)
+ {
+ if(player->GetTeam()== ALLIANCE && player->GetQuestRewardStatus(10589))
+ player->CastSpell(player,SPELL_TELE_A_TO,false);
+ if(player->GetTeam()== HORDE && player->GetQuestRewardStatus(10604))
+ player->CastSpell(player,SPELL_TELE_H_TO,false);
+ }
+ PlayerGuid=0;
+ }
+ TeleTimer = 5000;
+ }else TeleTimer -= diff;
+ }
+};
+CreatureAI* GetAI_npc_invis_legion_teleporter(Creature *_Creature)
+{
+ return new npc_invis_legion_teleporterAI (_Creature);
+}
+
+/*######
+## npc_flanis_swiftwing_and_kagrosh
+######*/
+
+bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30658,1,true))
+ player->ADD_GOSSIP_ITEM( 0, "Take Flanis's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if (player->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30659,1,true))
+ player->ADD_GOSSIP_ITEM( 0, "Take Kagrosh's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 30658, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ {
+ player->StoreNewItem( dest, 30658, 1, true);
+ player->PlayerTalkClass->ClearMenus();
+ }
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 30659, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ {
+ player->StoreNewItem( dest, 30659, 1, true);
+ player->PlayerTalkClass->ClearMenus();
+ }
+ }
+ return true;
+}
+
+/*######
+## npc_murkblood_overseer
+######*/
+
+#define QUEST_11082 11082
+
+bool GossipHello_npc_murkblood_overseer(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "I am here for you, overseer.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_murkblood_overseer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "How dare you question an overseer of the Dragonmaw!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Who speaks of me? What are you talking about, broken?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "Continue please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Who are these bidders?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "Well... yes.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ //correct id not known
+ player->SEND_GOSSIP_MENU(10940, _Creature->GetGUID());
+ _Creature->CastSpell(player,41121,false);
+ player->AreaExploredOrEventHappens(QUEST_11082);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_neltharaku
+######*/
+
+bool GossipHello_npc_neltharaku(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "I am listening, dragon", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10613, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_neltharaku(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "But you are dragons! How could orcs do this to you?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(10614, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Your mate?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(10615, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "I have battled many beasts, dragon. I will help you.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(10616, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(10814);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_oronok
+######*/
+
+#define GOSSIP_ORONOK1 "I am ready to hear your story, Oronok."
+#define GOSSIP_ORONOK2 "How do I find the cipher?"
+#define GOSSIP_ORONOK3 "How do you know all of this?"
+#define GOSSIP_ORONOK4 "Yet what? What is it, Oronok?"
+#define GOSSIP_ORONOK5 "Continue, please."
+#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?"
+#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok."
+
+bool GossipHello_npc_oronok_tornheart(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if (player->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(10312, _Creature->GetGUID());
+ }else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_oronok_tornheart(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(10313, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(10314, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(10315, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(10316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(10317, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(10318, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(10519);
+ break;
+ }
+ return true;
+}
+
+/*####
+# npc_karynaku
+####*/
+
+bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* quest)
+{
+ if(quest->GetQuestId() == 10870) // Ally of the Netherwing
+ {
+ std::vector<uint32> nodes;
+
+ nodes.resize(2);
+ nodes[0] = 161; // From Karynaku
+ nodes[1] = 162; // To Mordenai
+ error_log("SD2: Player %s started quest 10870 which has disabled taxi node, need to be fixed in core", player->GetName());
+ //player->ActivateTaxiPathTo(nodes, 20811);
+ }
+
+ return true;
+}
+
+void AddSC_shadowmoon_valley()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_mature_netherwing_drake";
+ newscript->GetAI = GetAI_mob_mature_netherwing_drake;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_enslaved_netherwing_drake";
+ newscript->GetAI = GetAI_mob_enslaved_netherwing_drake;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_drake_dealer_hurlunk";
+ newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk;
+ newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_invis_legion_teleporter";
+ newscript->GetAI = GetAI_npc_invis_legion_teleporter;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npcs_flanis_swiftwing_and_kagrosh";
+ newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh;
+ newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_murkblood_overseer";
+ newscript->pGossipHello = &GossipHello_npc_murkblood_overseer;
+ newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_neltharaku";
+ newscript->pGossipHello = &GossipHello_npc_neltharaku;
+ newscript->pGossipSelect = &GossipSelect_npc_neltharaku;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_karynaku";
+ newscript->pQuestAccept = &QuestAccept_npc_karynaku;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_oronok_tornheart";
+ newscript->pGossipHello = &GossipHello_npc_oronok_tornheart;
+ newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
index ffb8ff0b864..41cb56585ef 100644
--- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
+++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
@@ -1,441 +1,441 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Shattrath_City
-SD%Complete: 100
-SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time
-SDCategory: Shattrath City
-EndScriptData */
-
-/* ContentData
-npc_raliq_the_drunk
-npc_salsalabim
-npc_shattrathflaskvendors
-npc_zephyr
-npc_kservant
-EndContentData */
-
-#include "precompiled.h"
-#include "../../npc/npc_escortAI.h"
-
-/*######
-## npc_raliq_the_drunk
-######*/
-
-#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!"
-
-#define FACTION_HOSTILE_RD 45
-#define FACTION_FRIENDLY_RD 35
-
-#define SPELL_UPPERCUT 10966
-
-struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI
-{
- npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 Uppercut_Timer;
-
- void Reset()
- {
- Uppercut_Timer = 5000;
- m_creature->setFaction(FACTION_FRIENDLY_RD);
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Uppercut_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
- Uppercut_Timer = 15000;
- }else Uppercut_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_raliq_the_drunk(Creature *_Creature)
-{
- return new npc_raliq_the_drunkAI (_Creature);
-}
-
-bool GossipHello_npc_raliq_the_drunk(Player *player, Creature *_Creature )
-{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(9440, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_raliq_the_drunk(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(FACTION_HOSTILE_RD);
- ((npc_raliq_the_drunkAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-# npc_salsalabim
-######*/
-
-#define FACTION_HOSTILE_SA 90
-#define FACTION_FRIENDLY_SA 35
-#define QUEST_10004 10004
-
-#define SPELL_MAGNETIC_PULL 31705
-
-struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI
-{
- npc_salsalabimAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 MagneticPull_Timer;
-
- void Reset()
- {
- MagneticPull_Timer = 15000;
- m_creature->setFaction(FACTION_FRIENDLY_SA);
- }
-
- void Aggro(Unit *who) {}
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( done_by->GetTypeId() == TYPEID_PLAYER )
- if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20 )
- {
- ((Player*)done_by)->GroupEventHappens(QUEST_10004,m_creature);
- damage = 0;
- EnterEvadeMode();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( MagneticPull_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_MAGNETIC_PULL);
- MagneticPull_Timer = 15000;
- }else MagneticPull_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_salsalabim(Creature *_Creature)
-{
- return new npc_salsalabimAI (_Creature);
-}
-
-bool GossipHello_npc_salsalabim(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE )
- {
- _Creature->setFaction(FACTION_HOSTILE_SA);
- ((npc_salsalabimAI*)_Creature->AI())->AttackStart(player);
- }
- else
- {
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- }
- return true;
-}
-
-/*
-##################################################
-Shattrath City Flask Vendors provides flasks to people exalted with 3 factions:
-Haldor the Compulsive
-Arcanist Xorith
-Both sell special flasks for use in Outlands 25man raids only,
-purchasable for one Mark of Illidari each
-Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar
-##################################################
-*/
-
-bool GossipHello_npc_shattrathflaskvendors(Player *player, Creature *_Creature)
-{
- if(_Creature->GetEntry() == 23484)
- {
- // Aldor vendor
- if( _Creature->isVendor() && (player->GetReputationRank(932) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED) )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(11085, _Creature->GetGUID());
- }
- else
- {
- player->SEND_GOSSIP_MENU(11083, _Creature->GetGUID());
- }
- }
-
- if(_Creature->GetEntry() == 23483)
- {
- // Scryers vendor
- if( _Creature->isVendor() && (player->GetReputationRank(934) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED) )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(11085, _Creature->GetGUID());
- }
- else
- {
- player->SEND_GOSSIP_MENU(11084, _Creature->GetGUID());
- }
- }
-
- return true;
-}
-
-bool GossipSelect_npc_shattrathflaskvendors(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if( action == GOSSIP_ACTION_TRADE )
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-# npc_zephyr
-######*/
-
-bool GossipHello_npc_zephyr(Player *player, Creature *_Creature)
-{
- if( player->GetReputationRank(989) >= REP_REVERED )
- player->ADD_GOSSIP_ITEM(0, "Take me to the Caverns of Time.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_zephyr(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- player->CastSpell(player,37778,false);
-
- return true;
-}
-
-/*######
-# npc_kservant
-######*/
-
-#define SAY1 "Follow me, stranger. This won't take long."
-#define WHISP1 "Shattrath was once the draenei capital of this world. Its name means \"dwelling of light.\""
-#define WHISP2 "When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell."
-#define WHISP3 "The city was left in ruins and darkness... until the Sha'tar arrived."
-#define WHISP4 "Let us go into the Lower City. I will warn you that as one of the only safe havens in Outland, Shattrath has attracted droves of refugees from all wars, current and past. "
-#define WHISP5 "The Sha'tar, or \"born from light\" are the naaru that came to Outland to fight the demons of the Burning Legion."
-#define WHISP6 "They were drawn to the ruins of Shattrath City where a small remnant of the draenei priesthood conducted its rites inside a ruined temple on this very spot."
-#define WHISP7 "The priesthood, known as the Aldor, quickly regained its strength as word spread that the naaru had returned and reconstruction soon began. The ruined temple is now used as an infirmary for injured refugees."
-#define WHISP8 "It wouldn't be long, however, before the city came under attack once again. This time, the attack came from Illidan's armies. A large regiment of blood elves had been sent by Illidan's ally, Kael'thas Sunstrider, to lay waste to the city."
-#define WHISP9 "As the regiment of blood elves crossed this very bridge, the Aldor's exarchs and vindicators lined up to defend the Terrace of Light. But then the unexpected happened. "
-#define WHISP10 "The blood elves laid down their weapons in front of the city's defenders; their leader, a blood elf elder known as Voren'thal, stormed into the Terrace of Light and demanded to speak to A'dal."
-#define WHISP11 "As the naaru approached him, Voren'thal kneeled before him and uttered the following words: \"I've seen you in a vision, naaru. My race's only hope for survival lies with you. My followers and I are here to serve you.\""
-#define WHISP12 "The defection of Voren'thal and his followers was the largest loss ever incurred by Kael's forces. And these weren't just any blood elves. Many of the best and brightest amongst Kael's scholars and magisters had been swayed by Voren'thal's influence."
-#define WHISP13 "The naaru accepted the defectors, who would become known as the Scryers; their dwelling lies in the platform above. Only those initiated with the Scryers are allowed there."
-#define WHISP14 "The Aldor are followers of the Light and forgiveness and redemption are values they understand. However, they found hard to forget the deeds of the blood elves while under Kaell's command."
-#define WHISP15 "Many of the priesthood had been slain by the same magisters who now vowed to serve the naaru. They were not happy to share the city with their former enemies."
-#define WHISP16 "The Aldor's most holy temple and its surrounding dwellings lie on the terrace above. As a holy site, only the initiated are welcome inside."
-#define WHISP17 "The attacks against Shattrath continued, but the city did not fall, as you can see. On the contrary, the naaru known as Xi'ri led a successful incursion into Shadowmoon Valley - Illidan's doorstep."
-#define WHISP18 "There he continues to wage war on Illidan with the assistance of the Aldor and the Scryers. The two factions have not given up on their old feuds, though."
-#define WHISP19 "Such is their animosity that they vie for the honor of being sent to assist the naaru there. Each day, that decision is made here by A'dal. The armies gather here to receive A'dal's blessing before heading to Shadowmoon."
-#define WHISP20 "Khadgar should be ready to see you again. Just remember that to serve the Sha'tar you will most likely have to ally with the Aldor or the Scryers. And seeking the favor of one group will cause the others' dislike."
-#define WHISP21 "Good luck stranger, and welcome to Shattrath City."
-
-struct TRINITY_DLL_DECL npc_kservantAI : public npc_escortAI
-{
-public:
- npc_kservantAI(Creature *c) : npc_escortAI(c) { Reset();}
-
-
- void WaypointReached(uint32 i)
- {
- Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
- if( !pTemp )
- return;
-
- switch(i)
- {
- case 0: DoSay(SAY1, LANG_UNIVERSAL, pTemp); break;
- case 4: DoWhisper(WHISP1, pTemp); break;
- case 6: DoWhisper(WHISP2, pTemp); break;
- case 7: DoWhisper(WHISP3, pTemp); break;
- case 8: DoWhisper(WHISP4, pTemp); break;
- case 17: DoWhisper(WHISP5, pTemp); break;
- case 18: DoWhisper(WHISP6, pTemp); break;
- case 19: DoWhisper(WHISP7, pTemp); break;
- case 33: DoWhisper(WHISP8, pTemp); break;
- case 34: DoWhisper(WHISP9, pTemp); break;
- case 35: DoWhisper(WHISP10, pTemp); break;
- case 36: DoWhisper(WHISP11, pTemp); break;
- case 43: DoWhisper(WHISP12, pTemp); break;
- case 44: DoWhisper(WHISP13, pTemp); break;
- case 49: DoWhisper(WHISP14, pTemp); break;
- case 50: DoWhisper(WHISP15, pTemp); break;
- case 51: DoWhisper(WHISP16, pTemp); break;
- case 52: DoWhisper(WHISP17, pTemp); break;
- case 53: DoWhisper(WHISP18, pTemp); break;
- case 54: DoWhisper(WHISP19, pTemp); break;
- case 55: DoWhisper(WHISP20, pTemp); break;
- case 56: DoWhisper(WHISP21, pTemp);
- if( PlayerGUID )
- {
- Unit* player = ((Creature*)Unit::GetUnit((*m_creature), PlayerGUID));
- if( player && player->GetTypeId() == TYPEID_PLAYER )
- ((Player*)player)->GroupEventHappens(10211,m_creature);
- }
- break;
- }
- }
-
- void Aggro(Unit* who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if( IsBeingEscorted )
- return;
-
- if( who->GetTypeId() == TYPEID_PLAYER )
- {
- if( ((Player*)who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE )
- {
- float Radius = 10.0;
- if( m_creature->IsWithinDistInMap(who, Radius) )
- {
- ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID());
- }
- }
- }
- }
-
- void Reset() {}
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
- }
-};
-CreatureAI* GetAI_npc_kservantAI(Creature *_Creature)
-{
- npc_kservantAI* kservantAI = new npc_kservantAI(_Creature);
-
- kservantAI->AddWaypoint(0, -1863.369019, 5419.517090, -10.463668, 4000);
- kservantAI->AddWaypoint(1, -1861.749023, 5416.465332, -10.508068);
- kservantAI->AddWaypoint(2, -1857.036133, 5410.966309, -12.428039);
- kservantAI->AddWaypoint(3, -1831.539185, 5365.472168, -12.428039);
- kservantAI->AddWaypoint(4, -1813.416504, 5333.776855, -12.428039);
- kservantAI->AddWaypoint(5, -1800.354370, 5313.290039, -12.428039);
- kservantAI->AddWaypoint(6, -1775.624878, 5268.786133, -38.809181);
- kservantAI->AddWaypoint(7, -1770.147339, 5259.268066, -38.829231);
- kservantAI->AddWaypoint(8, -1762.814209, 5261.098145, -38.848995);
- kservantAI->AddWaypoint(9, -1740.110474, 5268.858398, -40.208965);
- kservantAI->AddWaypoint(10, -1725.837402, 5270.936035, -40.208965);
- kservantAI->AddWaypoint(11, -1701.580322, 5290.323242, -40.209187);
- kservantAI->AddWaypoint(12, -1682.877808, 5291.406738, -34.429646);
- kservantAI->AddWaypoint(13, -1670.101685, 5291.201172, -32.786007);
- kservantAI->AddWaypoint(14, -1656.666870, 5294.333496, -37.862648);
- kservantAI->AddWaypoint(15, -1652.035767, 5295.413086, -40.245499);
- kservantAI->AddWaypoint(16, -1620.860596, 5300.133301, -40.208992);
- kservantAI->AddWaypoint(17, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(18, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(19, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(20, -1622.140869, 5301.955566, -40.208897);
- kservantAI->AddWaypoint(21, -1621.131836, 5333.112793, -40.208897);
- kservantAI->AddWaypoint(22, -1637.598999, 5342.134277, -40.208790);
- kservantAI->AddWaypoint(23, -1648.521606, 5352.309570, -47.496170);
- kservantAI->AddWaypoint(24, -1654.606934, 5357.419434, -45.870892);
- kservantAI->AddWaypoint(25, -1633.670044, 5422.067871, -42.835541);
- kservantAI->AddWaypoint(25, -1656.567505, 5426.236328, -40.405815);
- kservantAI->AddWaypoint(26, -1664.932373, 5425.686523, -38.846405);
- kservantAI->AddWaypoint(27, -1681.406006, 5425.871094, -38.810928);
- kservantAI->AddWaypoint(28, -1730.875977, 5427.413574, -12.427910);
- kservantAI->AddWaypoint(29, -1743.509521, 5369.599121, -12.427910);
- kservantAI->AddWaypoint(30, -1877.217041, 5303.710449, -12.427989);
- kservantAI->AddWaypoint(31, -1890.371216, 5289.273438, -12.428268);
- kservantAI->AddWaypoint(32, -1905.505737, 5266.534668, 2.630672);
- kservantAI->AddWaypoint(33, -1909.381348, 5273.008301, 1.663714, 10000);
- kservantAI->AddWaypoint(34, -1909.381348, 5273.008301, 1.663714, 12000);
- kservantAI->AddWaypoint(35, -1909.381348, 5273.008301, 1.663714, 8000);
- kservantAI->AddWaypoint(36, -1909.381348, 5273.008301, 1.663714, 15000);
- kservantAI->AddWaypoint(37, -1927.561401, 5275.324707, 1.984987);
- kservantAI->AddWaypoint(38, -1927.385498, 5300.879883, -12.427236);
- kservantAI->AddWaypoint(39, -1921.063965, 5314.318359, -12.427236);
- kservantAI->AddWaypoint(40, -1965.425415, 5379.298828, -12.427236);
- kservantAI->AddWaypoint(41, -1981.233154, 5450.743652, -12.427236);
- kservantAI->AddWaypoint(42, -1958.022461, 5455.904297, 0.487659);
- kservantAI->AddWaypoint(43, -1951.991455, 5463.580566, 0.874490, 10000);
- kservantAI->AddWaypoint(44, -1951.991455, 5463.580566, 0.874490, 12000);
- kservantAI->AddWaypoint(45, -1968.730225, 5481.752930, -12.427846);
- kservantAI->AddWaypoint(46, -1881.839844, 5554.040039, -12.427846);
- kservantAI->AddWaypoint(47, -1841.566650, 5545.965332, -12.427846);
- kservantAI->AddWaypoint(48, -1837.658325, 5523.780273, 0.558756);
- kservantAI->AddWaypoint(49, -1831.321777, 5534.821777, 1.221819, 6000);
- kservantAI->AddWaypoint(50, -1831.321777, 5534.821777, 1.221819, 8000);
- kservantAI->AddWaypoint(51, -1831.321777, 5534.821777, 1.221819, 5000);
- kservantAI->AddWaypoint(52, -1850.060669, 5472.610840, 0.857320, 6000);
- kservantAI->AddWaypoint(53, -1850.060669, 5472.610840, 0.857320, 8000);
- kservantAI->AddWaypoint(54, -1850.060669, 5472.610840, 0.857320, 9000);
- kservantAI->AddWaypoint(55, -1850.060669, 5472.610840, 0.857320, 9000);
- kservantAI->AddWaypoint(56, -1850.060669, 5472.610840, 0.857320, 4000);
-
- return (CreatureAI*)kservantAI;
-}
-
-void AddSC_shattrath_city()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_raliq_the_drunk";
- newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk;
- newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_salsalabim";
- newscript->GetAI = GetAI_npc_salsalabim;
- newscript->pGossipHello = &GossipHello_npc_salsalabim;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_shattrathflaskvendors";
- newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors;
- newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_zephyr";
- newscript->pGossipHello = &GossipHello_npc_zephyr;
- newscript->pGossipSelect = &GossipSelect_npc_zephyr;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_kservant";
- newscript->GetAI = GetAI_npc_kservantAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Shattrath_City
+SD%Complete: 100
+SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time
+SDCategory: Shattrath City
+EndScriptData */
+
+/* ContentData
+npc_raliq_the_drunk
+npc_salsalabim
+npc_shattrathflaskvendors
+npc_zephyr
+npc_kservant
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+
+/*######
+## npc_raliq_the_drunk
+######*/
+
+#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!"
+
+#define FACTION_HOSTILE_RD 45
+#define FACTION_FRIENDLY_RD 35
+
+#define SPELL_UPPERCUT 10966
+
+struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI
+{
+ npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 Uppercut_Timer;
+
+ void Reset()
+ {
+ Uppercut_Timer = 5000;
+ m_creature->setFaction(FACTION_FRIENDLY_RD);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Uppercut_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
+ Uppercut_Timer = 15000;
+ }else Uppercut_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_raliq_the_drunk(Creature *_Creature)
+{
+ return new npc_raliq_the_drunkAI (_Creature);
+}
+
+bool GossipHello_npc_raliq_the_drunk(Player *player, Creature *_Creature )
+{
+ if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(9440, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_raliq_the_drunk(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(FACTION_HOSTILE_RD);
+ ((npc_raliq_the_drunkAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+# npc_salsalabim
+######*/
+
+#define FACTION_HOSTILE_SA 90
+#define FACTION_FRIENDLY_SA 35
+#define QUEST_10004 10004
+
+#define SPELL_MAGNETIC_PULL 31705
+
+struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI
+{
+ npc_salsalabimAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 MagneticPull_Timer;
+
+ void Reset()
+ {
+ MagneticPull_Timer = 15000;
+ m_creature->setFaction(FACTION_FRIENDLY_SA);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( done_by->GetTypeId() == TYPEID_PLAYER )
+ if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20 )
+ {
+ ((Player*)done_by)->GroupEventHappens(QUEST_10004,m_creature);
+ damage = 0;
+ EnterEvadeMode();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( MagneticPull_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_MAGNETIC_PULL);
+ MagneticPull_Timer = 15000;
+ }else MagneticPull_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_salsalabim(Creature *_Creature)
+{
+ return new npc_salsalabimAI (_Creature);
+}
+
+bool GossipHello_npc_salsalabim(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE )
+ {
+ _Creature->setFaction(FACTION_HOSTILE_SA);
+ ((npc_salsalabimAI*)_Creature->AI())->AttackStart(player);
+ }
+ else
+ {
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ }
+ return true;
+}
+
+/*
+##################################################
+Shattrath City Flask Vendors provides flasks to people exalted with 3 factions:
+Haldor the Compulsive
+Arcanist Xorith
+Both sell special flasks for use in Outlands 25man raids only,
+purchasable for one Mark of Illidari each
+Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar
+##################################################
+*/
+
+bool GossipHello_npc_shattrathflaskvendors(Player *player, Creature *_Creature)
+{
+ if(_Creature->GetEntry() == 23484)
+ {
+ // Aldor vendor
+ if( _Creature->isVendor() && (player->GetReputationRank(932) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED) )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(11085, _Creature->GetGUID());
+ }
+ else
+ {
+ player->SEND_GOSSIP_MENU(11083, _Creature->GetGUID());
+ }
+ }
+
+ if(_Creature->GetEntry() == 23483)
+ {
+ // Scryers vendor
+ if( _Creature->isVendor() && (player->GetReputationRank(934) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED) )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(11085, _Creature->GetGUID());
+ }
+ else
+ {
+ player->SEND_GOSSIP_MENU(11084, _Creature->GetGUID());
+ }
+ }
+
+ return true;
+}
+
+bool GossipSelect_npc_shattrathflaskvendors(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if( action == GOSSIP_ACTION_TRADE )
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+# npc_zephyr
+######*/
+
+bool GossipHello_npc_zephyr(Player *player, Creature *_Creature)
+{
+ if( player->GetReputationRank(989) >= REP_REVERED )
+ player->ADD_GOSSIP_ITEM(0, "Take me to the Caverns of Time.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_zephyr(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ player->CastSpell(player,37778,false);
+
+ return true;
+}
+
+/*######
+# npc_kservant
+######*/
+
+#define SAY1 "Follow me, stranger. This won't take long."
+#define WHISP1 "Shattrath was once the draenei capital of this world. Its name means \"dwelling of light.\""
+#define WHISP2 "When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell."
+#define WHISP3 "The city was left in ruins and darkness... until the Sha'tar arrived."
+#define WHISP4 "Let us go into the Lower City. I will warn you that as one of the only safe havens in Outland, Shattrath has attracted droves of refugees from all wars, current and past. "
+#define WHISP5 "The Sha'tar, or \"born from light\" are the naaru that came to Outland to fight the demons of the Burning Legion."
+#define WHISP6 "They were drawn to the ruins of Shattrath City where a small remnant of the draenei priesthood conducted its rites inside a ruined temple on this very spot."
+#define WHISP7 "The priesthood, known as the Aldor, quickly regained its strength as word spread that the naaru had returned and reconstruction soon began. The ruined temple is now used as an infirmary for injured refugees."
+#define WHISP8 "It wouldn't be long, however, before the city came under attack once again. This time, the attack came from Illidan's armies. A large regiment of blood elves had been sent by Illidan's ally, Kael'thas Sunstrider, to lay waste to the city."
+#define WHISP9 "As the regiment of blood elves crossed this very bridge, the Aldor's exarchs and vindicators lined up to defend the Terrace of Light. But then the unexpected happened. "
+#define WHISP10 "The blood elves laid down their weapons in front of the city's defenders; their leader, a blood elf elder known as Voren'thal, stormed into the Terrace of Light and demanded to speak to A'dal."
+#define WHISP11 "As the naaru approached him, Voren'thal kneeled before him and uttered the following words: \"I've seen you in a vision, naaru. My race's only hope for survival lies with you. My followers and I are here to serve you.\""
+#define WHISP12 "The defection of Voren'thal and his followers was the largest loss ever incurred by Kael's forces. And these weren't just any blood elves. Many of the best and brightest amongst Kael's scholars and magisters had been swayed by Voren'thal's influence."
+#define WHISP13 "The naaru accepted the defectors, who would become known as the Scryers; their dwelling lies in the platform above. Only those initiated with the Scryers are allowed there."
+#define WHISP14 "The Aldor are followers of the Light and forgiveness and redemption are values they understand. However, they found hard to forget the deeds of the blood elves while under Kaell's command."
+#define WHISP15 "Many of the priesthood had been slain by the same magisters who now vowed to serve the naaru. They were not happy to share the city with their former enemies."
+#define WHISP16 "The Aldor's most holy temple and its surrounding dwellings lie on the terrace above. As a holy site, only the initiated are welcome inside."
+#define WHISP17 "The attacks against Shattrath continued, but the city did not fall, as you can see. On the contrary, the naaru known as Xi'ri led a successful incursion into Shadowmoon Valley - Illidan's doorstep."
+#define WHISP18 "There he continues to wage war on Illidan with the assistance of the Aldor and the Scryers. The two factions have not given up on their old feuds, though."
+#define WHISP19 "Such is their animosity that they vie for the honor of being sent to assist the naaru there. Each day, that decision is made here by A'dal. The armies gather here to receive A'dal's blessing before heading to Shadowmoon."
+#define WHISP20 "Khadgar should be ready to see you again. Just remember that to serve the Sha'tar you will most likely have to ally with the Aldor or the Scryers. And seeking the favor of one group will cause the others' dislike."
+#define WHISP21 "Good luck stranger, and welcome to Shattrath City."
+
+struct TRINITY_DLL_DECL npc_kservantAI : public npc_escortAI
+{
+public:
+ npc_kservantAI(Creature *c) : npc_escortAI(c) { Reset();}
+
+
+ void WaypointReached(uint32 i)
+ {
+ Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
+ if( !pTemp )
+ return;
+
+ switch(i)
+ {
+ case 0: DoSay(SAY1, LANG_UNIVERSAL, pTemp); break;
+ case 4: DoWhisper(WHISP1, pTemp); break;
+ case 6: DoWhisper(WHISP2, pTemp); break;
+ case 7: DoWhisper(WHISP3, pTemp); break;
+ case 8: DoWhisper(WHISP4, pTemp); break;
+ case 17: DoWhisper(WHISP5, pTemp); break;
+ case 18: DoWhisper(WHISP6, pTemp); break;
+ case 19: DoWhisper(WHISP7, pTemp); break;
+ case 33: DoWhisper(WHISP8, pTemp); break;
+ case 34: DoWhisper(WHISP9, pTemp); break;
+ case 35: DoWhisper(WHISP10, pTemp); break;
+ case 36: DoWhisper(WHISP11, pTemp); break;
+ case 43: DoWhisper(WHISP12, pTemp); break;
+ case 44: DoWhisper(WHISP13, pTemp); break;
+ case 49: DoWhisper(WHISP14, pTemp); break;
+ case 50: DoWhisper(WHISP15, pTemp); break;
+ case 51: DoWhisper(WHISP16, pTemp); break;
+ case 52: DoWhisper(WHISP17, pTemp); break;
+ case 53: DoWhisper(WHISP18, pTemp); break;
+ case 54: DoWhisper(WHISP19, pTemp); break;
+ case 55: DoWhisper(WHISP20, pTemp); break;
+ case 56: DoWhisper(WHISP21, pTemp);
+ if( PlayerGUID )
+ {
+ Unit* player = ((Creature*)Unit::GetUnit((*m_creature), PlayerGUID));
+ if( player && player->GetTypeId() == TYPEID_PLAYER )
+ ((Player*)player)->GroupEventHappens(10211,m_creature);
+ }
+ break;
+ }
+ }
+
+ void Aggro(Unit* who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( IsBeingEscorted )
+ return;
+
+ if( who->GetTypeId() == TYPEID_PLAYER )
+ {
+ if( ((Player*)who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE )
+ {
+ float Radius = 10.0;
+ if( m_creature->IsWithinDistInMap(who, Radius) )
+ {
+ ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID());
+ }
+ }
+ }
+ }
+
+ void Reset() {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+};
+CreatureAI* GetAI_npc_kservantAI(Creature *_Creature)
+{
+ npc_kservantAI* kservantAI = new npc_kservantAI(_Creature);
+
+ kservantAI->AddWaypoint(0, -1863.369019, 5419.517090, -10.463668, 4000);
+ kservantAI->AddWaypoint(1, -1861.749023, 5416.465332, -10.508068);
+ kservantAI->AddWaypoint(2, -1857.036133, 5410.966309, -12.428039);
+ kservantAI->AddWaypoint(3, -1831.539185, 5365.472168, -12.428039);
+ kservantAI->AddWaypoint(4, -1813.416504, 5333.776855, -12.428039);
+ kservantAI->AddWaypoint(5, -1800.354370, 5313.290039, -12.428039);
+ kservantAI->AddWaypoint(6, -1775.624878, 5268.786133, -38.809181);
+ kservantAI->AddWaypoint(7, -1770.147339, 5259.268066, -38.829231);
+ kservantAI->AddWaypoint(8, -1762.814209, 5261.098145, -38.848995);
+ kservantAI->AddWaypoint(9, -1740.110474, 5268.858398, -40.208965);
+ kservantAI->AddWaypoint(10, -1725.837402, 5270.936035, -40.208965);
+ kservantAI->AddWaypoint(11, -1701.580322, 5290.323242, -40.209187);
+ kservantAI->AddWaypoint(12, -1682.877808, 5291.406738, -34.429646);
+ kservantAI->AddWaypoint(13, -1670.101685, 5291.201172, -32.786007);
+ kservantAI->AddWaypoint(14, -1656.666870, 5294.333496, -37.862648);
+ kservantAI->AddWaypoint(15, -1652.035767, 5295.413086, -40.245499);
+ kservantAI->AddWaypoint(16, -1620.860596, 5300.133301, -40.208992);
+ kservantAI->AddWaypoint(17, -1607.630981, 5293.983398, -38.577045, 5000);
+ kservantAI->AddWaypoint(18, -1607.630981, 5293.983398, -38.577045, 5000);
+ kservantAI->AddWaypoint(19, -1607.630981, 5293.983398, -38.577045, 5000);
+ kservantAI->AddWaypoint(20, -1622.140869, 5301.955566, -40.208897);
+ kservantAI->AddWaypoint(21, -1621.131836, 5333.112793, -40.208897);
+ kservantAI->AddWaypoint(22, -1637.598999, 5342.134277, -40.208790);
+ kservantAI->AddWaypoint(23, -1648.521606, 5352.309570, -47.496170);
+ kservantAI->AddWaypoint(24, -1654.606934, 5357.419434, -45.870892);
+ kservantAI->AddWaypoint(25, -1633.670044, 5422.067871, -42.835541);
+ kservantAI->AddWaypoint(25, -1656.567505, 5426.236328, -40.405815);
+ kservantAI->AddWaypoint(26, -1664.932373, 5425.686523, -38.846405);
+ kservantAI->AddWaypoint(27, -1681.406006, 5425.871094, -38.810928);
+ kservantAI->AddWaypoint(28, -1730.875977, 5427.413574, -12.427910);
+ kservantAI->AddWaypoint(29, -1743.509521, 5369.599121, -12.427910);
+ kservantAI->AddWaypoint(30, -1877.217041, 5303.710449, -12.427989);
+ kservantAI->AddWaypoint(31, -1890.371216, 5289.273438, -12.428268);
+ kservantAI->AddWaypoint(32, -1905.505737, 5266.534668, 2.630672);
+ kservantAI->AddWaypoint(33, -1909.381348, 5273.008301, 1.663714, 10000);
+ kservantAI->AddWaypoint(34, -1909.381348, 5273.008301, 1.663714, 12000);
+ kservantAI->AddWaypoint(35, -1909.381348, 5273.008301, 1.663714, 8000);
+ kservantAI->AddWaypoint(36, -1909.381348, 5273.008301, 1.663714, 15000);
+ kservantAI->AddWaypoint(37, -1927.561401, 5275.324707, 1.984987);
+ kservantAI->AddWaypoint(38, -1927.385498, 5300.879883, -12.427236);
+ kservantAI->AddWaypoint(39, -1921.063965, 5314.318359, -12.427236);
+ kservantAI->AddWaypoint(40, -1965.425415, 5379.298828, -12.427236);
+ kservantAI->AddWaypoint(41, -1981.233154, 5450.743652, -12.427236);
+ kservantAI->AddWaypoint(42, -1958.022461, 5455.904297, 0.487659);
+ kservantAI->AddWaypoint(43, -1951.991455, 5463.580566, 0.874490, 10000);
+ kservantAI->AddWaypoint(44, -1951.991455, 5463.580566, 0.874490, 12000);
+ kservantAI->AddWaypoint(45, -1968.730225, 5481.752930, -12.427846);
+ kservantAI->AddWaypoint(46, -1881.839844, 5554.040039, -12.427846);
+ kservantAI->AddWaypoint(47, -1841.566650, 5545.965332, -12.427846);
+ kservantAI->AddWaypoint(48, -1837.658325, 5523.780273, 0.558756);
+ kservantAI->AddWaypoint(49, -1831.321777, 5534.821777, 1.221819, 6000);
+ kservantAI->AddWaypoint(50, -1831.321777, 5534.821777, 1.221819, 8000);
+ kservantAI->AddWaypoint(51, -1831.321777, 5534.821777, 1.221819, 5000);
+ kservantAI->AddWaypoint(52, -1850.060669, 5472.610840, 0.857320, 6000);
+ kservantAI->AddWaypoint(53, -1850.060669, 5472.610840, 0.857320, 8000);
+ kservantAI->AddWaypoint(54, -1850.060669, 5472.610840, 0.857320, 9000);
+ kservantAI->AddWaypoint(55, -1850.060669, 5472.610840, 0.857320, 9000);
+ kservantAI->AddWaypoint(56, -1850.060669, 5472.610840, 0.857320, 4000);
+
+ return (CreatureAI*)kservantAI;
+}
+
+void AddSC_shattrath_city()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_raliq_the_drunk";
+ newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk;
+ newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_salsalabim";
+ newscript->GetAI = GetAI_npc_salsalabim;
+ newscript->pGossipHello = &GossipHello_npc_salsalabim;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_shattrathflaskvendors";
+ newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors;
+ newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_zephyr";
+ newscript->pGossipHello = &GossipHello_npc_zephyr;
+ newscript->pGossipSelect = &GossipSelect_npc_zephyr;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_kservant";
+ newscript->GetAI = GetAI_npc_kservantAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
index 4d6bfe74d60..5e05fa60630 100644
--- a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
+++ b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
@@ -1,149 +1,149 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Silithus
-SD%Complete: 100
-SDComment: Quest support: 8304.
-SDCategory: Silithus
-EndScriptData */
-
-/* ContentData
-npcs_rutgar_and_frankal
-EndContentData */
-
-#include "precompiled.h"
-
-/*###
-## npcs_rutgar_and_frankal
-###*/
-
-//gossip item text best guess
-#define GOSSIP_ITEM1 "I seek information about Natalia"
-
-#define GOSSIP_ITEM2 "That sounds dangerous!"
-#define GOSSIP_ITEM3 "What did you do?"
-#define GOSSIP_ITEM4 "Who?"
-#define GOSSIP_ITEM5 "Women do that. What did she demand?"
-#define GOSSIP_ITEM6 "What do you mean?"
-#define GOSSIP_ITEM7 "What happened next?"
-
-#define GOSSIP_ITEM11 "Yes, please continue"
-#define GOSSIP_ITEM12 "What language?"
-#define GOSSIP_ITEM13 "The Priestess attacked you?!"
-#define GOSSIP_ITEM14 "I should ask the monkey about this"
-#define GOSSIP_ITEM15 "Then what..."
-
-//trigger creatures to kill
-#define TRIGGER_RUTGAR 15222
-#define TRIGGER_FRANKAL 15221
-
-bool GossipHello_npcs_rutgar_and_frankal(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
- _Creature->GetEntry() == 15170 &&
- !player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR ))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
- _Creature->GetEntry() == 15171 &&
- player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR ))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
-
- player->SEND_GOSSIP_MENU(7754, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npcs_rutgar_and_frankal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(7755, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(7756, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7757, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(7758, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(7759, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(7760, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->SEND_GOSSIP_MENU(7761, _Creature->GetGUID());
- //'kill' our trigger to update quest status
- player->KilledMonster( TRIGGER_RUTGAR, _Creature->GetGUID() );
- break;
-
- case GOSSIP_ACTION_INFO_DEF + 9:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(7762, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(7763, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(7764, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(7765, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- player->SEND_GOSSIP_MENU(7766, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 14:
- player->SEND_GOSSIP_MENU(7767, _Creature->GetGUID());
- //'kill' our trigger to update quest status
- player->KilledMonster( TRIGGER_FRANKAL, _Creature->GetGUID() );
- break;
- }
- return true;
-}
-
-/*###
-##
-####*/
-
-void AddSC_silithus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="npcs_rutgar_and_frankal";
- newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal;
- newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Silithus
+SD%Complete: 100
+SDComment: Quest support: 8304.
+SDCategory: Silithus
+EndScriptData */
+
+/* ContentData
+npcs_rutgar_and_frankal
+EndContentData */
+
+#include "precompiled.h"
+
+/*###
+## npcs_rutgar_and_frankal
+###*/
+
+//gossip item text best guess
+#define GOSSIP_ITEM1 "I seek information about Natalia"
+
+#define GOSSIP_ITEM2 "That sounds dangerous!"
+#define GOSSIP_ITEM3 "What did you do?"
+#define GOSSIP_ITEM4 "Who?"
+#define GOSSIP_ITEM5 "Women do that. What did she demand?"
+#define GOSSIP_ITEM6 "What do you mean?"
+#define GOSSIP_ITEM7 "What happened next?"
+
+#define GOSSIP_ITEM11 "Yes, please continue"
+#define GOSSIP_ITEM12 "What language?"
+#define GOSSIP_ITEM13 "The Priestess attacked you?!"
+#define GOSSIP_ITEM14 "I should ask the monkey about this"
+#define GOSSIP_ITEM15 "Then what..."
+
+//trigger creatures to kill
+#define TRIGGER_RUTGAR 15222
+#define TRIGGER_FRANKAL 15221
+
+bool GossipHello_npcs_rutgar_and_frankal(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
+ _Creature->GetEntry() == 15170 &&
+ !player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR ))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
+ _Creature->GetEntry() == 15171 &&
+ player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR ))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
+
+ player->SEND_GOSSIP_MENU(7754, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npcs_rutgar_and_frankal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(7755, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(7756, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7757, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(7758, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(7759, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(7760, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ player->SEND_GOSSIP_MENU(7761, _Creature->GetGUID());
+ //'kill' our trigger to update quest status
+ player->KilledMonster( TRIGGER_RUTGAR, _Creature->GetGUID() );
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF + 9:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(7762, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(7763, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(7764, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(7765, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ player->SEND_GOSSIP_MENU(7766, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 14:
+ player->SEND_GOSSIP_MENU(7767, _Creature->GetGUID());
+ //'kill' our trigger to update quest status
+ player->KilledMonster( TRIGGER_FRANKAL, _Creature->GetGUID() );
+ break;
+ }
+ return true;
+}
+
+/*###
+##
+####*/
+
+void AddSC_silithus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="npcs_rutgar_and_frankal";
+ newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal;
+ newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
index 2b47041c296..99d7146aacf 100644
--- a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
+++ b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
@@ -1,103 +1,103 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Silvermoon_City
-SD%Complete: 100
-SDComment: Quest support: 9685
-SDCategory: Silvermoon City
-EndScriptData */
-
-/* ContentData
-npc_blood_knight_stillblade
-EndContentData */
-
-#include "precompiled.h"
-
-/*#######
-# npc_blood_knight_stillblade
-#######*/
-
-#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
-
-#define QUEST_REDEEMING_THE_DEAD 9685
-#define SPELL_SHIMMERING_VESSEL 31225
-#define SPELL_REVIVE_SELF 32343
-
-struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
-{
- npc_blood_knight_stillbladeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 lifeTimer;
- bool spellHit;
-
- void Reset()
- {
- lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
- spellHit = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
- {
- if(lifeTimer < diff)
- m_creature->AI()->EnterEvadeMode();
- else
- lifeTimer -= diff;
- }
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit &&
- (Hitter->GetTypeId() == TYPEID_PLAYER) && (((Player*)Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
- {
- ((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
- DoCast(m_creature,SPELL_REVIVE_SELF);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- //m_creature->RemoveAllAuras();
- DoSay(SAY_HEAL,LANG_COMMON,NULL);
- spellHit = true;
- }
- }
-};
-
-CreatureAI* GetAI_npc_blood_knight_stillblade(Creature *_Creature)
-{
- return new npc_blood_knight_stillbladeAI (_Creature);
-}
-
-void AddSC_silvermoon_city()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="npc_blood_knight_stillblade";
- newscript->GetAI = GetAI_npc_blood_knight_stillblade;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Silvermoon_City
+SD%Complete: 100
+SDComment: Quest support: 9685
+SDCategory: Silvermoon City
+EndScriptData */
+
+/* ContentData
+npc_blood_knight_stillblade
+EndContentData */
+
+#include "precompiled.h"
+
+/*#######
+# npc_blood_knight_stillblade
+#######*/
+
+#define SAY_HEAL "Thank you, dear Paladin, you just saved my life."
+
+#define QUEST_REDEEMING_THE_DEAD 9685
+#define SPELL_SHIMMERING_VESSEL 31225
+#define SPELL_REVIVE_SELF 32343
+
+struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
+{
+ npc_blood_knight_stillbladeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 lifeTimer;
+ bool spellHit;
+
+ void Reset()
+ {
+ lifeTimer = 120000;
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ spellHit = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ {
+ if(lifeTimer < diff)
+ m_creature->AI()->EnterEvadeMode();
+ else
+ lifeTimer -= diff;
+ }
+ }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit &&
+ (Hitter->GetTypeId() == TYPEID_PLAYER) && (((Player*)Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
+ {
+ ((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
+ DoCast(m_creature,SPELL_REVIVE_SELF);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ //m_creature->RemoveAllAuras();
+ DoSay(SAY_HEAL,LANG_COMMON,NULL);
+ spellHit = true;
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_blood_knight_stillblade(Creature *_Creature)
+{
+ return new npc_blood_knight_stillbladeAI (_Creature);
+}
+
+void AddSC_silvermoon_city()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="npc_blood_knight_stillblade";
+ newscript->GetAI = GetAI_npc_blood_knight_stillblade;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
index 8f357466fb6..597ab1ccb8d 100644
--- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
@@ -1,100 +1,100 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Silverpine_Forest
-SD%Complete: 100
-SDComment: Quest support: 1886
-SDCategory: Silverpine Forest
-EndScriptData */
-
-/* ContentData
-npc_astor_hadren
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_astor_hadren
-######*/
-
-struct TRINITY_DLL_DECL npc_astor_hadrenAI : public ScriptedAI
-{
- npc_astor_hadrenAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->setFaction(68);
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit *who)
- {
- m_creature->setFaction(68);
- }
-};
-
-CreatureAI* GetAI_npc_astor_hadren(Creature *_creature)
-{
- return new npc_astor_hadrenAI(_creature);
-}
-
-bool GossipHello_npc_astor_hadren(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "You're Astor Hadren, right?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(623, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM( 0, "You've got something I need, Astor. And I'll be taking it now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(624, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(21);
- if(player)
- ((npc_astor_hadrenAI*)_Creature->AI())->AttackStart(player);
- break;
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_silverpine_forest()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_astor_hadren";
- newscript->pGossipHello = &GossipHello_npc_astor_hadren;
- newscript->pGossipSelect = &GossipSelect_npc_astor_hadren;
- newscript->GetAI = GetAI_npc_astor_hadren;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Silverpine_Forest
+SD%Complete: 100
+SDComment: Quest support: 1886
+SDCategory: Silverpine Forest
+EndScriptData */
+
+/* ContentData
+npc_astor_hadren
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_astor_hadren
+######*/
+
+struct TRINITY_DLL_DECL npc_astor_hadrenAI : public ScriptedAI
+{
+ npc_astor_hadrenAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->setFaction(68);
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit *who)
+ {
+ m_creature->setFaction(68);
+ }
+};
+
+CreatureAI* GetAI_npc_astor_hadren(Creature *_creature)
+{
+ return new npc_astor_hadrenAI(_creature);
+}
+
+bool GossipHello_npc_astor_hadren(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "You're Astor Hadren, right?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ player->SEND_GOSSIP_MENU(623, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->ADD_GOSSIP_ITEM( 0, "You've got something I need, Astor. And I'll be taking it now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(624, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(21);
+ if(player)
+ ((npc_astor_hadrenAI*)_Creature->AI())->AttackStart(player);
+ break;
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_silverpine_forest()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_astor_hadren";
+ newscript->pGossipHello = &GossipHello_npc_astor_hadren;
+ newscript->pGossipSelect = &GossipSelect_npc_astor_hadren;
+ newscript->GetAI = GetAI_npc_astor_hadren;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
index 716ad3958ce..40cb6367379 100644
--- a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
@@ -1,80 +1,80 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Stonetalon_Mountains
-SD%Complete: 95
-SDComment: Quest support: 6627 (Braug Dimspirits questions/'answers' might have more to it, need more info)
-SDCategory: Stonetalon Mountains
-EndScriptData */
-
-#include "precompiled.h"
-
-/*######
-## npc_braug_dimspirit
-######*/
-
-bool GossipHello_npc_braug_dimspirit(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, "Ysera", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM( 0, "Neltharion", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM( 0, "Nozdormu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM( 0, "Alexstrasza", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM( 0, "Malygos", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(5820, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(5819, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_braug_dimspirit(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player,6766,false);
-
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(6627);
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_stonetalon_mountains()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_braug_dimspirit";
- newscript->pGossipHello = &GossipHello_npc_braug_dimspirit;
- newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Stonetalon_Mountains
+SD%Complete: 95
+SDComment: Quest support: 6627 (Braug Dimspirits questions/'answers' might have more to it, need more info)
+SDCategory: Stonetalon Mountains
+EndScriptData */
+
+#include "precompiled.h"
+
+/*######
+## npc_braug_dimspirit
+######*/
+
+bool GossipHello_npc_braug_dimspirit(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "Ysera", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Neltharion", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM( 0, "Nozdormu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Alexstrasza", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Malygos", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(5820, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(5819, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_braug_dimspirit(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player,6766,false);
+
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(6627);
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_stonetalon_mountains()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_braug_dimspirit";
+ newscript->pGossipHello = &GossipHello_npc_braug_dimspirit;
+ newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
index 3a3bd9e475a..b84b1d98cb6 100644
--- a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
+++ b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
@@ -1,272 +1,272 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Stormwind_City
-SD%Complete: 100
-SDComment: Quest support: 1640, 1447, 4185, 11223 (DB support required for spell 42711). Receive emote General Marcus
-SDCategory: Stormwind City
-EndScriptData */
-
-/* ContentData
-npc_archmage_malin
-npc_bartleby
-npc_dashel_stonefist
-npc_general_marcus_jonathan
-npc_lady_katrana_prestor
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_archmage_malin
-######*/
-
-#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar."
-
-bool GossipHello_npc_archmage_malin(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if(player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(11223))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_archmage_malin(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action = GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 42711, true);
- }
-
- return true;
-}
-
-/*######
-## npc_bartleby
-######*/
-
-struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI
-{
- npc_bartlebyAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 PlayerGUID;
-
- void Reset()
- {
- m_creature->setFaction(11);
- m_creature->setEmoteState(7);
-
- PlayerGUID = 0;
- }
-
- void JustDied(Unit *who)
- {
- m_creature->setFaction(11);
- }
-
- void DamageTaken(Unit *done_by, uint32 & damage)
- {
- if(damage > m_creature->GetHealth() || ((m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15))
- {
- //Take 0 damage
- damage = 0;
-
- if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID)
- {
- ((Player*)done_by)->AttackStop();
- ((Player*)done_by)->AreaExploredOrEventHappens(1640);
- }
- m_creature->CombatStop();
- EnterEvadeMode();
- }
- }
-
- void Aggro(Unit *who) {}
-};
-
-bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const *_Quest)
-{
- if(_Quest->GetQuestId() == 1640)
- {
- _Creature->setFaction(168);
- ((npc_bartlebyAI*)_Creature->AI())->PlayerGUID = player->GetGUID();
- ((npc_bartlebyAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-CreatureAI* GetAI_npc_bartleby(Creature *_creature)
-{
- return new npc_bartlebyAI(_creature);
-}
-
-/*######
-## npc_dashel_stonefist
-######*/
-
-struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
-{
- npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->setFaction(11);
- m_creature->setEmoteState(7);
- }
-
- void DamageTaken(Unit *done_by, uint32 & damage)
- {
- if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
- {
- //Take 0 damage
- damage = 0;
-
- if (done_by->GetTypeId() == TYPEID_PLAYER)
- {
- ((Player*)done_by)->AttackStop();
- ((Player*)done_by)->AreaExploredOrEventHappens(1447);
- }
- //m_creature->CombatStop();
- EnterEvadeMode();
- }
- AttackedBy(done_by);
- }
-
- void Aggro(Unit *who) {}
-};
-
-bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest)
-{
- if(_Quest->GetQuestId() == 1447)
- {
- _Creature->setFaction(168);
- ((npc_dashel_stonefistAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
-{
- return new npc_dashel_stonefistAI(_creature);
-}
-
-/*######
-## npc_general_marcus_jonathan
-######*/
-
-bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
-{
- if(player->GetTeam() == ALLIANCE)
- {
- if (emote == TEXTEMOTE_SALUTE)
- {
- _Creature->SetOrientation(_Creature->GetAngle(player));
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- }
- if (emote == TEXTEMOTE_WAVE)
- {
- _Creature->MonsterSay("Greetings citizen",LANG_COMMON,0);
- }
- }
- return true;
-}
-
-/*######
-## npc_lady_katrana_prestor
-######*/
-
-#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice."
-#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor."
-#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent."
-#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor."
-
-bool GossipHello_npc_lady_katrana_prestor(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2693, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lady_katrana_prestor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2694, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2695, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2696, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4185);
- break;
- }
- return true;
-}
-
-void AddSC_stormwind_city()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_archmage_malin";
- newscript->pGossipHello = &GossipHello_npc_archmage_malin;
- newscript->pGossipSelect = &GossipSelect_npc_archmage_malin;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_bartleby";
- newscript->GetAI = GetAI_npc_bartleby;
- newscript->pQuestAccept = &QuestAccept_npc_bartleby;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_dashel_stonefist";
- newscript->GetAI = GetAI_npc_dashel_stonefist;
- newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_general_marcus_jonathan";
- newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lady_katrana_prestor";
- newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
- newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Stormwind_City
+SD%Complete: 100
+SDComment: Quest support: 1640, 1447, 4185, 11223 (DB support required for spell 42711). Receive emote General Marcus
+SDCategory: Stormwind City
+EndScriptData */
+
+/* ContentData
+npc_archmage_malin
+npc_bartleby
+npc_dashel_stonefist
+npc_general_marcus_jonathan
+npc_lady_katrana_prestor
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_archmage_malin
+######*/
+
+#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar."
+
+bool GossipHello_npc_archmage_malin(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if(player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(11223))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_archmage_malin(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action = GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 42711, true);
+ }
+
+ return true;
+}
+
+/*######
+## npc_bartleby
+######*/
+
+struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI
+{
+ npc_bartlebyAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 PlayerGUID;
+
+ void Reset()
+ {
+ m_creature->setFaction(11);
+ m_creature->setEmoteState(7);
+
+ PlayerGUID = 0;
+ }
+
+ void JustDied(Unit *who)
+ {
+ m_creature->setFaction(11);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 & damage)
+ {
+ if(damage > m_creature->GetHealth() || ((m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15))
+ {
+ //Take 0 damage
+ damage = 0;
+
+ if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID)
+ {
+ ((Player*)done_by)->AttackStop();
+ ((Player*)done_by)->AreaExploredOrEventHappens(1640);
+ }
+ m_creature->CombatStop();
+ EnterEvadeMode();
+ }
+ }
+
+ void Aggro(Unit *who) {}
+};
+
+bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const *_Quest)
+{
+ if(_Quest->GetQuestId() == 1640)
+ {
+ _Creature->setFaction(168);
+ ((npc_bartlebyAI*)_Creature->AI())->PlayerGUID = player->GetGUID();
+ ((npc_bartlebyAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+CreatureAI* GetAI_npc_bartleby(Creature *_creature)
+{
+ return new npc_bartlebyAI(_creature);
+}
+
+/*######
+## npc_dashel_stonefist
+######*/
+
+struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
+{
+ npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->setFaction(11);
+ m_creature->setEmoteState(7);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 & damage)
+ {
+ if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
+ {
+ //Take 0 damage
+ damage = 0;
+
+ if (done_by->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)done_by)->AttackStop();
+ ((Player*)done_by)->AreaExploredOrEventHappens(1447);
+ }
+ //m_creature->CombatStop();
+ EnterEvadeMode();
+ }
+ AttackedBy(done_by);
+ }
+
+ void Aggro(Unit *who) {}
+};
+
+bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest)
+{
+ if(_Quest->GetQuestId() == 1447)
+ {
+ _Creature->setFaction(168);
+ ((npc_dashel_stonefistAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
+{
+ return new npc_dashel_stonefistAI(_creature);
+}
+
+/*######
+## npc_general_marcus_jonathan
+######*/
+
+bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
+{
+ if(player->GetTeam() == ALLIANCE)
+ {
+ if (emote == TEXTEMOTE_SALUTE)
+ {
+ _Creature->SetOrientation(_Creature->GetAngle(player));
+ _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ }
+ if (emote == TEXTEMOTE_WAVE)
+ {
+ _Creature->MonsterSay("Greetings citizen",LANG_COMMON,0);
+ }
+ }
+ return true;
+}
+
+/*######
+## npc_lady_katrana_prestor
+######*/
+
+#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice."
+#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor."
+#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent."
+#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor."
+
+bool GossipHello_npc_lady_katrana_prestor(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(2693, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lady_katrana_prestor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(2694, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(2695, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2696, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(4185);
+ break;
+ }
+ return true;
+}
+
+void AddSC_stormwind_city()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_archmage_malin";
+ newscript->pGossipHello = &GossipHello_npc_archmage_malin;
+ newscript->pGossipSelect = &GossipSelect_npc_archmage_malin;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_bartleby";
+ newscript->GetAI = GetAI_npc_bartleby;
+ newscript->pQuestAccept = &QuestAccept_npc_bartleby;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_dashel_stonefist";
+ newscript->GetAI = GetAI_npc_dashel_stonefist;
+ newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_general_marcus_jonathan";
+ newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lady_katrana_prestor";
+ newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
+ newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
index 359ecc9ebc3..40ff438cbd1 100644
--- a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
+++ b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
@@ -1,107 +1,107 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Stranglethorn_Vale
-SD%Complete: 100
-SDComment: Quest support: 592
-SDCategory: Stranglethorn Vale
-EndScriptData */
-
-/* ContentData
-mob_yenniku
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_yenniku
-######*/
-
-struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
-{
- mob_yennikuAI(Creature *c) : ScriptedAI(c)
- {
- bReset = false;
- Reset();
- }
-
- uint32 Reset_Timer;
- bool bReset;
-
- void Reset()
- {
- Reset_Timer = 0;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER)
- {
- //Yenniku's Release
- if(!bReset && ((Player*)caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
- {
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
- m_creature->CombatStop(); //stop combat
- m_creature->DeleteThreatList(); //unsure of this
- m_creature->setFaction(83); //horde generic
-
- bReset = true;
- Reset_Timer = 60000;
- }
- }
- return;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (bReset)
- if(Reset_Timer < diff)
- {
- EnterEvadeMode();
- bReset = false;
- m_creature->setFaction(28); //troll, bloodscalp
- }
- else Reset_Timer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mob_yenniku(Creature *_Creature)
-{
- return new mob_yennikuAI (_Creature);
-}
-
-/*######
-##
-######*/
-
-void AddSC_stranglethorn_vale()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_yenniku";
- newscript->GetAI = GetAI_mob_yenniku;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Stranglethorn_Vale
+SD%Complete: 100
+SDComment: Quest support: 592
+SDCategory: Stranglethorn Vale
+EndScriptData */
+
+/* ContentData
+mob_yenniku
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_yenniku
+######*/
+
+struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
+{
+ mob_yennikuAI(Creature *c) : ScriptedAI(c)
+ {
+ bReset = false;
+ Reset();
+ }
+
+ uint32 Reset_Timer;
+ bool bReset;
+
+ void Reset()
+ {
+ Reset_Timer = 0;
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ //Yenniku's Release
+ if(!bReset && ((Player*)caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
+ {
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+ m_creature->CombatStop(); //stop combat
+ m_creature->DeleteThreatList(); //unsure of this
+ m_creature->setFaction(83); //horde generic
+
+ bReset = true;
+ Reset_Timer = 60000;
+ }
+ }
+ return;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (bReset)
+ if(Reset_Timer < diff)
+ {
+ EnterEvadeMode();
+ bReset = false;
+ m_creature->setFaction(28); //troll, bloodscalp
+ }
+ else Reset_Timer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mob_yenniku(Creature *_Creature)
+{
+ return new mob_yennikuAI (_Creature);
+}
+
+/*######
+##
+######*/
+
+void AddSC_stranglethorn_vale()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_yenniku";
+ newscript->GetAI = GetAI_mob_yenniku;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
index 0dc36e210f9..d3cfa97be75 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
@@ -1,215 +1,215 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_baron_rivendare
-SD%Complete: 100
-SDComment: aura applied/defined in database
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!"
-#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!"
-#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!"
-#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!"
-#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting."
-#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!"
-
-#define ADD_1X 4017.403809
-#define ADD_1Y -3339.703369
-#define ADD_1Z 115.057655
-#define ADD_1O 5.487860
-
-#define ADD_2X 4013.189209
-#define ADD_2Y -3351.808350
-#define ADD_2Z 115.052254
-#define ADD_2O 0.134280
-
-#define ADD_3X 4017.738037
-#define ADD_3Y -3363.478016
-#define ADD_3Z 115.057274
-#define ADD_3O 0.723313
-
-#define ADD_4X 4048.877197
-#define ADD_4Y -3363.223633
-#define ADD_4Z 115.054253
-#define ADD_4O 3.627735
-
-#define ADD_5X 4051.777588
-#define ADD_5Y -3350.893311
-#define ADD_5Z 115.055351
-#define ADD_5O 3.066176
-
-#define ADD_6X 4048.375977
-#define ADD_6Y -3339.966309
-#define ADD_6Z 115.055222
-#define ADD_6O 2.457497
-
-#define SPELL_SHADOWBOLT 18164
-#define SPELL_CLEAVE 15584
-#define SPELL_MORTALSTRIKE 13737
-
-// spell 17473 should trigger -> 17471
-
-//#define SPELL_RAISEDEAD 17475
-//#define SPELL_DEATHPACT 17698
-//#define SPELL_SUMMONSKELETONS 17274
-
-struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI
-{
- boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 Cleave_Timer;
- uint32 MortalStrike_Timer;
- // uint32 RaiseDead_Timer;
- uint32 SummonSkeletons_Timer;
- Creature *Summoned;
-
- void Reset()
- {
- ShadowBolt_Timer = 5000;
- Cleave_Timer = 8000;
- MortalStrike_Timer = 12000;
- // RaiseDead_Timer = 30000;
- SummonSkeletons_Timer = 34000;
-
- m_creature->LoadCreaturesAddon();
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%6)
- {
- case 0:
- DoYell(SAY_0,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoYell(SAY_1,LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoYell(SAY_2,LANG_UNIVERSAL,NULL);
- break;
- case 3:
- DoYell(SAY_3,LANG_UNIVERSAL,NULL);
- break;
- case 4:
- DoYell(SAY_4,LANG_UNIVERSAL,NULL);
- break;
- case 5:
- DoYell(SAY_5,LANG_UNIVERSAL,NULL);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ShadowBolt
- if (ShadowBolt_Timer < diff)
- {
- //Cast
- if (rand()%100 < 70) //70% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
- }
- //10 seconds until we should cast this again
- ShadowBolt_Timer = 10000;
- }else ShadowBolt_Timer -= diff;
-
- //Cleave
- if (Cleave_Timer < diff)
- {
- //Cast
- if (rand()%100 < 55) //55% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- }
- //13 seconds until we should cast this again
- Cleave_Timer = 12000;
- }else Cleave_Timer -= diff;
-
- //MortalStrike
- if (MortalStrike_Timer < diff)
- {
- //Cast
- if (rand()%100 < 30) //30% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- }
- //16 seconds until we should cast this again
- MortalStrike_Timer = 16000;
- }else MortalStrike_Timer -= diff;
-
- //RaiseDead
- // if (RaiseDead_Timer < diff)
- // {
- //Cast
- // DoCast(m_creature,SPELL_RAISEDEAD);
- // DoSay("summon triggered",LANG_UNIVERSAL,NULL); //just a checkpoint
- //45 seconds until we should cast this again
- // RaiseDead_Timer = 45000;
- // }else RaiseDead_Timer -= diff;
-
- //SummonSkeletons
- //Creature* Unit::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
-
- if (SummonSkeletons_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- //Cast
- Summoned = m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- Summoned = m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000);
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
-
- //34 seconds until we should cast this again
- SummonSkeletons_Timer = 40000;
- }else SummonSkeletons_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_baron_rivendare(Creature *_Creature)
-{
- return new boss_baron_rivendareAI (_Creature);
-}
-
-
-void AddSC_boss_baron_rivendare()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_baron_rivendare";
- newscript->GetAI = GetAI_boss_baron_rivendare;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_baron_rivendare
+SD%Complete: 100
+SDComment: aura applied/defined in database
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!"
+#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!"
+#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!"
+#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!"
+#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting."
+#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!"
+
+#define ADD_1X 4017.403809
+#define ADD_1Y -3339.703369
+#define ADD_1Z 115.057655
+#define ADD_1O 5.487860
+
+#define ADD_2X 4013.189209
+#define ADD_2Y -3351.808350
+#define ADD_2Z 115.052254
+#define ADD_2O 0.134280
+
+#define ADD_3X 4017.738037
+#define ADD_3Y -3363.478016
+#define ADD_3Z 115.057274
+#define ADD_3O 0.723313
+
+#define ADD_4X 4048.877197
+#define ADD_4Y -3363.223633
+#define ADD_4Z 115.054253
+#define ADD_4O 3.627735
+
+#define ADD_5X 4051.777588
+#define ADD_5Y -3350.893311
+#define ADD_5Z 115.055351
+#define ADD_5O 3.066176
+
+#define ADD_6X 4048.375977
+#define ADD_6Y -3339.966309
+#define ADD_6Z 115.055222
+#define ADD_6O 2.457497
+
+#define SPELL_SHADOWBOLT 18164
+#define SPELL_CLEAVE 15584
+#define SPELL_MORTALSTRIKE 13737
+
+// spell 17473 should trigger -> 17471
+
+//#define SPELL_RAISEDEAD 17475
+//#define SPELL_DEATHPACT 17698
+//#define SPELL_SUMMONSKELETONS 17274
+
+struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI
+{
+ boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 Cleave_Timer;
+ uint32 MortalStrike_Timer;
+ // uint32 RaiseDead_Timer;
+ uint32 SummonSkeletons_Timer;
+ Creature *Summoned;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 5000;
+ Cleave_Timer = 8000;
+ MortalStrike_Timer = 12000;
+ // RaiseDead_Timer = 30000;
+ SummonSkeletons_Timer = 34000;
+
+ m_creature->LoadCreaturesAddon();
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%6)
+ {
+ case 0:
+ DoYell(SAY_0,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoYell(SAY_1,LANG_UNIVERSAL,NULL);
+ break;
+ case 2:
+ DoYell(SAY_2,LANG_UNIVERSAL,NULL);
+ break;
+ case 3:
+ DoYell(SAY_3,LANG_UNIVERSAL,NULL);
+ break;
+ case 4:
+ DoYell(SAY_4,LANG_UNIVERSAL,NULL);
+ break;
+ case 5:
+ DoYell(SAY_5,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ShadowBolt
+ if (ShadowBolt_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 70) //70% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
+ }
+ //10 seconds until we should cast this again
+ ShadowBolt_Timer = 10000;
+ }else ShadowBolt_Timer -= diff;
+
+ //Cleave
+ if (Cleave_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 55) //55% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ }
+ //13 seconds until we should cast this again
+ Cleave_Timer = 12000;
+ }else Cleave_Timer -= diff;
+
+ //MortalStrike
+ if (MortalStrike_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 30) //30% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ }
+ //16 seconds until we should cast this again
+ MortalStrike_Timer = 16000;
+ }else MortalStrike_Timer -= diff;
+
+ //RaiseDead
+ // if (RaiseDead_Timer < diff)
+ // {
+ //Cast
+ // DoCast(m_creature,SPELL_RAISEDEAD);
+ // DoSay("summon triggered",LANG_UNIVERSAL,NULL); //just a checkpoint
+ //45 seconds until we should cast this again
+ // RaiseDead_Timer = 45000;
+ // }else RaiseDead_Timer -= diff;
+
+ //SummonSkeletons
+ //Creature* Unit::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
+
+ if (SummonSkeletons_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ //Cast
+ Summoned = m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ Summoned = m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000);
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+
+ //34 seconds until we should cast this again
+ SummonSkeletons_Timer = 40000;
+ }else SummonSkeletons_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_baron_rivendare(Creature *_Creature)
+{
+ return new boss_baron_rivendareAI (_Creature);
+}
+
+
+void AddSC_boss_baron_rivendare()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_baron_rivendare";
+ newscript->GetAI = GetAI_boss_baron_rivendare;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
index 0ea7c5e3900..f1315e66b83 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
@@ -1,124 +1,124 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_baroness_anastari
-SD%Complete: 90
-SDComment: MC disabled
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_BANSHEEWAIL 16565
-#define SPELL_BANSHEECURSE 16867
-#define SPELL_SILENCE 18327
-//#define SPELL_POSSESS 17244
-
-struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI
-{
- boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BansheeWail_Timer;
- uint32 BansheeCurse_Timer;
- uint32 Silence_Timer;
- //uint32 Possess_Timer;
-
- void Reset()
- {
- BansheeWail_Timer = 1000;
- BansheeCurse_Timer = 11000;
- Silence_Timer = 13000;
- //Possess_Timer = 35000;
- }
-
- void Aggro(Unit *who)
- {
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //BansheeWail
- if (BansheeWail_Timer < diff)
- {
- //Cast
- if (rand()%100 < 95) //95% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_BANSHEEWAIL);
- }
- //4 seconds until we should cast this again
- BansheeWail_Timer = 4000;
- }else BansheeWail_Timer -= diff;
-
- //BansheeCurse
- if (BansheeCurse_Timer < diff)
- {
- //Cast
- if (rand()%100 < 75) //75% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_BANSHEECURSE);
- }
- //18 seconds until we should cast this again
- BansheeCurse_Timer = 18000;
- }else BansheeCurse_Timer -= diff;
-
- //Silence
- if (Silence_Timer < diff)
- {
- //Cast
- if (rand()%100 < 80) //80% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_SILENCE);
- }
- //13 seconds until we should cast this again
- Silence_Timer = 13000;
- }else Silence_Timer -= diff;
-
- //Possess
- /* if (Possess_Timer < diff)
- {
- //Cast
- if (rand()%100 < 65) //65% chance to cast
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_POSSESS);
- }
- //50 seconds until we should cast this again
- Possess_Timer = 50000;
- }else Possess_Timer -= diff;
- */
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_baroness_anastari(Creature *_Creature)
-{
- return new boss_baroness_anastariAI (_Creature);
-}
-
-
-void AddSC_boss_baroness_anastari()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_baroness_anastari";
- newscript->GetAI = GetAI_boss_baroness_anastari;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_baroness_anastari
+SD%Complete: 90
+SDComment: MC disabled
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_BANSHEEWAIL 16565
+#define SPELL_BANSHEECURSE 16867
+#define SPELL_SILENCE 18327
+//#define SPELL_POSSESS 17244
+
+struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI
+{
+ boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BansheeWail_Timer;
+ uint32 BansheeCurse_Timer;
+ uint32 Silence_Timer;
+ //uint32 Possess_Timer;
+
+ void Reset()
+ {
+ BansheeWail_Timer = 1000;
+ BansheeCurse_Timer = 11000;
+ Silence_Timer = 13000;
+ //Possess_Timer = 35000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //BansheeWail
+ if (BansheeWail_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 95) //95% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_BANSHEEWAIL);
+ }
+ //4 seconds until we should cast this again
+ BansheeWail_Timer = 4000;
+ }else BansheeWail_Timer -= diff;
+
+ //BansheeCurse
+ if (BansheeCurse_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 75) //75% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_BANSHEECURSE);
+ }
+ //18 seconds until we should cast this again
+ BansheeCurse_Timer = 18000;
+ }else BansheeCurse_Timer -= diff;
+
+ //Silence
+ if (Silence_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 80) //80% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_SILENCE);
+ }
+ //13 seconds until we should cast this again
+ Silence_Timer = 13000;
+ }else Silence_Timer -= diff;
+
+ //Possess
+ /* if (Possess_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 65) //65% chance to cast
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_POSSESS);
+ }
+ //50 seconds until we should cast this again
+ Possess_Timer = 50000;
+ }else Possess_Timer -= diff;
+ */
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_baroness_anastari(Creature *_Creature)
+{
+ return new boss_baroness_anastariAI (_Creature);
+}
+
+
+void AddSC_boss_baroness_anastari()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_baroness_anastari";
+ newscript->GetAI = GetAI_boss_baroness_anastari;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
index 6af4905dbbb..4c1bd05b432 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
@@ -1,221 +1,221 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_cannon_master_willey
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-//front, left
-#define ADD_1X 3553.851807
-#define ADD_1Y -2945.885986
-#define ADD_1Z 125.001015
-#define ADD_1O 0.592007
-//front, right
-#define ADD_2X 3559.206299
-#define ADD_2Y -2952.929932
-#define ADD_2Z 125.001015
-#define ADD_2O 0.592007
-//mid, left
-#define ADD_3X 3552.417480
-#define ADD_3Y -2948.667236
-#define ADD_3Z 125.001015
-#define ADD_3O 0.592007
-//mid, right
-#define ADD_4X 3555.651855
-#define ADD_4Y -2953.519043
-#define ADD_4Z 125.001015
-#define ADD_4O 0.592007
-//back, left
-#define ADD_5X 3547.927246
-#define ADD_5Y -2950.977295
-#define ADD_5Z 125.001015
-#define ADD_5O 0.592007
-//back, mid
-#define ADD_6X 3553.094697
-#define ADD_6Y -2952.123291
-#define ADD_6Z 125.001015
-#define ADD_6O 0.592007
-//back, right
-#define ADD_7X 3552.727539
-#define ADD_7Y -2957.776123
-#define ADD_7Z 125.001015
-#define ADD_7O 0.592007
-//behind, left
-#define ADD_8X 3547.156250
-#define ADD_8Y -2953.162354
-#define ADD_8Z 125.001015
-#define ADD_8O 0.592007
-//behind, right
-#define ADD_9X 3550.202148
-#define ADD_9Y -2957.437744
-#define ADD_9Z 125.001015
-#define ADD_9O 0.592007
-
-#define SPELL_KNOCKAWAY 10101
-#define SPELL_PUMMEL 15615
-#define SPELL_SHOOT 20463
-//#define SPELL_SUMMONCRIMSONRIFLEMAN 17279
-
-struct TRINITY_DLL_DECL boss_cannon_master_willeyAI : public ScriptedAI
-{
- boss_cannon_master_willeyAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 KnockAway_Timer;
- uint32 Pummel_Timer;
- uint32 Shoot_Timer;
- uint32 SummonRifleman_Timer;
-
- void Reset()
- {
- Shoot_Timer = 1000;
- Pummel_Timer = 7000;
- KnockAway_Timer = 11000;
- SummonRifleman_Timer = 15000;
- }
-
- 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);
- }
-
- void Aggro(Unit *who)
- {
- }
-
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Pummel
- if (Pummel_Timer < diff)
- {
- //Cast
- if (rand()%100 < 90) //90% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_PUMMEL);
- }
- //12 seconds until we should cast this again
- Pummel_Timer = 12000;
- }else Pummel_Timer -= diff;
-
- //KnockAway
- if (KnockAway_Timer < diff)
- {
- //Cast
- if (rand()%100 < 80) //80% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- }
- //14 seconds until we should cast this again
- KnockAway_Timer = 14000;
- }else KnockAway_Timer -= diff;
-
- //Shoot
- if (Shoot_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_SHOOT);
- //1 seconds until we should cast this again
- Shoot_Timer = 1000;
- }else Shoot_Timer -= diff;
-
- //SummonRifleman
- if (SummonRifleman_Timer < diff)
- {
- //Cast
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
- break;
- }
- //30 seconds until we should cast this again
- SummonRifleman_Timer = 30000;
- }else SummonRifleman_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_cannon_master_willey(Creature *_Creature)
-{
- return new boss_cannon_master_willeyAI (_Creature);
-}
-
-
-void AddSC_boss_cannon_master_willey()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_cannon_master_willey";
- newscript->GetAI = GetAI_boss_cannon_master_willey;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_cannon_master_willey
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+//front, left
+#define ADD_1X 3553.851807
+#define ADD_1Y -2945.885986
+#define ADD_1Z 125.001015
+#define ADD_1O 0.592007
+//front, right
+#define ADD_2X 3559.206299
+#define ADD_2Y -2952.929932
+#define ADD_2Z 125.001015
+#define ADD_2O 0.592007
+//mid, left
+#define ADD_3X 3552.417480
+#define ADD_3Y -2948.667236
+#define ADD_3Z 125.001015
+#define ADD_3O 0.592007
+//mid, right
+#define ADD_4X 3555.651855
+#define ADD_4Y -2953.519043
+#define ADD_4Z 125.001015
+#define ADD_4O 0.592007
+//back, left
+#define ADD_5X 3547.927246
+#define ADD_5Y -2950.977295
+#define ADD_5Z 125.001015
+#define ADD_5O 0.592007
+//back, mid
+#define ADD_6X 3553.094697
+#define ADD_6Y -2952.123291
+#define ADD_6Z 125.001015
+#define ADD_6O 0.592007
+//back, right
+#define ADD_7X 3552.727539
+#define ADD_7Y -2957.776123
+#define ADD_7Z 125.001015
+#define ADD_7O 0.592007
+//behind, left
+#define ADD_8X 3547.156250
+#define ADD_8Y -2953.162354
+#define ADD_8Z 125.001015
+#define ADD_8O 0.592007
+//behind, right
+#define ADD_9X 3550.202148
+#define ADD_9Y -2957.437744
+#define ADD_9Z 125.001015
+#define ADD_9O 0.592007
+
+#define SPELL_KNOCKAWAY 10101
+#define SPELL_PUMMEL 15615
+#define SPELL_SHOOT 20463
+//#define SPELL_SUMMONCRIMSONRIFLEMAN 17279
+
+struct TRINITY_DLL_DECL boss_cannon_master_willeyAI : public ScriptedAI
+{
+ boss_cannon_master_willeyAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 KnockAway_Timer;
+ uint32 Pummel_Timer;
+ uint32 Shoot_Timer;
+ uint32 SummonRifleman_Timer;
+
+ void Reset()
+ {
+ Shoot_Timer = 1000;
+ Pummel_Timer = 7000;
+ KnockAway_Timer = 11000;
+ SummonRifleman_Timer = 15000;
+ }
+
+ 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);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Pummel
+ if (Pummel_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 90) //90% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_PUMMEL);
+ }
+ //12 seconds until we should cast this again
+ Pummel_Timer = 12000;
+ }else Pummel_Timer -= diff;
+
+ //KnockAway
+ if (KnockAway_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 80) //80% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ }
+ //14 seconds until we should cast this again
+ KnockAway_Timer = 14000;
+ }else KnockAway_Timer -= diff;
+
+ //Shoot
+ if (Shoot_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_SHOOT);
+ //1 seconds until we should cast this again
+ Shoot_Timer = 1000;
+ }else Shoot_Timer -= diff;
+
+ //SummonRifleman
+ if (SummonRifleman_Timer < diff)
+ {
+ //Cast
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ break;
+ }
+ //30 seconds until we should cast this again
+ SummonRifleman_Timer = 30000;
+ }else SummonRifleman_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_cannon_master_willey(Creature *_Creature)
+{
+ return new boss_cannon_master_willeyAI (_Creature);
+}
+
+
+void AddSC_boss_cannon_master_willey()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_cannon_master_willey";
+ newscript->GetAI = GetAI_boss_cannon_master_willey;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
index 9a5f5a7e993..3d084fe0736 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
@@ -1,316 +1,316 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_darhrohan_balnazzar
-SD%Complete: 100
-SDComment: CHECK SQL
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-//Dathrohan spells
-#define SPELL_CRUSADERSHAMMER 17286 //AOE stun
-#define SPELL_CRUSADERSTRIKE 17281
-#define SPELL_MINDBLAST 17287
-#define SPELL_HOLYSTRIKE 17284 //weapon dmg +3
-#define SPELL_DAZED 1604
-
-//Transform
-#define SPELL_BALNAZZARTRANSFORM 17288 //restore full HP/mana, trigger spell Balnazzar Transform Stun
-
-//Balnazzar spells
-#define SPELL_SHADOWSHOCK 20603 //AOE 740-860dmg
-#define SPELL_PSYCHICSCREAM 15398 //One target, might want to make a code selecting random target
-#define SPELL_DEEPSLEEP 24777 //AOE, ten sec
-#define SPELL_SHADOWBOLTVOLLEY 20741 //AOE, 255-345dmg
-//#define SPELL_MINDCONTROL 15690 //core support needed
-
-//Summon
-//G1 front, left
-#define ADD_1X 3444.156250
-#define ADD_1Y -3090.626709
-#define ADD_1Z 135.002319
-#define ADD_1O 2.240888
-//G1 front, right
-#define ADD_2X 3449.123535
-#define ADD_2Y -3087.009766
-#define ADD_2Z 135.002319
-#define ADD_2O 2.240888
-//G1 back left
-#define ADD_3X 3446.246826
-#define ADD_3Y -3093.466309
-#define ADD_3Z 135.002319
-#define ADD_3O 2.240888
-//G1 back, right
-#define ADD_4X 3451.160889
-#define ADD_4Y -3089.904785
-#define ADD_4Z 135.002136
-#define ADD_4O 2.240888
-//G2 front, left
-#define ADD_5X 3457.995117
-#define ADD_5Y -3080.916504
-#define ADD_5Z 135.002319
-#define ADD_5O 3.784981
-//G2 front, right
-#define ADD_6X 3454.302490
-#define ADD_6Y -3076.330566
-#define ADD_6Z 135.002319
-#define ADD_6O 3.784981
-//G2 back left
-#define ADD_7X 3460.975098
-#define ADD_7Y -3078.901367
-#define ADD_7Z 135.002319
-#define ADD_7O 3.784981
-//G2 back, right
-#define ADD_8X 3457.338867
-#define ADD_8Y -3073.979004
-#define ADD_8Z 135.002319
-#define ADD_8O 3.784981
-
-struct TRINITY_DLL_DECL boss_dathrohan_balnazzarAI : public ScriptedAI
-{
- boss_dathrohan_balnazzarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CrusadersHammer_Timer;
- uint32 CrusaderStrike_Timer;
- uint32 MindBlast_Timer;
- uint32 HolyStrike_Timer;
- uint32 Dazed_Timer;
- uint32 ShadowShock_Timer;
- uint32 PsychicScream_Timer;
- uint32 DeepSleep_Timer;
- uint32 ShadowBoltVolley_Timer;
- // uint32 MindControl_Timer;
- bool Transformed;
-
- void Reset()
- {
- CrusadersHammer_Timer = 8000;
- CrusaderStrike_Timer = 14000;
- MindBlast_Timer = 17000;
- HolyStrike_Timer = 18000;
- Dazed_Timer = 23000;
- ShadowShock_Timer = 4000;
- PsychicScream_Timer = 16000;
- DeepSleep_Timer = 20000;
- ShadowBoltVolley_Timer = 9000;
- // MindControl_Timer = 10000;
- Transformed = false;
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,10545);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.00f);
-
- }
-
- void JustDied(Unit* Victim)
- {
- m_creature->SummonCreature(10698,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
- m_creature->SummonCreature(10698,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //START NOT TRANSFORMED
- if (!Transformed)
- {
- //CrusadersHammer
- if (CrusadersHammer_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 75) //50% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CRUSADERSHAMMER);
- }
- //15 seconds until we should cast this again
- CrusadersHammer_Timer = 12000;
- }else CrusadersHammer_Timer -= diff;
-
- //CrusaderStrike
- if (CrusaderStrike_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 60) //50% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE);
- }
- //15 seconds until we should cast this again
- CrusaderStrike_Timer = 15000;
- }else CrusaderStrike_Timer -= diff;
-
- //MindBlast
- if (MindBlast_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 70) //70% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- }
- //15 seconds until we should cast this again
- MindBlast_Timer = 10000;
- }else MindBlast_Timer -= diff;
-
- //HolyStrike
- if (HolyStrike_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 50) //50% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_HOLYSTRIKE);
- }
- //15 seconds until we should cast this again
- HolyStrike_Timer = 15000;
- }else HolyStrike_Timer -= diff;
-
- //Dazed
- if (Dazed_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 50) //50% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_DAZED);
- }
- //15 seconds until we should cast this again
- Dazed_Timer = 15000;
- }else Dazed_Timer -= diff;
-
- //BalnazzarTransform
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
- {
- //Cast
- DoCast(m_creature,SPELL_BALNAZZARTRANSFORM); //restore hp, mana and stun
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,10691); //then change disaply id
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.00f); //then, change size
- Transformed = true;
- }
-
- //START ELSE TRANSFORMED
- } else {
-
-
- //MindBlast
- if (MindBlast_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //Cast
- if (rand()%100 < 60) //70% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- }
- //15 seconds until we should cast this again
- MindBlast_Timer = 10000;
- }else MindBlast_Timer -= diff;
-
- //ShadowShock
- if (ShadowShock_Timer < diff)
- {
- //Cast
- if (rand()%100 < 80) //80% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWSHOCK);
- }
- //15 seconds until we should cast this again
- ShadowShock_Timer = 11000;
- }else ShadowShock_Timer -= diff;
-
- //PsychicScream
- if (PsychicScream_Timer < diff)
- {
- //Cast
- if (rand()%100 < 60) //60% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
- }
- //15 seconds until we should cast this again
- PsychicScream_Timer = 20000;
- }else PsychicScream_Timer -= diff;
-
- //DeepSleep
- if (DeepSleep_Timer < diff)
- {
- //Cast
- if (rand()%100 < 55) //55% chance to cast
- {
- //Cast
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_DEEPSLEEP);
- }
- //15 seconds until we should cast this again
- DeepSleep_Timer = 15000;
- }else DeepSleep_Timer -= diff;
-
- //ShadowBoltVolley
- if (ShadowBoltVolley_Timer < diff)
- {
- //Cast
- if (rand()%100 < 75) //75% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
- }
- //15 seconds until we should cast this again
- ShadowBoltVolley_Timer = 13000;
- }else ShadowBoltVolley_Timer -= diff;
-
- //MindControl
- // if (MindControl_Timer < diff)
- // {
- //Cast
- // if (rand()%100 < 50) //50% chance to cast
- // {
- // DoCast(m_creature->getVictim(),SPELL_MINDCONTROL);
- // }
- //15 seconds until we should cast this again
- // MindControl_Timer = 15000;
- // }else MindControl_Timer -= diff;
-
- //END ELSE TRANSFORMED
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_dathrohan_balnazzar(Creature *_Creature)
-{
- return new boss_dathrohan_balnazzarAI (_Creature);
-}
-
-void AddSC_boss_dathrohan_balnazzar()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_dathrohan_balnazzar";
- newscript->GetAI = GetAI_boss_dathrohan_balnazzar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_darhrohan_balnazzar
+SD%Complete: 100
+SDComment: CHECK SQL
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+//Dathrohan spells
+#define SPELL_CRUSADERSHAMMER 17286 //AOE stun
+#define SPELL_CRUSADERSTRIKE 17281
+#define SPELL_MINDBLAST 17287
+#define SPELL_HOLYSTRIKE 17284 //weapon dmg +3
+#define SPELL_DAZED 1604
+
+//Transform
+#define SPELL_BALNAZZARTRANSFORM 17288 //restore full HP/mana, trigger spell Balnazzar Transform Stun
+
+//Balnazzar spells
+#define SPELL_SHADOWSHOCK 20603 //AOE 740-860dmg
+#define SPELL_PSYCHICSCREAM 15398 //One target, might want to make a code selecting random target
+#define SPELL_DEEPSLEEP 24777 //AOE, ten sec
+#define SPELL_SHADOWBOLTVOLLEY 20741 //AOE, 255-345dmg
+//#define SPELL_MINDCONTROL 15690 //core support needed
+
+//Summon
+//G1 front, left
+#define ADD_1X 3444.156250
+#define ADD_1Y -3090.626709
+#define ADD_1Z 135.002319
+#define ADD_1O 2.240888
+//G1 front, right
+#define ADD_2X 3449.123535
+#define ADD_2Y -3087.009766
+#define ADD_2Z 135.002319
+#define ADD_2O 2.240888
+//G1 back left
+#define ADD_3X 3446.246826
+#define ADD_3Y -3093.466309
+#define ADD_3Z 135.002319
+#define ADD_3O 2.240888
+//G1 back, right
+#define ADD_4X 3451.160889
+#define ADD_4Y -3089.904785
+#define ADD_4Z 135.002136
+#define ADD_4O 2.240888
+//G2 front, left
+#define ADD_5X 3457.995117
+#define ADD_5Y -3080.916504
+#define ADD_5Z 135.002319
+#define ADD_5O 3.784981
+//G2 front, right
+#define ADD_6X 3454.302490
+#define ADD_6Y -3076.330566
+#define ADD_6Z 135.002319
+#define ADD_6O 3.784981
+//G2 back left
+#define ADD_7X 3460.975098
+#define ADD_7Y -3078.901367
+#define ADD_7Z 135.002319
+#define ADD_7O 3.784981
+//G2 back, right
+#define ADD_8X 3457.338867
+#define ADD_8Y -3073.979004
+#define ADD_8Z 135.002319
+#define ADD_8O 3.784981
+
+struct TRINITY_DLL_DECL boss_dathrohan_balnazzarAI : public ScriptedAI
+{
+ boss_dathrohan_balnazzarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CrusadersHammer_Timer;
+ uint32 CrusaderStrike_Timer;
+ uint32 MindBlast_Timer;
+ uint32 HolyStrike_Timer;
+ uint32 Dazed_Timer;
+ uint32 ShadowShock_Timer;
+ uint32 PsychicScream_Timer;
+ uint32 DeepSleep_Timer;
+ uint32 ShadowBoltVolley_Timer;
+ // uint32 MindControl_Timer;
+ bool Transformed;
+
+ void Reset()
+ {
+ CrusadersHammer_Timer = 8000;
+ CrusaderStrike_Timer = 14000;
+ MindBlast_Timer = 17000;
+ HolyStrike_Timer = 18000;
+ Dazed_Timer = 23000;
+ ShadowShock_Timer = 4000;
+ PsychicScream_Timer = 16000;
+ DeepSleep_Timer = 20000;
+ ShadowBoltVolley_Timer = 9000;
+ // MindControl_Timer = 10000;
+ Transformed = false;
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,10545);
+ m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.00f);
+
+ }
+
+ void JustDied(Unit* Victim)
+ {
+ m_creature->SummonCreature(10698,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ m_creature->SummonCreature(10698,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //START NOT TRANSFORMED
+ if (!Transformed)
+ {
+ //CrusadersHammer
+ if (CrusadersHammer_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 75) //50% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CRUSADERSHAMMER);
+ }
+ //15 seconds until we should cast this again
+ CrusadersHammer_Timer = 12000;
+ }else CrusadersHammer_Timer -= diff;
+
+ //CrusaderStrike
+ if (CrusaderStrike_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 60) //50% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE);
+ }
+ //15 seconds until we should cast this again
+ CrusaderStrike_Timer = 15000;
+ }else CrusaderStrike_Timer -= diff;
+
+ //MindBlast
+ if (MindBlast_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 70) //70% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ }
+ //15 seconds until we should cast this again
+ MindBlast_Timer = 10000;
+ }else MindBlast_Timer -= diff;
+
+ //HolyStrike
+ if (HolyStrike_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 50) //50% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLYSTRIKE);
+ }
+ //15 seconds until we should cast this again
+ HolyStrike_Timer = 15000;
+ }else HolyStrike_Timer -= diff;
+
+ //Dazed
+ if (Dazed_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 50) //50% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_DAZED);
+ }
+ //15 seconds until we should cast this again
+ Dazed_Timer = 15000;
+ }else Dazed_Timer -= diff;
+
+ //BalnazzarTransform
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
+ {
+ //Cast
+ DoCast(m_creature,SPELL_BALNAZZARTRANSFORM); //restore hp, mana and stun
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,10691); //then change disaply id
+ m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.00f); //then, change size
+ Transformed = true;
+ }
+
+ //START ELSE TRANSFORMED
+ } else {
+
+
+ //MindBlast
+ if (MindBlast_Timer < diff && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //Cast
+ if (rand()%100 < 60) //70% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ }
+ //15 seconds until we should cast this again
+ MindBlast_Timer = 10000;
+ }else MindBlast_Timer -= diff;
+
+ //ShadowShock
+ if (ShadowShock_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 80) //80% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWSHOCK);
+ }
+ //15 seconds until we should cast this again
+ ShadowShock_Timer = 11000;
+ }else ShadowShock_Timer -= diff;
+
+ //PsychicScream
+ if (PsychicScream_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 60) //60% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+ }
+ //15 seconds until we should cast this again
+ PsychicScream_Timer = 20000;
+ }else PsychicScream_Timer -= diff;
+
+ //DeepSleep
+ if (DeepSleep_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 55) //55% chance to cast
+ {
+ //Cast
+ Unit* target = NULL;
+
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_DEEPSLEEP);
+ }
+ //15 seconds until we should cast this again
+ DeepSleep_Timer = 15000;
+ }else DeepSleep_Timer -= diff;
+
+ //ShadowBoltVolley
+ if (ShadowBoltVolley_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 75) //75% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
+ }
+ //15 seconds until we should cast this again
+ ShadowBoltVolley_Timer = 13000;
+ }else ShadowBoltVolley_Timer -= diff;
+
+ //MindControl
+ // if (MindControl_Timer < diff)
+ // {
+ //Cast
+ // if (rand()%100 < 50) //50% chance to cast
+ // {
+ // DoCast(m_creature->getVictim(),SPELL_MINDCONTROL);
+ // }
+ //15 seconds until we should cast this again
+ // MindControl_Timer = 15000;
+ // }else MindControl_Timer -= diff;
+
+ //END ELSE TRANSFORMED
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_dathrohan_balnazzar(Creature *_Creature)
+{
+ return new boss_dathrohan_balnazzarAI (_Creature);
+}
+
+void AddSC_boss_dathrohan_balnazzar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_dathrohan_balnazzar";
+ newscript->GetAI = GetAI_boss_dathrohan_balnazzar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
index 24b021ee8bb..cbea76cf205 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
@@ -1,114 +1,114 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_magistrate_barthilas
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_DRAININGBLOW 16793
-#define SPELL_CROWDPUMMEL 10887
-#define SPELL_MIGHTYBLOW 14099
-#define SPELL_DAZED 1604
-
-struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI
-{
- boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 DrainingBlow_Timer;
- uint32 CrowdPummel_Timer;
- uint32 MightyBlow_Timer;
- uint32 Dazed_Timer;
-
- void Reset()
- {
- DrainingBlow_Timer = 4000;
- CrowdPummel_Timer = 13000;
- MightyBlow_Timer = 11000;
- Dazed_Timer = 7000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //DrainingBlow
- if (DrainingBlow_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_DRAININGBLOW);
-
- //4 seconds until we should cast this again
- DrainingBlow_Timer = 4000;
- }else DrainingBlow_Timer -= diff;
-
- //CrowdPummel
- if (CrowdPummel_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
-
- //13 seconds until we should cast this agian
- CrowdPummel_Timer = 13000;
- }else CrowdPummel_Timer -= diff;
-
- //MightyBlow
- if (MightyBlow_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
-
- //11 seconds until we should cast this again
- MightyBlow_Timer = 11000;
- }else MightyBlow_Timer -= diff;
-
- //Dazed
- if (Dazed_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_DAZED);
-
- //20 seconds until we should cast this again
- Dazed_Timer = 20000;
- }else Dazed_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_magistrate_barthilas(Creature *_Creature)
-{
- return new boss_magistrate_barthilasAI (_Creature);
-}
-
-
-void AddSC_boss_magistrate_barthilas()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_magistrate_barthilas";
- newscript->GetAI = GetAI_boss_magistrate_barthilas;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_magistrate_barthilas
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_DRAININGBLOW 16793
+#define SPELL_CROWDPUMMEL 10887
+#define SPELL_MIGHTYBLOW 14099
+#define SPELL_DAZED 1604
+
+struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI
+{
+ boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 DrainingBlow_Timer;
+ uint32 CrowdPummel_Timer;
+ uint32 MightyBlow_Timer;
+ uint32 Dazed_Timer;
+
+ void Reset()
+ {
+ DrainingBlow_Timer = 4000;
+ CrowdPummel_Timer = 13000;
+ MightyBlow_Timer = 11000;
+ Dazed_Timer = 7000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //DrainingBlow
+ if (DrainingBlow_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_DRAININGBLOW);
+
+ //4 seconds until we should cast this again
+ DrainingBlow_Timer = 4000;
+ }else DrainingBlow_Timer -= diff;
+
+ //CrowdPummel
+ if (CrowdPummel_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
+
+ //13 seconds until we should cast this agian
+ CrowdPummel_Timer = 13000;
+ }else CrowdPummel_Timer -= diff;
+
+ //MightyBlow
+ if (MightyBlow_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+
+ //11 seconds until we should cast this again
+ MightyBlow_Timer = 11000;
+ }else MightyBlow_Timer -= diff;
+
+ //Dazed
+ if (Dazed_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_DAZED);
+
+ //20 seconds until we should cast this again
+ Dazed_Timer = 20000;
+ }else Dazed_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_magistrate_barthilas(Creature *_Creature)
+{
+ return new boss_magistrate_barthilasAI (_Creature);
+}
+
+
+void AddSC_boss_magistrate_barthilas()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_magistrate_barthilas";
+ newscript->GetAI = GetAI_boss_magistrate_barthilas;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
index da831dd4b2b..e0f9c43cba7 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
@@ -1,119 +1,119 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_maleki_the_pallid
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTNOVA 22645
-#define SPELL_FROSTBOLT 17503
-#define SPELL_DRAINLIFE 20743
-#define SPELL_ICETOMB 16869
-
-struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI
-{
- boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FrostNova_Timer;
- uint32 Frostbolt_Timer;
- uint32 IceTomb_Timer;
- uint32 DrainLife_Timer;
-
- void Reset()
- {
- FrostNova_Timer = 11000;
- Frostbolt_Timer = 1000;
- IceTomb_Timer = 16000;
- DrainLife_Timer = 31000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //FrostNova
- if (FrostNova_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
- //23 seconds until we should cast this again
- FrostNova_Timer = 23000;
- }else FrostNova_Timer -= diff;
-
- //Frostbolt
- if (Frostbolt_Timer < diff)
- {
- //Cast
- if (rand()%100 < 90) //90% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- }
- //3.5 seconds until we should cast this again
- Frostbolt_Timer = 3500;
- }else Frostbolt_Timer -= diff;
-
- //IceTomb
- if (IceTomb_Timer < diff)
- {
- //Cast
- if (rand()%100 < 65) //65% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_ICETOMB);
- }
- //28 seconds until we should cast this again
- IceTomb_Timer = 28000;
- }else IceTomb_Timer -= diff;
-
- //DrainLife
- if (DrainLife_Timer < diff)
- {
- //Cast
- if (rand()%100 < 55) //55% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_DRAINLIFE);
- }
- //31 seconds until we should cast this again
- DrainLife_Timer = 31000;
- }else DrainLife_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_maleki_the_pallid(Creature *_Creature)
-{
- return new boss_maleki_the_pallidAI (_Creature);
-}
-
-
-void AddSC_boss_maleki_the_pallid()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_maleki_the_pallid";
- newscript->GetAI = GetAI_boss_maleki_the_pallid;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_maleki_the_pallid
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTNOVA 22645
+#define SPELL_FROSTBOLT 17503
+#define SPELL_DRAINLIFE 20743
+#define SPELL_ICETOMB 16869
+
+struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI
+{
+ boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FrostNova_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 IceTomb_Timer;
+ uint32 DrainLife_Timer;
+
+ void Reset()
+ {
+ FrostNova_Timer = 11000;
+ Frostbolt_Timer = 1000;
+ IceTomb_Timer = 16000;
+ DrainLife_Timer = 31000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //FrostNova
+ if (FrostNova_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
+ //23 seconds until we should cast this again
+ FrostNova_Timer = 23000;
+ }else FrostNova_Timer -= diff;
+
+ //Frostbolt
+ if (Frostbolt_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 90) //90% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ }
+ //3.5 seconds until we should cast this again
+ Frostbolt_Timer = 3500;
+ }else Frostbolt_Timer -= diff;
+
+ //IceTomb
+ if (IceTomb_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 65) //65% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_ICETOMB);
+ }
+ //28 seconds until we should cast this again
+ IceTomb_Timer = 28000;
+ }else IceTomb_Timer -= diff;
+
+ //DrainLife
+ if (DrainLife_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 55) //55% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_DRAINLIFE);
+ }
+ //31 seconds until we should cast this again
+ DrainLife_Timer = 31000;
+ }else DrainLife_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_maleki_the_pallid(Creature *_Creature)
+{
+ return new boss_maleki_the_pallidAI (_Creature);
+}
+
+
+void AddSC_boss_maleki_the_pallid()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_maleki_the_pallid";
+ newscript->GetAI = GetAI_boss_maleki_the_pallid;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
index ff9740eb0df..3929f2513dd 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
@@ -1,138 +1,138 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_nerubenkan
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ENCASINGWEBS 4962
-#define SPELL_PIERCEARMOR 6016
-#define SPELL_VIRULENTPOISON 16427
-//#define SPELL_RAISEUNDEADSCARAB 17235
-
-struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI
-{
- boss_nerubenkanAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 EncasingWebs_Timer;
- uint32 PierceArmor_Timer;
- uint32 VirulentPoison_Timer;
- uint32 RaiseUndeadScarab_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- VirulentPoison_Timer = 3000;
- EncasingWebs_Timer = 7000;
- PierceArmor_Timer = 19000;
- RaiseUndeadScarab_Timer = 11000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void RaiseUndeadScarab(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //EncasingWebs
- if (EncasingWebs_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_ENCASINGWEBS);
- //30 seconds until we should cast this again
- EncasingWebs_Timer = 30000;
- }else EncasingWebs_Timer -= diff;
-
- //PierceArmor
- if (PierceArmor_Timer < diff)
- {
- //Cast
- if (rand()%100 < 75) //75% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_PIERCEARMOR);
- }
- //35 seconds until we should cast this again
- PierceArmor_Timer = 35000;
- }else PierceArmor_Timer -= diff;
-
- //VirulentPoison
- if (VirulentPoison_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_VIRULENTPOISON);
- //20 seconds until we should cast this again
- VirulentPoison_Timer = 20000;
- }else VirulentPoison_Timer -= diff;
-
- //RaiseUndeadScarab
- if (RaiseUndeadScarab_Timer < diff)
- {
- //Cast
- RaiseUndeadScarab(m_creature->getVictim());
- //16 seconds until we should cast this again
- RaiseUndeadScarab_Timer = 16000;
- }else RaiseUndeadScarab_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_nerubenkan(Creature *_Creature)
-{
- return new boss_nerubenkanAI (_Creature);
-}
-
-
-void AddSC_boss_nerubenkan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_nerubenkan";
- newscript->GetAI = GetAI_boss_nerubenkan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_nerubenkan
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ENCASINGWEBS 4962
+#define SPELL_PIERCEARMOR 6016
+#define SPELL_VIRULENTPOISON 16427
+//#define SPELL_RAISEUNDEADSCARAB 17235
+
+struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI
+{
+ boss_nerubenkanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 EncasingWebs_Timer;
+ uint32 PierceArmor_Timer;
+ uint32 VirulentPoison_Timer;
+ uint32 RaiseUndeadScarab_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ VirulentPoison_Timer = 3000;
+ EncasingWebs_Timer = 7000;
+ PierceArmor_Timer = 19000;
+ RaiseUndeadScarab_Timer = 11000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void RaiseUndeadScarab(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //EncasingWebs
+ if (EncasingWebs_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_ENCASINGWEBS);
+ //30 seconds until we should cast this again
+ EncasingWebs_Timer = 30000;
+ }else EncasingWebs_Timer -= diff;
+
+ //PierceArmor
+ if (PierceArmor_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 75) //75% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_PIERCEARMOR);
+ }
+ //35 seconds until we should cast this again
+ PierceArmor_Timer = 35000;
+ }else PierceArmor_Timer -= diff;
+
+ //VirulentPoison
+ if (VirulentPoison_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_VIRULENTPOISON);
+ //20 seconds until we should cast this again
+ VirulentPoison_Timer = 20000;
+ }else VirulentPoison_Timer -= diff;
+
+ //RaiseUndeadScarab
+ if (RaiseUndeadScarab_Timer < diff)
+ {
+ //Cast
+ RaiseUndeadScarab(m_creature->getVictim());
+ //16 seconds until we should cast this again
+ RaiseUndeadScarab_Timer = 16000;
+ }else RaiseUndeadScarab_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_nerubenkan(Creature *_Creature)
+{
+ return new boss_nerubenkanAI (_Creature);
+}
+
+
+void AddSC_boss_nerubenkan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_nerubenkan";
+ newscript->GetAI = GetAI_boss_nerubenkan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
index b281322863f..a76913b658c 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
@@ -1,161 +1,161 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Silver_Hand_Bosses
-SD%Complete: 40
-SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now)
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_stratholme.h"
-
-/*#####
-# Additional:
-# Although this is a working solution, the correct would be in addition to check if Aurius is dead.
-# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile.
-# Once Aurius is defeated, he should be the one summoning the ghosts.
-#####*/
-
-#define SH_GREGOR 17910
-#define SH_CATHELA 17911
-#define SH_NEMAS 17912
-#define SH_AELMAR 17913
-#define SH_VICAR 17914
-#define SH_QUEST_CREDIT 17915
-
-#define SPELL_HOLY_LIGHT 25263
-#define SPELL_DIVINE_SHIELD 13874
-
-struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI
-{
- boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 HolyLight_Timer;
- uint32 DivineShield_Timer;
-
- void Reset()
- {
- HolyLight_Timer = 20000;
- DivineShield_Timer = 20000;
-
- if(pInstance)
- {
- switch(m_creature->GetEntry())
- {
- case SH_AELMAR:
- pInstance->SetData(TYPE_SH_AELMAR, 0);
- break;
- case SH_CATHELA:
- pInstance->SetData(TYPE_SH_CATHELA, 0);
- break;
- case SH_GREGOR:
- pInstance->SetData(TYPE_SH_GREGOR, 0);
- break;
- case SH_NEMAS:
- pInstance->SetData(TYPE_SH_NEMAS, 0);
- break;
- case SH_VICAR:
- pInstance->SetData(TYPE_SH_VICAR, 0);
- break;
- }
- }
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- {
- switch(m_creature->GetEntry())
- {
- case SH_AELMAR:
- pInstance->SetData(TYPE_SH_AELMAR, 2);
- break;
- case SH_CATHELA:
- pInstance->SetData(TYPE_SH_CATHELA, 2);
- break;
- case SH_GREGOR:
- pInstance->SetData(TYPE_SH_GREGOR, 2);
- break;
- case SH_NEMAS:
- pInstance->SetData(TYPE_SH_NEMAS, 2);
- break;
- case SH_VICAR:
- pInstance->SetData(TYPE_SH_VICAR, 2);
- break;
- }
- if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID());
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (HolyLight_Timer < diff)
- {
- if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth())
- {
- DoCast(m_creature, SPELL_HOLY_LIGHT);
- HolyLight_Timer = 20000;
- }
- }else HolyLight_Timer -= diff;
-
- if (DivineShield_Timer < diff)
- {
- if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth())
- {
- DoCast(m_creature, SPELL_DIVINE_SHIELD);
- DivineShield_Timer = 40000;
- }
- }else DivineShield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
-};
-CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature *_Creature)
-{
- return new boss_silver_hand_bossesAI (_Creature);
-}
-
-/*#####
-#
-#####*/
-
-void AddSC_boss_order_of_silver_hand()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_silver_hand_bosses";
- newscript->GetAI = GetAI_boss_silver_hand_bossesAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Silver_Hand_Bosses
+SD%Complete: 40
+SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now)
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_stratholme.h"
+
+/*#####
+# Additional:
+# Although this is a working solution, the correct would be in addition to check if Aurius is dead.
+# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile.
+# Once Aurius is defeated, he should be the one summoning the ghosts.
+#####*/
+
+#define SH_GREGOR 17910
+#define SH_CATHELA 17911
+#define SH_NEMAS 17912
+#define SH_AELMAR 17913
+#define SH_VICAR 17914
+#define SH_QUEST_CREDIT 17915
+
+#define SPELL_HOLY_LIGHT 25263
+#define SPELL_DIVINE_SHIELD 13874
+
+struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI
+{
+ boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 HolyLight_Timer;
+ uint32 DivineShield_Timer;
+
+ void Reset()
+ {
+ HolyLight_Timer = 20000;
+ DivineShield_Timer = 20000;
+
+ if(pInstance)
+ {
+ switch(m_creature->GetEntry())
+ {
+ case SH_AELMAR:
+ pInstance->SetData(TYPE_SH_AELMAR, 0);
+ break;
+ case SH_CATHELA:
+ pInstance->SetData(TYPE_SH_CATHELA, 0);
+ break;
+ case SH_GREGOR:
+ pInstance->SetData(TYPE_SH_GREGOR, 0);
+ break;
+ case SH_NEMAS:
+ pInstance->SetData(TYPE_SH_NEMAS, 0);
+ break;
+ case SH_VICAR:
+ pInstance->SetData(TYPE_SH_VICAR, 0);
+ break;
+ }
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ {
+ switch(m_creature->GetEntry())
+ {
+ case SH_AELMAR:
+ pInstance->SetData(TYPE_SH_AELMAR, 2);
+ break;
+ case SH_CATHELA:
+ pInstance->SetData(TYPE_SH_CATHELA, 2);
+ break;
+ case SH_GREGOR:
+ pInstance->SetData(TYPE_SH_GREGOR, 2);
+ break;
+ case SH_NEMAS:
+ pInstance->SetData(TYPE_SH_NEMAS, 2);
+ break;
+ case SH_VICAR:
+ pInstance->SetData(TYPE_SH_VICAR, 2);
+ break;
+ }
+ if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID());
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (HolyLight_Timer < diff)
+ {
+ if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth())
+ {
+ DoCast(m_creature, SPELL_HOLY_LIGHT);
+ HolyLight_Timer = 20000;
+ }
+ }else HolyLight_Timer -= diff;
+
+ if (DivineShield_Timer < diff)
+ {
+ if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth())
+ {
+ DoCast(m_creature, SPELL_DIVINE_SHIELD);
+ DivineShield_Timer = 40000;
+ }
+ }else DivineShield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature *_Creature)
+{
+ return new boss_silver_hand_bossesAI (_Creature);
+}
+
+/*#####
+#
+#####*/
+
+void AddSC_boss_order_of_silver_hand()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_silver_hand_bosses";
+ newscript->GetAI = GetAI_boss_silver_hand_bossesAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
index f84d9bbac41..a4eddd46b5e 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
@@ -1,144 +1,144 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_postmaster_malown
-SD%Complete: 50
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-//Spell ID to summon this guy is 24627 "Summon Postmaster Malown"
-//He should be spawned along with three other elites once the third postbox has been opened
-
-#define SAY_MALOWNED "You just got MALOWNED!"
-
-#define SPELL_WAILINGDEAD 7713
-#define SPELL_BACKHAND 6253
-#define SPELL_CURSEOFWEAKNESS 8552
-#define SPELL_CURSEOFTONGUES 12889
-#define SPELL_CALLOFTHEGRAVE 17831
-
-struct TRINITY_DLL_DECL boss_postmaster_malownAI : public ScriptedAI
-{
- boss_postmaster_malownAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WailingDead_Timer;
- uint32 Backhand_Timer;
- uint32 CurseOfWeakness_Timer;
- uint32 CurseOfTongues_Timer;
- uint32 CallOfTheGrave_Timer;
- bool HasYelled;
-
- void Reset()
- {
- WailingDead_Timer = 19000; //lasts 6 sec
- Backhand_Timer = 8000; //2 sec stun
- CurseOfWeakness_Timer = 20000; //lasts 2 mins
- CurseOfTongues_Timer = 22000;
- CallOfTheGrave_Timer = 25000;
- HasYelled = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //WailingDead
- if (WailingDead_Timer < diff)
- {
- //Cast
- if (rand()%100 < 65) //65% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_WAILINGDEAD);
- }
- //19 seconds until we should cast this again
- WailingDead_Timer = 19000;
- }else WailingDead_Timer -= diff;
-
- //Backhand
- if (Backhand_Timer < diff)
- {
- //Cast
- if (rand()%100 < 45) //45% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_BACKHAND);
- }
- //8 seconds until we should cast this again
- Backhand_Timer = 8000;
- }else Backhand_Timer -= diff;
-
- //CurseOfWeakness
- if (CurseOfWeakness_Timer < diff)
- {
- //Cast
- if (rand()%100 < 3) //3% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
- }
- //20 seconds until we should cast this again
- CurseOfWeakness_Timer = 20000;
- }else CurseOfWeakness_Timer -= diff;
-
- //CurseOfTongues
- if (CurseOfTongues_Timer < diff)
- {
- //Cast
- if (rand()%100 < 3) //3% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFTONGUES);
- }
- //22 seconds until we should cast this again
- CurseOfTongues_Timer = 22000;
- }else CurseOfTongues_Timer -= diff;
-
- //CallOfTheGrave
- if (CallOfTheGrave_Timer < diff)
- {
- //Cast
- if (rand()%100 < 5) //5% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE);
- }
- //25 seconds until we should cast this again
- CallOfTheGrave_Timer = 25000;
- }else CallOfTheGrave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_postmaster_malown(Creature *_Creature)
-{
- return new boss_postmaster_malownAI (_Creature);
-}
-
-
-void AddSC_boss_postmaster_malown()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_postmaster_malown";
- newscript->GetAI = GetAI_boss_postmaster_malown;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_postmaster_malown
+SD%Complete: 50
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+//Spell ID to summon this guy is 24627 "Summon Postmaster Malown"
+//He should be spawned along with three other elites once the third postbox has been opened
+
+#define SAY_MALOWNED "You just got MALOWNED!"
+
+#define SPELL_WAILINGDEAD 7713
+#define SPELL_BACKHAND 6253
+#define SPELL_CURSEOFWEAKNESS 8552
+#define SPELL_CURSEOFTONGUES 12889
+#define SPELL_CALLOFTHEGRAVE 17831
+
+struct TRINITY_DLL_DECL boss_postmaster_malownAI : public ScriptedAI
+{
+ boss_postmaster_malownAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WailingDead_Timer;
+ uint32 Backhand_Timer;
+ uint32 CurseOfWeakness_Timer;
+ uint32 CurseOfTongues_Timer;
+ uint32 CallOfTheGrave_Timer;
+ bool HasYelled;
+
+ void Reset()
+ {
+ WailingDead_Timer = 19000; //lasts 6 sec
+ Backhand_Timer = 8000; //2 sec stun
+ CurseOfWeakness_Timer = 20000; //lasts 2 mins
+ CurseOfTongues_Timer = 22000;
+ CallOfTheGrave_Timer = 25000;
+ HasYelled = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //WailingDead
+ if (WailingDead_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 65) //65% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_WAILINGDEAD);
+ }
+ //19 seconds until we should cast this again
+ WailingDead_Timer = 19000;
+ }else WailingDead_Timer -= diff;
+
+ //Backhand
+ if (Backhand_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 45) //45% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_BACKHAND);
+ }
+ //8 seconds until we should cast this again
+ Backhand_Timer = 8000;
+ }else Backhand_Timer -= diff;
+
+ //CurseOfWeakness
+ if (CurseOfWeakness_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 3) //3% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
+ }
+ //20 seconds until we should cast this again
+ CurseOfWeakness_Timer = 20000;
+ }else CurseOfWeakness_Timer -= diff;
+
+ //CurseOfTongues
+ if (CurseOfTongues_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 3) //3% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFTONGUES);
+ }
+ //22 seconds until we should cast this again
+ CurseOfTongues_Timer = 22000;
+ }else CurseOfTongues_Timer -= diff;
+
+ //CallOfTheGrave
+ if (CallOfTheGrave_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 5) //5% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE);
+ }
+ //25 seconds until we should cast this again
+ CallOfTheGrave_Timer = 25000;
+ }else CallOfTheGrave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_postmaster_malown(Creature *_Creature)
+{
+ return new boss_postmaster_malownAI (_Creature);
+}
+
+
+void AddSC_boss_postmaster_malown()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_postmaster_malown";
+ newscript->GetAI = GetAI_boss_postmaster_malown;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
index ec279308e5d..674d4403266 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
@@ -1,92 +1,92 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_ramstein_the_gorger
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_TRAMPLE 15550
-#define SPELL_KNOCKOUT 17307
-
-struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI
-{
- boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Trample_Timer;
- uint32 Knockout_Timer;
-
- void Reset()
- {
- Trample_Timer = 3000;
- Knockout_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Trample
- if (Trample_Timer < diff)
- {
- //Cast
- if (rand()%100 < 75) //75% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
- }
- //7 seconds until we should cast this again
- Trample_Timer = 7000;
- }else Trample_Timer -= diff;
-
- //Knockout
- if (Knockout_Timer < diff)
- {
- //Cast
- if (rand()%100 < 70) //70% chance to cast
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKOUT);
- }
- //10 seconds until we should cast this again
- Knockout_Timer = 10000;
- }else Knockout_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ramstein_the_gorger(Creature *_Creature)
-{
- return new boss_ramstein_the_gorgerAI (_Creature);
-}
-
-
-void AddSC_boss_ramstein_the_gorger()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ramstein_the_gorger";
- newscript->GetAI = GetAI_boss_ramstein_the_gorger;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_ramstein_the_gorger
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_TRAMPLE 15550
+#define SPELL_KNOCKOUT 17307
+
+struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI
+{
+ boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Trample_Timer;
+ uint32 Knockout_Timer;
+
+ void Reset()
+ {
+ Trample_Timer = 3000;
+ Knockout_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Trample
+ if (Trample_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 75) //75% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_TRAMPLE);
+ }
+ //7 seconds until we should cast this again
+ Trample_Timer = 7000;
+ }else Trample_Timer -= diff;
+
+ //Knockout
+ if (Knockout_Timer < diff)
+ {
+ //Cast
+ if (rand()%100 < 70) //70% chance to cast
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKOUT);
+ }
+ //10 seconds until we should cast this again
+ Knockout_Timer = 10000;
+ }else Knockout_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ramstein_the_gorger(Creature *_Creature)
+{
+ return new boss_ramstein_the_gorgerAI (_Creature);
+}
+
+
+void AddSC_boss_ramstein_the_gorger()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ramstein_the_gorger";
+ newscript->GetAI = GetAI_boss_ramstein_the_gorger;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
index f19ffb8afdb..2675a6621d9 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
@@ -1,103 +1,103 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_timmy_the_cruel
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_SPAWN "TIMMY!"
-
-#define SPELL_RAVENOUSCLAW 17470
-
-struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI
-{
- boss_timmy_the_cruelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 RavenousClaw_Timer;
- bool HasYelled;
-
- void Reset()
- {
- RavenousClaw_Timer = 10000;
- HasYelled = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!HasYelled)
- {
- DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
- HasYelled = true;
- }
-
- //Begin melee attack if we are within range
- DoStartAttackAndMovement(who);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //RavenousClaw
- if (RavenousClaw_Timer < diff)
- {
- //Cast
- DoCast(m_creature->getVictim(),SPELL_RAVENOUSCLAW);
- //15 seconds until we should cast this again
- RavenousClaw_Timer = 15000;
- }else RavenousClaw_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_timmy_the_cruel(Creature *_Creature)
-{
- return new boss_timmy_the_cruelAI (_Creature);
-}
-
-
-void AddSC_boss_timmy_the_cruel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_timmy_the_cruel";
- newscript->GetAI = GetAI_boss_timmy_the_cruel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_timmy_the_cruel
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_SPAWN "TIMMY!"
+
+#define SPELL_RAVENOUSCLAW 17470
+
+struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI
+{
+ boss_timmy_the_cruelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 RavenousClaw_Timer;
+ bool HasYelled;
+
+ void Reset()
+ {
+ RavenousClaw_Timer = 10000;
+ HasYelled = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!HasYelled)
+ {
+ DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
+ HasYelled = true;
+ }
+
+ //Begin melee attack if we are within range
+ DoStartAttackAndMovement(who);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //RavenousClaw
+ if (RavenousClaw_Timer < diff)
+ {
+ //Cast
+ DoCast(m_creature->getVictim(),SPELL_RAVENOUSCLAW);
+ //15 seconds until we should cast this again
+ RavenousClaw_Timer = 15000;
+ }else RavenousClaw_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_timmy_the_cruel(Creature *_Creature)
+{
+ return new boss_timmy_the_cruelAI (_Creature);
+}
+
+
+void AddSC_boss_timmy_the_cruel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_timmy_the_cruel";
+ newscript->GetAI = GetAI_boss_timmy_the_cruel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
index 26283d7b0fd..27c181a77f5 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
+++ b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
@@ -1,14 +1,14 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_STRATHOLME_H
-#define DEF_STRATHOLME_H
-
-#define TYPE_SH_AELMAR 1
-#define TYPE_SH_CATHELA 2
-#define TYPE_SH_GREGOR 3
-#define TYPE_SH_NEMAS 4
-#define TYPE_SH_VICAR 5
-#define TYPE_SH_QUEST 6
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_STRATHOLME_H
+#define DEF_STRATHOLME_H
+
+#define TYPE_SH_AELMAR 1
+#define TYPE_SH_CATHELA 2
+#define TYPE_SH_GREGOR 3
+#define TYPE_SH_NEMAS 4
+#define TYPE_SH_VICAR 5
+#define TYPE_SH_QUEST 6
+#endif
diff --git a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
index 270c29384eb..eff4edf91a8 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
@@ -1,77 +1,77 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: instance_stratholme
-SD%Complete: 100
-SDComment:
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_stratholme.h"
-
-struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
-{
- instance_stratholme(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- bool IsSilverHandDead[5];
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_SH_AELMAR:
- IsSilverHandDead[0] = (data) ? true : false;
- break;
- case TYPE_SH_CATHELA:
- IsSilverHandDead[1] = (data) ? true : false;
- break;
- case TYPE_SH_GREGOR:
- IsSilverHandDead[2] = (data) ? true : false;
- break;
- case TYPE_SH_NEMAS:
- IsSilverHandDead[3] = (data) ? true : false;
- break;
- case TYPE_SH_VICAR:
- IsSilverHandDead[4] = (data) ? true : false;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- if(type == TYPE_SH_QUEST)
- if(IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4])
- return true;
-
- return false;
- }
-};
-
-InstanceData* GetInstanceData_instance_stratholme(Map* map)
-{
- return new instance_stratholme(map);
-}
-
-void AddSC_instance_stratholme()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_stratholme";
- newscript->GetInstanceData = GetInstanceData_instance_stratholme;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: instance_stratholme
+SD%Complete: 100
+SDComment:
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_stratholme.h"
+
+struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
+{
+ instance_stratholme(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ bool IsSilverHandDead[5];
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_SH_AELMAR:
+ IsSilverHandDead[0] = (data) ? true : false;
+ break;
+ case TYPE_SH_CATHELA:
+ IsSilverHandDead[1] = (data) ? true : false;
+ break;
+ case TYPE_SH_GREGOR:
+ IsSilverHandDead[2] = (data) ? true : false;
+ break;
+ case TYPE_SH_NEMAS:
+ IsSilverHandDead[3] = (data) ? true : false;
+ break;
+ case TYPE_SH_VICAR:
+ IsSilverHandDead[4] = (data) ? true : false;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ if(type == TYPE_SH_QUEST)
+ if(IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4])
+ return true;
+
+ return false;
+ }
+};
+
+InstanceData* GetInstanceData_instance_stratholme(Map* map)
+{
+ return new instance_stratholme(map);
+}
+
+void AddSC_instance_stratholme()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_stratholme";
+ newscript->GetInstanceData = GetInstanceData_instance_stratholme;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
index 0e7542c542e..5097648a04a 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
@@ -1,335 +1,335 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Stratholme
-SD%Complete: 100
-SDComment: trash mobs for strat. Simple AI mobs converted to EAI (except Mindless Skeleton and Thuzadin Acolyte)
-SDCategory: Stratholme
-EndScriptData */
-
-#include "precompiled.h"
-#include "../../creature/simple_ai.h"
-
-/*######
-## mob_freed_soul
-######*/
-
-//Possibly more of these quotes around.
-#define SAY_ZAPPED0 "Thanks to Egan"
-#define SAY_ZAPPED1 "Rivendare must die"
-#define SAY_ZAPPED2 "Who you gonna call?"
-#define SAY_ZAPPED3 "Don't cross those beams!"
-
-struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI
-{
- mob_freed_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
-
- switch (rand()%4)
- {
- case 0:
- DoSay(SAY_ZAPPED0,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoSay(SAY_ZAPPED1,LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoSay(SAY_ZAPPED2,LANG_UNIVERSAL,NULL);
- break;
- case 3:
- DoSay(SAY_ZAPPED3,LANG_UNIVERSAL,NULL);
- break;
- }
- }
-
- void Aggro(Unit* who)
- {
- }
-};
-CreatureAI* GetAI_mob_freed_soul(Creature *_Creature)
-{
- return new mob_freed_soulAI (_Creature);
-}
-/*######
-## mob_restless_soul
-######*/
-
-struct TRINITY_DLL_DECL mob_restless_soulAI : public ScriptedAI
-{
- mob_restless_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- Unit* PlayerHolder;
- uint32 Die_Timer;
- bool OkToDie;
-
- void Reset()
- {
- Die_Timer = 10000;
- OkToDie = false;
-
- PlayerHolder = NULL;
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void SummonFreedSoul(Unit* victim)
- {
- int Rand;
- int RandX;
- int RandY;
-
- Rand = rand()%1;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%1;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- DoSpawnCreature(11136, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 300000);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER)
- {
- if(!PlayerHolder && !OkToDie && spell->Id == 17368 && ((Player*)caster)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerHolder = caster;
- OkToDie = true;
- Die_Timer = 5000;
- }
- }
- return;
- }
-
- void JustDied(Unit* Killer)
- {
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- {
- //check quest status
- if(PlayerHolder == ((Player*)Killer) && ((Player*)Killer)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
- {
- SummonFreedSoul(m_creature->getVictim());
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (PlayerHolder && OkToDie && Die_Timer < diff)
- {
- PlayerHolder->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else Die_Timer -= diff;
-
- return;
- }
-};
-CreatureAI* GetAI_mob_restless_soul(Creature *_Creature)
-{
- return new mob_restless_soulAI (_Creature);
-}
-
-/*######
-## mobs_spectral_ghostly_citizen
-######*/
-
-struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
-{
- mobs_spectral_ghostly_citizenAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- Unit* PlayerHolder;
- uint32 Die_Timer;
- bool OkToDie;
-
- void Reset()
- {
- Die_Timer = 5000;
- OkToDie = false;
- PlayerHolder = NULL;
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void SummonRestlessSoul(Unit* victim)
- {
- int Rand;
- int RandX;
- int RandY;
-
- Rand = rand()%7;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%7;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- DoSpawnCreature(11122, RandX, RandY, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 600000);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER)
- {
- if(!PlayerHolder && !OkToDie && spell->Id == 17368 && ((Player*)caster)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerHolder = caster;
- OkToDie = true;
- Die_Timer = 5000;
- }
- }
- return;
- }
-
- void JustDied(Unit* Killer)
- {
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- {
- //check quest status
- if(PlayerHolder == ((Player*)Killer) && ((Player*)Killer)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
- {
- SummonRestlessSoul(m_creature->getVictim()); //always one
- if (rand()%100 < 90) SummonRestlessSoul(m_creature->getVictim()); //90% a second
- if (rand()%100 < 50) SummonRestlessSoul(m_creature->getVictim()); //50% a third
- if (rand()%100 < 30) SummonRestlessSoul(m_creature->getVictim()); //30% a fourth
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (PlayerHolder && OkToDie && Die_Timer < diff)
- {
- PlayerHolder->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else Die_Timer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
-{
- return new mobs_spectral_ghostly_citizenAI (_Creature);
-}
-bool ReciveEmote_mobs_spectral_ghostly_citizen(Player *player, Creature *_Creature, uint32 emote)
-{
- _Creature->HandleEmoteCommand(emote);
-
- if (emote == TEXTEMOTE_DANCE)
- ((mobs_spectral_ghostly_citizenAI*)_Creature->AI())->EnterEvadeMode();
-
- return true;
-}
-
-/*######
-## mob_mindless_skeleton
-######*/
-
-CreatureAI* GetAI_mob_mindless_skeleton(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- //dazed
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 13496;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 3000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-/*######
-## mob_thuzadin_acolyte
-######*/
-
-CreatureAI* GetAI_mob_thuzadin_acolyte(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- //dazed
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 13496;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 1000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-/*######
-##
-######*/
-
-void AddSC_stratholme()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_freed_soul";
- newscript->GetAI = GetAI_mob_freed_soul;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_restless_soul";
- newscript->GetAI = GetAI_mob_restless_soul;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mobs_spectral_ghostly_citizen";
- newscript->GetAI = GetAI_mobs_spectral_ghostly_citizen;
- newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_mindless_skeleton";
- newscript->GetAI = GetAI_mob_mindless_skeleton;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_thuzadin_acolyte";
- newscript->GetAI = GetAI_mob_thuzadin_acolyte;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Stratholme
+SD%Complete: 100
+SDComment: trash mobs for strat. Simple AI mobs converted to EAI (except Mindless Skeleton and Thuzadin Acolyte)
+SDCategory: Stratholme
+EndScriptData */
+
+#include "precompiled.h"
+#include "../../creature/simple_ai.h"
+
+/*######
+## mob_freed_soul
+######*/
+
+//Possibly more of these quotes around.
+#define SAY_ZAPPED0 "Thanks to Egan"
+#define SAY_ZAPPED1 "Rivendare must die"
+#define SAY_ZAPPED2 "Who you gonna call?"
+#define SAY_ZAPPED3 "Don't cross those beams!"
+
+struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI
+{
+ mob_freed_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+
+ switch (rand()%4)
+ {
+ case 0:
+ DoSay(SAY_ZAPPED0,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoSay(SAY_ZAPPED1,LANG_UNIVERSAL,NULL);
+ break;
+ case 2:
+ DoSay(SAY_ZAPPED2,LANG_UNIVERSAL,NULL);
+ break;
+ case 3:
+ DoSay(SAY_ZAPPED3,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+};
+CreatureAI* GetAI_mob_freed_soul(Creature *_Creature)
+{
+ return new mob_freed_soulAI (_Creature);
+}
+/*######
+## mob_restless_soul
+######*/
+
+struct TRINITY_DLL_DECL mob_restless_soulAI : public ScriptedAI
+{
+ mob_restless_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ Unit* PlayerHolder;
+ uint32 Die_Timer;
+ bool OkToDie;
+
+ void Reset()
+ {
+ Die_Timer = 10000;
+ OkToDie = false;
+
+ PlayerHolder = NULL;
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void SummonFreedSoul(Unit* victim)
+ {
+ int Rand;
+ int RandX;
+ int RandY;
+
+ Rand = rand()%1;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%1;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ DoSpawnCreature(11136, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 300000);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(!PlayerHolder && !OkToDie && spell->Id == 17368 && ((Player*)caster)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
+ {
+ PlayerHolder = caster;
+ OkToDie = true;
+ Die_Timer = 5000;
+ }
+ }
+ return;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ {
+ //check quest status
+ if(PlayerHolder == ((Player*)Killer) && ((Player*)Killer)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
+ {
+ SummonFreedSoul(m_creature->getVictim());
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (PlayerHolder && OkToDie && Die_Timer < diff)
+ {
+ PlayerHolder->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else Die_Timer -= diff;
+
+ return;
+ }
+};
+CreatureAI* GetAI_mob_restless_soul(Creature *_Creature)
+{
+ return new mob_restless_soulAI (_Creature);
+}
+
+/*######
+## mobs_spectral_ghostly_citizen
+######*/
+
+struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
+{
+ mobs_spectral_ghostly_citizenAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ Unit* PlayerHolder;
+ uint32 Die_Timer;
+ bool OkToDie;
+
+ void Reset()
+ {
+ Die_Timer = 5000;
+ OkToDie = false;
+ PlayerHolder = NULL;
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void SummonRestlessSoul(Unit* victim)
+ {
+ int Rand;
+ int RandX;
+ int RandY;
+
+ Rand = rand()%7;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%7;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ DoSpawnCreature(11122, RandX, RandY, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 600000);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(!PlayerHolder && !OkToDie && spell->Id == 17368 && ((Player*)caster)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
+ {
+ PlayerHolder = caster;
+ OkToDie = true;
+ Die_Timer = 5000;
+ }
+ }
+ return;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ {
+ //check quest status
+ if(PlayerHolder == ((Player*)Killer) && ((Player*)Killer)->GetQuestStatus(5282) == QUEST_STATUS_INCOMPLETE)
+ {
+ SummonRestlessSoul(m_creature->getVictim()); //always one
+ if (rand()%100 < 90) SummonRestlessSoul(m_creature->getVictim()); //90% a second
+ if (rand()%100 < 50) SummonRestlessSoul(m_creature->getVictim()); //50% a third
+ if (rand()%100 < 30) SummonRestlessSoul(m_creature->getVictim()); //30% a fourth
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (PlayerHolder && OkToDie && Die_Timer < diff)
+ {
+ PlayerHolder->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else Die_Timer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
+{
+ return new mobs_spectral_ghostly_citizenAI (_Creature);
+}
+bool ReciveEmote_mobs_spectral_ghostly_citizen(Player *player, Creature *_Creature, uint32 emote)
+{
+ _Creature->HandleEmoteCommand(emote);
+
+ if (emote == TEXTEMOTE_DANCE)
+ ((mobs_spectral_ghostly_citizenAI*)_Creature->AI())->EnterEvadeMode();
+
+ return true;
+}
+
+/*######
+## mob_mindless_skeleton
+######*/
+
+CreatureAI* GetAI_mob_mindless_skeleton(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ //dazed
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 13496;
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].First_Cast = 3000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+/*######
+## mob_thuzadin_acolyte
+######*/
+
+CreatureAI* GetAI_mob_thuzadin_acolyte(Creature *_Creature)
+{
+ SimpleAI* ai = new SimpleAI (_Creature);
+
+ //dazed
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 13496;
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].First_Cast = 1000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+
+ ai->EnterEvadeMode();
+
+ return ai;
+}
+
+/*######
+##
+######*/
+
+void AddSC_stratholme()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_freed_soul";
+ newscript->GetAI = GetAI_mob_freed_soul;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_restless_soul";
+ newscript->GetAI = GetAI_mob_restless_soul;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_spectral_ghostly_citizen";
+ newscript->GetAI = GetAI_mobs_spectral_ghostly_citizen;
+ newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_mindless_skeleton";
+ newscript->GetAI = GetAI_mob_mindless_skeleton;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_thuzadin_acolyte";
+ newscript->GetAI = GetAI_mob_thuzadin_acolyte;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
index 48f36d03ebd..fefc0655383 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
@@ -1,180 +1,180 @@
-/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Brutallus
-SD%Complete: 90
-SDComment: Burn gets casted on himself and intro is missing.
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sunwell_plateau.h"
-
-// Yells and Sounds used by boss.
-#define YELL_AGGRO "Ahh! More lambs to the slaughter!"
-#define SOUND_AGGRO 12463
-
-#define YELL_BERSERK "So much for a real challenge... Die!"
-#define SOUND_BERSERK 12470
-
-#define YELL_KILL1 "Perish, insect!"
-#define SOUND_KILL1 12464
-
-#define YELL_KILL2 "You are meat!"
-#define SOUND_KILL2 12465
-
-#define YELL_KILL3 "Too easy!"
-#define SOUND_KILL3 12466
-
-#define YELL_CHARGE "I will crush you!"
-#define SOUND_CHARGE 12460
-
-#define YELL_DEATH "Gah! Well done... Now... this gets... interesting..."
-#define SOUND_DEATH 12471
-
-#define YELL_LOVE1 "Bring the fight to me!"
-#define SOUND_LOVE1 12467
-
-#define YELL_LOVE2 "Another day, another glorious battle!"
-#define SOUND_LOVE2 12468
-
-#define YELL_LOVE3 "I live for this!"
-#define SOUND_LOVE3 12469
-
-// Boss spells.
-#define SPELL_METEOR_SLASH 45150
-#define SPELL_BURN 46394
-#define SPELL_STOMP 45185
-#define SPELL_BERSERK 26662
-
-struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI
-{
- boss_brutallusAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 SlashTimer;
- uint32 BurnTimer;
- uint32 StompTimer;
- uint32 BerserkTimer;
-
- void Reset()
- {
- SlashTimer = 11000;
- StompTimer = 30000;
- BurnTimer = 60000;
- BerserkTimer = 360000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- break;
- case 1:
- DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- break;
- case 2:
- DoYell(YELL_KILL3,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(SlashTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_METEOR_SLASH);
- SlashTimer = 11000;
- }else SlashTimer -= diff;
-
- if(StompTimer < diff)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(YELL_LOVE1,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LOVE1);
- break;
- case 1:
- DoYell(YELL_LOVE2,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LOVE2);
- break;
- case 2:
- DoYell(YELL_LOVE3,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LOVE3);
- break;
- }
-
- Unit *Target = m_creature->getVictim();
- DoCast(Target,SPELL_STOMP);
- if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0);
- StompTimer = 30000;
- }else StompTimer -= diff;
-
- if(BurnTimer < diff)
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- //DoCast(target,SPELL_BURN);
- BurnTimer = 60000;
- }
- else BurnTimer -= diff;
-
- DoMeleeAttackIfReady();
-
- if(BerserkTimer < diff)
- {
- DoYell(YELL_BERSERK,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- DoCast(m_creature,SPELL_BERSERK);
- BerserkTimer = 20000;
- }
- else BerserkTimer -= diff;
- }
-
-};
-
-CreatureAI* GetAI_boss_brutallus(Creature *_Creature)
-{
- return new boss_brutallusAI (_Creature);
-}
-
-void AddSC_boss_brutallus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_brutallus";
- newscript->GetAI = GetAI_boss_brutallus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Brutallus
+SD%Complete: 90
+SDComment: Burn gets casted on himself and intro is missing.
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+
+// Yells and Sounds used by boss.
+#define YELL_AGGRO "Ahh! More lambs to the slaughter!"
+#define SOUND_AGGRO 12463
+
+#define YELL_BERSERK "So much for a real challenge... Die!"
+#define SOUND_BERSERK 12470
+
+#define YELL_KILL1 "Perish, insect!"
+#define SOUND_KILL1 12464
+
+#define YELL_KILL2 "You are meat!"
+#define SOUND_KILL2 12465
+
+#define YELL_KILL3 "Too easy!"
+#define SOUND_KILL3 12466
+
+#define YELL_CHARGE "I will crush you!"
+#define SOUND_CHARGE 12460
+
+#define YELL_DEATH "Gah! Well done... Now... this gets... interesting..."
+#define SOUND_DEATH 12471
+
+#define YELL_LOVE1 "Bring the fight to me!"
+#define SOUND_LOVE1 12467
+
+#define YELL_LOVE2 "Another day, another glorious battle!"
+#define SOUND_LOVE2 12468
+
+#define YELL_LOVE3 "I live for this!"
+#define SOUND_LOVE3 12469
+
+// Boss spells.
+#define SPELL_METEOR_SLASH 45150
+#define SPELL_BURN 46394
+#define SPELL_STOMP 45185
+#define SPELL_BERSERK 26662
+
+struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI
+{
+ boss_brutallusAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 SlashTimer;
+ uint32 BurnTimer;
+ uint32 StompTimer;
+ uint32 BerserkTimer;
+
+ void Reset()
+ {
+ SlashTimer = 11000;
+ StompTimer = 30000;
+ BurnTimer = 60000;
+ BerserkTimer = 360000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ break;
+ case 2:
+ DoYell(YELL_KILL3,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(SlashTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_METEOR_SLASH);
+ SlashTimer = 11000;
+ }else SlashTimer -= diff;
+
+ if(StompTimer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(YELL_LOVE1,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LOVE1);
+ break;
+ case 1:
+ DoYell(YELL_LOVE2,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LOVE2);
+ break;
+ case 2:
+ DoYell(YELL_LOVE3,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LOVE3);
+ break;
+ }
+
+ Unit *Target = m_creature->getVictim();
+ DoCast(Target,SPELL_STOMP);
+ if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0);
+ StompTimer = 30000;
+ }else StompTimer -= diff;
+
+ if(BurnTimer < diff)
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ //DoCast(target,SPELL_BURN);
+ BurnTimer = 60000;
+ }
+ else BurnTimer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ if(BerserkTimer < diff)
+ {
+ DoYell(YELL_BERSERK,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ DoCast(m_creature,SPELL_BERSERK);
+ BerserkTimer = 20000;
+ }
+ else BerserkTimer -= diff;
+ }
+
+};
+
+CreatureAI* GetAI_boss_brutallus(Creature *_Creature)
+{
+ return new boss_brutallusAI (_Creature);
+}
+
+void AddSC_boss_brutallus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_brutallus";
+ newscript->GetAI = GetAI_boss_brutallus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
index 7aa9588178d..afaa014dd80 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
@@ -1,783 +1,783 @@
-/* ScriptData
-SDName: Boss_Eredar_Twins
-SD%Complete: 100
-SDComment:
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sunwell_plateau.h"
-
-//Intro
-#define YELL_INTRO_SAC_1 "Misery..."
-#define YELL_INTRO_ALY_2 "Depravity..."
-#define YELL_INTRO_SAC_3 "Confusion..."
-#define YELL_INTRO_ALY_4 "Hatred..."
-#define YELL_INTRO_SAC_5 "Mistrust..."
-#define YELL_INTRO_ALY_6 "Chaos..."
-#define YELL_INTRO_SAC_7 "These are the hallmarks..."
-#define YELL_INTRO_ALY_8 "These are the pillars..."
-
-// Lady Sacrolash
-#define LADY_SACROLASH 25165
-
-#define SPELL_DARK_TOUCHED 45347
-#define SPELL_SHADOW_BLADES 45248//10 secs
-#define SPELL_DARK_STRIKE 45271
-#define SPELL_SHADOW_NOVA 45329//30-35 secs
-#define SPELL_CONFOUNDING_BLOW 45256//25 secs
-
-#define MOB_SHADOW_IMAGE 25214
-#define SPELL_SHADOW_FURY 45270
-#define SPELL_IMAGE_VISUAL 45263
-
-#define SOUND_INTRO 12484
-#define YELL_SHADOW_NOVA "Shadow to the aid of fire!" //only if Alythess is not dead
-#define SOUND_SHADOW_NOVA 12485
-#define YELL_SISTER_ALYTHESS_DEAD "Alythess! Your fire burns within me!"
-#define SOUND_SISTER_ALYTHESS_DEAD 12488
-#define YELL_SAC_KILL_1 "Shadow engulf."
-#define SOUND_SAC_KILL_1 12486
-#define YELL_SAC_KILL_2 "Ee-nok Kryul!"
-#define SOUND_SAC_KILL_2 12487
-#define SAY_SAC_DEAD "I... fade."
-#define YELL_ENRAGE "Time is a luxury you no longer possess!"
-
-//enrage 6 minutes
-#define SPELL_ENRAGE 46587
-//empower after sister is death
-#define SPELL_EMPOWER 45366
-
-//debuff prevents touched spell for 3 secounds
-#define SPELL_DARK_FLAME 45345
-
-//Grand Warlock Alythess
-// Don't move only spamm spells ...
-#define GRAND_WARLOCK_ALYTHESS 25166
-
-#define SPELL_PYROGENICS 45230//15secs
-#define SPELL_FLAME_TOUCHED 45348
-#define SPELL_CONFLAGRATION 45342//30-35 secs
-#define SPELL_BLAZE 45235//on main target every 3 secs
-#define SPELL_FLAME_SEAR 46771
-#define SPELL_BLAZE_SUMMON 45236 //187366 GO
-#define SPELL_BLAZE_BURN 45246
-
-#define YELL_CANFLAGRATION "Fire to the aid of shadow!" //only if Sacrolash is not dead
-#define SOUND_CANFLAGRATION 12489
-#define YELL_SISTER_SACROLASH_DEAD "Sacrolash!"
-#define SOUND_SISTER_SACROLASH_DEAD 12492
-#define YELL_ALY_KILL_1 "Fire consume."
-#define SOUND_ALY_KILL_1 12490
-#define YELL_ALY_KILL_2 "Ed-ir Halach!"
-#define SOUND_ALY_KILL_2 12491
-#define YELL_ALY_DEAD "De-ek Anur!"
-#define SOUND_ALY_DEAD 12494
-#define YELL_BERSERK "Your luck has run its curse!"
-#define SOUND_BERSERK 12493
-
-
-struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
-{
- boss_sacrolashAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool InCombat;
- bool sisterdeath;
-
- uint32 shadowblades_timer;
- uint32 shadownova_timer;
- uint32 confoundingblow_timer;
- uint32 shadowimage_timer;
-
- uint32 conflagration_timer;
-
-
- uint32 enrage_timer;
-
- void Reset()
- {
- InCombat = false;
- if(pInstance)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
- if (Temp)
- if (Temp->isDead())
- {
- ((Creature*)Temp)->Respawn();
- }else
- {
- if(Temp->getVictim())
- {
- m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
- InCombat = true;
- }
- }
- }
-
- if(!InCombat)
- {
- shadowblades_timer = 10000;
- shadownova_timer = 30000;
- confoundingblow_timer = 25000;
- shadowimage_timer = 20000;
- conflagration_timer = 30000;
- sisterdeath = false;
-
- enrage_timer = 360000;
- }
-
- }
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- if(pInstance)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
- if (Temp && Temp->isAlive() && !(Temp->getVictim()))
- Temp->getThreatManager().addThreat(who,0.0f);
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- if(rand()%4 == 0)
- {
- switch (rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_1);
- DoYell(YELL_SAC_KILL_1 ,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_2);
- DoYell(YELL_SAC_KILL_2 ,LANG_UNIVERSAL,NULL);
- break;
- }
- }
- }
-
- void JustDied(Unit* Killer)
- {
- // only if ALY death
- if (sisterdeath)
- {
- DoYell(SAY_SAC_DEAD ,LANG_UNIVERSAL,NULL);
- }
- else
- {
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
- }
-
- void SpellHitTarget(Unit* target,const SpellEntry* spell)
- {
- switch(spell->Id)
- {
- case SPELL_SHADOW_BLADES:
- case SPELL_SHADOW_NOVA:
- case SPELL_CONFOUNDING_BLOW:
- case SPELL_SHADOW_FURY:
- HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
- break;
- case SPELL_CONFLAGRATION:
- HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
- break;
- }
- }
-
- void HandleTouchedSpells(Unit* target, uint32 TouchedType)
- {
- switch(TouchedType)
- {
- case SPELL_FLAME_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
- {
- if(target->HasAura(SPELL_DARK_TOUCHED,0))
- {
- target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
- target->CastSpell(target,SPELL_DARK_FLAME,true);
- }else
- {
- target->CastSpell(target,SPELL_FLAME_TOUCHED,true);
- }
- }
- break;
- case SPELL_DARK_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
- {
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
- {
- target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
- target->CastSpell(target,SPELL_DARK_FLAME,true);
- }else
- {
- target->CastSpell(target,SPELL_DARK_TOUCHED,true);
- }
- }
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!sisterdeath)
- {
- if (pInstance)
- {
- Unit* Temp = NULL;
- Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
- if (Temp && Temp->isDead())
- {
- DoYell(YELL_SISTER_ALYTHESS_DEAD ,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SISTER_ALYTHESS_DEAD);
- sisterdeath = true;
-
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoCast(m_creature,SPELL_EMPOWER);
- }
- }
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(sisterdeath)
- {
- if (conflagration_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target,SPELL_CONFLAGRATION);
- conflagration_timer = 30000+(rand()%5000);
- }
- }else conflagration_timer -= diff;
- }
- else
- {
- if(shadownova_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target,SPELL_SHADOW_NOVA);
-
- if(!sisterdeath)
- {
- m_creature->MonsterTextEmote("directs Shadow Nova at $N",target->GetGUID(),true);
- DoPlaySoundToSet(m_creature,SOUND_SHADOW_NOVA);
- DoYell(YELL_SHADOW_NOVA,LANG_UNIVERSAL,NULL);
- }
-
- shadownova_timer= 30000+(rand()%5000);
- }
- }else shadownova_timer -=diff;
- }
-
- if(confoundingblow_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target,SPELL_CONFOUNDING_BLOW);
- confoundingblow_timer = 20000 + (rand()%5000);
- }
- }else confoundingblow_timer -=diff;
-
- if(shadowimage_timer < diff)
- {
- Unit* target = NULL;
- Creature* temp = NULL;
- for(int i = 0;i<3;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000);
- temp->AI()->AttackStart(target);
- }
- shadowimage_timer = 20000;
- }else shadowimage_timer -=diff;
-
- if(shadowblades_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature,SPELL_SHADOW_BLADES);
- shadowblades_timer = 10000;
-
- }
- }else shadowblades_timer -=diff;
-
- if (enrage_timer < diff)
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoYell(YELL_ENRAGE ,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ENRAGE);
- enrage_timer = 300000;
- }else enrage_timer -= diff;
-
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED);
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
- }
-};
-
-CreatureAI* GetAI_boss_sacrolash(Creature *_Creature)
-{
- return new boss_sacrolashAI (_Creature);
-};
-
-struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI
-{
- boss_alythessAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- IntroStepCounter = 10;
- }
-
- ScriptedInstance *pInstance;
- bool InCombat;
- bool sisterdeath;
- uint32 IntroStepCounter;
- uint32 IntroYell_Timer;
-
- uint32 conflagration_timer;
- uint32 blaze_timer;
- uint32 pyrogenics_timer;
-
- uint32 shadownova_timer;
- uint32 flamesear_timer;
-
- uint32 enrage_timer;
-
- void Reset()
- {
- InCombat = false;
- if(pInstance)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
- if (Temp)
- if (Temp->isDead())
- {
- ((Creature*)Temp)->Respawn();
- }else
- {
- if(Temp->getVictim())
- {
- m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
- InCombat = true;
- }
- }
- }
-
- if(!InCombat)
- {
- conflagration_timer = 45000;
- blaze_timer = 100;
- pyrogenics_timer = 15000;
- shadownova_timer = 40000;
- sisterdeath = false;
- enrage_timer = 360000;
- flamesear_timer = 15000;
- IntroYell_Timer = 10000;
- }
- }
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- if(pInstance)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
- if (Temp && Temp->isAlive() && !(Temp->getVictim()))
- Temp->getThreatManager().addThreat(who,0.0f);
- }
- }
-
- void AttackStart(Unit *who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack() && who!= m_creature)
- {
- if (!InCombat)
- {
- DoStartAttackNoMovement(who);
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- DoStartAttackNoMovement(who);
- Aggro(who);
- InCombat = true;
- }
- }
- }
- else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30) )
- {
- IntroStepCounter = 0;
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- if(rand()%4 == 0)
- {
- switch (rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_1);
- DoYell(YELL_ALY_KILL_1 ,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_2);
- DoYell(YELL_ALY_KILL_2 ,LANG_UNIVERSAL,NULL);
- break;
- }
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if (sisterdeath)
- {
- DoYell(YELL_ALY_DEAD ,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_ALY_DEAD);
- }
- else
- {
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
- }
-
- void SpellHitTarget(Unit* target,const SpellEntry* spell)
- {
- switch(spell->Id)
- {
-
- case SPELL_BLAZE:
- target->CastSpell(target,SPELL_BLAZE_SUMMON,true);
- case SPELL_CONFLAGRATION:
- case SPELL_FLAME_SEAR:
- HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
- break;
- case SPELL_SHADOW_NOVA:
- HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
- break;
- }
- }
-
- void HandleTouchedSpells(Unit* target, uint32 TouchedType)
- {
- switch(TouchedType)
- {
- case SPELL_FLAME_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
- {
- if(target->HasAura(SPELL_DARK_TOUCHED,0))
- {
- target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
- target->CastSpell(target,SPELL_DARK_FLAME,true);
- }else
- {
- target->CastSpell(target,SPELL_FLAME_TOUCHED,true);
- }
- }
- break;
- case SPELL_DARK_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
- {
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
- {
- target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
- target->CastSpell(target,SPELL_DARK_FLAME,true);
- }else
- {
- target->CastSpell(target,SPELL_DARK_TOUCHED,true);
- }
- }
- break;
- }
- }
-
- uint32 IntroStep(uint32 step)
- {
- Creature* Sacrolash = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
- switch (step)
- {
- case 0: DoPlaySoundToSet(m_creature,SOUND_INTRO); return 0;
- case 1:
- if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL);
- return 1000;
- case 2:
- m_creature->Yell(YELL_INTRO_ALY_2, LANG_UNIVERSAL,NULL);
- return 1000;
- case 3:
- if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL);
- return 2000;
- case 4:
- m_creature->Yell(YELL_INTRO_ALY_4, LANG_UNIVERSAL,NULL);
- return 1000;
- case 5:
- if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL);
- return 2000;
- case 6:
- m_creature->Yell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL);
- return 1000;
- case 7:
- if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL);
- return 3000;
- case 8:
- m_creature->Yell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL);
- return 900000;
- }
- return 10000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(IntroStepCounter < 9)
- {
- if(IntroYell_Timer < diff)
- {
- IntroYell_Timer = IntroStep(IntroStepCounter++);
- }else IntroYell_Timer -= diff;
- }
-
- if(!sisterdeath)
- {
- if (pInstance)
- {
- Unit* Temp = NULL;
- Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
- if (Temp && Temp->isDead())
- {
- DoYell(YELL_SISTER_SACROLASH_DEAD ,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SISTER_SACROLASH_DEAD);
- sisterdeath = true;
-
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoCast(m_creature,SPELL_EMPOWER);
- }
- }
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(sisterdeath)
- {
- if(shadownova_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target,SPELL_SHADOW_NOVA);
- shadownova_timer= 30000+(rand()%5000);
- }
- }else shadownova_timer -=diff;
- }
- else
- {
- if (conflagration_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target,SPELL_CONFLAGRATION);
- conflagration_timer = 30000+(rand()%5000);
-
- if(!sisterdeath)
- {
- m_creature->MonsterTextEmote("directs Conflagration at $N",target->GetGUID(),true);
- DoPlaySoundToSet(m_creature,SOUND_CANFLAGRATION);
- DoYell(YELL_CANFLAGRATION,LANG_UNIVERSAL,NULL);
- }
-
- blaze_timer = 4000;
- }
- }else conflagration_timer -= diff;
- }
-
- if (flamesear_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature,SPELL_FLAME_SEAR);
- flamesear_timer = 15000;
- }
- }else flamesear_timer -=diff;
-
- if (pyrogenics_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature,SPELL_PYROGENICS,true);
- pyrogenics_timer = 15000;
- }
- }else pyrogenics_timer -= diff;
-
- if (blaze_timer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature->getVictim(),SPELL_BLAZE);
- blaze_timer = 3800;
- }
- }else blaze_timer -= diff;
-
- if (enrage_timer < diff)
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoPlaySoundToSet(m_creature,SOUND_BERSERK);
- DoYell(YELL_BERSERK ,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ENRAGE);
- enrage_timer = 300000;
- }else enrage_timer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_alythess(Creature *_Creature)
-{
- return new boss_alythessAI (_Creature);
-};
-
-struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
-{
- mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 shadowfury_timer;
- uint32 kill_timer;
- uint32 darkstrike_timer;
-
- void Reset()
- {
- shadowfury_timer = 5000 + (rand()%15000);
- darkstrike_timer = 3000;
- kill_timer = 15000;
-
- }
-
- void Aggro(Unit *who){}
-
- void SpellHitTarget(Unit* target,const SpellEntry* spell)
- {
- switch(spell->Id)
- {
-
- case SPELL_SHADOW_FURY:
- case SPELL_DARK_STRIKE:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
- {
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
- {
- target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
- target->CastSpell(target,SPELL_DARK_FLAME,true);
- }else
- {
- target->CastSpell(target,SPELL_DARK_TOUCHED,true);
- }
- }
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->HasAura(SPELL_IMAGE_VISUAL,0))
- DoCast(m_creature,SPELL_IMAGE_VISUAL);
-
- if(kill_timer < diff)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- kill_timer = 9999999;
- }else kill_timer -=diff;
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(shadowfury_timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOW_FURY);
- shadowfury_timer = 10000;
- }else shadowfury_timer -=diff;
-
- if(darkstrike_timer < diff)
- {
- if(!m_creature->IsNonMeleeSpellCasted(false))
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- DoCast(m_creature->getVictim(),SPELL_DARK_STRIKE);
- }
- }
- darkstrike_timer = 3000;
- }
- else darkstrike_timer -= diff;
- }
-};
-
-CreatureAI* GetAI_mob_shadow_image(Creature *_Creature)
-{
- return new mob_shadow_imageAI (_Creature);
-};
-
-void AddSC_boss_eredar_twins()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_sacrolash";
- newscript->GetAI = GetAI_boss_sacrolash;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_alythess";
- newscript->GetAI = GetAI_boss_alythess;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_shadow_image";
- newscript->GetAI = GetAI_mob_shadow_image;
- m_scripts[nrscripts++] = newscript;
-}
+/* ScriptData
+SDName: Boss_Eredar_Twins
+SD%Complete: 100
+SDComment:
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+
+//Intro
+#define YELL_INTRO_SAC_1 "Misery..."
+#define YELL_INTRO_ALY_2 "Depravity..."
+#define YELL_INTRO_SAC_3 "Confusion..."
+#define YELL_INTRO_ALY_4 "Hatred..."
+#define YELL_INTRO_SAC_5 "Mistrust..."
+#define YELL_INTRO_ALY_6 "Chaos..."
+#define YELL_INTRO_SAC_7 "These are the hallmarks..."
+#define YELL_INTRO_ALY_8 "These are the pillars..."
+
+// Lady Sacrolash
+#define LADY_SACROLASH 25165
+
+#define SPELL_DARK_TOUCHED 45347
+#define SPELL_SHADOW_BLADES 45248//10 secs
+#define SPELL_DARK_STRIKE 45271
+#define SPELL_SHADOW_NOVA 45329//30-35 secs
+#define SPELL_CONFOUNDING_BLOW 45256//25 secs
+
+#define MOB_SHADOW_IMAGE 25214
+#define SPELL_SHADOW_FURY 45270
+#define SPELL_IMAGE_VISUAL 45263
+
+#define SOUND_INTRO 12484
+#define YELL_SHADOW_NOVA "Shadow to the aid of fire!" //only if Alythess is not dead
+#define SOUND_SHADOW_NOVA 12485
+#define YELL_SISTER_ALYTHESS_DEAD "Alythess! Your fire burns within me!"
+#define SOUND_SISTER_ALYTHESS_DEAD 12488
+#define YELL_SAC_KILL_1 "Shadow engulf."
+#define SOUND_SAC_KILL_1 12486
+#define YELL_SAC_KILL_2 "Ee-nok Kryul!"
+#define SOUND_SAC_KILL_2 12487
+#define SAY_SAC_DEAD "I... fade."
+#define YELL_ENRAGE "Time is a luxury you no longer possess!"
+
+//enrage 6 minutes
+#define SPELL_ENRAGE 46587
+//empower after sister is death
+#define SPELL_EMPOWER 45366
+
+//debuff prevents touched spell for 3 secounds
+#define SPELL_DARK_FLAME 45345
+
+//Grand Warlock Alythess
+// Don't move only spamm spells ...
+#define GRAND_WARLOCK_ALYTHESS 25166
+
+#define SPELL_PYROGENICS 45230//15secs
+#define SPELL_FLAME_TOUCHED 45348
+#define SPELL_CONFLAGRATION 45342//30-35 secs
+#define SPELL_BLAZE 45235//on main target every 3 secs
+#define SPELL_FLAME_SEAR 46771
+#define SPELL_BLAZE_SUMMON 45236 //187366 GO
+#define SPELL_BLAZE_BURN 45246
+
+#define YELL_CANFLAGRATION "Fire to the aid of shadow!" //only if Sacrolash is not dead
+#define SOUND_CANFLAGRATION 12489
+#define YELL_SISTER_SACROLASH_DEAD "Sacrolash!"
+#define SOUND_SISTER_SACROLASH_DEAD 12492
+#define YELL_ALY_KILL_1 "Fire consume."
+#define SOUND_ALY_KILL_1 12490
+#define YELL_ALY_KILL_2 "Ed-ir Halach!"
+#define SOUND_ALY_KILL_2 12491
+#define YELL_ALY_DEAD "De-ek Anur!"
+#define SOUND_ALY_DEAD 12494
+#define YELL_BERSERK "Your luck has run its curse!"
+#define SOUND_BERSERK 12493
+
+
+struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
+{
+ boss_sacrolashAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool InCombat;
+ bool sisterdeath;
+
+ uint32 shadowblades_timer;
+ uint32 shadownova_timer;
+ uint32 confoundingblow_timer;
+ uint32 shadowimage_timer;
+
+ uint32 conflagration_timer;
+
+
+ uint32 enrage_timer;
+
+ void Reset()
+ {
+ InCombat = false;
+ if(pInstance)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ if (Temp)
+ if (Temp->isDead())
+ {
+ ((Creature*)Temp)->Respawn();
+ }else
+ {
+ if(Temp->getVictim())
+ {
+ m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
+ InCombat = true;
+ }
+ }
+ }
+
+ if(!InCombat)
+ {
+ shadowblades_timer = 10000;
+ shadownova_timer = 30000;
+ confoundingblow_timer = 25000;
+ shadowimage_timer = 20000;
+ conflagration_timer = 30000;
+ sisterdeath = false;
+
+ enrage_timer = 360000;
+ }
+
+ }
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ if(pInstance)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ if (Temp && Temp->isAlive() && !(Temp->getVictim()))
+ Temp->getThreatManager().addThreat(who,0.0f);
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(rand()%4 == 0)
+ {
+ switch (rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_1);
+ DoYell(YELL_SAC_KILL_1 ,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_2);
+ DoYell(YELL_SAC_KILL_2 ,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ // only if ALY death
+ if (sisterdeath)
+ {
+ DoYell(SAY_SAC_DEAD ,LANG_UNIVERSAL,NULL);
+ }
+ else
+ {
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
+ }
+
+ void SpellHitTarget(Unit* target,const SpellEntry* spell)
+ {
+ switch(spell->Id)
+ {
+ case SPELL_SHADOW_BLADES:
+ case SPELL_SHADOW_NOVA:
+ case SPELL_CONFOUNDING_BLOW:
+ case SPELL_SHADOW_FURY:
+ HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
+ break;
+ case SPELL_CONFLAGRATION:
+ HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
+ break;
+ }
+ }
+
+ void HandleTouchedSpells(Unit* target, uint32 TouchedType)
+ {
+ switch(TouchedType)
+ {
+ case SPELL_FLAME_TOUCHED:
+ if(!target->HasAura(SPELL_DARK_FLAME,0))
+ {
+ if(target->HasAura(SPELL_DARK_TOUCHED,0))
+ {
+ target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
+ target->CastSpell(target,SPELL_DARK_FLAME,true);
+ }else
+ {
+ target->CastSpell(target,SPELL_FLAME_TOUCHED,true);
+ }
+ }
+ break;
+ case SPELL_DARK_TOUCHED:
+ if(!target->HasAura(SPELL_DARK_FLAME,0))
+ {
+ if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ {
+ target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
+ target->CastSpell(target,SPELL_DARK_FLAME,true);
+ }else
+ {
+ target->CastSpell(target,SPELL_DARK_TOUCHED,true);
+ }
+ }
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!sisterdeath)
+ {
+ if (pInstance)
+ {
+ Unit* Temp = NULL;
+ Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
+ if (Temp && Temp->isDead())
+ {
+ DoYell(YELL_SISTER_ALYTHESS_DEAD ,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SISTER_ALYTHESS_DEAD);
+ sisterdeath = true;
+
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoCast(m_creature,SPELL_EMPOWER);
+ }
+ }
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(sisterdeath)
+ {
+ if (conflagration_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target,SPELL_CONFLAGRATION);
+ conflagration_timer = 30000+(rand()%5000);
+ }
+ }else conflagration_timer -= diff;
+ }
+ else
+ {
+ if(shadownova_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target,SPELL_SHADOW_NOVA);
+
+ if(!sisterdeath)
+ {
+ m_creature->MonsterTextEmote("directs Shadow Nova at $N",target->GetGUID(),true);
+ DoPlaySoundToSet(m_creature,SOUND_SHADOW_NOVA);
+ DoYell(YELL_SHADOW_NOVA,LANG_UNIVERSAL,NULL);
+ }
+
+ shadownova_timer= 30000+(rand()%5000);
+ }
+ }else shadownova_timer -=diff;
+ }
+
+ if(confoundingblow_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target,SPELL_CONFOUNDING_BLOW);
+ confoundingblow_timer = 20000 + (rand()%5000);
+ }
+ }else confoundingblow_timer -=diff;
+
+ if(shadowimage_timer < diff)
+ {
+ Unit* target = NULL;
+ Creature* temp = NULL;
+ for(int i = 0;i<3;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000);
+ temp->AI()->AttackStart(target);
+ }
+ shadowimage_timer = 20000;
+ }else shadowimage_timer -=diff;
+
+ if(shadowblades_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature,SPELL_SHADOW_BLADES);
+ shadowblades_timer = 10000;
+
+ }
+ }else shadowblades_timer -=diff;
+
+ if (enrage_timer < diff)
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoYell(YELL_ENRAGE ,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ENRAGE);
+ enrage_timer = 300000;
+ }else enrage_timer -= diff;
+
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED);
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_sacrolash(Creature *_Creature)
+{
+ return new boss_sacrolashAI (_Creature);
+};
+
+struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI
+{
+ boss_alythessAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ IntroStepCounter = 10;
+ }
+
+ ScriptedInstance *pInstance;
+ bool InCombat;
+ bool sisterdeath;
+ uint32 IntroStepCounter;
+ uint32 IntroYell_Timer;
+
+ uint32 conflagration_timer;
+ uint32 blaze_timer;
+ uint32 pyrogenics_timer;
+
+ uint32 shadownova_timer;
+ uint32 flamesear_timer;
+
+ uint32 enrage_timer;
+
+ void Reset()
+ {
+ InCombat = false;
+ if(pInstance)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ if (Temp)
+ if (Temp->isDead())
+ {
+ ((Creature*)Temp)->Respawn();
+ }else
+ {
+ if(Temp->getVictim())
+ {
+ m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
+ InCombat = true;
+ }
+ }
+ }
+
+ if(!InCombat)
+ {
+ conflagration_timer = 45000;
+ blaze_timer = 100;
+ pyrogenics_timer = 15000;
+ shadownova_timer = 40000;
+ sisterdeath = false;
+ enrage_timer = 360000;
+ flamesear_timer = 15000;
+ IntroYell_Timer = 10000;
+ }
+ }
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ if(pInstance)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ if (Temp && Temp->isAlive() && !(Temp->getVictim()))
+ Temp->getThreatManager().addThreat(who,0.0f);
+ }
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack() && who!= m_creature)
+ {
+ if (!InCombat)
+ {
+ DoStartAttackNoMovement(who);
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ DoStartAttackNoMovement(who);
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+ else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30) )
+ {
+ IntroStepCounter = 0;
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(rand()%4 == 0)
+ {
+ switch (rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_1);
+ DoYell(YELL_ALY_KILL_1 ,LANG_UNIVERSAL,NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_2);
+ DoYell(YELL_ALY_KILL_2 ,LANG_UNIVERSAL,NULL);
+ break;
+ }
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (sisterdeath)
+ {
+ DoYell(YELL_ALY_DEAD ,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ALY_DEAD);
+ }
+ else
+ {
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
+ }
+
+ void SpellHitTarget(Unit* target,const SpellEntry* spell)
+ {
+ switch(spell->Id)
+ {
+
+ case SPELL_BLAZE:
+ target->CastSpell(target,SPELL_BLAZE_SUMMON,true);
+ case SPELL_CONFLAGRATION:
+ case SPELL_FLAME_SEAR:
+ HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
+ break;
+ case SPELL_SHADOW_NOVA:
+ HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
+ break;
+ }
+ }
+
+ void HandleTouchedSpells(Unit* target, uint32 TouchedType)
+ {
+ switch(TouchedType)
+ {
+ case SPELL_FLAME_TOUCHED:
+ if(!target->HasAura(SPELL_DARK_FLAME,0))
+ {
+ if(target->HasAura(SPELL_DARK_TOUCHED,0))
+ {
+ target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
+ target->CastSpell(target,SPELL_DARK_FLAME,true);
+ }else
+ {
+ target->CastSpell(target,SPELL_FLAME_TOUCHED,true);
+ }
+ }
+ break;
+ case SPELL_DARK_TOUCHED:
+ if(!target->HasAura(SPELL_DARK_FLAME,0))
+ {
+ if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ {
+ target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
+ target->CastSpell(target,SPELL_DARK_FLAME,true);
+ }else
+ {
+ target->CastSpell(target,SPELL_DARK_TOUCHED,true);
+ }
+ }
+ break;
+ }
+ }
+
+ uint32 IntroStep(uint32 step)
+ {
+ Creature* Sacrolash = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ switch (step)
+ {
+ case 0: DoPlaySoundToSet(m_creature,SOUND_INTRO); return 0;
+ case 1:
+ if(Sacrolash)
+ Sacrolash->Yell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL);
+ return 1000;
+ case 2:
+ m_creature->Yell(YELL_INTRO_ALY_2, LANG_UNIVERSAL,NULL);
+ return 1000;
+ case 3:
+ if(Sacrolash)
+ Sacrolash->Yell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL);
+ return 2000;
+ case 4:
+ m_creature->Yell(YELL_INTRO_ALY_4, LANG_UNIVERSAL,NULL);
+ return 1000;
+ case 5:
+ if(Sacrolash)
+ Sacrolash->Yell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL);
+ return 2000;
+ case 6:
+ m_creature->Yell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL);
+ return 1000;
+ case 7:
+ if(Sacrolash)
+ Sacrolash->Yell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL);
+ return 3000;
+ case 8:
+ m_creature->Yell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL);
+ return 900000;
+ }
+ return 10000;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(IntroStepCounter < 9)
+ {
+ if(IntroYell_Timer < diff)
+ {
+ IntroYell_Timer = IntroStep(IntroStepCounter++);
+ }else IntroYell_Timer -= diff;
+ }
+
+ if(!sisterdeath)
+ {
+ if (pInstance)
+ {
+ Unit* Temp = NULL;
+ Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
+ if (Temp && Temp->isDead())
+ {
+ DoYell(YELL_SISTER_SACROLASH_DEAD ,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SISTER_SACROLASH_DEAD);
+ sisterdeath = true;
+
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoCast(m_creature,SPELL_EMPOWER);
+ }
+ }
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(sisterdeath)
+ {
+ if(shadownova_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target,SPELL_SHADOW_NOVA);
+ shadownova_timer= 30000+(rand()%5000);
+ }
+ }else shadownova_timer -=diff;
+ }
+ else
+ {
+ if (conflagration_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(target,SPELL_CONFLAGRATION);
+ conflagration_timer = 30000+(rand()%5000);
+
+ if(!sisterdeath)
+ {
+ m_creature->MonsterTextEmote("directs Conflagration at $N",target->GetGUID(),true);
+ DoPlaySoundToSet(m_creature,SOUND_CANFLAGRATION);
+ DoYell(YELL_CANFLAGRATION,LANG_UNIVERSAL,NULL);
+ }
+
+ blaze_timer = 4000;
+ }
+ }else conflagration_timer -= diff;
+ }
+
+ if (flamesear_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature,SPELL_FLAME_SEAR);
+ flamesear_timer = 15000;
+ }
+ }else flamesear_timer -=diff;
+
+ if (pyrogenics_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature,SPELL_PYROGENICS,true);
+ pyrogenics_timer = 15000;
+ }
+ }else pyrogenics_timer -= diff;
+
+ if (blaze_timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLAZE);
+ blaze_timer = 3800;
+ }
+ }else blaze_timer -= diff;
+
+ if (enrage_timer < diff)
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ DoPlaySoundToSet(m_creature,SOUND_BERSERK);
+ DoYell(YELL_BERSERK ,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ENRAGE);
+ enrage_timer = 300000;
+ }else enrage_timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_alythess(Creature *_Creature)
+{
+ return new boss_alythessAI (_Creature);
+};
+
+struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
+{
+ mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 shadowfury_timer;
+ uint32 kill_timer;
+ uint32 darkstrike_timer;
+
+ void Reset()
+ {
+ shadowfury_timer = 5000 + (rand()%15000);
+ darkstrike_timer = 3000;
+ kill_timer = 15000;
+
+ }
+
+ void Aggro(Unit *who){}
+
+ void SpellHitTarget(Unit* target,const SpellEntry* spell)
+ {
+ switch(spell->Id)
+ {
+
+ case SPELL_SHADOW_FURY:
+ case SPELL_DARK_STRIKE:
+ if(!target->HasAura(SPELL_DARK_FLAME,0))
+ {
+ if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ {
+ target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
+ target->CastSpell(target,SPELL_DARK_FLAME,true);
+ }else
+ {
+ target->CastSpell(target,SPELL_DARK_TOUCHED,true);
+ }
+ }
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->HasAura(SPELL_IMAGE_VISUAL,0))
+ DoCast(m_creature,SPELL_IMAGE_VISUAL);
+
+ if(kill_timer < diff)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ kill_timer = 9999999;
+ }else kill_timer -=diff;
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(shadowfury_timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOW_FURY);
+ shadowfury_timer = 10000;
+ }else shadowfury_timer -=diff;
+
+ if(darkstrike_timer < diff)
+ {
+ if(!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ DoCast(m_creature->getVictim(),SPELL_DARK_STRIKE);
+ }
+ }
+ darkstrike_timer = 3000;
+ }
+ else darkstrike_timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_shadow_image(Creature *_Creature)
+{
+ return new mob_shadow_imageAI (_Creature);
+};
+
+void AddSC_boss_eredar_twins()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_sacrolash";
+ newscript->GetAI = GetAI_boss_sacrolash;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_alythess";
+ newscript->GetAI = GetAI_boss_alythess;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shadow_image";
+ newscript->GetAI = GetAI_mob_shadow_image;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
index 8745f5bcc5b..018507dc41d 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
@@ -1,614 +1,614 @@
-/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Felmyst
-SD%Complete: 0
-SDComment:
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sunwell_plateau.h"
-#include "Player.h"
-
-// AURA
-#define AURA_SUNWELL_RADIANCE 45769
-#define AURA_NOXIOUS_FUMES 47002
-// LAND PHASE SPELL
-#define SPELL_CLEAVE 19983
-#define SPELL_CORROSION 45866
-#define SPELL_GAS_NOVA 45855
-#define SPELL_ENCAPSULATE_CHANNEL 45661
-#define SPELL_ENCAPSULATE_EFFECT 45665
-#define SPELL_ENCAPSULATE_AOE 45662
-// FLIGHT PHASE SPELL
-#define SPELL_VAPOR_SELECT 45391 // fel to player, force cast 45392, 50000y selete target
-#define SPELL_VAPOR_SUMMON 45392 // player summon vapor, radius around caster, 5y,
-#define SPELL_VAPOR_FORCE 45388 // vapor to fel, force cast 45389
-#define SPELL_VAPOR_CHANNEL 45389 // fel to vapor, green beam channel
-#define SPELL_VAPOR_TRIGGER 45411 // linked to 45389, vapor to self, trigger 45410 and 46931
-#define SPELL_VAPOR_DAMAGE 46931 // vapor damage, 4000
-#define SPELL_TRAIL_SUMMON 45410 // vapor summon trail
-#define SPELL_TRAIL_TRIGGER 45399 // trail to self, trigger 45402
-#define SPELL_TRAIL_DAMAGE 45402 // trail damage, 2000 + 2000 dot
-#define SPELL_DEAD_SUMMON 45400 // summon blazing dead, 5min
-#define SPELL_DEAD_PASSIVE 45415
-#define SPELL_FOG_BREATH 45495 // fel to self, speed burst
-#define SPELL_FOG_TRIGGER 45582 // fog to self, trigger 45782
-#define SPELL_FOG_FORCE 45782 // fog to player, force cast 45714
-#define SPELL_FOG_INFORM 45714 // player let fel cast 45717, script effect
-#define SPELL_FOG_CHARM 45717 // fel to player
-#define SPELL_FOG_CHARM2 45726 // link to 45717
-
-#define SPELL_TRANSFORM_TRIGGER 44885 // madrigosa to self, trigger 46350
-#define SPELL_TRANSFORM_VISUAL 46350 //46411stun?
-#define SPELL_TRANSFORM_FELMYST 45068 // become fel
-#define SPELL_FELMYST_SUMMON 45069
-// OTHER
-#define SPELL_BERSERK 45078
-#define SPELL_CLOUD_VISUAL 45212
-#define SPELL_CLOUD_SUMMON 45884
-
-//Creatures
-#define MOB_FELMYST 25038
-#define MOB_BRUTALLUS
-#define MOB_KALECGOS
-#define MOB_DEAD 25268
-#define MOB_MADRIGOSA 25160
-#define MOB_FELMYST_VISUAL 25041
-#define MOB_FLIGHT_LEFT 25357
-#define MOB_FLIGHT_RIGHT 25358
-#define MOB_DEATH_CLOUD 25703
-#define MOB_VAPOR 25265
-#define MOB_VAPOR_TRAIL 25267
-
-//Yells and Sounds
-#define YELL_BIRTH "Glory to Kil'jaeden! Death to all who oppose!"
-#define SOUND_BIRTH 12477
-#define YELL_KILL1 "I kill for the master!"
-#define SOUND_KILL1 12480
-#define YELL_KILL2 "The end has come!"
-#define SOUND_KILL2 12481
-#define YELL_BREATH "Choke on your final breath!"
-#define SOUND_BREATH 12478
-#define YELL_TAKEOFF "I am stronger than ever before!"
-#define SOUND_TAKEOFF 12479
-#define YELL_BERSERK "No more hesitation! Your fates are written!"
-#define SOUND_BERSERK 12482
-#define YELL_DEATH "Kil'jaeden... will... prevail..."
-#define SOUND_DEATH 12483
-
-#define YELL_KALECGOS "Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over."
-
-enum PhaseFelmyst
-{
- PHASE_NULL = 0,
- PHASE_GROUND = 1,
- PHASE_FLIGHT = 2,
-};
-
-enum EventFelmyst
-{
- EVENT_NULL = 0,
- EVENT_BERSERK = 1,
-
- EVENT_CLEAVE = 2,
- EVENT_CORROSION = 3,
- EVENT_GAS_NOVA = 4,
- EVENT_ENCAPSULATE = 5,
- EVENT_FLIGHT = 6,
-
- EVENT_FLIGHT_SEQUENCE = 2,
- EVENT_SUMMON_DEAD = 3,
- EVENT_SUMMON_FOG = 4
-};
-
-static EventFelmyst MaxTimer[]=
-{
- EVENT_NULL,
- EVENT_FLIGHT,
- EVENT_SUMMON_FOG,
-};
-
-struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
-{
- boss_felmystAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
-
- // wait for core patch be accepted
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ENCAPSULATE_EFFECT);
- if(TempSpell->SpellIconID == 2294)
- TempSpell->SpellIconID = 2295;
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_VAPOR_TRIGGER);
- if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0)
- TempSpell->Attributes |= SPELL_ATTR_PASSIVE;
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_FOG_CHARM2);
- if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0)
- TempSpell->Attributes |= SPELL_ATTR_PASSIVE;
- }
-
- PhaseFelmyst Phase;
- EventFelmyst Event;
- uint32 Timer[EVENT_FLIGHT + 1];
-
- uint32 FlightCount;
- uint32 BreathCount;
-
- float BreathX, BreathY;
-
- void Reset()
- {
- Phase = PHASE_NULL;
- Event = EVENT_NULL;
- Timer[EVENT_BERSERK] = 600000;
- FlightCount = 0;
-
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
-
- DespawnSummons(MOB_VAPOR_TRAIL);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true);
- m_creature->CastSpell(m_creature, AURA_NOXIOUS_FUMES, true);
- EnterPhase(PHASE_GROUND);
- }
-
- void AttackStart(Unit *who)
- {
- if(Phase != PHASE_FLIGHT)
- ScriptedAI::AttackStart(who);
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if(Phase != PHASE_FLIGHT)
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- break;
- case 1:
- DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- // workaround for linked aura
- /*if(spell->Id == SPELL_VAPOR_FORCE)
- {
- caster->CastSpell(caster, SPELL_VAPOR_TRIGGER, true);
- }*/
- // workaround for mind control
- if(spell->Id == SPELL_FOG_INFORM)
- {
- float x, y, z;
- caster->GetPosition(x, y, z);
- Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(summon)
- {
- 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);
- }
- }
-
- void JustSummoned(Creature *summon)
- {
- if(summon->GetEntry() == MOB_DEAD)
- {
- summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- DoZoneInCombat(summon);
- summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true);
- }
- }
-
- void MovementInform(uint32, uint32)
- {
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- }
-
- void DamageTaken(Unit*, uint32 &damage)
- {
- if(Phase != PHASE_GROUND && damage >= m_creature->GetHealth())
- damage = 0;
- }
-
- void EnterPhase(PhaseFelmyst NextPhase)
- {
- switch(NextPhase)
- {
- case PHASE_GROUND:
- Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000;
- Timer[EVENT_CORROSION] = 10000 + rand()%10 * 1000;
- Timer[EVENT_GAS_NOVA] = 15000 + rand()%5 * 1000;
- Timer[EVENT_ENCAPSULATE] = 20000 + rand()%5 * 1000;
- Timer[EVENT_FLIGHT] = 60000;
- break;
- case PHASE_FLIGHT:
- Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
- Timer[EVENT_SUMMON_DEAD] = 0;
- Timer[EVENT_SUMMON_FOG] = 0;
- FlightCount = 0;
- BreathCount = 0;
- break;
- default:
- break;
- }
- Phase = NextPhase;
- }
-
- void HandleFlightSequence()
- {
- switch(FlightCount)
- {
- case 0:
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- DoYell(YELL_TAKEOFF, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 1:
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 2:
- if(Player* target = SelectRandomPlayer(50))
- {
- Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
- if(Vapor)
- {
- Vapor->AI()->AttackStart(target);
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
- Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
- }
- }else EnterEvadeMode();
- Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
- break;
- case 3:
- DespawnSummons(MOB_VAPOR_TRAIL);
- //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support
- if(Player* target = SelectRandomPlayer(50))
- {
- //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
- Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
- if(Vapor)
- {
- Vapor->AI()->AttackStart(target);
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
- Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
- }
- }else EnterEvadeMode();
- Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
- break;
- case 4:
- DespawnSummons(MOB_VAPOR_TRAIL);
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- break;
- case 5:
- if(Player* target = SelectRandomPlayer(80))
- {
- BreathX = target->GetPositionX();
- BreathY = target->GetPositionY();
- float x, y, z;
- target->GetContactPoint(m_creature, x, y, z, 40);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- }else EnterEvadeMode();
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 6:
- m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY));
- m_creature->StopMoving();
- DoTextEmote("takes a deep breath.", NULL);
- Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
- break;
- case 7:
- m_creature->CastSpell(m_creature, SPELL_FOG_BREATH, true);
- {
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- x = 2 * BreathX - x;
- y = 2 * BreathY - y;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- }
- Timer[EVENT_SUMMON_FOG] = 1;
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 8:
- m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
- BreathCount++;
- Timer[EVENT_SUMMON_FOG] = 0;
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- if(BreathCount < 3) FlightCount = 4;
- break;
- case 9:
- if(Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
- {
- float x, y, z;
- target->GetContactPoint(m_creature, x, y, z);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- }else EnterEvadeMode();
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 10:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->StopMoving();
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- EnterPhase(PHASE_GROUND);
- m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
- break;
- default:
- break;
- }
- FlightCount++;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- {
- if(Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode())
- EnterEvadeMode();
- return;
- }
-
- Event = EVENT_NULL;
- for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
- {
- if(Timer[i])
- if(Timer[i] <= diff)
- {
- if(!Event)
- Event = (EventFelmyst)i;
- }else Timer[i] -= diff;
- }
-
- if(m_creature->IsNonMeleeSpellCasted(false))
- return;
-
- if(Phase == PHASE_GROUND)
- {
- switch(Event)
- {
- case EVENT_BERSERK:
- DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- Timer[EVENT_BERSERK] = 0;
- break;
- case EVENT_CLEAVE:
- m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, false);
- Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000;
- break;
- case EVENT_CORROSION:
- m_creature->CastSpell(m_creature->getVictim(), SPELL_CORROSION, false);
- Timer[EVENT_CORROSION] = 20000 + rand()%10 * 1000;
- break;
- case EVENT_GAS_NOVA:
- m_creature->CastSpell(m_creature, SPELL_GAS_NOVA, false);
- Timer[EVENT_GAS_NOVA] = 20000 + rand()%5 * 1000;
- break;
- case EVENT_ENCAPSULATE:
- if(Unit* target = SelectRandomPlayer(50))
- {
- m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false);
- target->CastSpell(target, SPELL_ENCAPSULATE_EFFECT, true);// linked aura, need core patch to remove this hack
- Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000;
- }break;
- case EVENT_FLIGHT:
- EnterPhase(PHASE_FLIGHT);
- break;
- default:
- DoMeleeAttackIfReady();
- break;
- }
- }
-
- if(Phase == PHASE_FLIGHT)
- {
- switch(Event)
- {
- case EVENT_BERSERK:
- DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- Timer[EVENT_BERSERK] = 0;
- break;
- case EVENT_FLIGHT_SEQUENCE:
- HandleFlightSequence();
- break;
- 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))
- {
- Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER);
- Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true);
- }
- }
- Timer[EVENT_SUMMON_FOG] = 1000;
- break;
- default:
- break;
- }
- }
- }
-
- void DespawnSummons(uint32 entry)
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
-
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
- {
- if(entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT)
- {
- float x, y, z;
- (*i)->GetPosition(x, y, z);
- m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- }
- (*i)->SetVisibility(VISIBILITY_OFF);
- (*i)->setDeathState(JUST_DIED);
- if((*i)->getDeathState() == CORPSE)
- (*i)->RemoveCorpse();
- }
- }
-
- Player* SelectRandomPlayer(float range = 0.0f)
- {
- Map *map = m_creature->GetMap();
- if (!map->IsDungeon()) return NULL;
-
- InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
- InstanceMap::PlayerList::iterator i;
- while(PlayerList.size())
- {
- i = PlayerList.begin();
- advance(i, rand()%PlayerList.size());
- if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
- && (*i)->isTargetableForAttack())
- return *i;
- else
- PlayerList.erase(i);
- }
- return NULL;
- }
-};
-
-struct TRINITY_DLL_DECL 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);
- }
- void Reset() {}
- void Aggro(Unit* who)
- {
- DoZoneInCombat();
- //m_creature->CastSpell(m_creature, SPELL_VAPOR_FORCE, true); core bug
- }
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim())
- AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- }
-};
-
-struct TRINITY_DLL_DECL mob_felmyst_trailAI : public ScriptedAI
-{
- mob_felmyst_trailAI(Creature *c) : ScriptedAI(c)
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->CastSpell(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
- }
- void Reset() {}
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-};
-
-CreatureAI* GetAI_boss_felmyst(Creature *_Creature)
-{
- return new boss_felmystAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_felmyst_vapor(Creature *_Creature)
-{
- return new mob_felmyst_vaporAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_felmyst_trail(Creature *_Creature)
-{
- return new mob_felmyst_trailAI(_Creature);
-}
-
-void AddSC_boss_felmyst()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_felmyst";
- newscript->GetAI = GetAI_boss_felmyst;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_felmyst_vapor";
- newscript->GetAI = GetAI_mob_felmyst_vapor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_felmyst_trail";
- newscript->GetAI = GetAI_mob_felmyst_trail;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Felmyst
+SD%Complete: 0
+SDComment:
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+#include "Player.h"
+
+// AURA
+#define AURA_SUNWELL_RADIANCE 45769
+#define AURA_NOXIOUS_FUMES 47002
+// LAND PHASE SPELL
+#define SPELL_CLEAVE 19983
+#define SPELL_CORROSION 45866
+#define SPELL_GAS_NOVA 45855
+#define SPELL_ENCAPSULATE_CHANNEL 45661
+#define SPELL_ENCAPSULATE_EFFECT 45665
+#define SPELL_ENCAPSULATE_AOE 45662
+// FLIGHT PHASE SPELL
+#define SPELL_VAPOR_SELECT 45391 // fel to player, force cast 45392, 50000y selete target
+#define SPELL_VAPOR_SUMMON 45392 // player summon vapor, radius around caster, 5y,
+#define SPELL_VAPOR_FORCE 45388 // vapor to fel, force cast 45389
+#define SPELL_VAPOR_CHANNEL 45389 // fel to vapor, green beam channel
+#define SPELL_VAPOR_TRIGGER 45411 // linked to 45389, vapor to self, trigger 45410 and 46931
+#define SPELL_VAPOR_DAMAGE 46931 // vapor damage, 4000
+#define SPELL_TRAIL_SUMMON 45410 // vapor summon trail
+#define SPELL_TRAIL_TRIGGER 45399 // trail to self, trigger 45402
+#define SPELL_TRAIL_DAMAGE 45402 // trail damage, 2000 + 2000 dot
+#define SPELL_DEAD_SUMMON 45400 // summon blazing dead, 5min
+#define SPELL_DEAD_PASSIVE 45415
+#define SPELL_FOG_BREATH 45495 // fel to self, speed burst
+#define SPELL_FOG_TRIGGER 45582 // fog to self, trigger 45782
+#define SPELL_FOG_FORCE 45782 // fog to player, force cast 45714
+#define SPELL_FOG_INFORM 45714 // player let fel cast 45717, script effect
+#define SPELL_FOG_CHARM 45717 // fel to player
+#define SPELL_FOG_CHARM2 45726 // link to 45717
+
+#define SPELL_TRANSFORM_TRIGGER 44885 // madrigosa to self, trigger 46350
+#define SPELL_TRANSFORM_VISUAL 46350 //46411stun?
+#define SPELL_TRANSFORM_FELMYST 45068 // become fel
+#define SPELL_FELMYST_SUMMON 45069
+// OTHER
+#define SPELL_BERSERK 45078
+#define SPELL_CLOUD_VISUAL 45212
+#define SPELL_CLOUD_SUMMON 45884
+
+//Creatures
+#define MOB_FELMYST 25038
+#define MOB_BRUTALLUS
+#define MOB_KALECGOS
+#define MOB_DEAD 25268
+#define MOB_MADRIGOSA 25160
+#define MOB_FELMYST_VISUAL 25041
+#define MOB_FLIGHT_LEFT 25357
+#define MOB_FLIGHT_RIGHT 25358
+#define MOB_DEATH_CLOUD 25703
+#define MOB_VAPOR 25265
+#define MOB_VAPOR_TRAIL 25267
+
+//Yells and Sounds
+#define YELL_BIRTH "Glory to Kil'jaeden! Death to all who oppose!"
+#define SOUND_BIRTH 12477
+#define YELL_KILL1 "I kill for the master!"
+#define SOUND_KILL1 12480
+#define YELL_KILL2 "The end has come!"
+#define SOUND_KILL2 12481
+#define YELL_BREATH "Choke on your final breath!"
+#define SOUND_BREATH 12478
+#define YELL_TAKEOFF "I am stronger than ever before!"
+#define SOUND_TAKEOFF 12479
+#define YELL_BERSERK "No more hesitation! Your fates are written!"
+#define SOUND_BERSERK 12482
+#define YELL_DEATH "Kil'jaeden... will... prevail..."
+#define SOUND_DEATH 12483
+
+#define YELL_KALECGOS "Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over."
+
+enum PhaseFelmyst
+{
+ PHASE_NULL = 0,
+ PHASE_GROUND = 1,
+ PHASE_FLIGHT = 2,
+};
+
+enum EventFelmyst
+{
+ EVENT_NULL = 0,
+ EVENT_BERSERK = 1,
+
+ EVENT_CLEAVE = 2,
+ EVENT_CORROSION = 3,
+ EVENT_GAS_NOVA = 4,
+ EVENT_ENCAPSULATE = 5,
+ EVENT_FLIGHT = 6,
+
+ EVENT_FLIGHT_SEQUENCE = 2,
+ EVENT_SUMMON_DEAD = 3,
+ EVENT_SUMMON_FOG = 4
+};
+
+static EventFelmyst MaxTimer[]=
+{
+ EVENT_NULL,
+ EVENT_FLIGHT,
+ EVENT_SUMMON_FOG,
+};
+
+struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
+{
+ boss_felmystAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+
+ // wait for core patch be accepted
+ SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ENCAPSULATE_EFFECT);
+ if(TempSpell->SpellIconID == 2294)
+ TempSpell->SpellIconID = 2295;
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_VAPOR_TRIGGER);
+ if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0)
+ TempSpell->Attributes |= SPELL_ATTR_PASSIVE;
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_FOG_CHARM2);
+ if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0)
+ TempSpell->Attributes |= SPELL_ATTR_PASSIVE;
+ }
+
+ PhaseFelmyst Phase;
+ EventFelmyst Event;
+ uint32 Timer[EVENT_FLIGHT + 1];
+
+ uint32 FlightCount;
+ uint32 BreathCount;
+
+ float BreathX, BreathY;
+
+ void Reset()
+ {
+ Phase = PHASE_NULL;
+ Event = EVENT_NULL;
+ Timer[EVENT_BERSERK] = 600000;
+ FlightCount = 0;
+
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+
+ DespawnSummons(MOB_VAPOR_TRAIL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true);
+ m_creature->CastSpell(m_creature, AURA_NOXIOUS_FUMES, true);
+ EnterPhase(PHASE_GROUND);
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(Phase != PHASE_FLIGHT)
+ ScriptedAI::AttackStart(who);
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(Phase != PHASE_FLIGHT)
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ // workaround for linked aura
+ /*if(spell->Id == SPELL_VAPOR_FORCE)
+ {
+ caster->CastSpell(caster, SPELL_VAPOR_TRIGGER, true);
+ }*/
+ // workaround for mind control
+ if(spell->Id == SPELL_FOG_INFORM)
+ {
+ float x, y, z;
+ caster->GetPosition(x, y, z);
+ Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if(summon)
+ {
+ 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);
+ }
+ }
+
+ void JustSummoned(Creature *summon)
+ {
+ if(summon->GetEntry() == MOB_DEAD)
+ {
+ summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ DoZoneInCombat(summon);
+ summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true);
+ }
+ }
+
+ void MovementInform(uint32, uint32)
+ {
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ }
+
+ void DamageTaken(Unit*, uint32 &damage)
+ {
+ if(Phase != PHASE_GROUND && damage >= m_creature->GetHealth())
+ damage = 0;
+ }
+
+ void EnterPhase(PhaseFelmyst NextPhase)
+ {
+ switch(NextPhase)
+ {
+ case PHASE_GROUND:
+ Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000;
+ Timer[EVENT_CORROSION] = 10000 + rand()%10 * 1000;
+ Timer[EVENT_GAS_NOVA] = 15000 + rand()%5 * 1000;
+ Timer[EVENT_ENCAPSULATE] = 20000 + rand()%5 * 1000;
+ Timer[EVENT_FLIGHT] = 60000;
+ break;
+ case PHASE_FLIGHT:
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
+ Timer[EVENT_SUMMON_DEAD] = 0;
+ Timer[EVENT_SUMMON_FOG] = 0;
+ FlightCount = 0;
+ BreathCount = 0;
+ break;
+ default:
+ break;
+ }
+ Phase = NextPhase;
+ }
+
+ void HandleFlightSequence()
+ {
+ switch(FlightCount)
+ {
+ case 0:
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ m_creature->StopMoving();
+ DoYell(YELL_TAKEOFF, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 1:
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 2:
+ if(Player* target = SelectRandomPlayer(50))
+ {
+ Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
+ if(Vapor)
+ {
+ Vapor->AI()->AttackStart(target);
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
+ Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
+ }
+ }else EnterEvadeMode();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
+ break;
+ case 3:
+ DespawnSummons(MOB_VAPOR_TRAIL);
+ //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support
+ if(Player* target = SelectRandomPlayer(50))
+ {
+ //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
+ Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
+ if(Vapor)
+ {
+ Vapor->AI()->AttackStart(target);
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
+ Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
+ }
+ }else EnterEvadeMode();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
+ break;
+ case 4:
+ DespawnSummons(MOB_VAPOR_TRAIL);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ break;
+ case 5:
+ if(Player* target = SelectRandomPlayer(80))
+ {
+ BreathX = target->GetPositionX();
+ BreathY = target->GetPositionY();
+ float x, y, z;
+ target->GetContactPoint(m_creature, x, y, z, 40);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ }else EnterEvadeMode();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 6:
+ m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY));
+ m_creature->StopMoving();
+ DoTextEmote("takes a deep breath.", NULL);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
+ break;
+ case 7:
+ m_creature->CastSpell(m_creature, SPELL_FOG_BREATH, true);
+ {
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ x = 2 * BreathX - x;
+ y = 2 * BreathY - y;
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ }
+ Timer[EVENT_SUMMON_FOG] = 1;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 8:
+ m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
+ BreathCount++;
+ Timer[EVENT_SUMMON_FOG] = 0;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ if(BreathCount < 3) FlightCount = 4;
+ break;
+ case 9:
+ if(Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
+ {
+ float x, y, z;
+ target->GetContactPoint(m_creature, x, y, z);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ }else EnterEvadeMode();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 10:
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ m_creature->StopMoving();
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ EnterPhase(PHASE_GROUND);
+ m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
+ break;
+ default:
+ break;
+ }
+ FlightCount++;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ {
+ if(Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode())
+ EnterEvadeMode();
+ return;
+ }
+
+ Event = EVENT_NULL;
+ for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
+ {
+ if(Timer[i])
+ if(Timer[i] <= diff)
+ {
+ if(!Event)
+ Event = (EventFelmyst)i;
+ }else Timer[i] -= diff;
+ }
+
+ if(m_creature->IsNonMeleeSpellCasted(false))
+ return;
+
+ if(Phase == PHASE_GROUND)
+ {
+ switch(Event)
+ {
+ case EVENT_BERSERK:
+ DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ Timer[EVENT_BERSERK] = 0;
+ break;
+ case EVENT_CLEAVE:
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, false);
+ Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000;
+ break;
+ case EVENT_CORROSION:
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_CORROSION, false);
+ Timer[EVENT_CORROSION] = 20000 + rand()%10 * 1000;
+ break;
+ case EVENT_GAS_NOVA:
+ m_creature->CastSpell(m_creature, SPELL_GAS_NOVA, false);
+ Timer[EVENT_GAS_NOVA] = 20000 + rand()%5 * 1000;
+ break;
+ case EVENT_ENCAPSULATE:
+ if(Unit* target = SelectRandomPlayer(50))
+ {
+ m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false);
+ target->CastSpell(target, SPELL_ENCAPSULATE_EFFECT, true);// linked aura, need core patch to remove this hack
+ Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000;
+ }break;
+ case EVENT_FLIGHT:
+ EnterPhase(PHASE_FLIGHT);
+ break;
+ default:
+ DoMeleeAttackIfReady();
+ break;
+ }
+ }
+
+ if(Phase == PHASE_FLIGHT)
+ {
+ switch(Event)
+ {
+ case EVENT_BERSERK:
+ DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ Timer[EVENT_BERSERK] = 0;
+ break;
+ case EVENT_FLIGHT_SEQUENCE:
+ HandleFlightSequence();
+ break;
+ 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))
+ {
+ Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER);
+ Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true);
+ }
+ }
+ Timer[EVENT_SUMMON_FOG] = 1000;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ void DespawnSummons(uint32 entry)
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
+ {
+ if(entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT)
+ {
+ float x, y, z;
+ (*i)->GetPosition(x, y, z);
+ m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ }
+ (*i)->SetVisibility(VISIBILITY_OFF);
+ (*i)->setDeathState(JUST_DIED);
+ if((*i)->getDeathState() == CORPSE)
+ (*i)->RemoveCorpse();
+ }
+ }
+
+ Player* SelectRandomPlayer(float range = 0.0f)
+ {
+ Map *map = m_creature->GetMap();
+ if (!map->IsDungeon()) return NULL;
+
+ InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
+ InstanceMap::PlayerList::iterator i;
+ while(PlayerList.size())
+ {
+ i = PlayerList.begin();
+ advance(i, rand()%PlayerList.size());
+ if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
+ && (*i)->isTargetableForAttack())
+ return *i;
+ else
+ PlayerList.erase(i);
+ }
+ return NULL;
+ }
+};
+
+struct TRINITY_DLL_DECL 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);
+ }
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoZoneInCombat();
+ //m_creature->CastSpell(m_creature, SPELL_VAPOR_FORCE, true); core bug
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim())
+ AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ }
+};
+
+struct TRINITY_DLL_DECL mob_felmyst_trailAI : public ScriptedAI
+{
+ mob_felmyst_trailAI(Creature *c) : ScriptedAI(c)
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->CastSpell(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
+ }
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_boss_felmyst(Creature *_Creature)
+{
+ return new boss_felmystAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_felmyst_vapor(Creature *_Creature)
+{
+ return new mob_felmyst_vaporAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_felmyst_trail(Creature *_Creature)
+{
+ return new mob_felmyst_trailAI(_Creature);
+}
+
+void AddSC_boss_felmyst()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_felmyst";
+ newscript->GetAI = GetAI_boss_felmyst;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_felmyst_vapor";
+ newscript->GetAI = GetAI_mob_felmyst_vapor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_felmyst_trail";
+ newscript->GetAI = GetAI_mob_felmyst_trail;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
index 6007fb25f9b..fbef4275425 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
@@ -1,657 +1,657 @@
-/* Copyright ? 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kalecgos
-SD%Complete: 0
-SDComment: VERIFY SCRIPT
-SDCategory: Sunwell Plateau
-EndScriptData */
-
-#include "precompiled.h"
-#include "WorldPacket.h"
-#include "def_sunwell_plateau.h"
-
-#define SAY_KALECGOS_AGGRO "Aggh! No longer will I be a slave to Malygos! Challenge me and you will be destroyed!"
-#define SOUND_KALECGOS_AGGRO 12422
-#define SAY_KALECGOS_SPELL1 "I will purge you!"
-#define SOUND_KALECGOS_SPELL1 12423
-#define SAY_KALECGOS_SPELL2 "Your pain has only begun!"
-#define SOUND_KALECGOS_SPELL2 12424
-#define SAY_KALECGOS_SLAY1 "In the name of Kil'jaeden!"
-#define SOUND_KALECGOS_SLAY1 12425
-#define SAY_KALECGOS_SLAY2 "You were warned!"
-#define SOUND_KALECGOS_SLAY2 12426
-#define SAY_KALECGOS_ENRAGE "My awakening is complete! You shall all perish!"
-#define SOUND_KALECGOS_ENRAGE 12427
-
-#define SAY_SATH_AGGRO "There will be no reprieve. My work here is nearly finished."
-#define SOUND_SATH_AGGRO 12451
-#define SAY_SATH_DEATH "I'm... never on... the losing... side..."
-#define SOUND_SATH_DEATH 12452
-#define SAY_SATH_SPELL1 "Your misery is my delight!"
-#define SOUND_SATH_SPELL1 12453
-#define SAY_SATH_SPELL2 "I will watch you bleed!"
-#define SOUND_SATH_SPELL2 12454
-#define SAY_SATH_SLAY1 "Pitious mortal!"
-#define SOUND_SATH_SLAY1 12455
-#define SAY_SATH_SLAY2 "Haven't you heard? I always win!"
-#define SOUND_SATH_SLAY2 12456
-#define SAY_SATH_ENRAGE "I have toyed with you long enough!"
-#define SOUND_SATH_ENRAGE 12457
-
-#define SAY_KALEC_AGGRO "I need... your help... Cannot... resist him... much longer..."
-#define SOUND_KALEC_AGGRO 12428
-#define SAY_KALEC_NEAR_DEATH "Aaahhh! Help me, before I lose my mind!"
-#define SOUND_KALEC_NEAR_DEATH 12429
- //???
-#define SAY_KALEC_NEAR_DEATH2 "Hurry! There is not much of me left!"
-#define SOUND_KALEC_NEAR_DEATH2 12430
-#define SAY_KALEC_PLRWIN "I am forever in your debt. Once we have triumphed over Kil'jaeden, this entire world will be in your debt as well."
-#define SOUND_KALEC_PLRWIN 12431
-
-#define SPELL_SPECTRAL_EXHAUSTION 44867
-#define SPELL_TELEPORT_SPECTRAL_REALM 46019
-#define SPELL_SPECTRAL_REALM 46021
-
-#define NOTIFY_SPECTRALLY_EXHAUSTED "Your body is too exhausted to travel to the Spectral Realm."
-#define ERROR_INST_DATA "SD2: Instance Data not set properly for Sunwell Plateau. Kalecgos Encounter will be buggy."
-#define ERROR_INST_DATA_PLR "SD2 ERROR: Instance Data not set properly for Sunwell Plateau. Please report this to your administrator."
-#define ERROR_UNABLE_TO_TELEPORT "SD2: Unable to select target for Spectral Blast. Threatlist has too few players."
-#define ERROR_MISSING_TELEPORT_GUID "SD2: [Kalecgos] Invalid TeleportTargetGUID. Unable to teleport player."
-#define ERROR_KALECGOS_NOT_FOUND "SD2: Unable to create pointer to Kalecgos from Sathrovarr."
-
-#define KALECGOS_ARENA_X 1704.34
-#define KALECGOS_ARENA_Y 928.17
-#define KALECGOS_ARENA_Z 53.08
-
-/*** Kalecgos ****/
-#define SPELL_SPECTRAL_BLAST 44866
-#define SPELL_ARCANE_BUFFET 45018
-#define SPELL_FROST_BREATH 44799
-#define SPELL_HEROIC_STRIKE 45026
-#define SPELL_REVITALIZE 45027
-#define SPELL_TAIL_LASH 45122
-#define SPELL_TRANSFORM_KALEC 45027
-#define SPELL_CRAZED_RAGE 44806
-uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 };
-
-/*** Sathrovarr ***/
-#define SPELL_CORRUPTING_STRIKE 45029
-#define SPELL_CURSE_OF_BOUNDLESS_AGONY 45032
-#define SPELL_SHADOW_BOLT_VOLLEY 45031
-
-/*** Misc ***/
-#define SPELL_BANISH 44836
-
-void TeleportToInnerVeil(Player* plr)
-{
- if(plr->HasAura(SPELL_SPECTRAL_EXHAUSTION, 0))
- {
- plr->GetSession()->SendNotification(NOTIFY_SPECTRALLY_EXHAUSTED);
- return;
- }
-
- ScriptedInstance* pInstance = ((ScriptedInstance*)plr->GetInstanceData());
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- plr->GetSession()->SendNotification(ERROR_INST_DATA_PLR);
- return;
- }
-
- pInstance->SetData64(DATA_PLAYER_SPECTRAL_REALM, plr->GetGUID());
- // Remove the player from Kalecgos' Threat List
- Creature* Kalecgos = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_DRAGON)));
- if(Kalecgos)
- {
- HostilReference* ref = Kalecgos->getThreatManager().getOnlineContainer().getReferenceByTarget(plr);
- if(ref)
- ref->removeReference();
- }
-
- // Add the player to Sathrovarr's Threat List
- Creature* Sathrovarr = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_SATHROVARR)));
- if(Sathrovarr)
- Sathrovarr->AddThreat(plr, 1.0f);
-
- // Make them able to see Sathrovarr (he's invisible for some reason). Also, when this buff wears off, they get teleported back to Normal Realm (this is handled by Instance Script)
- plr->CastSpell(plr, SPELL_SPECTRAL_REALM, true);
- plr->CastSpell(plr, SPELL_TELEPORT_SPECTRAL_REALM, true);
-}
-
-bool GOHello_GO_Spectral_Portal(Player* plr, GameObject* go)
-{
- TeleportToInnerVeil(plr);
-
- return true;
-}
-
-struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
-{
- boss_kalecgosAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 TeleportTargetGUID;
-
- uint32 ArcaneBuffetTimer;
- uint32 FrostBreathTimer;
- uint32 WildMagicTimer;
- uint32 SpectralBlastTimer;
- uint32 SpectralTeleportTimer;
- uint32 ForceFieldTimer;
- uint32 ExitTimer;
-
- bool LockedArena;
- bool Uncorrupted;
- bool Banished;
- bool Checked;
- bool Enraged;
-
- void Reset()
- {
- TeleportTargetGUID = 0;
-
- // TODO: Fix timers
- ArcaneBuffetTimer = 8000;
- FrostBreathTimer = 24000;
- WildMagicTimer = 18000;
- SpectralBlastTimer = 30000;
- SpectralTeleportTimer = SpectralBlastTimer + 2000;
-
- ForceFieldTimer = 20000;
- ExitTimer = 0;
-
- LockedArena = false;
- Uncorrupted = false;
- Banished = false;
- Checked = false;
- Enraged = false;
-
- // Reset Sathrovarr too
- if(pInstance)
- if(Creature* Sath = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR))))
- Sath->AI()->EnterEvadeMode();
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_KALECGOS_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALECGOS_AGGRO);
-
- if(pInstance)
- pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS);
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth() && done_by != m_creature)
- {
- if(!Uncorrupted)
- {
- damage = 0;
- Banished = true;
- DoCast(m_creature, SPELL_BANISH, true);
- m_creature->GetMotionMaster()->MoveIdle();
- }
- else
- {
- damage = 0;
- BeginOutro();
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KALECGOS_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KALECGOS_SLAY1);
- break;
- case 1:
- DoYell(SAY_KALECGOS_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KALECGOS_SLAY2);
- break;
- }
- }
-
- void BeginOutro()
- {
- debug_log("SD2: KALEC: Beginning Outro");
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Unit* Sathrovarr = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR));
- if(Sathrovarr)
- {
- Sathrovarr->DealDamage(Sathrovarr, Sathrovarr->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- Sathrovarr->Relocate(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z);
- Sathrovarr->SendMonsterMove(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z, 0, 0, 0);
- }
-
- Creature* Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_HUMAN)));
- if(Kalec)
- {
- Kalec->DeleteThreatList();
- Kalec->SetVisibility(VISIBILITY_OFF);
- }
-
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->setFaction(35);
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- if(id)
- {
- if(pInstance)
- {
- GameObject* ForceField = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GO_FORCEFIELD));
- if(ForceField)
- ForceField->SetGoState(1);
-
- pInstance->SetData(DATA_KALECGOS_EVENT, DONE);
- }
- else error_log(ERROR_INST_DATA);
-
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget() || Banished)
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
- {
- Unit* Sathrovarr = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR));
- if(Sathrovarr)
- Sathrovarr->CastSpell(Sathrovarr, SPELL_CRAZED_RAGE, true);
- DoCast(m_creature, SPELL_CRAZED_RAGE, true);
- Enraged = true;
- }
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) && !Checked)
- {
- Checked = true;
-
- if(!Uncorrupted)
- {
- Banished = true;
- DoCast(m_creature, SPELL_BANISH, true);
- m_creature->GetMotionMaster()->MoveIdle();
- }
- else
- BeginOutro();
- }
-
- if(ExitTimer)
- if(ExitTimer <= diff)
- {
- debug_log("SD2: KALEC: Exiting the arena");
- DoYell(SAY_KALEC_PLRWIN, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALEC_PLRWIN);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- float x, y, z;
- float iniX, iniY, iniZ;
- m_creature->GetPosition(iniX, iniY, iniZ);
- m_creature->GetRandomPoint(iniX, iniY, iniZ, 30, x, y, z);
- z = 70;
- m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
- }else ExitTimer -= diff;
-
- if(!LockedArena)
- if(ForceFieldTimer < diff)
- {
- if(pInstance)
- {
- GameObject* ForceField = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_FORCEFIELD));
- if(ForceField)
- ForceField->SetUInt32Value(GAMEOBJECT_STATE, 0);
-
- LockedArena = true;
- }else error_log(ERROR_INST_DATA);
- }else ForceFieldTimer -= diff;
-
- if(ArcaneBuffetTimer < diff)
- {
- if(rand()%3 == 0)
- {
- DoYell(SAY_KALECGOS_SPELL1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALECGOS_SPELL1);
- }
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BUFFET);
- ArcaneBuffetTimer = 20000;
- }else ArcaneBuffetTimer -= diff;
-
- if(FrostBreathTimer < diff)
- {
- if(rand()%2 == 0)
- {
- DoYell(SAY_KALECGOS_SPELL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALECGOS_SPELL2);
- }
- DoCast(m_creature->getVictim(), SPELL_FROST_BREATH);
- FrostBreathTimer = 25000;
- }else FrostBreathTimer -= diff;
-
- if(WildMagicTimer < diff)
- {
- DoCast(m_creature->getVictim(), WildMagic[rand()%6]);
- WildMagicTimer = 19000;
- }else WildMagicTimer -= diff;
-
- if(SpectralBlastTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1))
- {
- TeleportTargetGUID = target->GetGUID();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, TeleportTargetGUID);
- SpectralBlastTimer = 30000;
- SpectralTeleportTimer = 2000;
- }
- }else SpectralBlastTimer -= diff;
-
- if(SpectralTeleportTimer < diff)
- {
- if(TeleportTargetGUID)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), TeleportTargetGUID);
- if(pUnit)
- {
- pUnit->CastSpell(pUnit, SPELL_SPECTRAL_BLAST, true);
- TeleportToInnerVeil((Player*)pUnit);
- }
- else error_log(ERROR_MISSING_TELEPORT_GUID);
- }
- else error_log(ERROR_MISSING_TELEPORT_GUID);
-
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID());
- TeleportTargetGUID = 0;
- SpectralTeleportTimer = SpectralBlastTimer + 2000;
-
- }else SpectralTeleportTimer -= diff;
-
- if(!Banished) DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
-{
- boss_sathrovarrAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 CorruptingStrikeTimer;
- uint32 CurseOfBoundlessAgonyTimer;
- uint32 ShadowBoltVolleyTimer;
- bool Banished;
- bool Enraged;
-
- void Reset()
- {
- // FIXME: Timers
- CorruptingStrikeTimer = 5000;
- CurseOfBoundlessAgonyTimer = 15000;
- ShadowBoltVolleyTimer = 10000;
-
- Banished = false;
- Enraged = false;
-
- DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_SATH_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SATH_AGGRO);
-
- Creature* Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_HUMAN)));
- if(Kalec)
- {
- m_creature->AddThreat(Kalec, 10000000.0f);
- Kalec->AddThreat(m_creature, 10000000.0f);
- }
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth())
- {
- damage = 0;
- DoCast(m_creature, SPELL_BANISH, true);
- Banished = true;
-
- DoYell(SAY_SATH_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SATH_DEATH);
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- pInstance->SetData(DATA_SET_SPECTRAL_CHECK, 5000);
-
- Creature* Kalecgos = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KALECGOS_DRAGON)));
- if(Kalecgos)
- {
- ((boss_kalecgosAI*)Kalecgos->AI())->Checked = false;
- ((boss_kalecgosAI*)Kalecgos->AI())->Uncorrupted = true;
- }
- else error_log(ERROR_KALECGOS_NOT_FOUND);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SATH_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SATH_SLAY1);
- break;
- case 1:
- DoYell(SAY_SATH_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SATH_SLAY2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget() || Banished)
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
- {
- Unit* Kalecgos = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_DRAGON));
- if(Kalecgos)
- Kalecgos->CastSpell(Kalecgos, SPELL_CRAZED_RAGE, true);
- DoCast(m_creature, SPELL_CRAZED_RAGE, true);
- Enraged = true;
- }
-
- if(CorruptingStrikeTimer < diff)
- {
- if(rand()%2 == 0)
- {
- DoYell(SAY_SATH_SPELL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SATH_SPELL2);
- }
- DoCast(m_creature->getVictim(), SPELL_CORRUPTING_STRIKE);
- CorruptingStrikeTimer = 13000;
- }else CorruptingStrikeTimer -= diff;
-
- if(CurseOfBoundlessAgonyTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_BOUNDLESS_AGONY);
- CurseOfBoundlessAgonyTimer = 35000;
- DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
- }else CurseOfBoundlessAgonyTimer -= diff;
-
- if(ShadowBoltVolleyTimer < diff)
- {
- if(rand()%2 == 0)
- {
- DoYell(SAY_SATH_SPELL1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SATH_SPELL1);
- }
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
- ShadowBoltVolleyTimer = 15000;
- }else ShadowBoltVolleyTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI
-{
- boss_kalecAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 RevitalizeTimer;
- uint32 HeroicStrikeTimer;
-
- bool HasYelled10Percent;
- bool HasYelled20Percent;
-
- void Reset()
- {
- //TODO: Times!
- RevitalizeTimer = 30000;
- HeroicStrikeTimer = 8000;
-
- HasYelled10Percent = false;
- HasYelled20Percent = false;
-
- DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
- }
-
- void Aggro(Unit* who)
- {
- DoYell(SAY_KALEC_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALEC_AGGRO);
- }
-
- void JustDied(Unit* killer)
- {
- // Whatever happens when Kalec (Half-elf) dies
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(RevitalizeTimer < diff)
- {
- if(pInstance)
- {
- Unit* pUnit = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_RANDOM_SPECTRAL_PLAYER));
- if(pUnit)
- DoCast(pUnit, SPELL_REVITALIZE);
- RevitalizeTimer = 30000;
- }
- }else RevitalizeTimer -= diff;
-
- if(HeroicStrikeTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HEROIC_STRIKE);
- HeroicStrikeTimer = 30000;
- }else HeroicStrikeTimer -= diff;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !HasYelled20Percent)
- {
- DoYell(SAY_KALEC_NEAR_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALEC_NEAR_DEATH);
- HasYelled20Percent = true;
- }
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !HasYelled10Percent)
- {
- DoYell(SAY_KALEC_NEAR_DEATH2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KALEC_NEAR_DEATH2);
- HasYelled10Percent = true;
- }
- }
-};
-
-CreatureAI* GetAI_boss_kalecgos(Creature* c)
-{
- return new boss_kalecgosAI(c);
-}
-
-CreatureAI* GetAI_boss_sathrovarr(Creature* c)
-{
- return new boss_sathrovarrAI(c);
-}
-
-CreatureAI* GetAI_boss_kalec(Creature* c)
-{
- return new boss_kalecAI(c);
-}
-
-void AddSC_boss_kalecgos()
-{
- Script* newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_kalecgos;
- newscript->Name = "boss_kalecgos";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_sathrovarr;
- newscript->Name = "boss_sathrovarr";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->GetAI = GetAI_boss_kalec;
- newscript->Name = "boss_kalec";
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->pGOHello = GOHello_GO_Spectral_Portal;
- newscript->Name = "go_spectral_portal";
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright ? 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kalecgos
+SD%Complete: 0
+SDComment: VERIFY SCRIPT
+SDCategory: Sunwell Plateau
+EndScriptData */
+
+#include "precompiled.h"
+#include "WorldPacket.h"
+#include "def_sunwell_plateau.h"
+
+#define SAY_KALECGOS_AGGRO "Aggh! No longer will I be a slave to Malygos! Challenge me and you will be destroyed!"
+#define SOUND_KALECGOS_AGGRO 12422
+#define SAY_KALECGOS_SPELL1 "I will purge you!"
+#define SOUND_KALECGOS_SPELL1 12423
+#define SAY_KALECGOS_SPELL2 "Your pain has only begun!"
+#define SOUND_KALECGOS_SPELL2 12424
+#define SAY_KALECGOS_SLAY1 "In the name of Kil'jaeden!"
+#define SOUND_KALECGOS_SLAY1 12425
+#define SAY_KALECGOS_SLAY2 "You were warned!"
+#define SOUND_KALECGOS_SLAY2 12426
+#define SAY_KALECGOS_ENRAGE "My awakening is complete! You shall all perish!"
+#define SOUND_KALECGOS_ENRAGE 12427
+
+#define SAY_SATH_AGGRO "There will be no reprieve. My work here is nearly finished."
+#define SOUND_SATH_AGGRO 12451
+#define SAY_SATH_DEATH "I'm... never on... the losing... side..."
+#define SOUND_SATH_DEATH 12452
+#define SAY_SATH_SPELL1 "Your misery is my delight!"
+#define SOUND_SATH_SPELL1 12453
+#define SAY_SATH_SPELL2 "I will watch you bleed!"
+#define SOUND_SATH_SPELL2 12454
+#define SAY_SATH_SLAY1 "Pitious mortal!"
+#define SOUND_SATH_SLAY1 12455
+#define SAY_SATH_SLAY2 "Haven't you heard? I always win!"
+#define SOUND_SATH_SLAY2 12456
+#define SAY_SATH_ENRAGE "I have toyed with you long enough!"
+#define SOUND_SATH_ENRAGE 12457
+
+#define SAY_KALEC_AGGRO "I need... your help... Cannot... resist him... much longer..."
+#define SOUND_KALEC_AGGRO 12428
+#define SAY_KALEC_NEAR_DEATH "Aaahhh! Help me, before I lose my mind!"
+#define SOUND_KALEC_NEAR_DEATH 12429
+ //???
+#define SAY_KALEC_NEAR_DEATH2 "Hurry! There is not much of me left!"
+#define SOUND_KALEC_NEAR_DEATH2 12430
+#define SAY_KALEC_PLRWIN "I am forever in your debt. Once we have triumphed over Kil'jaeden, this entire world will be in your debt as well."
+#define SOUND_KALEC_PLRWIN 12431
+
+#define SPELL_SPECTRAL_EXHAUSTION 44867
+#define SPELL_TELEPORT_SPECTRAL_REALM 46019
+#define SPELL_SPECTRAL_REALM 46021
+
+#define NOTIFY_SPECTRALLY_EXHAUSTED "Your body is too exhausted to travel to the Spectral Realm."
+#define ERROR_INST_DATA "SD2: Instance Data not set properly for Sunwell Plateau. Kalecgos Encounter will be buggy."
+#define ERROR_INST_DATA_PLR "SD2 ERROR: Instance Data not set properly for Sunwell Plateau. Please report this to your administrator."
+#define ERROR_UNABLE_TO_TELEPORT "SD2: Unable to select target for Spectral Blast. Threatlist has too few players."
+#define ERROR_MISSING_TELEPORT_GUID "SD2: [Kalecgos] Invalid TeleportTargetGUID. Unable to teleport player."
+#define ERROR_KALECGOS_NOT_FOUND "SD2: Unable to create pointer to Kalecgos from Sathrovarr."
+
+#define KALECGOS_ARENA_X 1704.34
+#define KALECGOS_ARENA_Y 928.17
+#define KALECGOS_ARENA_Z 53.08
+
+/*** Kalecgos ****/
+#define SPELL_SPECTRAL_BLAST 44866
+#define SPELL_ARCANE_BUFFET 45018
+#define SPELL_FROST_BREATH 44799
+#define SPELL_HEROIC_STRIKE 45026
+#define SPELL_REVITALIZE 45027
+#define SPELL_TAIL_LASH 45122
+#define SPELL_TRANSFORM_KALEC 45027
+#define SPELL_CRAZED_RAGE 44806
+uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 };
+
+/*** Sathrovarr ***/
+#define SPELL_CORRUPTING_STRIKE 45029
+#define SPELL_CURSE_OF_BOUNDLESS_AGONY 45032
+#define SPELL_SHADOW_BOLT_VOLLEY 45031
+
+/*** Misc ***/
+#define SPELL_BANISH 44836
+
+void TeleportToInnerVeil(Player* plr)
+{
+ if(plr->HasAura(SPELL_SPECTRAL_EXHAUSTION, 0))
+ {
+ plr->GetSession()->SendNotification(NOTIFY_SPECTRALLY_EXHAUSTED);
+ return;
+ }
+
+ ScriptedInstance* pInstance = ((ScriptedInstance*)plr->GetInstanceData());
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ plr->GetSession()->SendNotification(ERROR_INST_DATA_PLR);
+ return;
+ }
+
+ pInstance->SetData64(DATA_PLAYER_SPECTRAL_REALM, plr->GetGUID());
+ // Remove the player from Kalecgos' Threat List
+ Creature* Kalecgos = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_DRAGON)));
+ if(Kalecgos)
+ {
+ HostilReference* ref = Kalecgos->getThreatManager().getOnlineContainer().getReferenceByTarget(plr);
+ if(ref)
+ ref->removeReference();
+ }
+
+ // Add the player to Sathrovarr's Threat List
+ Creature* Sathrovarr = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_SATHROVARR)));
+ if(Sathrovarr)
+ Sathrovarr->AddThreat(plr, 1.0f);
+
+ // Make them able to see Sathrovarr (he's invisible for some reason). Also, when this buff wears off, they get teleported back to Normal Realm (this is handled by Instance Script)
+ plr->CastSpell(plr, SPELL_SPECTRAL_REALM, true);
+ plr->CastSpell(plr, SPELL_TELEPORT_SPECTRAL_REALM, true);
+}
+
+bool GOHello_GO_Spectral_Portal(Player* plr, GameObject* go)
+{
+ TeleportToInnerVeil(plr);
+
+ return true;
+}
+
+struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
+{
+ boss_kalecgosAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 TeleportTargetGUID;
+
+ uint32 ArcaneBuffetTimer;
+ uint32 FrostBreathTimer;
+ uint32 WildMagicTimer;
+ uint32 SpectralBlastTimer;
+ uint32 SpectralTeleportTimer;
+ uint32 ForceFieldTimer;
+ uint32 ExitTimer;
+
+ bool LockedArena;
+ bool Uncorrupted;
+ bool Banished;
+ bool Checked;
+ bool Enraged;
+
+ void Reset()
+ {
+ TeleportTargetGUID = 0;
+
+ // TODO: Fix timers
+ ArcaneBuffetTimer = 8000;
+ FrostBreathTimer = 24000;
+ WildMagicTimer = 18000;
+ SpectralBlastTimer = 30000;
+ SpectralTeleportTimer = SpectralBlastTimer + 2000;
+
+ ForceFieldTimer = 20000;
+ ExitTimer = 0;
+
+ LockedArena = false;
+ Uncorrupted = false;
+ Banished = false;
+ Checked = false;
+ Enraged = false;
+
+ // Reset Sathrovarr too
+ if(pInstance)
+ if(Creature* Sath = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR))))
+ Sath->AI()->EnterEvadeMode();
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_KALECGOS_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALECGOS_AGGRO);
+
+ if(pInstance)
+ pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS);
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth() && done_by != m_creature)
+ {
+ if(!Uncorrupted)
+ {
+ damage = 0;
+ Banished = true;
+ DoCast(m_creature, SPELL_BANISH, true);
+ m_creature->GetMotionMaster()->MoveIdle();
+ }
+ else
+ {
+ damage = 0;
+ BeginOutro();
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KALECGOS_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KALECGOS_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_KALECGOS_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KALECGOS_SLAY2);
+ break;
+ }
+ }
+
+ void BeginOutro()
+ {
+ debug_log("SD2: KALEC: Beginning Outro");
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Unit* Sathrovarr = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR));
+ if(Sathrovarr)
+ {
+ Sathrovarr->DealDamage(Sathrovarr, Sathrovarr->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ Sathrovarr->Relocate(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z);
+ Sathrovarr->SendMonsterMove(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z, 0, 0, 0);
+ }
+
+ Creature* Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_HUMAN)));
+ if(Kalec)
+ {
+ Kalec->DeleteThreatList();
+ Kalec->SetVisibility(VISIBILITY_OFF);
+ }
+
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->setFaction(35);
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ if(id)
+ {
+ if(pInstance)
+ {
+ GameObject* ForceField = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GO_FORCEFIELD));
+ if(ForceField)
+ ForceField->SetGoState(1);
+
+ pInstance->SetData(DATA_KALECGOS_EVENT, DONE);
+ }
+ else error_log(ERROR_INST_DATA);
+
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget() || Banished)
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
+ {
+ Unit* Sathrovarr = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR));
+ if(Sathrovarr)
+ Sathrovarr->CastSpell(Sathrovarr, SPELL_CRAZED_RAGE, true);
+ DoCast(m_creature, SPELL_CRAZED_RAGE, true);
+ Enraged = true;
+ }
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) && !Checked)
+ {
+ Checked = true;
+
+ if(!Uncorrupted)
+ {
+ Banished = true;
+ DoCast(m_creature, SPELL_BANISH, true);
+ m_creature->GetMotionMaster()->MoveIdle();
+ }
+ else
+ BeginOutro();
+ }
+
+ if(ExitTimer)
+ if(ExitTimer <= diff)
+ {
+ debug_log("SD2: KALEC: Exiting the arena");
+ DoYell(SAY_KALEC_PLRWIN, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALEC_PLRWIN);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ float x, y, z;
+ float iniX, iniY, iniZ;
+ m_creature->GetPosition(iniX, iniY, iniZ);
+ m_creature->GetRandomPoint(iniX, iniY, iniZ, 30, x, y, z);
+ z = 70;
+ m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
+ }else ExitTimer -= diff;
+
+ if(!LockedArena)
+ if(ForceFieldTimer < diff)
+ {
+ if(pInstance)
+ {
+ GameObject* ForceField = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_FORCEFIELD));
+ if(ForceField)
+ ForceField->SetUInt32Value(GAMEOBJECT_STATE, 0);
+
+ LockedArena = true;
+ }else error_log(ERROR_INST_DATA);
+ }else ForceFieldTimer -= diff;
+
+ if(ArcaneBuffetTimer < diff)
+ {
+ if(rand()%3 == 0)
+ {
+ DoYell(SAY_KALECGOS_SPELL1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALECGOS_SPELL1);
+ }
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_BUFFET);
+ ArcaneBuffetTimer = 20000;
+ }else ArcaneBuffetTimer -= diff;
+
+ if(FrostBreathTimer < diff)
+ {
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_KALECGOS_SPELL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALECGOS_SPELL2);
+ }
+ DoCast(m_creature->getVictim(), SPELL_FROST_BREATH);
+ FrostBreathTimer = 25000;
+ }else FrostBreathTimer -= diff;
+
+ if(WildMagicTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), WildMagic[rand()%6]);
+ WildMagicTimer = 19000;
+ }else WildMagicTimer -= diff;
+
+ if(SpectralBlastTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1))
+ {
+ TeleportTargetGUID = target->GetGUID();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, TeleportTargetGUID);
+ SpectralBlastTimer = 30000;
+ SpectralTeleportTimer = 2000;
+ }
+ }else SpectralBlastTimer -= diff;
+
+ if(SpectralTeleportTimer < diff)
+ {
+ if(TeleportTargetGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), TeleportTargetGUID);
+ if(pUnit)
+ {
+ pUnit->CastSpell(pUnit, SPELL_SPECTRAL_BLAST, true);
+ TeleportToInnerVeil((Player*)pUnit);
+ }
+ else error_log(ERROR_MISSING_TELEPORT_GUID);
+ }
+ else error_log(ERROR_MISSING_TELEPORT_GUID);
+
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID());
+ TeleportTargetGUID = 0;
+ SpectralTeleportTimer = SpectralBlastTimer + 2000;
+
+ }else SpectralTeleportTimer -= diff;
+
+ if(!Banished) DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
+{
+ boss_sathrovarrAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 CorruptingStrikeTimer;
+ uint32 CurseOfBoundlessAgonyTimer;
+ uint32 ShadowBoltVolleyTimer;
+ bool Banished;
+ bool Enraged;
+
+ void Reset()
+ {
+ // FIXME: Timers
+ CorruptingStrikeTimer = 5000;
+ CurseOfBoundlessAgonyTimer = 15000;
+ ShadowBoltVolleyTimer = 10000;
+
+ Banished = false;
+ Enraged = false;
+
+ DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_SATH_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SATH_AGGRO);
+
+ Creature* Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_HUMAN)));
+ if(Kalec)
+ {
+ m_creature->AddThreat(Kalec, 10000000.0f);
+ Kalec->AddThreat(m_creature, 10000000.0f);
+ }
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth())
+ {
+ damage = 0;
+ DoCast(m_creature, SPELL_BANISH, true);
+ Banished = true;
+
+ DoYell(SAY_SATH_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SATH_DEATH);
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ pInstance->SetData(DATA_SET_SPECTRAL_CHECK, 5000);
+
+ Creature* Kalecgos = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KALECGOS_DRAGON)));
+ if(Kalecgos)
+ {
+ ((boss_kalecgosAI*)Kalecgos->AI())->Checked = false;
+ ((boss_kalecgosAI*)Kalecgos->AI())->Uncorrupted = true;
+ }
+ else error_log(ERROR_KALECGOS_NOT_FOUND);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SATH_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SATH_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SATH_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SATH_SLAY2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget() || Banished)
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
+ {
+ Unit* Kalecgos = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_DRAGON));
+ if(Kalecgos)
+ Kalecgos->CastSpell(Kalecgos, SPELL_CRAZED_RAGE, true);
+ DoCast(m_creature, SPELL_CRAZED_RAGE, true);
+ Enraged = true;
+ }
+
+ if(CorruptingStrikeTimer < diff)
+ {
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_SATH_SPELL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SATH_SPELL2);
+ }
+ DoCast(m_creature->getVictim(), SPELL_CORRUPTING_STRIKE);
+ CorruptingStrikeTimer = 13000;
+ }else CorruptingStrikeTimer -= diff;
+
+ if(CurseOfBoundlessAgonyTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_BOUNDLESS_AGONY);
+ CurseOfBoundlessAgonyTimer = 35000;
+ DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
+ }else CurseOfBoundlessAgonyTimer -= diff;
+
+ if(ShadowBoltVolleyTimer < diff)
+ {
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_SATH_SPELL1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SATH_SPELL1);
+ }
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
+ ShadowBoltVolleyTimer = 15000;
+ }else ShadowBoltVolleyTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI
+{
+ boss_kalecAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 RevitalizeTimer;
+ uint32 HeroicStrikeTimer;
+
+ bool HasYelled10Percent;
+ bool HasYelled20Percent;
+
+ void Reset()
+ {
+ //TODO: Times!
+ RevitalizeTimer = 30000;
+ HeroicStrikeTimer = 8000;
+
+ HasYelled10Percent = false;
+ HasYelled20Percent = false;
+
+ DoCast(m_creature, SPELL_SPECTRAL_REALM, true);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(SAY_KALEC_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALEC_AGGRO);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ // Whatever happens when Kalec (Half-elf) dies
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(RevitalizeTimer < diff)
+ {
+ if(pInstance)
+ {
+ Unit* pUnit = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_RANDOM_SPECTRAL_PLAYER));
+ if(pUnit)
+ DoCast(pUnit, SPELL_REVITALIZE);
+ RevitalizeTimer = 30000;
+ }
+ }else RevitalizeTimer -= diff;
+
+ if(HeroicStrikeTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HEROIC_STRIKE);
+ HeroicStrikeTimer = 30000;
+ }else HeroicStrikeTimer -= diff;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !HasYelled20Percent)
+ {
+ DoYell(SAY_KALEC_NEAR_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALEC_NEAR_DEATH);
+ HasYelled20Percent = true;
+ }
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !HasYelled10Percent)
+ {
+ DoYell(SAY_KALEC_NEAR_DEATH2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KALEC_NEAR_DEATH2);
+ HasYelled10Percent = true;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_kalecgos(Creature* c)
+{
+ return new boss_kalecgosAI(c);
+}
+
+CreatureAI* GetAI_boss_sathrovarr(Creature* c)
+{
+ return new boss_sathrovarrAI(c);
+}
+
+CreatureAI* GetAI_boss_kalec(Creature* c)
+{
+ return new boss_kalecAI(c);
+}
+
+void AddSC_boss_kalecgos()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_kalecgos;
+ newscript->Name = "boss_kalecgos";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_sathrovarr;
+ newscript->Name = "boss_sathrovarr";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->GetAI = GetAI_boss_kalec;
+ newscript->Name = "boss_kalec";
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->pGOHello = GOHello_GO_Spectral_Portal;
+ newscript->Name = "go_spectral_portal";
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
index 5b6ae7fcf9a..316b13062f0 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
@@ -1,43 +1,43 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SUNWELLPLATEAU_H
-#define DEF_SUNWELLPLATEAU_H
-
-/*** Encounters ***/
-#define DATA_KALECGOS_EVENT 0
-#define DATA_BRUTALLUS_EVENT 1
-#define DATA_FELMYST_EVENT 2
-#define DATA_EREDAR_TWINS_EVENT 3
-#define DATA_MURU_EVENT 4
-#define DATA_KILJAEDEN_EVENT 5
-
-/*** Creatures ***/
-#define DATA_KALECGOS_DRAGON 6
-#define DATA_KALECGOS_HUMAN 7
-#define DATA_SATHROVARR 8
-#define DATA_BRUTALLUS 9
-#define DATA_FELMYST 10
-#define DATA_ALYTHESS 11
-#define DATA_SACROLASH 12
-#define DATA_MURU 13
-#define DATA_KILJAEDEN 14
-#define DATA_KILJAEDEN_CONTROLLER 15
-#define DATA_ANVEENA 16
-
-/*** GameObjects ***/
-#define DATA_GO_FORCEFIELD 17
-#define DATA_GO_FIRE_BARRIER 18
-#define DATA_GATE_1 19
-#define DATA_GATE_2 20
-#define DATA_GATE_3 21
-#define DATA_GATE_4 22
-#define DATA_GATE_5 23
-
-/*** Misc ***/
-#define DATA_PLAYER_SPECTRAL_REALM 24
-#define DATA_SET_SPECTRAL_CHECK 25
-#define DATA_RANDOM_SPECTRAL_PLAYER 26
-#define DATA_INST_EJECT_PLAYERS 27
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SUNWELLPLATEAU_H
+#define DEF_SUNWELLPLATEAU_H
+
+/*** Encounters ***/
+#define DATA_KALECGOS_EVENT 0
+#define DATA_BRUTALLUS_EVENT 1
+#define DATA_FELMYST_EVENT 2
+#define DATA_EREDAR_TWINS_EVENT 3
+#define DATA_MURU_EVENT 4
+#define DATA_KILJAEDEN_EVENT 5
+
+/*** Creatures ***/
+#define DATA_KALECGOS_DRAGON 6
+#define DATA_KALECGOS_HUMAN 7
+#define DATA_SATHROVARR 8
+#define DATA_BRUTALLUS 9
+#define DATA_FELMYST 10
+#define DATA_ALYTHESS 11
+#define DATA_SACROLASH 12
+#define DATA_MURU 13
+#define DATA_KILJAEDEN 14
+#define DATA_KILJAEDEN_CONTROLLER 15
+#define DATA_ANVEENA 16
+
+/*** GameObjects ***/
+#define DATA_GO_FORCEFIELD 17
+#define DATA_GO_FIRE_BARRIER 18
+#define DATA_GATE_1 19
+#define DATA_GATE_2 20
+#define DATA_GATE_3 21
+#define DATA_GATE_4 22
+#define DATA_GATE_5 23
+
+/*** Misc ***/
+#define DATA_PLAYER_SPECTRAL_REALM 24
+#define DATA_SET_SPECTRAL_CHECK 25
+#define DATA_RANDOM_SPECTRAL_PLAYER 26
+#define DATA_INST_EJECT_PLAYERS 27
+#endif
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
index 9faddfc712d..739215c47ff 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
@@ -1,275 +1,275 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-/* ScriptData
-SDName: instance_sunwell_plateau
-SD%Complete: 0
-SDComment: VERIFY SCRIPT
-SDCategory: Sunwell_Plateau
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sunwell_plateau.h"
-
-#define ENCOUNTERS 6
-
-#define SPELL_SPECTRAL_REALM 46021
-#define SPELL_TELEPORT_NORMAL_REALM 46020
-#define SPELL_SPECTRAL_EXHAUSTION 44867
-
-/* Sunwell Plateau:
-0 - Kalecgos and Sathrovarr
-1 - Brutallus
-2 - Felmyst
-3 - Eredar Twins (Alythess and Sacrolash)
-4 - M'uru
-5 - Kil'Jaeden
-*/
-
-struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
-{
- instance_sunwell_plateau(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounters[ENCOUNTERS];
-
- /** Creatures **/
- uint64 Kalecgos_Dragon;
- uint64 Kalecgos_Human;
- uint64 Sathrovarr;
- uint64 Brutallus;
- uint64 Felmyst;
- uint64 Alythess;
- uint64 Sacrolash;
- uint64 Muru;
- uint64 KilJaeden;
- uint64 KilJaedenController;
- uint64 Anveena;
-
- /** GameObjects **/
- uint64 ForceField; // Kalecgos Encounter
- uint64 FireBarrier; // Brutallus Encounter
- uint64 Gate[5]; // Rename this to be more specific after door placement is verified.
-
- /*** Misc ***/
- uint32 SpectralRealmTimer;
- std::vector<uint64> SpectralRealmList;
-
- void Initialize()
- {
- /*** Creatures ***/
- Kalecgos_Dragon = 0;
- Kalecgos_Human = 0;
- Sathrovarr = 0;
- Brutallus = 0;
- Felmyst = 0;
- Alythess = 0;
- Sacrolash = 0;
- Muru = 0;
- KilJaeden = 0;
- KilJaedenController = 0;
- Anveena = 0;
-
- /*** GameObjects ***/
- ForceField = 0;
- FireBarrier = 0;
- Gate[0] = 0; // TODO: Rename Gate[n] with gate_<boss name> for better specificity
- Gate[1] = 0;
- Gate[2] = 0;
- Gate[3] = 0;
- Gate[4] = 0;
-
- /*** Encounters ***/
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- Encounters[i] = NOT_STARTED;
-
- /*** Misc ***/
- SpectralRealmTimer = 5000;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS)
- return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature* creature, uint32 entry)
- {
- switch(entry)
- {
- case 24850: Kalecgos_Dragon = creature->GetGUID(); break;
- case 24891: Kalecgos_Human = creature->GetGUID(); break;
- case 24892: Sathrovarr = creature->GetGUID(); break;
- case 24882: Brutallus = creature->GetGUID(); break;
- case 25038: Felmyst = creature->GetGUID(); break;
- case 25166: Alythess = creature->GetGUID(); break;
- case 25165: Sacrolash = creature->GetGUID(); break;
- case 25741: Muru = creature->GetGUID(); break;
- case 25315: KilJaeden = creature->GetGUID(); break;
- case 25608: KilJaedenController = creature->GetGUID(); break;
- case 26046: Anveena = creature->GetGUID(); break;
- }
- }
-
- void OnObjectCreate(GameObject* gobj)
- {
- switch(gobj->GetEntry())
- {
- case 188421: ForceField = gobj->GetGUID(); break;
- case 188075: FireBarrier = gobj->GetGUID(); break;
- case 187979: Gate[0] = gobj->GetGUID(); break;
- case 187770: Gate[1] = gobj->GetGUID(); break;
- case 187896: Gate[2] = gobj->GetGUID(); break;
- case 187990: Gate[3] = gobj->GetGUID(); break;
- case 188118: Gate[4] = gobj->GetGUID(); break;
- }
- }
-
- uint32 GetData(uint32 id)
- {
- switch(id)
- {
- case DATA_KALECGOS_EVENT: return Encounters[0]; break;
- case DATA_BRUTALLUS_EVENT: return Encounters[1]; break;
- case DATA_FELMYST_EVENT: return Encounters[2]; break;
- case DATA_EREDAR_TWINS_EVENT: return Encounters[3]; break;
- case DATA_MURU_EVENT: return Encounters[4]; break;
- case DATA_KILJAEDEN_EVENT: return Encounters[5]; break;
- }
-
- return 0;
- }
-
- uint64 GetData64(uint32 id)
- {
- switch(id)
- {
- case DATA_KALECGOS_DRAGON: return Kalecgos_Dragon; break;
- case DATA_KALECGOS_HUMAN: return Kalecgos_Human; break;
- case DATA_SATHROVARR: return Sathrovarr; break;
- case DATA_BRUTALLUS: return Brutallus; break;
- case DATA_FELMYST: return Felmyst; break;
- case DATA_ALYTHESS: return Alythess; break;
- case DATA_SACROLASH: return Sacrolash; break;
- case DATA_MURU: return Muru; break;
- case DATA_KILJAEDEN: return KilJaeden; break;
- case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; break;
- case DATA_ANVEENA: return Anveena; break;
-
- case DATA_RANDOM_SPECTRAL_PLAYER:
- return *(SpectralRealmList.begin() + rand()%SpectralRealmList.size());
- break;
- }
- return 0;
- }
-
- void SetData(uint32 id, uint32 data)
- {
- switch(id)
- {
- case DATA_KALECGOS_EVENT: Encounters[0] = data; break;
- case DATA_BRUTALLUS_EVENT: Encounters[1] = data; break;
- case DATA_FELMYST_EVENT: Encounters[2] = data; break;
- case DATA_EREDAR_TWINS_EVENT: Encounters[3] = data; break;
- case DATA_MURU_EVENT: Encounters[4] = data; break;
- case DATA_KILJAEDEN_EVENT: Encounters[5] = data; break;
-
- case DATA_SET_SPECTRAL_CHECK: SpectralRealmTimer = data; break;
- case DATA_INST_EJECT_PLAYERS: EjectPlayers(); break;
- }
- }
-
- void SetData64(uint32 id, uint64 guid)
- {
- switch(id)
- {
- case DATA_PLAYER_SPECTRAL_REALM:
- SpectralRealmList.push_back(guid);
- break;
- }
- }
-
- // Dirty Hack as we can't use Unit::GetUnit in instance scripts due to lack of a WorldObject.
- Player* DirtyHackToGetPlayerFromSpectralList(uint64 guid)
- {
- Player* first = ((InstanceMap*)instance)->GetPlayers().front();
- if(!first)
- return NULL;
-
- Player* plr = ((Player*)Unit::GetUnit(*first, guid));
- if(plr)
- return plr;
-
- return NULL;
- }
-
- void EjectPlayer(Player* plr)
- {
- debug_log("SD2: INST: Ejecting Player %s from Spectral Realm", plr->GetName());
- // Remove player from Sathrovarr's threat list
- Creature* Sath = ((Creature*)Unit::GetUnit(*plr, Sathrovarr));
- if(Sath && Sath->isAlive())
- {
- HostilReference* ref = Sath->getThreatManager().getOnlineContainer().getReferenceByTarget(plr);
- if(ref)
- {
- ref->removeReference();
- debug_log("SD2: INST: Deleting %s from Sathrovarr's threatlist", plr->GetName());
- }
- }
-
- // Put player back in Kalecgos(Dragon)'s threat list
- Creature* Kalecgos = ((Creature*)Unit::GetUnit(*plr, Kalecgos_Dragon));
- if(Kalecgos && Kalecgos->isAlive())
- {
- debug_log("SD2: INST: Putting %s in Kalecgos' threatlist", plr->GetName());
- Kalecgos->AddThreat(plr, 1.0f);
- }
-
- plr->CastSpell(plr, SPELL_TELEPORT_NORMAL_REALM, true);
- plr->CastSpell(plr, SPELL_SPECTRAL_EXHAUSTION, true);
- }
-
- void EjectPlayers()
- {
- for(uint8 i = 0; i < SpectralRealmList.size(); ++i)
- {
- Player* plr = DirtyHackToGetPlayerFromSpectralList(SpectralRealmList[i]);
- if(plr && !plr->HasAura(SPELL_SPECTRAL_REALM, 0))
- {
- EjectPlayer(plr);
- SpectralRealmList.erase(SpectralRealmList.begin() + i);
- }
- }
-
- SpectralRealmList.clear();
- }
-
- void Update(uint32 diff)
- {
- // Only check for Spectral Realm if Kalecgos Encounter is running
- if(Encounters[0] == IN_PROGRESS)
- if(SpectralRealmTimer < diff)
- {
- EjectPlayers();
- SpectralRealmTimer = 5000;
- }else SpectralRealmTimer -= diff;
- }
-};
-
-InstanceData* GetInstanceData_instance_sunwell_plateau(Map* map)
-{
- return new instance_sunwell_plateau(map);
-}
-
-void AddSC_instance_sunwell_plateau()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_sunwell_plateau";
- newscript->GetInstanceData = GetInstanceData_instance_sunwell_plateau;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+/* ScriptData
+SDName: instance_sunwell_plateau
+SD%Complete: 0
+SDComment: VERIFY SCRIPT
+SDCategory: Sunwell_Plateau
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+
+#define ENCOUNTERS 6
+
+#define SPELL_SPECTRAL_REALM 46021
+#define SPELL_TELEPORT_NORMAL_REALM 46020
+#define SPELL_SPECTRAL_EXHAUSTION 44867
+
+/* Sunwell Plateau:
+0 - Kalecgos and Sathrovarr
+1 - Brutallus
+2 - Felmyst
+3 - Eredar Twins (Alythess and Sacrolash)
+4 - M'uru
+5 - Kil'Jaeden
+*/
+
+struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
+{
+ instance_sunwell_plateau(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounters[ENCOUNTERS];
+
+ /** Creatures **/
+ uint64 Kalecgos_Dragon;
+ uint64 Kalecgos_Human;
+ uint64 Sathrovarr;
+ uint64 Brutallus;
+ uint64 Felmyst;
+ uint64 Alythess;
+ uint64 Sacrolash;
+ uint64 Muru;
+ uint64 KilJaeden;
+ uint64 KilJaedenController;
+ uint64 Anveena;
+
+ /** GameObjects **/
+ uint64 ForceField; // Kalecgos Encounter
+ uint64 FireBarrier; // Brutallus Encounter
+ uint64 Gate[5]; // Rename this to be more specific after door placement is verified.
+
+ /*** Misc ***/
+ uint32 SpectralRealmTimer;
+ std::vector<uint64> SpectralRealmList;
+
+ void Initialize()
+ {
+ /*** Creatures ***/
+ Kalecgos_Dragon = 0;
+ Kalecgos_Human = 0;
+ Sathrovarr = 0;
+ Brutallus = 0;
+ Felmyst = 0;
+ Alythess = 0;
+ Sacrolash = 0;
+ Muru = 0;
+ KilJaeden = 0;
+ KilJaedenController = 0;
+ Anveena = 0;
+
+ /*** GameObjects ***/
+ ForceField = 0;
+ FireBarrier = 0;
+ Gate[0] = 0; // TODO: Rename Gate[n] with gate_<boss name> for better specificity
+ Gate[1] = 0;
+ Gate[2] = 0;
+ Gate[3] = 0;
+ Gate[4] = 0;
+
+ /*** Encounters ***/
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+
+ /*** Misc ***/
+ SpectralRealmTimer = 5000;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS)
+ return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature* creature, uint32 entry)
+ {
+ switch(entry)
+ {
+ case 24850: Kalecgos_Dragon = creature->GetGUID(); break;
+ case 24891: Kalecgos_Human = creature->GetGUID(); break;
+ case 24892: Sathrovarr = creature->GetGUID(); break;
+ case 24882: Brutallus = creature->GetGUID(); break;
+ case 25038: Felmyst = creature->GetGUID(); break;
+ case 25166: Alythess = creature->GetGUID(); break;
+ case 25165: Sacrolash = creature->GetGUID(); break;
+ case 25741: Muru = creature->GetGUID(); break;
+ case 25315: KilJaeden = creature->GetGUID(); break;
+ case 25608: KilJaedenController = creature->GetGUID(); break;
+ case 26046: Anveena = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* gobj)
+ {
+ switch(gobj->GetEntry())
+ {
+ case 188421: ForceField = gobj->GetGUID(); break;
+ case 188075: FireBarrier = gobj->GetGUID(); break;
+ case 187979: Gate[0] = gobj->GetGUID(); break;
+ case 187770: Gate[1] = gobj->GetGUID(); break;
+ case 187896: Gate[2] = gobj->GetGUID(); break;
+ case 187990: Gate[3] = gobj->GetGUID(); break;
+ case 188118: Gate[4] = gobj->GetGUID(); break;
+ }
+ }
+
+ uint32 GetData(uint32 id)
+ {
+ switch(id)
+ {
+ case DATA_KALECGOS_EVENT: return Encounters[0]; break;
+ case DATA_BRUTALLUS_EVENT: return Encounters[1]; break;
+ case DATA_FELMYST_EVENT: return Encounters[2]; break;
+ case DATA_EREDAR_TWINS_EVENT: return Encounters[3]; break;
+ case DATA_MURU_EVENT: return Encounters[4]; break;
+ case DATA_KILJAEDEN_EVENT: return Encounters[5]; break;
+ }
+
+ return 0;
+ }
+
+ uint64 GetData64(uint32 id)
+ {
+ switch(id)
+ {
+ case DATA_KALECGOS_DRAGON: return Kalecgos_Dragon; break;
+ case DATA_KALECGOS_HUMAN: return Kalecgos_Human; break;
+ case DATA_SATHROVARR: return Sathrovarr; break;
+ case DATA_BRUTALLUS: return Brutallus; break;
+ case DATA_FELMYST: return Felmyst; break;
+ case DATA_ALYTHESS: return Alythess; break;
+ case DATA_SACROLASH: return Sacrolash; break;
+ case DATA_MURU: return Muru; break;
+ case DATA_KILJAEDEN: return KilJaeden; break;
+ case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; break;
+ case DATA_ANVEENA: return Anveena; break;
+
+ case DATA_RANDOM_SPECTRAL_PLAYER:
+ return *(SpectralRealmList.begin() + rand()%SpectralRealmList.size());
+ break;
+ }
+ return 0;
+ }
+
+ void SetData(uint32 id, uint32 data)
+ {
+ switch(id)
+ {
+ case DATA_KALECGOS_EVENT: Encounters[0] = data; break;
+ case DATA_BRUTALLUS_EVENT: Encounters[1] = data; break;
+ case DATA_FELMYST_EVENT: Encounters[2] = data; break;
+ case DATA_EREDAR_TWINS_EVENT: Encounters[3] = data; break;
+ case DATA_MURU_EVENT: Encounters[4] = data; break;
+ case DATA_KILJAEDEN_EVENT: Encounters[5] = data; break;
+
+ case DATA_SET_SPECTRAL_CHECK: SpectralRealmTimer = data; break;
+ case DATA_INST_EJECT_PLAYERS: EjectPlayers(); break;
+ }
+ }
+
+ void SetData64(uint32 id, uint64 guid)
+ {
+ switch(id)
+ {
+ case DATA_PLAYER_SPECTRAL_REALM:
+ SpectralRealmList.push_back(guid);
+ break;
+ }
+ }
+
+ // Dirty Hack as we can't use Unit::GetUnit in instance scripts due to lack of a WorldObject.
+ Player* DirtyHackToGetPlayerFromSpectralList(uint64 guid)
+ {
+ Player* first = ((InstanceMap*)instance)->GetPlayers().front();
+ if(!first)
+ return NULL;
+
+ Player* plr = ((Player*)Unit::GetUnit(*first, guid));
+ if(plr)
+ return plr;
+
+ return NULL;
+ }
+
+ void EjectPlayer(Player* plr)
+ {
+ debug_log("SD2: INST: Ejecting Player %s from Spectral Realm", plr->GetName());
+ // Remove player from Sathrovarr's threat list
+ Creature* Sath = ((Creature*)Unit::GetUnit(*plr, Sathrovarr));
+ if(Sath && Sath->isAlive())
+ {
+ HostilReference* ref = Sath->getThreatManager().getOnlineContainer().getReferenceByTarget(plr);
+ if(ref)
+ {
+ ref->removeReference();
+ debug_log("SD2: INST: Deleting %s from Sathrovarr's threatlist", plr->GetName());
+ }
+ }
+
+ // Put player back in Kalecgos(Dragon)'s threat list
+ Creature* Kalecgos = ((Creature*)Unit::GetUnit(*plr, Kalecgos_Dragon));
+ if(Kalecgos && Kalecgos->isAlive())
+ {
+ debug_log("SD2: INST: Putting %s in Kalecgos' threatlist", plr->GetName());
+ Kalecgos->AddThreat(plr, 1.0f);
+ }
+
+ plr->CastSpell(plr, SPELL_TELEPORT_NORMAL_REALM, true);
+ plr->CastSpell(plr, SPELL_SPECTRAL_EXHAUSTION, true);
+ }
+
+ void EjectPlayers()
+ {
+ for(uint8 i = 0; i < SpectralRealmList.size(); ++i)
+ {
+ Player* plr = DirtyHackToGetPlayerFromSpectralList(SpectralRealmList[i]);
+ if(plr && !plr->HasAura(SPELL_SPECTRAL_REALM, 0))
+ {
+ EjectPlayer(plr);
+ SpectralRealmList.erase(SpectralRealmList.begin() + i);
+ }
+ }
+
+ SpectralRealmList.clear();
+ }
+
+ void Update(uint32 diff)
+ {
+ // Only check for Spectral Realm if Kalecgos Encounter is running
+ if(Encounters[0] == IN_PROGRESS)
+ if(SpectralRealmTimer < diff)
+ {
+ EjectPlayers();
+ SpectralRealmTimer = 5000;
+ }else SpectralRealmTimer -= diff;
+ }
+};
+
+InstanceData* GetInstanceData_instance_sunwell_plateau(Map* map)
+{
+ return new instance_sunwell_plateau(map);
+}
+
+void AddSC_instance_sunwell_plateau()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_sunwell_plateau";
+ newscript->GetInstanceData = GetInstanceData_instance_sunwell_plateau;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
index 2b328d2185e..2eb6ab80335 100644
--- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
+++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
@@ -1,402 +1,402 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Tanaris
-SD%Complete: 80
-SDComment: Quest support: 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor
-SDCategory: Tanaris
-EndScriptData */
-
-/* ContentData
-mob_aquementas
-npc_custodian_of_time
-npc_marin_noggenfogger
-npc_steward_of_time
-npc_stone_watcher_of_norgannon
-EndContentData */
-
-#include "precompiled.h"
-#include "../../npc/npc_escortAI.h"
-
-/*######
-## mob_aquementas
-######*/
-
-#define AGGRO_YELL_AQUE "Who dares awaken Aquementas?"
-
-#define SPELL_AQUA_JET 13586
-#define SPELL_FROST_SHOCK 15089
-
-struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI
-{
- mob_aquementasAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SendItem_Timer;
- uint32 SwitchFaction_Timer;
- bool isFriendly;
-
- uint32 FrostShock_Timer;
- uint32 AquaJet_Timer;
-
- void Reset()
- {
- SendItem_Timer = 0;
- SwitchFaction_Timer = 10000;
- m_creature->setFaction(35);
- isFriendly = true;
-
- AquaJet_Timer = 5000;
- FrostShock_Timer = 1000;
- }
-
- void SendItem(Unit* receiver)
- {
- if (((Player*)receiver)->HasItemCount(11169,1,false) &&
- ((Player*)receiver)->HasItemCount(11172,11,false) &&
- ((Player*)receiver)->HasItemCount(11173,1,false) &&
- !((Player*)receiver)->HasItemCount(11522,1,true))
- {
- ItemPosCountVec dest;
- uint8 msg = ((Player*)receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false);
- if( msg == EQUIP_ERR_OK )
- ((Player*)receiver)->StoreNewItem( dest, 11522, 1, true);
- }
- }
-
- void Aggro(Unit* who)
- {
- DoYell(AGGRO_YELL_AQUE,LANG_UNIVERSAL,who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( isFriendly )
- {
- if( SwitchFaction_Timer < diff )
- {
- m_creature->setFaction(91);
- isFriendly = false;
- }else SwitchFaction_Timer -= diff;
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( !isFriendly )
- {
- if( SendItem_Timer < diff )
- {
- if( m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER )
- SendItem(m_creature->getVictim());
- SendItem_Timer = 5000;
- }else SendItem_Timer -= diff;
- }
-
- if( FrostShock_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_SHOCK);
- FrostShock_Timer = 15000;
- }else FrostShock_Timer -= diff;
-
- if( AquaJet_Timer < diff )
- {
- DoCast(m_creature,SPELL_AQUA_JET);
- AquaJet_Timer = 15000;
- }else AquaJet_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mob_aquementas(Creature *_Creature)
-{
- return new mob_aquementasAI (_Creature);
-}
-
-/*######
-## npc_custodian_of_time
-######*/
-
-#define WHISPER_CUSTODIAN_1 "Greetings, $N. I will guide you through the cavern. Please try and keep up."
-#define WHISPER_CUSTODIAN_2 "We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place."
-#define WHISPER_CUSTODIAN_3 "It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality."
-#define WHISPER_CUSTODIAN_4 "Follow me, please."
-#define WHISPER_CUSTODIAN_5 "There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality."
-#define WHISPER_CUSTODIAN_6 "As custodians of time, we watch over and care for Nozdormu's realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard."
-#define WHISPER_CUSTODIAN_7 "For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present."
-#define WHISPER_CUSTODIAN_8 "These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as 'trouble spots.' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one..."
-#define WHISPER_CUSTODIAN_9 "This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall's freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost."
-#define WHISPER_CUSTODIAN_10 "We have very little information on this timeway. Sa'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not..."
-#define WHISPER_CUSTODIAN_11 "This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown..."
-#define WHISPER_CUSTODIAN_12 "The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities."
-#define WHISPER_CUSTODIAN_13 "All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway's defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict."
-#define WHISPER_CUSTODIAN_14 "Our time is at an end $N. I would wish you luck, if such a thing existed."
-
-struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
-{
- npc_custodian_of_timeAI(Creature *c) : npc_escortAI(c) { Reset(); }
-
- void WaypointReached(uint32 i)
- {
- Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
- if( !pTemp )
- return;
-
- switch( i )
- {
- case 0: DoWhisper(WHISPER_CUSTODIAN_1, pTemp); break;
- case 1: DoWhisper(WHISPER_CUSTODIAN_2, pTemp); break;
- case 2: DoWhisper(WHISPER_CUSTODIAN_3, pTemp); break;
- case 3: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 5: DoWhisper(WHISPER_CUSTODIAN_5, pTemp); break;
- case 6: DoWhisper(WHISPER_CUSTODIAN_6, pTemp); break;
- case 7: DoWhisper(WHISPER_CUSTODIAN_7, pTemp); break;
- case 8: DoWhisper(WHISPER_CUSTODIAN_8, pTemp); break;
- case 9: DoWhisper(WHISPER_CUSTODIAN_9, pTemp); break;
- case 10: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 13: DoWhisper(WHISPER_CUSTODIAN_10, pTemp); break;
- case 14: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 16: DoWhisper(WHISPER_CUSTODIAN_11, pTemp); break;
- case 17: DoWhisper(WHISPER_CUSTODIAN_12, pTemp); break;
- case 18: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 22: DoWhisper(WHISPER_CUSTODIAN_13, pTemp); break;
- case 23: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 24:
- DoWhisper(WHISPER_CUSTODIAN_14, pTemp);
- DoCast(pTemp,34883);
- //below here is temporary workaround, to be removed when spell works properly
- ((Player*)pTemp)->AreaExploredOrEventHappens(10277);
- break;
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( IsBeingEscorted )
- return;
-
- if( who->GetTypeId() == TYPEID_PLAYER )
- {
- if( ((Player*)who)->HasAura(34877,1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
- {
- float Radius = 10.0;
- if( m_creature->IsWithinDistInMap(who, Radius) )
- {
- ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID());
- }
- }
- }
- }
-
- void Aggro(Unit* who) { }
- void Reset() { }
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
- }
-};
-
-CreatureAI* GetAI_npc_custodian_of_time(Creature *_Creature)
-{
- npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(_Creature);
-
- custodian_of_timeAI->AddWaypoint(0, -8374.93,-4250.21, -204.38,5000);
- custodian_of_timeAI->AddWaypoint(1, -8374.93,-4250.21, -204.38,16000);
- custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -204.38,10000);
- custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,2000);
- custodian_of_timeAI->AddWaypoint(4, -8439.40,-4180.05, -209.25);
- custodian_of_timeAI->AddWaypoint(5, -8437.82,-4120.84, -208.59,10000);
- custodian_of_timeAI->AddWaypoint(6, -8437.82,-4120.84, -208.59,16000);
- custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,13000);
- custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,18000);
- custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,15000);
- custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,2000);
- custodian_of_timeAI->AddWaypoint(11, -8467.26,-4198.63, -214.21);
- custodian_of_timeAI->AddWaypoint(12, -8667.76,-4252.13, -209.56);
- custodian_of_timeAI->AddWaypoint(13, -8703.71,-4234.58, -209.5,14000);
- custodian_of_timeAI->AddWaypoint(14, -8703.71,-4234.58, -209.5,2000);
- custodian_of_timeAI->AddWaypoint(15, -8642.81,-4304.37, -209.57);
- custodian_of_timeAI->AddWaypoint(16, -8649.06,-4394.36, -208.46,6000);
- custodian_of_timeAI->AddWaypoint(17, -8649.06,-4394.36, -208.46,18000);
- custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,2000);
- custodian_of_timeAI->AddWaypoint(19, -8468.72,-4437.67, -215.45);
- custodian_of_timeAI->AddWaypoint(20, -8427.54,-4426, -211.13);
- custodian_of_timeAI->AddWaypoint(21, -8364.83,-4393.32, -205.91);
- custodian_of_timeAI->AddWaypoint(22, -8304.54,-4357.2, -208.2,18000);
- custodian_of_timeAI->AddWaypoint(23, -8304.54,-4357.2, -208.2,2000);
- custodian_of_timeAI->AddWaypoint(24, -8375.42,-4250.41, -205.14,5000);
- custodian_of_timeAI->AddWaypoint(25, -8375.42,-4250.41, -205.14,5000);
-
- return (CreatureAI*)custodian_of_timeAI;
-}
-
-/*######
-## npc_marin_noggenfogger
-######*/
-
-bool GossipHello_npc_marin_noggenfogger(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isVendor() && player->GetQuestRewardStatus(2662) )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_marin_noggenfogger(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if( action == GOSSIP_ACTION_TRADE )
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-## npc_steward_of_time
-######*/
-
-#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair."
-
-bool GossipHello_npc_steward_of_time(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279) )
- {
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9978,_Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(9977,_Creature->GetGUID());
-
- return true;
-}
-
-bool QuestAccept_npc_steward_of_time(Player *player, Creature *creature, Quest const *quest )
-{
- if( quest->GetQuestId() == 10279 ) //Quest: To The Master's Lair
- player->CastSpell(player,34891,true); //(Flight through Caverns)
-
- return false;
-}
-
-bool GossipSelect_npc_steward_of_time(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF + 1 )
- player->CastSpell(player,34891,true); //(Flight through Caverns)
-
- return true;
-}
-
-/*######
-## npc_stone_watcher_of_norgannon
-######*/
-
-#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?"
-#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!"
-#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?"
-#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum."
-
-bool GossipHello_npc_stone_watcher_of_norgannon(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(1674, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_stone_watcher_of_norgannon(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(1675, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(1676, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(1677, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(1678, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(1679, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2954);
- break;
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_tanaris()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_aquementas";
- newscript->GetAI = GetAI_mob_aquementas;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_custodian_of_time";
- newscript->GetAI = GetAI_npc_custodian_of_time;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_marin_noggenfogger";
- newscript->pGossipHello = &GossipHello_npc_marin_noggenfogger;
- newscript->pGossipSelect = &GossipSelect_npc_marin_noggenfogger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_steward_of_time";
- newscript->pGossipHello = &GossipHello_npc_steward_of_time;
- newscript->pGossipSelect = &GossipSelect_npc_steward_of_time;
- newscript->pQuestAccept = &QuestAccept_npc_steward_of_time;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_stone_watcher_of_norgannon";
- newscript->pGossipHello = &GossipHello_npc_stone_watcher_of_norgannon;
- newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Tanaris
+SD%Complete: 80
+SDComment: Quest support: 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor
+SDCategory: Tanaris
+EndScriptData */
+
+/* ContentData
+mob_aquementas
+npc_custodian_of_time
+npc_marin_noggenfogger
+npc_steward_of_time
+npc_stone_watcher_of_norgannon
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+
+/*######
+## mob_aquementas
+######*/
+
+#define AGGRO_YELL_AQUE "Who dares awaken Aquementas?"
+
+#define SPELL_AQUA_JET 13586
+#define SPELL_FROST_SHOCK 15089
+
+struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI
+{
+ mob_aquementasAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SendItem_Timer;
+ uint32 SwitchFaction_Timer;
+ bool isFriendly;
+
+ uint32 FrostShock_Timer;
+ uint32 AquaJet_Timer;
+
+ void Reset()
+ {
+ SendItem_Timer = 0;
+ SwitchFaction_Timer = 10000;
+ m_creature->setFaction(35);
+ isFriendly = true;
+
+ AquaJet_Timer = 5000;
+ FrostShock_Timer = 1000;
+ }
+
+ void SendItem(Unit* receiver)
+ {
+ if (((Player*)receiver)->HasItemCount(11169,1,false) &&
+ ((Player*)receiver)->HasItemCount(11172,11,false) &&
+ ((Player*)receiver)->HasItemCount(11173,1,false) &&
+ !((Player*)receiver)->HasItemCount(11522,1,true))
+ {
+ ItemPosCountVec dest;
+ uint8 msg = ((Player*)receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ ((Player*)receiver)->StoreNewItem( dest, 11522, 1, true);
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoYell(AGGRO_YELL_AQUE,LANG_UNIVERSAL,who);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( isFriendly )
+ {
+ if( SwitchFaction_Timer < diff )
+ {
+ m_creature->setFaction(91);
+ isFriendly = false;
+ }else SwitchFaction_Timer -= diff;
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( !isFriendly )
+ {
+ if( SendItem_Timer < diff )
+ {
+ if( m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER )
+ SendItem(m_creature->getVictim());
+ SendItem_Timer = 5000;
+ }else SendItem_Timer -= diff;
+ }
+
+ if( FrostShock_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROST_SHOCK);
+ FrostShock_Timer = 15000;
+ }else FrostShock_Timer -= diff;
+
+ if( AquaJet_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_AQUA_JET);
+ AquaJet_Timer = 15000;
+ }else AquaJet_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mob_aquementas(Creature *_Creature)
+{
+ return new mob_aquementasAI (_Creature);
+}
+
+/*######
+## npc_custodian_of_time
+######*/
+
+#define WHISPER_CUSTODIAN_1 "Greetings, $N. I will guide you through the cavern. Please try and keep up."
+#define WHISPER_CUSTODIAN_2 "We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place."
+#define WHISPER_CUSTODIAN_3 "It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality."
+#define WHISPER_CUSTODIAN_4 "Follow me, please."
+#define WHISPER_CUSTODIAN_5 "There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality."
+#define WHISPER_CUSTODIAN_6 "As custodians of time, we watch over and care for Nozdormu's realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard."
+#define WHISPER_CUSTODIAN_7 "For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present."
+#define WHISPER_CUSTODIAN_8 "These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as 'trouble spots.' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one..."
+#define WHISPER_CUSTODIAN_9 "This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall's freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost."
+#define WHISPER_CUSTODIAN_10 "We have very little information on this timeway. Sa'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not..."
+#define WHISPER_CUSTODIAN_11 "This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown..."
+#define WHISPER_CUSTODIAN_12 "The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities."
+#define WHISPER_CUSTODIAN_13 "All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway's defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict."
+#define WHISPER_CUSTODIAN_14 "Our time is at an end $N. I would wish you luck, if such a thing existed."
+
+struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
+{
+ npc_custodian_of_timeAI(Creature *c) : npc_escortAI(c) { Reset(); }
+
+ void WaypointReached(uint32 i)
+ {
+ Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
+ if( !pTemp )
+ return;
+
+ switch( i )
+ {
+ case 0: DoWhisper(WHISPER_CUSTODIAN_1, pTemp); break;
+ case 1: DoWhisper(WHISPER_CUSTODIAN_2, pTemp); break;
+ case 2: DoWhisper(WHISPER_CUSTODIAN_3, pTemp); break;
+ case 3: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
+ case 5: DoWhisper(WHISPER_CUSTODIAN_5, pTemp); break;
+ case 6: DoWhisper(WHISPER_CUSTODIAN_6, pTemp); break;
+ case 7: DoWhisper(WHISPER_CUSTODIAN_7, pTemp); break;
+ case 8: DoWhisper(WHISPER_CUSTODIAN_8, pTemp); break;
+ case 9: DoWhisper(WHISPER_CUSTODIAN_9, pTemp); break;
+ case 10: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
+ case 13: DoWhisper(WHISPER_CUSTODIAN_10, pTemp); break;
+ case 14: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
+ case 16: DoWhisper(WHISPER_CUSTODIAN_11, pTemp); break;
+ case 17: DoWhisper(WHISPER_CUSTODIAN_12, pTemp); break;
+ case 18: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
+ case 22: DoWhisper(WHISPER_CUSTODIAN_13, pTemp); break;
+ case 23: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
+ case 24:
+ DoWhisper(WHISPER_CUSTODIAN_14, pTemp);
+ DoCast(pTemp,34883);
+ //below here is temporary workaround, to be removed when spell works properly
+ ((Player*)pTemp)->AreaExploredOrEventHappens(10277);
+ break;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( IsBeingEscorted )
+ return;
+
+ if( who->GetTypeId() == TYPEID_PLAYER )
+ {
+ if( ((Player*)who)->HasAura(34877,1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
+ {
+ float Radius = 10.0;
+ if( m_creature->IsWithinDistInMap(who, Radius) )
+ {
+ ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID());
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit* who) { }
+ void Reset() { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+};
+
+CreatureAI* GetAI_npc_custodian_of_time(Creature *_Creature)
+{
+ npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(_Creature);
+
+ custodian_of_timeAI->AddWaypoint(0, -8374.93,-4250.21, -204.38,5000);
+ custodian_of_timeAI->AddWaypoint(1, -8374.93,-4250.21, -204.38,16000);
+ custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -204.38,10000);
+ custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,2000);
+ custodian_of_timeAI->AddWaypoint(4, -8439.40,-4180.05, -209.25);
+ custodian_of_timeAI->AddWaypoint(5, -8437.82,-4120.84, -208.59,10000);
+ custodian_of_timeAI->AddWaypoint(6, -8437.82,-4120.84, -208.59,16000);
+ custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,13000);
+ custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,18000);
+ custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,15000);
+ custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,2000);
+ custodian_of_timeAI->AddWaypoint(11, -8467.26,-4198.63, -214.21);
+ custodian_of_timeAI->AddWaypoint(12, -8667.76,-4252.13, -209.56);
+ custodian_of_timeAI->AddWaypoint(13, -8703.71,-4234.58, -209.5,14000);
+ custodian_of_timeAI->AddWaypoint(14, -8703.71,-4234.58, -209.5,2000);
+ custodian_of_timeAI->AddWaypoint(15, -8642.81,-4304.37, -209.57);
+ custodian_of_timeAI->AddWaypoint(16, -8649.06,-4394.36, -208.46,6000);
+ custodian_of_timeAI->AddWaypoint(17, -8649.06,-4394.36, -208.46,18000);
+ custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,2000);
+ custodian_of_timeAI->AddWaypoint(19, -8468.72,-4437.67, -215.45);
+ custodian_of_timeAI->AddWaypoint(20, -8427.54,-4426, -211.13);
+ custodian_of_timeAI->AddWaypoint(21, -8364.83,-4393.32, -205.91);
+ custodian_of_timeAI->AddWaypoint(22, -8304.54,-4357.2, -208.2,18000);
+ custodian_of_timeAI->AddWaypoint(23, -8304.54,-4357.2, -208.2,2000);
+ custodian_of_timeAI->AddWaypoint(24, -8375.42,-4250.41, -205.14,5000);
+ custodian_of_timeAI->AddWaypoint(25, -8375.42,-4250.41, -205.14,5000);
+
+ return (CreatureAI*)custodian_of_timeAI;
+}
+
+/*######
+## npc_marin_noggenfogger
+######*/
+
+bool GossipHello_npc_marin_noggenfogger(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isVendor() && player->GetQuestRewardStatus(2662) )
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_marin_noggenfogger(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if( action == GOSSIP_ACTION_TRADE )
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+## npc_steward_of_time
+######*/
+
+#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair."
+
+bool GossipHello_npc_steward_of_time(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279) )
+ {
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(9978,_Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(9977,_Creature->GetGUID());
+
+ return true;
+}
+
+bool QuestAccept_npc_steward_of_time(Player *player, Creature *creature, Quest const *quest )
+{
+ if( quest->GetQuestId() == 10279 ) //Quest: To The Master's Lair
+ player->CastSpell(player,34891,true); //(Flight through Caverns)
+
+ return false;
+}
+
+bool GossipSelect_npc_steward_of_time(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF + 1 )
+ player->CastSpell(player,34891,true); //(Flight through Caverns)
+
+ return true;
+}
+
+/*######
+## npc_stone_watcher_of_norgannon
+######*/
+
+#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?"
+#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?"
+#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?"
+#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!"
+#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?"
+#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum."
+
+bool GossipHello_npc_stone_watcher_of_norgannon(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(1674, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_stone_watcher_of_norgannon(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(1675, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(1676, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(1677, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(1678, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(1679, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2954);
+ break;
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_tanaris()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_aquementas";
+ newscript->GetAI = GetAI_mob_aquementas;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_custodian_of_time";
+ newscript->GetAI = GetAI_npc_custodian_of_time;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_marin_noggenfogger";
+ newscript->pGossipHello = &GossipHello_npc_marin_noggenfogger;
+ newscript->pGossipSelect = &GossipSelect_npc_marin_noggenfogger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_steward_of_time";
+ newscript->pGossipHello = &GossipHello_npc_steward_of_time;
+ newscript->pGossipSelect = &GossipSelect_npc_steward_of_time;
+ newscript->pQuestAccept = &QuestAccept_npc_steward_of_time;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_stone_watcher_of_norgannon";
+ newscript->pGossipHello = &GossipHello_npc_stone_watcher_of_norgannon;
+ newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
index cd45e139eaf..b8b296229aa 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
@@ -1,606 +1,606 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Arcatraz
-SD%Complete: 60
-SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse.
-SDCategory: Tempest Keep, The Arcatraz
-EndScriptData */
-
-/* ContentData
-npc_millhouse_manastorm
-npc_warden_mellichar
-mob_zerekethvoidzone
-EndContentData */
-
-#include "precompiled.h"
-#include "def_arcatraz.h"
-
-/*#####
-# npc_millhouse_manastorm
-#####*/
-
-#define SAY_INTRO_1 "Where in Bonzo's brass buttons am I? And who are-- yaaghh, that's one mother of a headache!"
-#define SOUND_INTRO_1 11171
-#define SAY_INTRO_2 "\"Lowly\"? I don't care who you are friend, no one refers to the mighty Millhouse Manastorm as \"Lowly\"! I have no idea what goes on here, but I will gladly join your fight against this impudent imbecile! Prepare to defend yourself, cretin!"
-#define SOUND_INTRO_2 11172
-
-#define SAY_WATER "I just need to get some things ready first. You guys go ahead and get started. I need to summon up some water..."
-#define SOUND_WATER 11173
-
-#define SAY_BUFFS "Fantastic! Next, some protective spells. Yes! Now we're cookin'"
-#define SOUND_BUFFS 11174
-
-#define SAY_DRINK "And of course i'll need some mana. You guys are gonna love this, just wait."
-#define SOUND_DRINK 11175
-
-#define SAY_READY "Aaalllriiiight!! Who ordered up an extra large can of whoop-ass?"
-#define SOUND_READY 11176
-
-#define SAY_KILL_1 "I didn't even break a sweat on that one."
-#define SOUND_KILL_1 11177
-#define SAY_KILL_2 "You guys, feel free to jump in anytime."
-#define SOUND_KILL_2 11178
-
-#define SAY_PYRO "I'm gonna light you up, sweet cheeks!"
-#define SOUND_PYRO 11179
-
-#define SAY_ICEBLOCK "Ice, ice, baby!"
-#define SOUND_ICEBLOCK 11180
-
-#define SAY_LOWHP "Heal me! Oh, for the love of all that is holy, HEAL me! I'm dying!"
-#define SOUND_LOWHP 11181
-
-#define SAY_DEATH "You'll be hearing from my lawyer..."
-#define SOUND_DEATH 11182
-
-#define SAY_COMPLETE "Who's bad? Who's bad? That's right: we bad!"
-#define SOUND_COMPLETE 11183
-
-#define SPELL_CONJURE_WATER 36879
-#define SPELL_ARCANE_INTELLECT 36880
-#define SPELL_ICE_ARMOR 36881
-
-#define SPELL_ARCANE_MISSILES 33833
-#define SPELL_CONE_OF_COLD 12611
-#define SPELL_FIRE_BLAST 13341
-#define SPELL_FIREBALL 14034
-#define SPELL_FROSTBOLT 15497
-#define SPELL_PYROBLAST 33975
-
-struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI
-{
- npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 EventProgress_Timer;
- uint32 Phase;
- bool Init;
- bool LowHp;
-
- uint32 Pyroblast_Timer;
- uint32 Fireball_Timer;
-
- void Reset()
- {
- EventProgress_Timer = 2000;
- LowHp = false;
- Init = false;
- Phase = 1;
-
- Pyroblast_Timer = 1000;
- Fireball_Timer = 2500;
-
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_WARDEN_2) == DONE )
- Init = true;
-
- if( pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE )
- {
- DoYell(SAY_COMPLETE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_COMPLETE);
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackNoMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void AttackStart(Unit* who)
- {
- if (who->isTargetableForAttack())
- {
- DoStartAttackNoMovement(who);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- /*for questId 10886 (heroic mode only)
- if( pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE )
- ->FailQuest();*/
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Init )
- {
- if( EventProgress_Timer < diff )
- {
- if( Phase < 8 )
- {
- switch( Phase )
- {
- case 1:
- DoYell(SAY_INTRO_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO_1);
- EventProgress_Timer = 18000;
- break;
- case 2:
- DoYell(SAY_INTRO_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO_2);
- EventProgress_Timer = 18000;
- break;
- case 3:
- DoYell(SAY_WATER,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_WATER);
- DoCast(m_creature,SPELL_CONJURE_WATER);
- EventProgress_Timer = 7000;
- break;
- case 4:
- DoYell(SAY_BUFFS,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_BUFFS);
- DoCast(m_creature,SPELL_ICE_ARMOR);
- EventProgress_Timer = 7000;
- break;
- case 5:
- DoYell(SAY_DRINK,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DRINK);
- DoCast(m_creature,SPELL_ARCANE_INTELLECT);
- EventProgress_Timer = 7000;
- break;
- case 6:
- DoYell(SAY_READY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_READY);
- EventProgress_Timer = 6000;
- break;
- case 7:
- if( pInstance )
- pInstance->SetData(TYPE_WARDEN_2,DONE);
- Init = true;
- break;
- }
- ++Phase;
- }
- } else EventProgress_Timer -= diff;
- }
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) )
- {
- DoYell(SAY_LOWHP,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LOWHP);
- LowHp = true;
- }
-
- if( Pyroblast_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- return;
-
- DoYell(SAY_PYRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_PYRO);
-
- DoCast(m_creature->getVictim(),SPELL_PYROBLAST);
- Pyroblast_Timer = 40000;
- }else Pyroblast_Timer -=diff;
-
- if( Fireball_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALL);
- Fireball_Timer = 4000;
- }else Fireball_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_npc_millhouse_manastorm(Creature *_Creature)
-{
- return new npc_millhouse_manastormAI (_Creature);
-}
-
-/*#####
-# npc_warden_mellichar
-#####*/
-
-#define YELL_INTRO1 "I knew the prince would be angry but, I... I have not been myself. I had to let them out! The great one speaks to me, you see. Wait--outsiders. Kael'thas did not send you! Good... I'll just tell the prince you released the prisoners!"
-#define SOUND_INTRO1 11222
-
-#define YELL_INTRO2 "The naaru kept some of the most dangerous beings in existence here in these cells. Let me introduce you to another...."
-#define SOUND_INTRO2 11223
-
-#define YELL_RELEASE1 "Yes, yes... another! Your will is mine!"
-#define SOUND_RELEASE1 11224
-
-#define YELL_RELEASE2A "Behold another terrifying creature of incomprehensible power!"
-#define SOUND_RELEASE2A 11225
-#define YELL_RELEASE2B "What is this? A lowly gnome? I will do better, O'great one."
-#define SOUND_RELEASE2B 11226
-
-#define YELL_RELEASE3 "Anarchy! Bedlam! Oh, you are so wise! Yes, I see it now, of course!"
-#define SOUND_RELEASE3 11227
-
-#define YELL_RELEASE4 "One final cell remains. Yes, O'great one, right away!"
-#define SOUND_RELEASE4 11228
-
-#define YELL_WELCOME "Welcome, O'great one. I am your humble servant."
-#define SOUND_WELCOME 11229
-
-//phase 2(acid mobs)
-#define ENTRY_TRICKSTER 20905
-#define ENTRY_PH_HUNTER 20906
-//phase 3
-#define ENTRY_MILLHOUSE 20977
-//phase 4(acid mobs)
-#define ENTRY_AKKIRIS 20908
-#define ENTRY_SULFURON 20909
-//phase 5(acid mobs)
-#define ENTRY_TW_DRAK 20910
-#define ENTRY_BL_DRAK 20911
-//phase 6
-#define ENTRY_SKYRISS 20912
-
-//TARGET_SCRIPT
-#define SPELL_TARGET_ALPHA 36856
-#define SPELL_TARGET_BETA 36854
-#define SPELL_TARGET_DELTA 36857
-#define SPELL_TARGET_GAMMA 36858
-#define SPELL_TARGET_OMEGA 36852
-#define SPELL_BUBBLE_VISUAL 36849
-
-struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
-{
- npc_warden_mellicharAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- bool IsRunning;
- bool CanSpawn;
-
- uint32 EventProgress_Timer;
- uint32 Phase;
-
- void Reset()
- {
- IsRunning = false;
- CanSpawn = false;
-
- EventProgress_Timer = 22000;
- Phase = 1;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- DoCast(m_creature,SPELL_TARGET_OMEGA);
-
- if( pInstance )
- pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED);
- }
-
- void AttackStart(Unit* who) { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( IsRunning )
- return;
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
- if (who->GetTypeId() != TYPEID_PLAYER)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who)/10;
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- Aggro(who);
- }
- }
-
- void Aggro(Unit *who)
- {
- DoYell(YELL_INTRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO1);
- //possibly wrong spell OR should also cast second spell to make bubble appear (visual for this spell appear to be the correct)
- DoCast(m_creature,SPELL_BUBBLE_VISUAL);
-
- if( pInstance )
- {
- pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS);
- IsRunning = true;
- }
- }
-
- uint32 CanProgress()
- {
- if( pInstance )
- {
- if( Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE )
- return true;
- if( Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE )
- return true;
- if( Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE )
- return true;
- if( Phase == 4 )
- return true;
- if( Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE )
- return true;
- if( Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS )
- return true;
- if( Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS )
- return true;
- return false;
- }
- return false;
- }
-
- void DoPrepareForPhase()
- {
- if( pInstance )
- {
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY);
-
- switch( Phase )
- {
- case 2:
- DoCast(m_creature,SPELL_TARGET_ALPHA);
- pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS);
- break;
- case 3:
- DoCast(m_creature,SPELL_TARGET_BETA);
- pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS);
- break;
- case 5:
- DoCast(m_creature,SPELL_TARGET_DELTA);
- pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS);
- break;
- case 6:
- DoCast(m_creature,SPELL_TARGET_GAMMA);
- pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS);
- break;
- case 7:
- pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS);
- break;
- }
- CanSpawn = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !IsRunning )
- return;
-
- if( EventProgress_Timer < diff )
- {
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL )
- Reset();
- }
-
- if( CanSpawn )
- {
- //continue beam omega pod, unless we are about to summon skyriss
- if( Phase != 7 )
- DoCast(m_creature,SPELL_TARGET_OMEGA);
-
- switch( Phase )
- {
- case 2:
- switch( rand()%2 )
- {
- case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- }
- break;
- case 3:
- m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- break;
- case 4:
- DoYell(YELL_RELEASE2B,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RELEASE2B);
- break;
- case 5:
- switch( rand()%2 )
- {
- case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- }
- break;
- case 6:
- switch( rand()%2 )
- {
- case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
- }
- break;
- case 7:
- m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoYell(YELL_WELCOME,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_WELCOME);
- break;
- }
- CanSpawn = false;
- ++Phase;
- }
- if( CanProgress() )
- {
- switch( Phase )
- {
- case 1:
- DoYell(YELL_INTRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO2);
- EventProgress_Timer = 10000;
- ++Phase;
- break;
- case 2:
- DoYell(YELL_RELEASE1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RELEASE1);
- DoPrepareForPhase();
- EventProgress_Timer = 7000;
- break;
- case 3:
- DoYell(YELL_RELEASE2A,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RELEASE2A);
- DoPrepareForPhase();
- EventProgress_Timer = 10000;
- break;
- case 4:
- DoPrepareForPhase();
- EventProgress_Timer = 15000;
- break;
- case 5:
- DoYell(YELL_RELEASE3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RELEASE3);
- DoPrepareForPhase();
- EventProgress_Timer = 15000;
- break;
- case 6:
- DoYell(YELL_RELEASE4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RELEASE4);
- DoPrepareForPhase();
- EventProgress_Timer = 15000;
- break;
- case 7:
- DoPrepareForPhase();
- EventProgress_Timer = 15000;
- break;
- }
- }
- } else EventProgress_Timer -= diff;
- }
-};
-CreatureAI* GetAI_npc_warden_mellichar(Creature *_Creature)
-{
- return new npc_warden_mellicharAI (_Creature);
-}
-
-/*#####
-# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0')
-#####*/
-
-#define SPELL_VOID_ZONE_DAMAGE 36120
-
-struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI
-{
- mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(16);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE);
- }
-
- void Aggro(Unit* who) {}
-};
-CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature *_Creature)
-{
- return new mob_zerekethvoidzoneAI (_Creature);
-}
-
-void AddSC_arcatraz()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_millhouse_manastorm";
- newscript->GetAI = GetAI_npc_millhouse_manastorm;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_warden_mellichar";
- newscript->GetAI = GetAI_npc_warden_mellichar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_zerekethvoidzone";
- newscript->GetAI = GetAI_mob_zerekethvoidzoneAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Arcatraz
+SD%Complete: 60
+SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse.
+SDCategory: Tempest Keep, The Arcatraz
+EndScriptData */
+
+/* ContentData
+npc_millhouse_manastorm
+npc_warden_mellichar
+mob_zerekethvoidzone
+EndContentData */
+
+#include "precompiled.h"
+#include "def_arcatraz.h"
+
+/*#####
+# npc_millhouse_manastorm
+#####*/
+
+#define SAY_INTRO_1 "Where in Bonzo's brass buttons am I? And who are-- yaaghh, that's one mother of a headache!"
+#define SOUND_INTRO_1 11171
+#define SAY_INTRO_2 "\"Lowly\"? I don't care who you are friend, no one refers to the mighty Millhouse Manastorm as \"Lowly\"! I have no idea what goes on here, but I will gladly join your fight against this impudent imbecile! Prepare to defend yourself, cretin!"
+#define SOUND_INTRO_2 11172
+
+#define SAY_WATER "I just need to get some things ready first. You guys go ahead and get started. I need to summon up some water..."
+#define SOUND_WATER 11173
+
+#define SAY_BUFFS "Fantastic! Next, some protective spells. Yes! Now we're cookin'"
+#define SOUND_BUFFS 11174
+
+#define SAY_DRINK "And of course i'll need some mana. You guys are gonna love this, just wait."
+#define SOUND_DRINK 11175
+
+#define SAY_READY "Aaalllriiiight!! Who ordered up an extra large can of whoop-ass?"
+#define SOUND_READY 11176
+
+#define SAY_KILL_1 "I didn't even break a sweat on that one."
+#define SOUND_KILL_1 11177
+#define SAY_KILL_2 "You guys, feel free to jump in anytime."
+#define SOUND_KILL_2 11178
+
+#define SAY_PYRO "I'm gonna light you up, sweet cheeks!"
+#define SOUND_PYRO 11179
+
+#define SAY_ICEBLOCK "Ice, ice, baby!"
+#define SOUND_ICEBLOCK 11180
+
+#define SAY_LOWHP "Heal me! Oh, for the love of all that is holy, HEAL me! I'm dying!"
+#define SOUND_LOWHP 11181
+
+#define SAY_DEATH "You'll be hearing from my lawyer..."
+#define SOUND_DEATH 11182
+
+#define SAY_COMPLETE "Who's bad? Who's bad? That's right: we bad!"
+#define SOUND_COMPLETE 11183
+
+#define SPELL_CONJURE_WATER 36879
+#define SPELL_ARCANE_INTELLECT 36880
+#define SPELL_ICE_ARMOR 36881
+
+#define SPELL_ARCANE_MISSILES 33833
+#define SPELL_CONE_OF_COLD 12611
+#define SPELL_FIRE_BLAST 13341
+#define SPELL_FIREBALL 14034
+#define SPELL_FROSTBOLT 15497
+#define SPELL_PYROBLAST 33975
+
+struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI
+{
+ npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 EventProgress_Timer;
+ uint32 Phase;
+ bool Init;
+ bool LowHp;
+
+ uint32 Pyroblast_Timer;
+ uint32 Fireball_Timer;
+
+ void Reset()
+ {
+ EventProgress_Timer = 2000;
+ LowHp = false;
+ Init = false;
+ Phase = 1;
+
+ Pyroblast_Timer = 1000;
+ Fireball_Timer = 2500;
+
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_WARDEN_2) == DONE )
+ Init = true;
+
+ if( pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE )
+ {
+ DoYell(SAY_COMPLETE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_COMPLETE);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackNoMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (who->isTargetableForAttack())
+ {
+ DoStartAttackNoMovement(who);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ /*for questId 10886 (heroic mode only)
+ if( pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE )
+ ->FailQuest();*/
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Init )
+ {
+ if( EventProgress_Timer < diff )
+ {
+ if( Phase < 8 )
+ {
+ switch( Phase )
+ {
+ case 1:
+ DoYell(SAY_INTRO_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO_1);
+ EventProgress_Timer = 18000;
+ break;
+ case 2:
+ DoYell(SAY_INTRO_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO_2);
+ EventProgress_Timer = 18000;
+ break;
+ case 3:
+ DoYell(SAY_WATER,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WATER);
+ DoCast(m_creature,SPELL_CONJURE_WATER);
+ EventProgress_Timer = 7000;
+ break;
+ case 4:
+ DoYell(SAY_BUFFS,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_BUFFS);
+ DoCast(m_creature,SPELL_ICE_ARMOR);
+ EventProgress_Timer = 7000;
+ break;
+ case 5:
+ DoYell(SAY_DRINK,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DRINK);
+ DoCast(m_creature,SPELL_ARCANE_INTELLECT);
+ EventProgress_Timer = 7000;
+ break;
+ case 6:
+ DoYell(SAY_READY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_READY);
+ EventProgress_Timer = 6000;
+ break;
+ case 7:
+ if( pInstance )
+ pInstance->SetData(TYPE_WARDEN_2,DONE);
+ Init = true;
+ break;
+ }
+ ++Phase;
+ }
+ } else EventProgress_Timer -= diff;
+ }
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) )
+ {
+ DoYell(SAY_LOWHP,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LOWHP);
+ LowHp = true;
+ }
+
+ if( Pyroblast_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ return;
+
+ DoYell(SAY_PYRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_PYRO);
+
+ DoCast(m_creature->getVictim(),SPELL_PYROBLAST);
+ Pyroblast_Timer = 40000;
+ }else Pyroblast_Timer -=diff;
+
+ if( Fireball_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALL);
+ Fireball_Timer = 4000;
+ }else Fireball_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_millhouse_manastorm(Creature *_Creature)
+{
+ return new npc_millhouse_manastormAI (_Creature);
+}
+
+/*#####
+# npc_warden_mellichar
+#####*/
+
+#define YELL_INTRO1 "I knew the prince would be angry but, I... I have not been myself. I had to let them out! The great one speaks to me, you see. Wait--outsiders. Kael'thas did not send you! Good... I'll just tell the prince you released the prisoners!"
+#define SOUND_INTRO1 11222
+
+#define YELL_INTRO2 "The naaru kept some of the most dangerous beings in existence here in these cells. Let me introduce you to another...."
+#define SOUND_INTRO2 11223
+
+#define YELL_RELEASE1 "Yes, yes... another! Your will is mine!"
+#define SOUND_RELEASE1 11224
+
+#define YELL_RELEASE2A "Behold another terrifying creature of incomprehensible power!"
+#define SOUND_RELEASE2A 11225
+#define YELL_RELEASE2B "What is this? A lowly gnome? I will do better, O'great one."
+#define SOUND_RELEASE2B 11226
+
+#define YELL_RELEASE3 "Anarchy! Bedlam! Oh, you are so wise! Yes, I see it now, of course!"
+#define SOUND_RELEASE3 11227
+
+#define YELL_RELEASE4 "One final cell remains. Yes, O'great one, right away!"
+#define SOUND_RELEASE4 11228
+
+#define YELL_WELCOME "Welcome, O'great one. I am your humble servant."
+#define SOUND_WELCOME 11229
+
+//phase 2(acid mobs)
+#define ENTRY_TRICKSTER 20905
+#define ENTRY_PH_HUNTER 20906
+//phase 3
+#define ENTRY_MILLHOUSE 20977
+//phase 4(acid mobs)
+#define ENTRY_AKKIRIS 20908
+#define ENTRY_SULFURON 20909
+//phase 5(acid mobs)
+#define ENTRY_TW_DRAK 20910
+#define ENTRY_BL_DRAK 20911
+//phase 6
+#define ENTRY_SKYRISS 20912
+
+//TARGET_SCRIPT
+#define SPELL_TARGET_ALPHA 36856
+#define SPELL_TARGET_BETA 36854
+#define SPELL_TARGET_DELTA 36857
+#define SPELL_TARGET_GAMMA 36858
+#define SPELL_TARGET_OMEGA 36852
+#define SPELL_BUBBLE_VISUAL 36849
+
+struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
+{
+ npc_warden_mellicharAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool IsRunning;
+ bool CanSpawn;
+
+ uint32 EventProgress_Timer;
+ uint32 Phase;
+
+ void Reset()
+ {
+ IsRunning = false;
+ CanSpawn = false;
+
+ EventProgress_Timer = 22000;
+ Phase = 1;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
+ DoCast(m_creature,SPELL_TARGET_OMEGA);
+
+ if( pInstance )
+ pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED);
+ }
+
+ void AttackStart(Unit* who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( IsRunning )
+ return;
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who)/10;
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ Aggro(who);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(YELL_INTRO1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO1);
+ //possibly wrong spell OR should also cast second spell to make bubble appear (visual for this spell appear to be the correct)
+ DoCast(m_creature,SPELL_BUBBLE_VISUAL);
+
+ if( pInstance )
+ {
+ pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS);
+ IsRunning = true;
+ }
+ }
+
+ uint32 CanProgress()
+ {
+ if( pInstance )
+ {
+ if( Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE )
+ return true;
+ if( Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE )
+ return true;
+ if( Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE )
+ return true;
+ if( Phase == 4 )
+ return true;
+ if( Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE )
+ return true;
+ if( Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS )
+ return true;
+ if( Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS )
+ return true;
+ return false;
+ }
+ return false;
+ }
+
+ void DoPrepareForPhase()
+ {
+ if( pInstance )
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY);
+
+ switch( Phase )
+ {
+ case 2:
+ DoCast(m_creature,SPELL_TARGET_ALPHA);
+ pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS);
+ break;
+ case 3:
+ DoCast(m_creature,SPELL_TARGET_BETA);
+ pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS);
+ break;
+ case 5:
+ DoCast(m_creature,SPELL_TARGET_DELTA);
+ pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS);
+ break;
+ case 6:
+ DoCast(m_creature,SPELL_TARGET_GAMMA);
+ pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS);
+ break;
+ case 7:
+ pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS);
+ break;
+ }
+ CanSpawn = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !IsRunning )
+ return;
+
+ if( EventProgress_Timer < diff )
+ {
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL )
+ Reset();
+ }
+
+ if( CanSpawn )
+ {
+ //continue beam omega pod, unless we are about to summon skyriss
+ if( Phase != 7 )
+ DoCast(m_creature,SPELL_TARGET_OMEGA);
+
+ switch( Phase )
+ {
+ case 2:
+ switch( rand()%2 )
+ {
+ case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ }
+ break;
+ case 3:
+ m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ break;
+ case 4:
+ DoYell(YELL_RELEASE2B,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RELEASE2B);
+ break;
+ case 5:
+ switch( rand()%2 )
+ {
+ case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ }
+ break;
+ case 6:
+ switch( rand()%2 )
+ {
+ case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break;
+ }
+ break;
+ case 7:
+ m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoYell(YELL_WELCOME,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_WELCOME);
+ break;
+ }
+ CanSpawn = false;
+ ++Phase;
+ }
+ if( CanProgress() )
+ {
+ switch( Phase )
+ {
+ case 1:
+ DoYell(YELL_INTRO2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO2);
+ EventProgress_Timer = 10000;
+ ++Phase;
+ break;
+ case 2:
+ DoYell(YELL_RELEASE1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RELEASE1);
+ DoPrepareForPhase();
+ EventProgress_Timer = 7000;
+ break;
+ case 3:
+ DoYell(YELL_RELEASE2A,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RELEASE2A);
+ DoPrepareForPhase();
+ EventProgress_Timer = 10000;
+ break;
+ case 4:
+ DoPrepareForPhase();
+ EventProgress_Timer = 15000;
+ break;
+ case 5:
+ DoYell(YELL_RELEASE3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RELEASE3);
+ DoPrepareForPhase();
+ EventProgress_Timer = 15000;
+ break;
+ case 6:
+ DoYell(YELL_RELEASE4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RELEASE4);
+ DoPrepareForPhase();
+ EventProgress_Timer = 15000;
+ break;
+ case 7:
+ DoPrepareForPhase();
+ EventProgress_Timer = 15000;
+ break;
+ }
+ }
+ } else EventProgress_Timer -= diff;
+ }
+};
+CreatureAI* GetAI_npc_warden_mellichar(Creature *_Creature)
+{
+ return new npc_warden_mellicharAI (_Creature);
+}
+
+/*#####
+# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0')
+#####*/
+
+#define SPELL_VOID_ZONE_DAMAGE 36120
+
+struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI
+{
+ mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ m_creature->setFaction(16);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE);
+ }
+
+ void Aggro(Unit* who) {}
+};
+CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature *_Creature)
+{
+ return new mob_zerekethvoidzoneAI (_Creature);
+}
+
+void AddSC_arcatraz()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_millhouse_manastorm";
+ newscript->GetAI = GetAI_npc_millhouse_manastorm;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_warden_mellichar";
+ newscript->GetAI = GetAI_npc_warden_mellichar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_zerekethvoidzone";
+ newscript->GetAI = GetAI_mob_zerekethvoidzoneAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
index 2ebc1beb34a..9c706566de4 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
@@ -1,378 +1,378 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Harbinger_Skyriss
-SD%Complete: 45
-SDComment: CombatAI not fully implemented. Timers will need adjustments. Need better method to "kill" the warden. Need more docs on how event fully work. Reset all event and force start over if fail at one point?
-SDCategory: Tempest Keep, The Arcatraz
-EndScriptData */
-
-/* ContentData
-boss_harbinger_skyriss
-boss_harbinger_skyriss_illusion
-EndContentData */
-
-#include "precompiled.h"
-#include "def_arcatraz.h"
-
-#define SAY_INTRO "It is a small matter to control the mind of the weak... for I bear allegiance to powers untouched by time, unmoved by fate. No force on this world or beyond harbors the strength to bend our knee... not even the mighty Legion!"
-#define SOUND_INTRO 11122
-
-#define SAY_AGGRO "Bear witness to the agent of your demise!"
-#define SOUND_AGGRO 11123
-
-#define SAY_KILL_1 "Your fate is written!"
-#define SOUND_KILL_1 11124
-#define SAY_KILL_2 "The chaos I have sown here is but a taste...."
-#define SOUND_KILL_2 11125
-
-#define SAY_MIND_1 "You will do my bidding, weakling."
-#define SOUND_MIND_1 11127
-#define SAY_MIND_2 "Your will is no longer your own."
-#define SOUND_MIND_2 11128
-
-#define SAY_FEAR_1 "Flee in terror!"
-#define SOUND_FEAR_1 11129
-#define SAY_FEAR_2 "I will show you horrors undreamed of!"
-#define SOUND_FEAR_2 11130
-
-#define SAY_IMAGE "We span the universe, as countless as the stars!"
-#define SOUND_IMAGE 11131
-
-#define SAY_DEATH "I am merely one of... infinite multitudes."
-#define SOUND_DEATH 11126
-
-#define SPELL_FEAR 39415
-
-#define SPELL_MIND_REND 36924
-#define H_SPELL_MIND_REND 39017
-
-#define SPELL_DOMINATION 37162
-#define H_SPELL_DOMINATION 39019
-
-#define H_SPELL_MANA_BURN 39020
-
-#define SPELL_66_ILLUSION 36931 //entry 21466
-#define SPELL_33_ILLUSION 36932 //entry 21467
-
-struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
-{
- boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool HeroicMode;
-
- bool Intro;
- bool IsImage33;
- bool IsImage66;
-
- uint32 Intro_Phase;
- uint32 Intro_Timer;
- uint32 MindRend_Timer;
- uint32 Fear_Timer;
- uint32 Domination_Timer;
- uint32 ManaBurn_Timer;
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNKNOWN2);
-
- if( Intro )
- Intro = true;
- else
- Intro = false;
-
- IsImage33 = false;
- IsImage66 = false;
-
- Intro_Phase = 1;
- Intro_Timer = 5000;
- MindRend_Timer = 3000;
- Fear_Timer = 15000;
- Domination_Timer = 30000;
- ManaBurn_Timer = 25000;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !Intro )
- return;
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void AttackStart(Unit* who)
- {
- if( !Intro )
- return;
-
- if( who->isTargetableForAttack() )
- {
- DoStartAttackAndMovement(who);
-
- if( !InCombat )
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNKNOWN2);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- if( pInstance )
- pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- /*if( victim->GetEntry() == 21436 )
- return;*/
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(m_creature->getVictim());
- }
-
- void DoSplit(uint32 val)
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- DoYell(SAY_IMAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_IMAGE);
-
- if( val == 66 )
- DoCast(m_creature, SPELL_66_ILLUSION);
- else
- DoCast(m_creature, SPELL_33_ILLUSION);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Intro && !InCombat )
- {
- if( !pInstance )
- return;
-
- if( Intro_Timer < diff )
- {
- switch( Intro_Phase )
- {
- case 1:
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- ++Intro_Phase;
- Intro_Timer = 25000;
- break;
- case 2:
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- if( Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR)) )
- {
- //should have a better way to do this. possibly spell exist.
- mellic->setDeathState(JUST_DIED);
- mellic->SetHealth(0);
- }
- ++Intro_Phase;
- Intro_Timer = 3000;
- break;
- case 3:
- Intro = true;
- break;
- }
- }else Intro_Timer -=diff;
- }
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( !IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66) )
- {
- DoSplit(66);
- IsImage66 = true;
- }
- if( !IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33) )
- {
- DoSplit(33);
- IsImage33 = true;
- }
-
- if( MindRend_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
- DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND);
- else
- DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND);
-
- MindRend_Timer = 8000;
- }else MindRend_Timer -=diff;
-
- if( Fear_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_FEAR_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_FEAR_1);
- break;
- case 1:
- DoYell(SAY_FEAR_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_FEAR_2);
- break;
- }
-
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
- DoCast(target,SPELL_FEAR);
- else
- DoCast(m_creature->getVictim(),SPELL_FEAR);
-
- Fear_Timer = 25000;
- }else Fear_Timer -=diff;
-
- if( Domination_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_MIND_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MIND_1);
- break;
- case 1:
- DoYell(SAY_MIND_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MIND_2);
- break;
- }
-
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
- DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION);
- else
- DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION);
-
- Domination_Timer = 16000+rand()%16000;
- }else Domination_Timer -=diff;
-
- if( HeroicMode )
- {
- if( ManaBurn_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- return;
-
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
- DoCast(target,H_SPELL_MANA_BURN);
-
- ManaBurn_Timer = 16000+rand()%16000;
- }else ManaBurn_Timer -=diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_harbinger_skyriss(Creature *_Creature)
-{
- return new boss_harbinger_skyrissAI (_Creature);
-}
-
-#define SPELL_MIND_REND_IMAGE 36929
-#define H_SPELL_MIND_REND_IMAGE 39021
-
-struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI
-{
- boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool HeroicMode;
-
- void Reset() { }
-
- void Aggro(Unit *who) { }
-};
-
-CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature *_Creature)
-{
- return new boss_harbinger_skyriss_illusionAI (_Creature);
-}
-
-void AddSC_boss_harbinger_skyriss()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_harbinger_skyriss";
- newscript->GetAI = GetAI_boss_harbinger_skyriss;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_harbinger_skyriss_illusion";
- newscript->GetAI = GetAI_boss_harbinger_skyriss_illusion;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Harbinger_Skyriss
+SD%Complete: 45
+SDComment: CombatAI not fully implemented. Timers will need adjustments. Need better method to "kill" the warden. Need more docs on how event fully work. Reset all event and force start over if fail at one point?
+SDCategory: Tempest Keep, The Arcatraz
+EndScriptData */
+
+/* ContentData
+boss_harbinger_skyriss
+boss_harbinger_skyriss_illusion
+EndContentData */
+
+#include "precompiled.h"
+#include "def_arcatraz.h"
+
+#define SAY_INTRO "It is a small matter to control the mind of the weak... for I bear allegiance to powers untouched by time, unmoved by fate. No force on this world or beyond harbors the strength to bend our knee... not even the mighty Legion!"
+#define SOUND_INTRO 11122
+
+#define SAY_AGGRO "Bear witness to the agent of your demise!"
+#define SOUND_AGGRO 11123
+
+#define SAY_KILL_1 "Your fate is written!"
+#define SOUND_KILL_1 11124
+#define SAY_KILL_2 "The chaos I have sown here is but a taste...."
+#define SOUND_KILL_2 11125
+
+#define SAY_MIND_1 "You will do my bidding, weakling."
+#define SOUND_MIND_1 11127
+#define SAY_MIND_2 "Your will is no longer your own."
+#define SOUND_MIND_2 11128
+
+#define SAY_FEAR_1 "Flee in terror!"
+#define SOUND_FEAR_1 11129
+#define SAY_FEAR_2 "I will show you horrors undreamed of!"
+#define SOUND_FEAR_2 11130
+
+#define SAY_IMAGE "We span the universe, as countless as the stars!"
+#define SOUND_IMAGE 11131
+
+#define SAY_DEATH "I am merely one of... infinite multitudes."
+#define SOUND_DEATH 11126
+
+#define SPELL_FEAR 39415
+
+#define SPELL_MIND_REND 36924
+#define H_SPELL_MIND_REND 39017
+
+#define SPELL_DOMINATION 37162
+#define H_SPELL_DOMINATION 39019
+
+#define H_SPELL_MANA_BURN 39020
+
+#define SPELL_66_ILLUSION 36931 //entry 21466
+#define SPELL_33_ILLUSION 36932 //entry 21467
+
+struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
+{
+ boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool HeroicMode;
+
+ bool Intro;
+ bool IsImage33;
+ bool IsImage66;
+
+ uint32 Intro_Phase;
+ uint32 Intro_Timer;
+ uint32 MindRend_Timer;
+ uint32 Fear_Timer;
+ uint32 Domination_Timer;
+ uint32 ManaBurn_Timer;
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNKNOWN2);
+
+ if( Intro )
+ Intro = true;
+ else
+ Intro = false;
+
+ IsImage33 = false;
+ IsImage66 = false;
+
+ Intro_Phase = 1;
+ Intro_Timer = 5000;
+ MindRend_Timer = 3000;
+ Fear_Timer = 15000;
+ Domination_Timer = 30000;
+ ManaBurn_Timer = 25000;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !Intro )
+ return;
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if( !Intro )
+ return;
+
+ if( who->isTargetableForAttack() )
+ {
+ DoStartAttackAndMovement(who);
+
+ if( !InCombat )
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNKNOWN2);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ if( pInstance )
+ pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ /*if( victim->GetEntry() == 21436 )
+ return;*/
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ void DoSplit(uint32 val)
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoYell(SAY_IMAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_IMAGE);
+
+ if( val == 66 )
+ DoCast(m_creature, SPELL_66_ILLUSION);
+ else
+ DoCast(m_creature, SPELL_33_ILLUSION);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Intro && !InCombat )
+ {
+ if( !pInstance )
+ return;
+
+ if( Intro_Timer < diff )
+ {
+ switch( Intro_Phase )
+ {
+ case 1:
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ ++Intro_Phase;
+ Intro_Timer = 25000;
+ break;
+ case 2:
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ if( Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR)) )
+ {
+ //should have a better way to do this. possibly spell exist.
+ mellic->setDeathState(JUST_DIED);
+ mellic->SetHealth(0);
+ }
+ ++Intro_Phase;
+ Intro_Timer = 3000;
+ break;
+ case 3:
+ Intro = true;
+ break;
+ }
+ }else Intro_Timer -=diff;
+ }
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( !IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66) )
+ {
+ DoSplit(66);
+ IsImage66 = true;
+ }
+ if( !IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33) )
+ {
+ DoSplit(33);
+ IsImage33 = true;
+ }
+
+ if( MindRend_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
+ DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND);
+ else
+ DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND);
+
+ MindRend_Timer = 8000;
+ }else MindRend_Timer -=diff;
+
+ if( Fear_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_FEAR_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_FEAR_1);
+ break;
+ case 1:
+ DoYell(SAY_FEAR_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_FEAR_2);
+ break;
+ }
+
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
+ DoCast(target,SPELL_FEAR);
+ else
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+
+ Fear_Timer = 25000;
+ }else Fear_Timer -=diff;
+
+ if( Domination_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_MIND_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MIND_1);
+ break;
+ case 1:
+ DoYell(SAY_MIND_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MIND_2);
+ break;
+ }
+
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
+ DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION);
+ else
+ DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION);
+
+ Domination_Timer = 16000+rand()%16000;
+ }else Domination_Timer -=diff;
+
+ if( HeroicMode )
+ {
+ if( ManaBurn_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ return;
+
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) )
+ DoCast(target,H_SPELL_MANA_BURN);
+
+ ManaBurn_Timer = 16000+rand()%16000;
+ }else ManaBurn_Timer -=diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_harbinger_skyriss(Creature *_Creature)
+{
+ return new boss_harbinger_skyrissAI (_Creature);
+}
+
+#define SPELL_MIND_REND_IMAGE 36929
+#define H_SPELL_MIND_REND_IMAGE 39021
+
+struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI
+{
+ boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool HeroicMode;
+
+ void Reset() { }
+
+ void Aggro(Unit *who) { }
+};
+
+CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature *_Creature)
+{
+ return new boss_harbinger_skyriss_illusionAI (_Creature);
+}
+
+void AddSC_boss_harbinger_skyriss()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_harbinger_skyriss";
+ newscript->GetAI = GetAI_boss_harbinger_skyriss;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_harbinger_skyriss_illusion";
+ newscript->GetAI = GetAI_boss_harbinger_skyriss_illusion;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
index fc6cde1ebaa..8868a36d70c 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
@@ -1,19 +1,19 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_ARCATRAZ_H
-#define DEF_ARCATRAZ_H
-
-#define TYPE_ZEREKETH 1
-#define TYPE_DALLIAH 2
-#define TYPE_SOCCOTHRATES 3
-#define TYPE_HARBINGERSKYRISS 4
-#define TYPE_WARDEN_1 5
-#define TYPE_WARDEN_2 6
-#define TYPE_WARDEN_3 7
-#define TYPE_WARDEN_4 8
-#define TYPE_WARDEN_5 9
-
-#define DATA_MELLICHAR 10
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_ARCATRAZ_H
+#define DEF_ARCATRAZ_H
+
+#define TYPE_ZEREKETH 1
+#define TYPE_DALLIAH 2
+#define TYPE_SOCCOTHRATES 3
+#define TYPE_HARBINGERSKYRISS 4
+#define TYPE_WARDEN_1 5
+#define TYPE_WARDEN_2 6
+#define TYPE_WARDEN_3 7
+#define TYPE_WARDEN_4 8
+#define TYPE_WARDEN_5 9
+
+#define DATA_MELLICHAR 10
+#endif
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
index bf964af75ea..93f21f2a72f 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
@@ -1,224 +1,224 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Arcatraz
-SD%Complete: 80
-SDComment: Mainly Harbringer Skyriss event
-SDCategory: Tempest Keep, The Arcatraz
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_arcatraz.h"
-
-#define ENCOUNTERS 9
-
-#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies
-#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies
-#define POD_ALPHA 183961 //pod first boss wave
-#define POD_BETA 183963 //pod second boss wave
-#define POD_DELTA 183964 //pod third boss wave
-#define POD_GAMMA 183962 //pod fourth boss wave
-#define POD_OMEGA 183965 //pod fifth boss wave
-
-#define MELLICHAR 21436 //skyriss will kill this unit
-
-/* Arcatraz encounters:
-1 - Zereketh the Unbound event
-2 - Dalliah the Doomsayer event
-3 - Wrath-Scryer Soccothrates event
-4 - Harbinger Skyriss event, 5 sub-events
-*/
-
-struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
-{
- instance_arcatraz(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
-
- GameObject *Containment_Core_Security_Field_Alpha;
- GameObject *Containment_Core_Security_Field_Beta;
- GameObject *Pod_Alpha;
- GameObject *Pod_Gamma;
- GameObject *Pod_Beta;
- GameObject *Pod_Delta;
- GameObject *Pod_Omega;
-
- uint64 Mellichar;
-
- void Initialize()
- {
- Containment_Core_Security_Field_Alpha = NULL;
- Containment_Core_Security_Field_Beta = NULL;
- Pod_Alpha = NULL;
- Pod_Beta = NULL;
- Pod_Delta = NULL;
- Pod_Gamma = NULL;
- Pod_Omega = NULL;
-
- Mellichar = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = NOT_STARTED;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounter[i]) return true;
-
- return false;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = go; break;
- case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = go; break;
- case POD_ALPHA: Pod_Alpha = go; break;
- case POD_BETA: Pod_Beta = go; break;
- case POD_DELTA: Pod_Delta = go; break;
- case POD_GAMMA: Pod_Gamma = go; break;
- case POD_OMEGA: Pod_Omega = go; break;
- }
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case MELLICHAR:
- Mellichar = creature->GetGUID();
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_ZEREKETH:
- Encounter[0] = data;
- break;
-
- case TYPE_DALLIAH:
- if( data == DONE )
- if( Containment_Core_Security_Field_Beta )
- Containment_Core_Security_Field_Beta->UseDoorOrButton();
- Encounter[1] = data;
- break;
-
- case TYPE_SOCCOTHRATES:
- if( data == DONE )
- if( Containment_Core_Security_Field_Alpha )
- Containment_Core_Security_Field_Alpha->UseDoorOrButton();
- Encounter[2] = data;
- break;
-
- case TYPE_HARBINGERSKYRISS:
- if( data == NOT_STARTED || data == FAIL )
- {
- Encounter[4] = NOT_STARTED;
- Encounter[5] = NOT_STARTED;
- Encounter[6] = NOT_STARTED;
- Encounter[7] = NOT_STARTED;
- Encounter[8] = NOT_STARTED;
- }
- Encounter[3] = data;
- break;
-
- case TYPE_WARDEN_1:
- if( data == IN_PROGRESS )
- if( Pod_Alpha )
- Pod_Alpha->UseDoorOrButton();
- Encounter[4] = data;
- break;
-
- case TYPE_WARDEN_2:
- if( data == IN_PROGRESS )
- if( Pod_Beta )
- Pod_Beta->UseDoorOrButton();
- Encounter[5] = data;
- break;
-
- case TYPE_WARDEN_3:
- if( data == IN_PROGRESS )
- if( Pod_Delta )
- Pod_Delta->UseDoorOrButton();
- Encounter[6] = data;
- break;
-
- case TYPE_WARDEN_4:
- if( data == IN_PROGRESS )
- if( Pod_Gamma )
- Pod_Gamma->UseDoorOrButton();
- Encounter[7] = data;
- break;
-
- case TYPE_WARDEN_5:
- if( data == IN_PROGRESS )
- if( Pod_Omega )
- Pod_Omega->UseDoorOrButton();
- Encounter[8] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 data)
- {
- switch(data)
- {
- case TYPE_HARBINGERSKYRISS:
- return Encounter[3];
- case TYPE_WARDEN_1:
- return Encounter[4];
- case TYPE_WARDEN_2:
- return Encounter[5];
- case TYPE_WARDEN_3:
- return Encounter[6];
- case TYPE_WARDEN_4:
- return Encounter[7];
- case TYPE_WARDEN_5:
- return Encounter[8];
- }
- return 0;
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_MELLICHAR:
- return Mellichar;
- }
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_arcatraz(Map* map)
-{
- return new instance_arcatraz(map);
-}
-
-void AddSC_instance_arcatraz()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_arcatraz";
- newscript->GetInstanceData = GetInstanceData_instance_arcatraz;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Arcatraz
+SD%Complete: 80
+SDComment: Mainly Harbringer Skyriss event
+SDCategory: Tempest Keep, The Arcatraz
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_arcatraz.h"
+
+#define ENCOUNTERS 9
+
+#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies
+#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies
+#define POD_ALPHA 183961 //pod first boss wave
+#define POD_BETA 183963 //pod second boss wave
+#define POD_DELTA 183964 //pod third boss wave
+#define POD_GAMMA 183962 //pod fourth boss wave
+#define POD_OMEGA 183965 //pod fifth boss wave
+
+#define MELLICHAR 21436 //skyriss will kill this unit
+
+/* Arcatraz encounters:
+1 - Zereketh the Unbound event
+2 - Dalliah the Doomsayer event
+3 - Wrath-Scryer Soccothrates event
+4 - Harbinger Skyriss event, 5 sub-events
+*/
+
+struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
+{
+ instance_arcatraz(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+
+ GameObject *Containment_Core_Security_Field_Alpha;
+ GameObject *Containment_Core_Security_Field_Beta;
+ GameObject *Pod_Alpha;
+ GameObject *Pod_Gamma;
+ GameObject *Pod_Beta;
+ GameObject *Pod_Delta;
+ GameObject *Pod_Omega;
+
+ uint64 Mellichar;
+
+ void Initialize()
+ {
+ Containment_Core_Security_Field_Alpha = NULL;
+ Containment_Core_Security_Field_Beta = NULL;
+ Pod_Alpha = NULL;
+ Pod_Beta = NULL;
+ Pod_Delta = NULL;
+ Pod_Gamma = NULL;
+ Pod_Omega = NULL;
+
+ Mellichar = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounter[i]) return true;
+
+ return false;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = go; break;
+ case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = go; break;
+ case POD_ALPHA: Pod_Alpha = go; break;
+ case POD_BETA: Pod_Beta = go; break;
+ case POD_DELTA: Pod_Delta = go; break;
+ case POD_GAMMA: Pod_Gamma = go; break;
+ case POD_OMEGA: Pod_Omega = go; break;
+ }
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case MELLICHAR:
+ Mellichar = creature->GetGUID();
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_ZEREKETH:
+ Encounter[0] = data;
+ break;
+
+ case TYPE_DALLIAH:
+ if( data == DONE )
+ if( Containment_Core_Security_Field_Beta )
+ Containment_Core_Security_Field_Beta->UseDoorOrButton();
+ Encounter[1] = data;
+ break;
+
+ case TYPE_SOCCOTHRATES:
+ if( data == DONE )
+ if( Containment_Core_Security_Field_Alpha )
+ Containment_Core_Security_Field_Alpha->UseDoorOrButton();
+ Encounter[2] = data;
+ break;
+
+ case TYPE_HARBINGERSKYRISS:
+ if( data == NOT_STARTED || data == FAIL )
+ {
+ Encounter[4] = NOT_STARTED;
+ Encounter[5] = NOT_STARTED;
+ Encounter[6] = NOT_STARTED;
+ Encounter[7] = NOT_STARTED;
+ Encounter[8] = NOT_STARTED;
+ }
+ Encounter[3] = data;
+ break;
+
+ case TYPE_WARDEN_1:
+ if( data == IN_PROGRESS )
+ if( Pod_Alpha )
+ Pod_Alpha->UseDoorOrButton();
+ Encounter[4] = data;
+ break;
+
+ case TYPE_WARDEN_2:
+ if( data == IN_PROGRESS )
+ if( Pod_Beta )
+ Pod_Beta->UseDoorOrButton();
+ Encounter[5] = data;
+ break;
+
+ case TYPE_WARDEN_3:
+ if( data == IN_PROGRESS )
+ if( Pod_Delta )
+ Pod_Delta->UseDoorOrButton();
+ Encounter[6] = data;
+ break;
+
+ case TYPE_WARDEN_4:
+ if( data == IN_PROGRESS )
+ if( Pod_Gamma )
+ Pod_Gamma->UseDoorOrButton();
+ Encounter[7] = data;
+ break;
+
+ case TYPE_WARDEN_5:
+ if( data == IN_PROGRESS )
+ if( Pod_Omega )
+ Pod_Omega->UseDoorOrButton();
+ Encounter[8] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 data)
+ {
+ switch(data)
+ {
+ case TYPE_HARBINGERSKYRISS:
+ return Encounter[3];
+ case TYPE_WARDEN_1:
+ return Encounter[4];
+ case TYPE_WARDEN_2:
+ return Encounter[5];
+ case TYPE_WARDEN_3:
+ return Encounter[6];
+ case TYPE_WARDEN_4:
+ return Encounter[7];
+ case TYPE_WARDEN_5:
+ return Encounter[8];
+ }
+ return 0;
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_MELLICHAR:
+ return Mellichar;
+ }
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_arcatraz(Map* map)
+{
+ return new instance_arcatraz(map);
+}
+
+void AddSC_instance_arcatraz()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_arcatraz";
+ newscript->GetInstanceData = GetInstanceData_instance_arcatraz;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
index 2dfd6e79f24..201b5936ee9 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
@@ -1,215 +1,215 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_Botanist_Freywinn
-SD%Complete: 90
-SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay)
-SDCategory: Tempest Keep, The Botanica
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO "What are you doing? These specimens are very delicate!"
-#define SOUND_AGGRO 11144
-
-#define SAY_KILL_1 "Your life cycle is now concluded!"
-#define SOUND_KILL_1 11145
-#define SAY_KILL_2 "You will feed the worms."
-#define SOUND_KILL_2 11146
-
-#define SAY_TREE_1 "Endorel aluminor!"
-#define SOUND_TREE_1 11147
-#define SAY_TREE_2 "Nature bends to my will!"
-#define SOUND_TREE_2 11148
-
-#define SAY_DEATH "The specimens...must be preserved."
-#define SOUND_DEATH 11149
-
-#define SPELL_TRANQUILITY 34550
-#define SPELL_TREE_FORM 34551
-
-#define SPELL_SUMMON_FRAYER 34557
-#define ENTRY_FRAYER 19953
-
-#define SPELL_PLANT_WHITE 34759
-#define SPELL_PLANT_GREEN 34761
-#define SPELL_PLANT_BLUE 34762
-#define SPELL_PLANT_RED 34763
-
-struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI
-{
- boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- std::list<uint64> Adds_List;
-
- uint32 SummonSeedling_Timer;
- uint32 TreeForm_Timer;
- uint32 MoveCheck_Timer;
- uint32 DeadAddsCount;
- bool MoveFree;
-
- void Reset()
- {
- Adds_List.clear();
-
- SummonSeedling_Timer = 6000;
- TreeForm_Timer = 30000;
- MoveCheck_Timer = 1000;
- DeadAddsCount = 0;
- MoveFree = true;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_FRAYER )
- Adds_List.push_back(summoned->GetGUID());
- }
-
- void DoSummonSeedling()
- {
- switch(rand()%4)
- {
- case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break;
- case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break;
- case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break;
- case 3: DoCast(m_creature,SPELL_PLANT_RED); break;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( TreeForm_Timer < diff )
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_TREE_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_TREE_1);
- break;
- case 1:
- DoYell(SAY_TREE_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_TREE_2);
- break;
- }
-
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- m_creature->RemoveAllAuras();
-
- DoCast(m_creature,SPELL_SUMMON_FRAYER,true);
- DoCast(m_creature,SPELL_TRANQUILITY,true);
- DoCast(m_creature,SPELL_TREE_FORM,true);
-
- m_creature->GetMotionMaster()->MoveIdle();
- MoveFree = false;
-
- TreeForm_Timer = 75000;
- }else TreeForm_Timer -= diff;
-
- if( !MoveFree )
- {
- if( MoveCheck_Timer < diff )
- {
- if( !Adds_List.empty() )
- {
- for(std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr)
- {
- if( Unit *temp = Unit::GetUnit(*m_creature,*itr) )
- {
- if( !temp->isAlive() )
- {
- Adds_List.erase(itr);
- ++DeadAddsCount;
- break;
- }
- }
- }
- }
-
- if( DeadAddsCount < 3 && TreeForm_Timer-30000 < diff )
- DeadAddsCount = 3;
-
- if( DeadAddsCount >= 3 )
- {
- Adds_List.clear();
- DeadAddsCount = 0;
-
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- MoveFree = true;
- }
- MoveCheck_Timer = 500;
- }
- else MoveCheck_Timer -= diff;
-
- return;
- }
-
- /*if( m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0) )
- return;*/
-
- //one random seedling every 5 secs, but not in tree form
- if( SummonSeedling_Timer < diff )
- {
- DoSummonSeedling();
- SummonSeedling_Timer = 6000;
- }else SummonSeedling_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_high_botanist_freywinn(Creature *_Creature)
-{
- return new boss_high_botanist_freywinnAI (_Creature);
-}
-
-void AddSC_boss_high_botanist_freywinn()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_high_botanist_freywinn";
- newscript->GetAI = GetAI_boss_high_botanist_freywinn;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_Botanist_Freywinn
+SD%Complete: 90
+SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay)
+SDCategory: Tempest Keep, The Botanica
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO "What are you doing? These specimens are very delicate!"
+#define SOUND_AGGRO 11144
+
+#define SAY_KILL_1 "Your life cycle is now concluded!"
+#define SOUND_KILL_1 11145
+#define SAY_KILL_2 "You will feed the worms."
+#define SOUND_KILL_2 11146
+
+#define SAY_TREE_1 "Endorel aluminor!"
+#define SOUND_TREE_1 11147
+#define SAY_TREE_2 "Nature bends to my will!"
+#define SOUND_TREE_2 11148
+
+#define SAY_DEATH "The specimens...must be preserved."
+#define SOUND_DEATH 11149
+
+#define SPELL_TRANQUILITY 34550
+#define SPELL_TREE_FORM 34551
+
+#define SPELL_SUMMON_FRAYER 34557
+#define ENTRY_FRAYER 19953
+
+#define SPELL_PLANT_WHITE 34759
+#define SPELL_PLANT_GREEN 34761
+#define SPELL_PLANT_BLUE 34762
+#define SPELL_PLANT_RED 34763
+
+struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI
+{
+ boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ std::list<uint64> Adds_List;
+
+ uint32 SummonSeedling_Timer;
+ uint32 TreeForm_Timer;
+ uint32 MoveCheck_Timer;
+ uint32 DeadAddsCount;
+ bool MoveFree;
+
+ void Reset()
+ {
+ Adds_List.clear();
+
+ SummonSeedling_Timer = 6000;
+ TreeForm_Timer = 30000;
+ MoveCheck_Timer = 1000;
+ DeadAddsCount = 0;
+ MoveFree = true;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_FRAYER )
+ Adds_List.push_back(summoned->GetGUID());
+ }
+
+ void DoSummonSeedling()
+ {
+ switch(rand()%4)
+ {
+ case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break;
+ case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break;
+ case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break;
+ case 3: DoCast(m_creature,SPELL_PLANT_RED); break;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( TreeForm_Timer < diff )
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_TREE_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_TREE_1);
+ break;
+ case 1:
+ DoYell(SAY_TREE_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_TREE_2);
+ break;
+ }
+
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ m_creature->RemoveAllAuras();
+
+ DoCast(m_creature,SPELL_SUMMON_FRAYER,true);
+ DoCast(m_creature,SPELL_TRANQUILITY,true);
+ DoCast(m_creature,SPELL_TREE_FORM,true);
+
+ m_creature->GetMotionMaster()->MoveIdle();
+ MoveFree = false;
+
+ TreeForm_Timer = 75000;
+ }else TreeForm_Timer -= diff;
+
+ if( !MoveFree )
+ {
+ if( MoveCheck_Timer < diff )
+ {
+ if( !Adds_List.empty() )
+ {
+ for(std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr)
+ {
+ if( Unit *temp = Unit::GetUnit(*m_creature,*itr) )
+ {
+ if( !temp->isAlive() )
+ {
+ Adds_List.erase(itr);
+ ++DeadAddsCount;
+ break;
+ }
+ }
+ }
+ }
+
+ if( DeadAddsCount < 3 && TreeForm_Timer-30000 < diff )
+ DeadAddsCount = 3;
+
+ if( DeadAddsCount >= 3 )
+ {
+ Adds_List.clear();
+ DeadAddsCount = 0;
+
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ MoveFree = true;
+ }
+ MoveCheck_Timer = 500;
+ }
+ else MoveCheck_Timer -= diff;
+
+ return;
+ }
+
+ /*if( m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0) )
+ return;*/
+
+ //one random seedling every 5 secs, but not in tree form
+ if( SummonSeedling_Timer < diff )
+ {
+ DoSummonSeedling();
+ SummonSeedling_Timer = 6000;
+ }else SummonSeedling_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_high_botanist_freywinn(Creature *_Creature)
+{
+ return new boss_high_botanist_freywinnAI (_Creature);
+}
+
+void AddSC_boss_high_botanist_freywinn()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_high_botanist_freywinn";
+ newscript->GetAI = GetAI_boss_high_botanist_freywinn;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
index 316251a2712..c714c470c55 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
@@ -1,198 +1,198 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Laj
-SD%Complete: 95
-SDComment: Immunities _may_ be applied by spells, but this has _not_ been confirmed to be proper way. Most spells require database support.
-SDCategory: Tempest Keep, The Botanica
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ALLERGIC_REACTION 34697
-#define SPELL_TELEPORT_SELF 34673
-
-#define SPELL_SUMMON_LASHER_1 34681
-#define SPELL_SUMMON_FLAYER_1 34682
-#define SPELL_SUMMON_LASHER_2 34684
-#define SPELL_SUMMON_FLAYER_2 34685
-#define SPELL_SUMMON_LASHER_3 34686
-#define SPELL_SUMMON_FLAYER_4 34687
-#define SPELL_SUMMON_LASHER_4 34688
-#define SPELL_SUMMON_FLAYER_3 34690
-
-#define EMOTE_SUMMON "emits a strange noise."
-
-#define MODEL_DEFAULT 13109
-#define MODEL_ARCANE 14213
-#define MODEL_FIRE 13110
-#define MODEL_FROST 14112
-#define MODEL_NATURE 14214
-
-struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI
-{
- boss_lajAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- bool CanSummon;
- uint32 Teleport_Timer;
- uint32 Summon_Timer;
- uint32 Transform_Timer;
- uint32 Allergic_Timer;
-
- void Reset()
- {
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_DEFAULT);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
-
- CanSummon = false;
- Teleport_Timer = 20000;
- Summon_Timer = 2500;
- Transform_Timer = 30000;
- Allergic_Timer = 5000;
- }
-
- void DoTransform()
- {
- switch(rand()%5)
- {
- case 0:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_DEFAULT);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- break;
- case 1:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_ARCANE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- break;
- case 2:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_FIRE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- break;
- case 3:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_FROST);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- break;
- case 4:
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_NATURE);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- break;
- }
- }
-
- void DoSummons()
- {
- switch(rand()%4)
- {
- case 0:
- DoCast(m_creature,SPELL_SUMMON_LASHER_1,true);
- DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true);
- break;
- case 1:
- DoCast(m_creature,SPELL_SUMMON_LASHER_2,true);
- DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true);
- break;
- case 2:
- DoCast(m_creature,SPELL_SUMMON_LASHER_3,true);
- DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true);
- break;
- case 3:
- DoCast(m_creature,SPELL_SUMMON_LASHER_4,true);
- DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true);
- break;
- }
- CanSummon = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( CanSummon )
- {
- if( Summon_Timer < diff )
- {
- DoTextEmote(EMOTE_SUMMON,NULL);
- DoSummons();
- Summon_Timer = 2500;
- }else Summon_Timer -= diff;
- }
-
- if( Allergic_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION);
- Allergic_Timer = 25000+rand()%15000;
- }else Allergic_Timer -= diff;
-
- if( Teleport_Timer < diff )
- {
- DoCast(m_creature,SPELL_TELEPORT_SELF);
- Teleport_Timer = 30000+rand()%10000;
- CanSummon = true;
- }else Teleport_Timer -= diff;
-
- if( Transform_Timer < diff )
- {
- DoTransform();
- Transform_Timer = 25000+rand()%15000;
- }else Transform_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_laj(Creature *_Creature)
-{
- return new boss_lajAI (_Creature);
-}
-
-void AddSC_boss_laj()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_laj";
- newscript->GetAI = GetAI_boss_laj;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Laj
+SD%Complete: 95
+SDComment: Immunities _may_ be applied by spells, but this has _not_ been confirmed to be proper way. Most spells require database support.
+SDCategory: Tempest Keep, The Botanica
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ALLERGIC_REACTION 34697
+#define SPELL_TELEPORT_SELF 34673
+
+#define SPELL_SUMMON_LASHER_1 34681
+#define SPELL_SUMMON_FLAYER_1 34682
+#define SPELL_SUMMON_LASHER_2 34684
+#define SPELL_SUMMON_FLAYER_2 34685
+#define SPELL_SUMMON_LASHER_3 34686
+#define SPELL_SUMMON_FLAYER_4 34687
+#define SPELL_SUMMON_LASHER_4 34688
+#define SPELL_SUMMON_FLAYER_3 34690
+
+#define EMOTE_SUMMON "emits a strange noise."
+
+#define MODEL_DEFAULT 13109
+#define MODEL_ARCANE 14213
+#define MODEL_FIRE 13110
+#define MODEL_FROST 14112
+#define MODEL_NATURE 14214
+
+struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI
+{
+ boss_lajAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ bool CanSummon;
+ uint32 Teleport_Timer;
+ uint32 Summon_Timer;
+ uint32 Transform_Timer;
+ uint32 Allergic_Timer;
+
+ void Reset()
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_DEFAULT);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+
+ CanSummon = false;
+ Teleport_Timer = 20000;
+ Summon_Timer = 2500;
+ Transform_Timer = 30000;
+ Allergic_Timer = 5000;
+ }
+
+ void DoTransform()
+ {
+ switch(rand()%5)
+ {
+ case 0:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_DEFAULT);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ break;
+ case 1:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_ARCANE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ break;
+ case 2:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_FIRE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ break;
+ case 3:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_FROST);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ break;
+ case 4:
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,MODEL_NATURE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ break;
+ }
+ }
+
+ void DoSummons()
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ DoCast(m_creature,SPELL_SUMMON_LASHER_1,true);
+ DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true);
+ break;
+ case 1:
+ DoCast(m_creature,SPELL_SUMMON_LASHER_2,true);
+ DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true);
+ break;
+ case 2:
+ DoCast(m_creature,SPELL_SUMMON_LASHER_3,true);
+ DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true);
+ break;
+ case 3:
+ DoCast(m_creature,SPELL_SUMMON_LASHER_4,true);
+ DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true);
+ break;
+ }
+ CanSummon = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( CanSummon )
+ {
+ if( Summon_Timer < diff )
+ {
+ DoTextEmote(EMOTE_SUMMON,NULL);
+ DoSummons();
+ Summon_Timer = 2500;
+ }else Summon_Timer -= diff;
+ }
+
+ if( Allergic_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION);
+ Allergic_Timer = 25000+rand()%15000;
+ }else Allergic_Timer -= diff;
+
+ if( Teleport_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_TELEPORT_SELF);
+ Teleport_Timer = 30000+rand()%10000;
+ CanSummon = true;
+ }else Teleport_Timer -= diff;
+
+ if( Transform_Timer < diff )
+ {
+ DoTransform();
+ Transform_Timer = 25000+rand()%15000;
+ }else Transform_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_laj(Creature *_Creature)
+{
+ return new boss_lajAI (_Creature);
+}
+
+void AddSC_boss_laj()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_laj";
+ newscript->GetAI = GetAI_boss_laj;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
index 67a37db1aa1..046c4fe86f3 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
@@ -1,288 +1,288 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warp_Splinter
-SD%Complete: 80
-SDComment: Includes Sapling (need some better control with these). Spells for boss possibly need some rework.
-SDCategory: Tempest Keep, The Botanica
-EndScriptData */
-
-#include "precompiled.h"
-
-/*#####
-# mob_treant (Sapling)
-#####*/
-
-struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI
-{
- mob_treantAI (Creature *c) : ScriptedAI(c)
- {
- WarpGuid = 0;
- Reset();
- }
-
- uint64 WarpGuid;
-
- void Reset()
- {
- m_creature->SetSpeed( MOVE_RUN, 0.5f, true);
- m_creature->SetUnitMovementFlags(0);
- }
-
- void Aggro(Unit *who)
- {
- return;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (m_creature->getVictim()->GetGUID() != WarpGuid)
- DoMeleeAttackIfReady();
- }
-};
-
-/*#####
-# boss_warp_splinter
-#####*/
-
-#define WAR_STOMP 34716
-#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon)
-#define ARCANE_VOLLEY 35059 //37078, 34785 //must additional script them (because Splinter eats them after 20 sec ^)
-#define SPELL_HEAL_FATHER 6262
-
-#define CREATURE_TREANT 19949
-
-#define SAY_COMBAT_START "Who disturbs this sanctuary?"
-#define SOUND_COMBAT_START 11230
-
-#define SAY_SLAY_1 "You must die! But wait: this does not-- No, no... you must die!"
-#define SOUND_SLAY_1 11231
-#define SAY_SLAY_2 "What am I doing? Why do I..."
-#define SOUND_SLAY_2 11232
-
-#define SAY_SUMMON_1 "Children, come to me!"
-#define SOUND_SUMMON_1 11233
-#define SAY_SUMMON_2 "Maybe this is not-- No, we fight! Come to my aid."
-#define SOUND_SUMMON_2 11234
-
-#define SAY_DEATH "So... confused. Do not... belong here!"
-#define SOUND_DEATH 11235
-
-#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point
-
-float treant_pos[6][3] =
-{
- {24.301233, 427.221100, -27.060635},
- {16.795492, 359.678802, -27.355425},
- {53.493484, 345.381470, -26.196192},
- {61.867096, 439.362732, -25.921030},
- {109.861877, 423.201630, -27.356019},
- {106.780159, 355.582581, -27.593357}
-};
-
-struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI
-{
- boss_warp_splinterAI(Creature *c) : ScriptedAI(c)
- {
- Treant_Spawn_Pos_X = c->GetPositionX();
- Treant_Spawn_Pos_Y = c->GetPositionY();
- Reset();
- }
-
- uint32 War_Stomp_Timer;
- uint32 Summon_Treants_Timer;
- uint32 Arcane_Volley_Timer;
- uint32 CheckTreantLOS_Timer;
- uint32 TreantLife_Timer;
- uint64 Treant_GUIDs[6];
-
- float Treant_Spawn_Pos_X;
- float Treant_Spawn_Pos_Y;
-
-
- void Reset()
- {
- War_Stomp_Timer = 60000;
- Summon_Treants_Timer = 45000;
- Arcane_Volley_Timer = 140000;
- CheckTreantLOS_Timer = 1000;
- TreantLife_Timer = 999999;
-
- for(int i = 0; i < 6; ++i)
- Treant_GUIDs[i] = 0;
-
- m_creature->SetSpeed( MOVE_RUN, 0.7f, true);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_COMBAT_START,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_COMBAT_START);
- }
-
- // On Killed Unit
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void SummonTreants()
- {
- for(int i = 0; i < 6; ++i)
- {
- float angle = (M_PI / 3) * i;
-
- float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle);
- float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle);
- //float Z = m_creature->GetMap()->GetHeight(X,Y, m_creature->GetPositionZ());
- //float Z = m_creature->GetPositionZ();
- float O = - m_creature->GetAngle(X,Y);
-
- 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,40000);
- if(pTreant)
- {
- //pTreant->GetMotionMaster()->Mutate(new TargetedMovementGenerator<Creature>(*m_creature));
- pTreant->AddThreat(m_creature, 0.1f);
- Treant_GUIDs[i] = pTreant->GetGUID();
- ((mob_treantAI*)pTreant->AI())->WarpGuid = m_creature->GetGUID();
- }
- }
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SUMMON_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON_1);
- break;
- case 1:
- DoYell(SAY_SUMMON_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON_2);
- break;
- }
- }
-
- // Warp Splinter eat treants if they are near him
- void EatTreant()
- {
- for( int i=0; i<6; ++i )
- {
- Unit *pTreant = Unit::GetUnit(*m_creature, Treant_GUIDs[i]);
-
- if( pTreant )
- {
- if( m_creature->IsWithinDistInMap(pTreant, 5))
- {
- // 2) Heal Warp Splinter
- int32 CurrentHP_Treant = (int32)pTreant->GetHealth();
- m_creature->CastCustomSpell(m_creature,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID());
-
- // 3) Kill Treant
- pTreant->DealDamage(pTreant, pTreant->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Check for War Stomp
- if(War_Stomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),WAR_STOMP);
- War_Stomp_Timer = 60000;
- }
- else War_Stomp_Timer -= diff;
-
- //Check for Arcane Volley
- if(Arcane_Volley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),ARCANE_VOLLEY);
- Arcane_Volley_Timer = 40000+((rand()%20)*1000);
- }
- else Arcane_Volley_Timer -= diff;
-
- //Check for Summon Treants
- if(Summon_Treants_Timer < diff)
- {
- SummonTreants();
- Summon_Treants_Timer = 45000;
- }
- else Summon_Treants_Timer -= diff;
-
- // I check if there is a Treant in Warp Splinter's LOS, so he can eat them
- if( CheckTreantLOS_Timer < diff)
- {
- EatTreant();
- CheckTreantLOS_Timer = 1000;
- }
- else CheckTreantLOS_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_warp_splinter(Creature *_Creature)
-{
- return new boss_warp_splinterAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_treant(Creature *_Creature)
-{
- return new mob_treantAI (_Creature);
-}
-
-void AddSC_boss_warp_splinter()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_warp_splinter";
- newscript->GetAI = GetAI_boss_warp_splinter;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_warp_splinter_treant";
- newscript->GetAI = GetAI_mob_treant;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warp_Splinter
+SD%Complete: 80
+SDComment: Includes Sapling (need some better control with these). Spells for boss possibly need some rework.
+SDCategory: Tempest Keep, The Botanica
+EndScriptData */
+
+#include "precompiled.h"
+
+/*#####
+# mob_treant (Sapling)
+#####*/
+
+struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI
+{
+ mob_treantAI (Creature *c) : ScriptedAI(c)
+ {
+ WarpGuid = 0;
+ Reset();
+ }
+
+ uint64 WarpGuid;
+
+ void Reset()
+ {
+ m_creature->SetSpeed( MOVE_RUN, 0.5f, true);
+ m_creature->SetUnitMovementFlags(0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ return;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (m_creature->getVictim()->GetGUID() != WarpGuid)
+ DoMeleeAttackIfReady();
+ }
+};
+
+/*#####
+# boss_warp_splinter
+#####*/
+
+#define WAR_STOMP 34716
+#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon)
+#define ARCANE_VOLLEY 35059 //37078, 34785 //must additional script them (because Splinter eats them after 20 sec ^)
+#define SPELL_HEAL_FATHER 6262
+
+#define CREATURE_TREANT 19949
+
+#define SAY_COMBAT_START "Who disturbs this sanctuary?"
+#define SOUND_COMBAT_START 11230
+
+#define SAY_SLAY_1 "You must die! But wait: this does not-- No, no... you must die!"
+#define SOUND_SLAY_1 11231
+#define SAY_SLAY_2 "What am I doing? Why do I..."
+#define SOUND_SLAY_2 11232
+
+#define SAY_SUMMON_1 "Children, come to me!"
+#define SOUND_SUMMON_1 11233
+#define SAY_SUMMON_2 "Maybe this is not-- No, we fight! Come to my aid."
+#define SOUND_SUMMON_2 11234
+
+#define SAY_DEATH "So... confused. Do not... belong here!"
+#define SOUND_DEATH 11235
+
+#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point
+
+float treant_pos[6][3] =
+{
+ {24.301233, 427.221100, -27.060635},
+ {16.795492, 359.678802, -27.355425},
+ {53.493484, 345.381470, -26.196192},
+ {61.867096, 439.362732, -25.921030},
+ {109.861877, 423.201630, -27.356019},
+ {106.780159, 355.582581, -27.593357}
+};
+
+struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI
+{
+ boss_warp_splinterAI(Creature *c) : ScriptedAI(c)
+ {
+ Treant_Spawn_Pos_X = c->GetPositionX();
+ Treant_Spawn_Pos_Y = c->GetPositionY();
+ Reset();
+ }
+
+ uint32 War_Stomp_Timer;
+ uint32 Summon_Treants_Timer;
+ uint32 Arcane_Volley_Timer;
+ uint32 CheckTreantLOS_Timer;
+ uint32 TreantLife_Timer;
+ uint64 Treant_GUIDs[6];
+
+ float Treant_Spawn_Pos_X;
+ float Treant_Spawn_Pos_Y;
+
+
+ void Reset()
+ {
+ War_Stomp_Timer = 60000;
+ Summon_Treants_Timer = 45000;
+ Arcane_Volley_Timer = 140000;
+ CheckTreantLOS_Timer = 1000;
+ TreantLife_Timer = 999999;
+
+ for(int i = 0; i < 6; ++i)
+ Treant_GUIDs[i] = 0;
+
+ m_creature->SetSpeed( MOVE_RUN, 0.7f, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_COMBAT_START,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_COMBAT_START);
+ }
+
+ // On Killed Unit
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void SummonTreants()
+ {
+ for(int i = 0; i < 6; ++i)
+ {
+ float angle = (M_PI / 3) * i;
+
+ float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle);
+ float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle);
+ //float Z = m_creature->GetMap()->GetHeight(X,Y, m_creature->GetPositionZ());
+ //float Z = m_creature->GetPositionZ();
+ float O = - m_creature->GetAngle(X,Y);
+
+ 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,40000);
+ if(pTreant)
+ {
+ //pTreant->GetMotionMaster()->Mutate(new TargetedMovementGenerator<Creature>(*m_creature));
+ pTreant->AddThreat(m_creature, 0.1f);
+ Treant_GUIDs[i] = pTreant->GetGUID();
+ ((mob_treantAI*)pTreant->AI())->WarpGuid = m_creature->GetGUID();
+ }
+ }
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SUMMON_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON_1);
+ break;
+ case 1:
+ DoYell(SAY_SUMMON_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON_2);
+ break;
+ }
+ }
+
+ // Warp Splinter eat treants if they are near him
+ void EatTreant()
+ {
+ for( int i=0; i<6; ++i )
+ {
+ Unit *pTreant = Unit::GetUnit(*m_creature, Treant_GUIDs[i]);
+
+ if( pTreant )
+ {
+ if( m_creature->IsWithinDistInMap(pTreant, 5))
+ {
+ // 2) Heal Warp Splinter
+ int32 CurrentHP_Treant = (int32)pTreant->GetHealth();
+ m_creature->CastCustomSpell(m_creature,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID());
+
+ // 3) Kill Treant
+ pTreant->DealDamage(pTreant, pTreant->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Check for War Stomp
+ if(War_Stomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),WAR_STOMP);
+ War_Stomp_Timer = 60000;
+ }
+ else War_Stomp_Timer -= diff;
+
+ //Check for Arcane Volley
+ if(Arcane_Volley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),ARCANE_VOLLEY);
+ Arcane_Volley_Timer = 40000+((rand()%20)*1000);
+ }
+ else Arcane_Volley_Timer -= diff;
+
+ //Check for Summon Treants
+ if(Summon_Treants_Timer < diff)
+ {
+ SummonTreants();
+ Summon_Treants_Timer = 45000;
+ }
+ else Summon_Treants_Timer -= diff;
+
+ // I check if there is a Treant in Warp Splinter's LOS, so he can eat them
+ if( CheckTreantLOS_Timer < diff)
+ {
+ EatTreant();
+ CheckTreantLOS_Timer = 1000;
+ }
+ else CheckTreantLOS_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_warp_splinter(Creature *_Creature)
+{
+ return new boss_warp_splinterAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_treant(Creature *_Creature)
+{
+ return new mob_treantAI (_Creature);
+}
+
+void AddSC_boss_warp_splinter()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_warp_splinter";
+ newscript->GetAI = GetAI_boss_warp_splinter;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_warp_splinter_treant";
+ newscript->GetAI = GetAI_mob_treant;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
index e54bdcb8079..1fda311e173 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
@@ -1,532 +1,532 @@
-/* Copyright(C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-*(at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_alar
-SD%Complete: 95
-SDComment:
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-
-#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions
-#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20%
-#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1)
-#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2
-#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2
-#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown
-#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec
-#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5.
-#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown)
-
-#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health.
-#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast
-
-#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2
-#define SPELL_FLAME_PATCH 35380 //
-
-static float waypoint[6][3] =
-{
- {340.15, 58.65, 17.71},
- {388.09, 31.54, 20.18},
- {388.18, -32.85, 20.18},
- {340.29, -60.19, 17.72},
- {332, 0.01, 39}, // better not use the same xy coord
- {331, 0.01, -2.39}
-};
-
-enum WaitEventType
-{
- WE_NONE = 0,
- WE_DUMMY = 1,
- WE_PLATFORM = 2,
- WE_QUILL = 3,
- WE_DIE = 4,
- WE_REVIVE = 5,
- WE_CHARGE = 6,
- WE_METEOR = 7,
- WE_DIVE = 8,
- WE_LAND = 9,
- WE_SUMMON = 10
-};
-
-struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
-{
- boss_alarAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =((ScriptedInstance*)c->GetInstanceData());
- DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN);
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- WaitEventType WaitEvent;
- uint32 WaitTimer;
-
- bool AfterMoving;
-
- uint32 Platforms_Move_Timer;
- uint32 DiveBomb_Timer;
- uint32 MeltArmor_Timer;
- uint32 Charge_Timer;
- uint32 FlamePatch_Timer;
- uint32 Berserk_Timer;
-
- float DefaultMoveSpeedRate;
-
- bool Phase1;
-
- int8 cur_wp;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_ALAREVENT, NOT_STARTED);
-
- Berserk_Timer = 1200000;
- Platforms_Move_Timer = 0;
-
- Phase1 = true;
- WaitEvent = WE_NONE;
- WaitTimer = 0;
- AfterMoving = false;
-
- 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);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS);
-
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
- DoZoneInCombat();
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_ALAREVENT, DONE);
- }
-
- void JustSummoned(Creature *summon)
- {
- if(summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- summon->AI()->AttackStart(target);
- summon->SetInCombatWith(target);
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who) {}
-
- void AttackStart(Unit* who)
- {
- if(!who)
- return;
-
- if(who->isTargetableForAttack())
- {
- //Begin attack
- if(Phase1)
- DoStartAttackNoMovement(who);
- else
- DoStartAttackAndMovement(who);
-
- if(!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void DamageTaken(Unit* pKiller, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth() && Phase1)
- {
- damage = 0;
- if(!WaitEvent)
- {
- WaitEvent = WE_DIE;
- WaitTimer = 0;
- m_creature->SetHealth(0);
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AttackStop();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
- }
- }
- }
-
- void SpellHit(Unit*, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_DIVE_BOMB_VISUAL)
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- m_creature->SetDisplayId(11686);
- //m_creature->SendUpdateObjectToAllExcept(NULL);
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type == POINT_MOTION_TYPE)
- {
- WaitTimer = 1;
- AfterMoving = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug?
- return;
-
- if(Berserk_Timer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- Berserk_Timer = 60000;
- }else Berserk_Timer -= diff;
-
- if(WaitEvent)
- {
- if(WaitTimer)
- {
- if(WaitTimer <= diff)
- {
- if(AfterMoving)
- {
- m_creature->GetMotionMaster()->MoveIdle();
- AfterMoving = false;
- }
-
- switch(WaitEvent)
- {
- case WE_PLATFORM:
- Platforms_Move_Timer = 30000+rand()%5000;
- break;
- case WE_QUILL:
- m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true);
- Platforms_Move_Timer = 1;
- WaitTimer = 10000;
- WaitEvent = WE_DUMMY;
- return;
- case WE_DIE:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
- WaitTimer = 5000;
- WaitEvent = WE_REVIVE;
- return;
- case WE_REVIVE:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoResetThreat();
- DoZoneInCombat();
- m_creature->CastSpell(m_creature, SPELL_REBIRTH, true);
- MeltArmor_Timer = 60000;
- Charge_Timer = 7000;
- DiveBomb_Timer = 40000+rand()%5000;
- FlamePatch_Timer = 30000;
- Phase1 = false;
- break;
- case WE_CHARGE:
- m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
- break;
- case WE_METEOR:
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
- m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false);
- WaitEvent = WE_DIVE;
- WaitTimer = 4000;
- return;
- case WE_DIVE:
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
- m_creature->CastSpell(target, SPELL_DIVE_BOMB, true);
- float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
- if (dist < 5.0f) dist = 5.0f;
- WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
- m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
- m_creature->StopMoving();
- WaitEvent = WE_LAND;
- }else EnterEvadeMode();
- return;
- case WE_LAND:
- WaitEvent = WE_SUMMON;
- WaitTimer = 2000;
- return;
- case WE_SUMMON:
- for(uint8 i = 0; i < 2; ++i)
- DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
- m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true);
- break;
- case WE_DUMMY:
- default:
- break;
- }
-
- WaitEvent = WE_NONE;
- WaitTimer = 0;
- }else WaitTimer -= diff;
- }
- return;
- }
-
- if(Phase1)
- {
- if(m_creature->getThreatManager().getThreatList().empty())
- {
- EnterEvadeMode();
- return;
- }
-
- if(Platforms_Move_Timer < diff)
- {
- if(cur_wp == 4)
- {
- cur_wp = 0;
- WaitEvent = WE_PLATFORM;
- }
- else
- {
- if(rand()%5) // next platform
- {
- DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(cur_wp == 3)
- cur_wp = 0;
- else
- cur_wp++;
- WaitEvent = WE_PLATFORM;
- }
- else // flame quill
- {
- cur_wp = 4;
- WaitEvent = WE_QUILL;
- }
- }
- m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
- WaitTimer = 0;
- return;
- }else Platforms_Move_Timer -= diff;
- }
- else
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(Charge_Timer < diff)
- {
- if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1))
- {
- m_creature->SetInFront(target);
- m_creature->GetMotionMaster()->Clear();
- m_creature->AttackStop();
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- DoCast(target, SPELL_CHARGE);
- WaitEvent = WE_CHARGE;
- WaitTimer = 1000;
- return;
- }
- Charge_Timer = 30000;
- }else Charge_Timer -= diff;
-
- if(MeltArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR);
- MeltArmor_Timer = 60000;
- }else MeltArmor_Timer -= diff;
-
- if(DiveBomb_Timer < diff)
- {
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
- WaitEvent = WE_METEOR;
- WaitTimer = 0;
- DiveBomb_Timer = 40000+rand()%5000;
- return;
- }else DiveBomb_Timer -= diff;
-
- if(FlamePatch_Timer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
- if(Summoned)
- {
- Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
- Summoned->SetDisplayId(11686);
- Summoned->setFaction(m_creature->getFaction());
- Summoned->SetLevel(m_creature->getLevel());
- Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
- }
- }
- FlamePatch_Timer = 30000;
- }else FlamePatch_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-
- void DoMeleeAttackIfReady()
- {
- if(m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- else
- {
- Unit *target = NULL;
- if(Phase1 && (target = m_creature->SelectNearbyTarget()) && m_creature->IsHostileTo(target)) // core bug, 1620 faction bugged
- m_creature->AI()->AttackStart(target);
- else
- {
- m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true);
- m_creature->setAttackTimer(BASE_ATTACK, 1500);
- }
- }
- }
- }
-};
-
-CreatureAI* GetAI_boss_alar(Creature *_Creature)
-{
- return new boss_alarAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI
-{
- mob_ember_of_alarAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (ScriptedInstance*)c->GetInstanceData();
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool toDie;
-
- void Reset() {toDie = false;}
- void Aggro(Unit *who) {DoZoneInCombat();}
- void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);}
-
- void DamageTaken(Unit* pKiller, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie)
- {
- damage = 0;
- m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true);
- m_creature->SetDisplayId(11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(pInstance && pInstance->GetData(DATA_ALAREVENT) == 2)
- {
- if(Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR)))
- {
- int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03;
- if(AlarHealth > 0)
- Alar->SetHealth(AlarHealth);
- else
- Alar->SetHealth(1);
- }
- }
- toDie = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(toDie)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- //m_creature->SetVisibility(VISIBILITY_OFF);
- }
-
- DoMeleeAttackIfReady();
- }
-
-};
-
-CreatureAI* GetAI_mob_ember_of_alar(Creature *_Creature)
-{
- return new mob_ember_of_alarAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI
-{
- mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {}
- void Reset() {}
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-};
-
-CreatureAI* GetAI_mob_flame_patch_alar(Creature *_Creature)
-{
- return new mob_flame_patch_alarAI(_Creature);
-}
-
-void AddSC_boss_alar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_alar";
- newscript->GetAI = GetAI_boss_alar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ember_of_alar";
- newscript->GetAI = GetAI_mob_ember_of_alar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_flame_patch_alar";
- newscript->GetAI = GetAI_mob_flame_patch_alar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright(C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+*(at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_alar
+SD%Complete: 95
+SDComment:
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+
+#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions
+#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20%
+#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1)
+#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2
+#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2
+#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown
+#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec
+#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5.
+#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown)
+
+#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health.
+#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast
+
+#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2
+#define SPELL_FLAME_PATCH 35380 //
+
+static float waypoint[6][3] =
+{
+ {340.15, 58.65, 17.71},
+ {388.09, 31.54, 20.18},
+ {388.18, -32.85, 20.18},
+ {340.29, -60.19, 17.72},
+ {332, 0.01, 39}, // better not use the same xy coord
+ {331, 0.01, -2.39}
+};
+
+enum WaitEventType
+{
+ WE_NONE = 0,
+ WE_DUMMY = 1,
+ WE_PLATFORM = 2,
+ WE_QUILL = 3,
+ WE_DIE = 4,
+ WE_REVIVE = 5,
+ WE_CHARGE = 6,
+ WE_METEOR = 7,
+ WE_DIVE = 8,
+ WE_LAND = 9,
+ WE_SUMMON = 10
+};
+
+struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
+{
+ boss_alarAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =((ScriptedInstance*)c->GetInstanceData());
+ DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN);
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ WaitEventType WaitEvent;
+ uint32 WaitTimer;
+
+ bool AfterMoving;
+
+ uint32 Platforms_Move_Timer;
+ uint32 DiveBomb_Timer;
+ uint32 MeltArmor_Timer;
+ uint32 Charge_Timer;
+ uint32 FlamePatch_Timer;
+ uint32 Berserk_Timer;
+
+ float DefaultMoveSpeedRate;
+
+ bool Phase1;
+
+ int8 cur_wp;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ALAREVENT, NOT_STARTED);
+
+ Berserk_Timer = 1200000;
+ Platforms_Move_Timer = 0;
+
+ Phase1 = true;
+ WaitEvent = WE_NONE;
+ WaitTimer = 0;
+ AfterMoving = false;
+
+ 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);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS);
+
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
+ DoZoneInCombat();
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ALAREVENT, DONE);
+ }
+
+ void JustSummoned(Creature *summon)
+ {
+ if(summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ summon->AI()->AttackStart(target);
+ summon->SetInCombatWith(target);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who) {}
+
+ void AttackStart(Unit* who)
+ {
+ if(!who)
+ return;
+
+ if(who->isTargetableForAttack())
+ {
+ //Begin attack
+ if(Phase1)
+ DoStartAttackNoMovement(who);
+ else
+ DoStartAttackAndMovement(who);
+
+ if(!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void DamageTaken(Unit* pKiller, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth() && Phase1)
+ {
+ damage = 0;
+ if(!WaitEvent)
+ {
+ WaitEvent = WE_DIE;
+ WaitTimer = 0;
+ m_creature->SetHealth(0);
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->AttackStop();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
+ }
+ }
+ }
+
+ void SpellHit(Unit*, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_DIVE_BOMB_VISUAL)
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ m_creature->SetDisplayId(11686);
+ //m_creature->SendUpdateObjectToAllExcept(NULL);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type == POINT_MOTION_TYPE)
+ {
+ WaitTimer = 1;
+ AfterMoving = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug?
+ return;
+
+ if(Berserk_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ Berserk_Timer = 60000;
+ }else Berserk_Timer -= diff;
+
+ if(WaitEvent)
+ {
+ if(WaitTimer)
+ {
+ if(WaitTimer <= diff)
+ {
+ if(AfterMoving)
+ {
+ m_creature->GetMotionMaster()->MoveIdle();
+ AfterMoving = false;
+ }
+
+ switch(WaitEvent)
+ {
+ case WE_PLATFORM:
+ Platforms_Move_Timer = 30000+rand()%5000;
+ break;
+ case WE_QUILL:
+ m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true);
+ Platforms_Move_Timer = 1;
+ WaitTimer = 10000;
+ WaitEvent = WE_DUMMY;
+ return;
+ case WE_DIE:
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+ WaitTimer = 5000;
+ WaitEvent = WE_REVIVE;
+ return;
+ case WE_REVIVE:
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoResetThreat();
+ DoZoneInCombat();
+ m_creature->CastSpell(m_creature, SPELL_REBIRTH, true);
+ MeltArmor_Timer = 60000;
+ Charge_Timer = 7000;
+ DiveBomb_Timer = 40000+rand()%5000;
+ FlamePatch_Timer = 30000;
+ Phase1 = false;
+ break;
+ case WE_CHARGE:
+ m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ break;
+ case WE_METEOR:
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
+ m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false);
+ WaitEvent = WE_DIVE;
+ WaitTimer = 4000;
+ return;
+ case WE_DIVE:
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
+ m_creature->CastSpell(target, SPELL_DIVE_BOMB, true);
+ float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ if (dist < 5.0f) dist = 5.0f;
+ WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
+ m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ m_creature->StopMoving();
+ WaitEvent = WE_LAND;
+ }else EnterEvadeMode();
+ return;
+ case WE_LAND:
+ WaitEvent = WE_SUMMON;
+ WaitTimer = 2000;
+ return;
+ case WE_SUMMON:
+ for(uint8 i = 0; i < 2; ++i)
+ DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
+ m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true);
+ break;
+ case WE_DUMMY:
+ default:
+ break;
+ }
+
+ WaitEvent = WE_NONE;
+ WaitTimer = 0;
+ }else WaitTimer -= diff;
+ }
+ return;
+ }
+
+ if(Phase1)
+ {
+ if(m_creature->getThreatManager().getThreatList().empty())
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ if(Platforms_Move_Timer < diff)
+ {
+ if(cur_wp == 4)
+ {
+ cur_wp = 0;
+ WaitEvent = WE_PLATFORM;
+ }
+ else
+ {
+ if(rand()%5) // next platform
+ {
+ DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if(cur_wp == 3)
+ cur_wp = 0;
+ else
+ cur_wp++;
+ WaitEvent = WE_PLATFORM;
+ }
+ else // flame quill
+ {
+ cur_wp = 4;
+ WaitEvent = WE_QUILL;
+ }
+ }
+ m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
+ WaitTimer = 0;
+ return;
+ }else Platforms_Move_Timer -= diff;
+ }
+ else
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(Charge_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1))
+ {
+ m_creature->SetInFront(target);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->AttackStop();
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ DoCast(target, SPELL_CHARGE);
+ WaitEvent = WE_CHARGE;
+ WaitTimer = 1000;
+ return;
+ }
+ Charge_Timer = 30000;
+ }else Charge_Timer -= diff;
+
+ if(MeltArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR);
+ MeltArmor_Timer = 60000;
+ }else MeltArmor_Timer -= diff;
+
+ if(DiveBomb_Timer < diff)
+ {
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
+ WaitEvent = WE_METEOR;
+ WaitTimer = 0;
+ DiveBomb_Timer = 40000+rand()%5000;
+ return;
+ }else DiveBomb_Timer -= diff;
+
+ if(FlamePatch_Timer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
+ if(Summoned)
+ {
+ Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
+ Summoned->SetDisplayId(11686);
+ Summoned->setFaction(m_creature->getFaction());
+ Summoned->SetLevel(m_creature->getLevel());
+ Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
+ }
+ }
+ FlamePatch_Timer = 30000;
+ }else FlamePatch_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void DoMeleeAttackIfReady()
+ {
+ if(m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ if(m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ else
+ {
+ Unit *target = NULL;
+ if(Phase1 && (target = m_creature->SelectNearbyTarget()) && m_creature->IsHostileTo(target)) // core bug, 1620 faction bugged
+ m_creature->AI()->AttackStart(target);
+ else
+ {
+ m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true);
+ m_creature->setAttackTimer(BASE_ATTACK, 1500);
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_alar(Creature *_Creature)
+{
+ return new boss_alarAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI
+{
+ mob_ember_of_alarAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (ScriptedInstance*)c->GetInstanceData();
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool toDie;
+
+ void Reset() {toDie = false;}
+ void Aggro(Unit *who) {DoZoneInCombat();}
+ void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);}
+
+ void DamageTaken(Unit* pKiller, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie)
+ {
+ damage = 0;
+ m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true);
+ m_creature->SetDisplayId(11686);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if(pInstance && pInstance->GetData(DATA_ALAREVENT) == 2)
+ {
+ if(Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR)))
+ {
+ int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03;
+ if(AlarHealth > 0)
+ Alar->SetHealth(AlarHealth);
+ else
+ Alar->SetHealth(1);
+ }
+ }
+ toDie = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(toDie)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ //m_creature->SetVisibility(VISIBILITY_OFF);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+
+CreatureAI* GetAI_mob_ember_of_alar(Creature *_Creature)
+{
+ return new mob_ember_of_alarAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI
+{
+ mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {}
+ void Reset() {}
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_mob_flame_patch_alar(Creature *_Creature)
+{
+ return new mob_flame_patch_alarAI(_Creature);
+}
+
+void AddSC_boss_alar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_alar";
+ newscript->GetAI = GetAI_boss_alar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ember_of_alar";
+ newscript->GetAI = GetAI_mob_ember_of_alar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_flame_patch_alar";
+ newscript->GetAI = GetAI_mob_flame_patch_alar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
index aa220e82676..895faaad107 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
@@ -1,545 +1,545 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_astromancer
-SD%Complete: 75
-SDComment:
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-
-#define SPELL_ARCANE_MISSILES 33031
-#define SPELL_MARK_OF_THE_ASTROMANCER 33045
-#define MARK_OF_SOLARIAN 33023
-#define SPELL_BLINDING_LIGHT 33009
-#define SPELL_FEAR 29321
-#define SPELL_VOID_BOLT 39329
-
-#define SAY_PHASE1 "Tal anu'men no Sin'dorei!"
-#define SOUND_PHASE1 11134
-#define SAY_PHASE2 "I will crush your delusions of grandeur!"
-#define SOUND_PHASE2 11140
-#define SAY_PHASE21 "Ha ha ha! You are hopelessly outmatched!"
-#define SOUND_PHASE21 11139
-
-#define SAY_VOID "Enough of this! Now I call upon the fury of the cosmos itself."
-//#define SOUND_VOID Not found :(
-#define SAY_VOID1 "I become ONE... with the VOID!"
-//#define SOUND_VOID1 Not found :(
-
-#define SAY_KILL1 "Your soul belongs to the Abyss!"
-#define SOUND_KILL1 11136
-#define SAY_KILL2 "By the blood of the Highborne!"
-#define SOUND_KILL2 11137
-#define SAY_KILL3 "For the Sunwell!"
-#define SOUND_KILL3 11138
-#define SAY_DEATH "The warmth of the sun... awaits."
-#define SOUND_DEATH 11135
-
-#define CENTER_X 432.909f
-#define CENTER_Y -373.424f
-#define CENTER_Z 17.9608f
-#define CENTER_O 1.06421f
-#define SMALL_PORTAL_RADIUS 12.6f
-#define LARGE_PORTAL_RADIUS 26.0f
-#define PORTAL_Z 17.005f
-
-#define SOLARIUM_AGENT 18925
-#define SOLARIUM_PRIEST 18806
-#define ASTROMANCER_SOLARIAN_SPOTLIGHT 18928
-#define SPELL_SPOTLIGHT 25824
-#define MODEL_HUMAN 18239
-#define MODEL_VOIDWALKER 18988
-
-#define SOLARIUM_HEAL 41378
-#define SOLARIUM_SMITE 31740
-#define SOLARIUM_SILENCE 37160
-
-#define WV_ARMOR 31000
-#define MIN_RANGE_FOR_DOT_JUMP 20.0f
-
-struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
-{
- boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
-
- defaultarmor=m_creature->GetArmor();
- defaultsize=m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X);
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 ArcaneMissiles_Timer;
- uint32 MarkOfTheAstromancer_Timer;
- uint32 BlindingLight_Timer;
- uint32 Fear_Timer;
- uint32 VoidBolt_Timer;
- uint32 Phase1_Timer;
- uint32 Phase2_Timer;
- uint32 Phase3_Timer;
- uint32 AppearDelay_Timer;
- uint32 MarkOfTheSolarian_Timer;
- uint32 Jump_Timer;
- uint32 defaultarmor;
-
- float defaultsize;
-
- bool AppearDelay;
-
- uint8 Phase;
-
- uint64 WrathTarget;
-
- float Portals[3][3];
-
- void Reset()
- {
- WrathTarget=0;
- ArcaneMissiles_Timer = 2000;
- MarkOfTheAstromancer_Timer = 15000;
- BlindingLight_Timer = 41000;
- Fear_Timer = 20000;
- VoidBolt_Timer = 10000;
- Phase1_Timer = 50000;
- Phase2_Timer = 10000;
- Phase3_Timer = 15000;
- AppearDelay_Timer = 2000;
- AppearDelay = false;
- MarkOfTheSolarian_Timer=45000;
- Jump_Timer=8000;
- Phase = 1;
-
- 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->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN);
- }
-
- void StartEvent()
- {
- DoYell(SAY_PHASE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE1);
-
- if(pInstance)
- pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- break;
- case 1:
- DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- break;
- case 2:
- DoYell(SAY_KILL3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN);
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
- }
-
- void Aggro(Unit *who)
- {
- StartEvent();
- }
-
- void SummonMinion(uint32 entry, float x, float y, float z)
- {
- Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(Summoned)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Summoned->AI()->AttackStart(target);
- }
- }
-
- float Portal_X(float radius)
- {
- if ((rand()%2)==1) radius = -radius;
- return (radius * (float)(rand()%100)/100.0f + CENTER_X);
- }
-
- float Portal_Y(float x, float radius)
- {
- float z;
-
- switch(rand()%2)
- {
- case 0: z = 1; break;
- case 1: z = -1; break;
- }
- return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (AppearDelay)
- {
- m_creature->StopMoving();
- m_creature->AttackStop();
- if (AppearDelay_Timer < diff)
- {
- AppearDelay = false;
- if (Phase == 2)
- {
- switch (rand()%2)
- {
- case 0:
- DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE2);
- break;
- case 1:
- DoYell(SAY_PHASE21, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE21);
- break;
- }
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
- }
- if (Phase == 3)
- Phase = 1;
-
- AppearDelay_Timer = 2000;
- }else AppearDelay_Timer -= diff;
- }
-
- //the jumping of the dot part of the wrath of the astromancer
- if(WrathTarget)
- {
- if(Jump_Timer< diff)
- {
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- bool hasJumped = false;
-
- Unit* target = Unit::GetUnit((*m_creature),WrathTarget);
- if(target && target->isAlive())
- {
- for(std::list<HostilReference*>::iterator iter = m_threatlist.begin();iter!=m_threatlist.end();++iter)
- {
- Unit* currentUnit=Unit::GetUnit((*m_creature),(*iter)->getUnitGuid());
- if(currentUnit)
- {
- if(currentUnit->IsWithinDistInMap(target,MIN_RANGE_FOR_DOT_JUMP)&&currentUnit->isAlive()&&currentUnit!=target)
- {
- m_creature->CastSpell(currentUnit,SPELL_MARK_OF_THE_ASTROMANCER, false,0,0,m_creature->GetGUID());
-
- Jump_Timer=8000;
- WrathTarget=currentUnit->GetGUID();
- hasJumped = true;
- break;
- }
- }
- }
- }
-
- if(!hasJumped)
- WrathTarget = 0;
- }else Jump_Timer -= diff;
- }
-
- if (Phase == 1)
- {
- //ArcaneMissiles_Timer
- if (ArcaneMissiles_Timer < diff)
- {
- //Solarian casts Arcane Missiles on on random targets in the raid.
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!m_creature->HasInArc(2.5f, target))
- target = m_creature->getVictim();
- if (target)
- DoCast(target, SPELL_ARCANE_MISSILES);
-
- ArcaneMissiles_Timer = 3000;
- }else ArcaneMissiles_Timer -= diff;
-
- //MarkOfTheSolarian_Timer
- if (MarkOfTheSolarian_Timer < diff)
- {
- DoCast(m_creature->getVictim(), MARK_OF_SOLARIAN);
- MarkOfTheSolarian_Timer = 45000;
- }else MarkOfTheSolarian_Timer -= diff;
-
- //MarkOfTheAstromancer_Timer
- if (MarkOfTheAstromancer_Timer < diff)
- {
- //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(target)
- {
- DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER);
-
- WrathTarget=target->GetGUID();
- Jump_Timer=8000;
- }
-
- MarkOfTheAstromancer_Timer = 15000;
- }else MarkOfTheAstromancer_Timer -= diff;
-
- //BlindingLight_Timer
- if (BlindingLight_Timer < diff)
- {
- //She casts this spell every 45 seconds. It is a kind of Moonfire spell, which she strikes down on the whole raid simultaneously. It hits everyone in the raid for 2280 to 2520 arcane damage.
- DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT);
-
- BlindingLight_Timer = 45000;
- }else BlindingLight_Timer -= diff;
-
- //Phase1_Timer
- if (Phase1_Timer < diff)
- {
- Phase = 2;
- Phase1_Timer = 50000;
- //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
- m_creature->GetMotionMaster()->Clear();
- m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
- for(int i=0; i<=2; i++)
- {
- if (!i)
- {
- Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS);
- Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS);
- Portals[i][2] = CENTER_Z;
- }else
- {
- Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS);
- Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS);
- Portals[i][2] = PORTAL_Z;
- }
- }
- if((abs(Portals[2][0] - Portals[1][0]) < 7)
- && (abs(Portals[2][1] - Portals[1][1]) < 7))
- {
- int i=1;
- if(abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
- i = -1;
- Portals[2][0] = Portals[2][0]+7*i;
- Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
- }
- for (int i=0; i<=2; i++)
- {
- Creature* Summoned = m_creature->SummonCreature(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(Summoned)
- {
- Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
- }
- }
- AppearDelay = true;
- }else Phase1_Timer-=diff;
- }
- else if(Phase == 2)
- {
- //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
- m_creature->AttackStop();
- m_creature->StopMoving();
- if (Phase2_Timer < diff)
- {
- Phase = 3;
- for (int i=0; i<=2; i++)
- for (int j=1; j<=4; j++)
- SummonMinion(SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
- Phase2_Timer = 10000;
- } else Phase2_Timer -= diff;
- }
- else if(Phase == 3)
- {
- //Check Phase3_Timer
- if(Phase3_Timer < diff)
- {
- //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
- m_creature->AttackStop();
- m_creature->StopMoving();
- int i = rand()%3;
- m_creature->GetMotionMaster()->Clear();
- m_creature->Relocate(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
-
- for (int j=0; j<=2; j++)
- if (j!=i)
- SummonMinion(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);
-
- DoYell(SAY_PHASE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE1);
- AppearDelay = true;
- Phase3_Timer = 15000;
- }else Phase3_Timer -= diff;
- }
- else if(Phase == 4)
- {
- //Fear_Timer
- if (Fear_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEAR);
- Fear_Timer = 20000;
- }else Fear_Timer -= diff;
-
- //VoidBolt_Timer
- if (VoidBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_VOID_BOLT);
- VoidBolt_Timer = 10000;
- }else VoidBolt_Timer -= diff;
- }
-
- //When Solarian reaches 20% she will transform into a huge void walker.
- if(Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20))
- {
- Phase = 4;
-
- //To make sure she wont be invisible or not selecatble
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_VOID, LANG_UNIVERSAL, NULL);
- break;
- case 1:
- DoYell(SAY_VOID1, LANG_UNIVERSAL, NULL);
- break;
- }
-
- m_creature->SetArmor(WV_ARMOR);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_VOIDWALKER);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
- }
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI
-{
- mob_solarium_priestAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 healTimer;
- uint32 holysmiteTimer;
- uint32 aoesilenceTimer;
-
- void Reset()
- {
- healTimer = 9000;
- holysmiteTimer = 1;
- aoesilenceTimer = 15000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (healTimer < diff)
- {
- Unit* target = NULL;
-
- switch(rand()%2)
- {
- case 0:
- if(pInstance)
- target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER));
- break;
- case 1:
- target = m_creature;
- break;
- }
-
- if(target)
- {
- DoCast(target,SOLARIUM_HEAL);
- healTimer = 9000;
- }
- } else healTimer -= diff;
-
- if(holysmiteTimer < diff)
- {
- DoCast(m_creature->getVictim(), SOLARIUM_SMITE);
- holysmiteTimer = 4000;
- } else holysmiteTimer -= diff;
-
- if (aoesilenceTimer < diff)
- {
- DoCast(m_creature->getVictim(), SOLARIUM_SILENCE);
- aoesilenceTimer = 13000;
- } else aoesilenceTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_solarium_priest(Creature *_Creature)
-{
- return new mob_solarium_priestAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_high_astromancer_solarian(Creature *_Creature)
-{
- return new boss_high_astromancer_solarianAI (_Creature);
-}
-
-void AddSC_boss_high_astromancer_solarian()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_high_astromancer_solarian";
- newscript->GetAI = GetAI_boss_high_astromancer_solarian;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_solarium_priest";
- newscript->GetAI = GetAI_mob_solarium_priest;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_astromancer
+SD%Complete: 75
+SDComment:
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+
+#define SPELL_ARCANE_MISSILES 33031
+#define SPELL_MARK_OF_THE_ASTROMANCER 33045
+#define MARK_OF_SOLARIAN 33023
+#define SPELL_BLINDING_LIGHT 33009
+#define SPELL_FEAR 29321
+#define SPELL_VOID_BOLT 39329
+
+#define SAY_PHASE1 "Tal anu'men no Sin'dorei!"
+#define SOUND_PHASE1 11134
+#define SAY_PHASE2 "I will crush your delusions of grandeur!"
+#define SOUND_PHASE2 11140
+#define SAY_PHASE21 "Ha ha ha! You are hopelessly outmatched!"
+#define SOUND_PHASE21 11139
+
+#define SAY_VOID "Enough of this! Now I call upon the fury of the cosmos itself."
+//#define SOUND_VOID Not found :(
+#define SAY_VOID1 "I become ONE... with the VOID!"
+//#define SOUND_VOID1 Not found :(
+
+#define SAY_KILL1 "Your soul belongs to the Abyss!"
+#define SOUND_KILL1 11136
+#define SAY_KILL2 "By the blood of the Highborne!"
+#define SOUND_KILL2 11137
+#define SAY_KILL3 "For the Sunwell!"
+#define SOUND_KILL3 11138
+#define SAY_DEATH "The warmth of the sun... awaits."
+#define SOUND_DEATH 11135
+
+#define CENTER_X 432.909f
+#define CENTER_Y -373.424f
+#define CENTER_Z 17.9608f
+#define CENTER_O 1.06421f
+#define SMALL_PORTAL_RADIUS 12.6f
+#define LARGE_PORTAL_RADIUS 26.0f
+#define PORTAL_Z 17.005f
+
+#define SOLARIUM_AGENT 18925
+#define SOLARIUM_PRIEST 18806
+#define ASTROMANCER_SOLARIAN_SPOTLIGHT 18928
+#define SPELL_SPOTLIGHT 25824
+#define MODEL_HUMAN 18239
+#define MODEL_VOIDWALKER 18988
+
+#define SOLARIUM_HEAL 41378
+#define SOLARIUM_SMITE 31740
+#define SOLARIUM_SILENCE 37160
+
+#define WV_ARMOR 31000
+#define MIN_RANGE_FOR_DOT_JUMP 20.0f
+
+struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
+{
+ boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+
+ defaultarmor=m_creature->GetArmor();
+ defaultsize=m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X);
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 ArcaneMissiles_Timer;
+ uint32 MarkOfTheAstromancer_Timer;
+ uint32 BlindingLight_Timer;
+ uint32 Fear_Timer;
+ uint32 VoidBolt_Timer;
+ uint32 Phase1_Timer;
+ uint32 Phase2_Timer;
+ uint32 Phase3_Timer;
+ uint32 AppearDelay_Timer;
+ uint32 MarkOfTheSolarian_Timer;
+ uint32 Jump_Timer;
+ uint32 defaultarmor;
+
+ float defaultsize;
+
+ bool AppearDelay;
+
+ uint8 Phase;
+
+ uint64 WrathTarget;
+
+ float Portals[3][3];
+
+ void Reset()
+ {
+ WrathTarget=0;
+ ArcaneMissiles_Timer = 2000;
+ MarkOfTheAstromancer_Timer = 15000;
+ BlindingLight_Timer = 41000;
+ Fear_Timer = 20000;
+ VoidBolt_Timer = 10000;
+ Phase1_Timer = 50000;
+ Phase2_Timer = 10000;
+ Phase3_Timer = 15000;
+ AppearDelay_Timer = 2000;
+ AppearDelay = false;
+ MarkOfTheSolarian_Timer=45000;
+ Jump_Timer=8000;
+ Phase = 1;
+
+ 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->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN);
+ }
+
+ void StartEvent()
+ {
+ DoYell(SAY_PHASE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE1);
+
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_KILL1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(SAY_KILL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ break;
+ case 2:
+ DoYell(SAY_KILL3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN);
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who)
+ {
+ StartEvent();
+ }
+
+ void SummonMinion(uint32 entry, float x, float y, float z)
+ {
+ Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if(Summoned)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Summoned->AI()->AttackStart(target);
+ }
+ }
+
+ float Portal_X(float radius)
+ {
+ if ((rand()%2)==1) radius = -radius;
+ return (radius * (float)(rand()%100)/100.0f + CENTER_X);
+ }
+
+ float Portal_Y(float x, float radius)
+ {
+ float z;
+
+ switch(rand()%2)
+ {
+ case 0: z = 1; break;
+ case 1: z = -1; break;
+ }
+ return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (AppearDelay)
+ {
+ m_creature->StopMoving();
+ m_creature->AttackStop();
+ if (AppearDelay_Timer < diff)
+ {
+ AppearDelay = false;
+ if (Phase == 2)
+ {
+ switch (rand()%2)
+ {
+ case 0:
+ DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE2);
+ break;
+ case 1:
+ DoYell(SAY_PHASE21, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE21);
+ break;
+ }
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ }
+ if (Phase == 3)
+ Phase = 1;
+
+ AppearDelay_Timer = 2000;
+ }else AppearDelay_Timer -= diff;
+ }
+
+ //the jumping of the dot part of the wrath of the astromancer
+ if(WrathTarget)
+ {
+ if(Jump_Timer< diff)
+ {
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ bool hasJumped = false;
+
+ Unit* target = Unit::GetUnit((*m_creature),WrathTarget);
+ if(target && target->isAlive())
+ {
+ for(std::list<HostilReference*>::iterator iter = m_threatlist.begin();iter!=m_threatlist.end();++iter)
+ {
+ Unit* currentUnit=Unit::GetUnit((*m_creature),(*iter)->getUnitGuid());
+ if(currentUnit)
+ {
+ if(currentUnit->IsWithinDistInMap(target,MIN_RANGE_FOR_DOT_JUMP)&&currentUnit->isAlive()&&currentUnit!=target)
+ {
+ m_creature->CastSpell(currentUnit,SPELL_MARK_OF_THE_ASTROMANCER, false,0,0,m_creature->GetGUID());
+
+ Jump_Timer=8000;
+ WrathTarget=currentUnit->GetGUID();
+ hasJumped = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if(!hasJumped)
+ WrathTarget = 0;
+ }else Jump_Timer -= diff;
+ }
+
+ if (Phase == 1)
+ {
+ //ArcaneMissiles_Timer
+ if (ArcaneMissiles_Timer < diff)
+ {
+ //Solarian casts Arcane Missiles on on random targets in the raid.
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (!m_creature->HasInArc(2.5f, target))
+ target = m_creature->getVictim();
+ if (target)
+ DoCast(target, SPELL_ARCANE_MISSILES);
+
+ ArcaneMissiles_Timer = 3000;
+ }else ArcaneMissiles_Timer -= diff;
+
+ //MarkOfTheSolarian_Timer
+ if (MarkOfTheSolarian_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), MARK_OF_SOLARIAN);
+ MarkOfTheSolarian_Timer = 45000;
+ }else MarkOfTheSolarian_Timer -= diff;
+
+ //MarkOfTheAstromancer_Timer
+ if (MarkOfTheAstromancer_Timer < diff)
+ {
+ //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(target)
+ {
+ DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER);
+
+ WrathTarget=target->GetGUID();
+ Jump_Timer=8000;
+ }
+
+ MarkOfTheAstromancer_Timer = 15000;
+ }else MarkOfTheAstromancer_Timer -= diff;
+
+ //BlindingLight_Timer
+ if (BlindingLight_Timer < diff)
+ {
+ //She casts this spell every 45 seconds. It is a kind of Moonfire spell, which she strikes down on the whole raid simultaneously. It hits everyone in the raid for 2280 to 2520 arcane damage.
+ DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT);
+
+ BlindingLight_Timer = 45000;
+ }else BlindingLight_Timer -= diff;
+
+ //Phase1_Timer
+ if (Phase1_Timer < diff)
+ {
+ Phase = 2;
+ Phase1_Timer = 50000;
+ //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
+ for(int i=0; i<=2; i++)
+ {
+ if (!i)
+ {
+ Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS);
+ Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS);
+ Portals[i][2] = CENTER_Z;
+ }else
+ {
+ Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS);
+ Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS);
+ Portals[i][2] = PORTAL_Z;
+ }
+ }
+ if((abs(Portals[2][0] - Portals[1][0]) < 7)
+ && (abs(Portals[2][1] - Portals[1][1]) < 7))
+ {
+ int i=1;
+ if(abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
+ i = -1;
+ Portals[2][0] = Portals[2][0]+7*i;
+ Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
+ }
+ for (int i=0; i<=2; i++)
+ {
+ Creature* Summoned = m_creature->SummonCreature(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(Summoned)
+ {
+ Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
+ }
+ }
+ AppearDelay = true;
+ }else Phase1_Timer-=diff;
+ }
+ else if(Phase == 2)
+ {
+ //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
+ m_creature->AttackStop();
+ m_creature->StopMoving();
+ if (Phase2_Timer < diff)
+ {
+ Phase = 3;
+ for (int i=0; i<=2; i++)
+ for (int j=1; j<=4; j++)
+ SummonMinion(SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
+ Phase2_Timer = 10000;
+ } else Phase2_Timer -= diff;
+ }
+ else if(Phase == 3)
+ {
+ //Check Phase3_Timer
+ if(Phase3_Timer < diff)
+ {
+ //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
+ m_creature->AttackStop();
+ m_creature->StopMoving();
+ int i = rand()%3;
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->Relocate(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
+
+ for (int j=0; j<=2; j++)
+ if (j!=i)
+ SummonMinion(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);
+
+ DoYell(SAY_PHASE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE1);
+ AppearDelay = true;
+ Phase3_Timer = 15000;
+ }else Phase3_Timer -= diff;
+ }
+ else if(Phase == 4)
+ {
+ //Fear_Timer
+ if (Fear_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEAR);
+ Fear_Timer = 20000;
+ }else Fear_Timer -= diff;
+
+ //VoidBolt_Timer
+ if (VoidBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_VOID_BOLT);
+ VoidBolt_Timer = 10000;
+ }else VoidBolt_Timer -= diff;
+ }
+
+ //When Solarian reaches 20% she will transform into a huge void walker.
+ if(Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20))
+ {
+ Phase = 4;
+
+ //To make sure she wont be invisible or not selecatble
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetVisibility(VISIBILITY_ON);
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_VOID, LANG_UNIVERSAL, NULL);
+ break;
+ case 1:
+ DoYell(SAY_VOID1, LANG_UNIVERSAL, NULL);
+ break;
+ }
+
+ m_creature->SetArmor(WV_ARMOR);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_VOIDWALKER);
+ m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
+ }
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI
+{
+ mob_solarium_priestAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 healTimer;
+ uint32 holysmiteTimer;
+ uint32 aoesilenceTimer;
+
+ void Reset()
+ {
+ healTimer = 9000;
+ holysmiteTimer = 1;
+ aoesilenceTimer = 15000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (healTimer < diff)
+ {
+ Unit* target = NULL;
+
+ switch(rand()%2)
+ {
+ case 0:
+ if(pInstance)
+ target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER));
+ break;
+ case 1:
+ target = m_creature;
+ break;
+ }
+
+ if(target)
+ {
+ DoCast(target,SOLARIUM_HEAL);
+ healTimer = 9000;
+ }
+ } else healTimer -= diff;
+
+ if(holysmiteTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SOLARIUM_SMITE);
+ holysmiteTimer = 4000;
+ } else holysmiteTimer -= diff;
+
+ if (aoesilenceTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SOLARIUM_SILENCE);
+ aoesilenceTimer = 13000;
+ } else aoesilenceTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_solarium_priest(Creature *_Creature)
+{
+ return new mob_solarium_priestAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_high_astromancer_solarian(Creature *_Creature)
+{
+ return new boss_high_astromancer_solarianAI (_Creature);
+}
+
+void AddSC_boss_high_astromancer_solarian()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_high_astromancer_solarian";
+ newscript->GetAI = GetAI_boss_high_astromancer_solarian;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_solarium_priest";
+ newscript->GetAI = GetAI_mob_solarium_priest;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
index 204ff2c8e7f..a712b4bae6e 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
@@ -1,1617 +1,1617 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_Kaelthas
-SD%Complete: 60
-SDComment: SQL, phase 2, phase 3, Mind Control, taunt immunity
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-#include "WorldPacket.h"
-
-//Phase 2 spells (Not used)
-#define SPELL_SUMMON_WEAPONS 36976
-#define SPELL_SUMMON_WEAPONA 36958
-#define SPELL_SUMMON_WEAPONB 36959
-#define SPELL_SUMMON_WEAPONC 36960
-#define SPELL_SUMMON_WEAPOND 36961
-#define SPELL_SUMMON_WEAPONE 36962
-#define SPELL_SUMMON_WEAPONF 36963
-#define SPELL_SUMMON_WEAPONG 36964
-#define SPELL_RES_VISUAL 24171
-#define SPELL_WEAPON_SPAWN 41236
-//Phase 4 spells
-#define SPELL_FIREBALL 22088 //wrong but works with CastCustomSpell
-#define SPELL_PYROBLAST 36819
-#define SPELL_FLAME_STRIKE 36735
-#define SPELL_FLAME_STRIKE_VIS 36730
-#define SPELL_FLAME_STRIKE_DMG 36731
-#define SPELL_ARCANE_DISRUPTION 36834
-#define SPELL_SHOCK_BARRIER 36815
-#define SPELL_PHOENIX_ANIMATION 36723
-#define SPELL_MIND_CONTROL 32830
-//Phase 5 spells
-#define SPELL_EXPLODE 36092
-#define SPELL_FULLPOWER 36187
-#define SPELL_KNOCKBACK 11027
-#define SPELL_GRAVITY_LAPSE 34480
-#define SPELL_GRAVITY_LAPSE_AURA 39432
-#define SPELL_NETHER_BEAM 35873
-//Thaladred the Darkener spells
-#define SPELL_PSYCHIC_BLOW 10689
-#define SPELL_SILENCE 30225
-//Lord Sanguinar spells
-#define SPELL_BELLOWING_ROAR 40636
-//Grand Astromancer Capernian spells
-#define CAPERNIAN_DISTANCE 20 //she casts away from the target
-#define SPELL_CAPERNIAN_FIREBALL 36971
-#define SPELL_CONFLAGRATION 37018
-#define SPELL_ARCANE_EXPLOSION 36970
-//Master Engineer Telonicus spells
-#define SPELL_BOMB 37036
-#define SPELL_REMOTE_TOY 37027
-//Nether Vapor spell
-#define SPELL_NETHER_VAPOR 35859
-//Phoenix spell
-#define SPELL_BURN 36721
-
-//kael'thas Speech
-#define SAY_INTRO "Energy. Power. My people are addicted to it... a dependence made manifest after the Sunwell was destroyed. Welcome... to the future. A pity you are too late to stop it. No one can stop me now! Selama ashal'anore!"
-#define SOUND_INTRO 11256
-
-#define SAY_ASTROMANCER_CAPERNIAN "Capernian will see to it that your stay here is a short one."
-#define SOUND_ASTROMANCER_CAPERNIAN 11257
-
-#define SAY_ENGINEER_TELONICUS "Well done, you have proven worthy to test your skills against my master engineer, Telonicus."
-#define SOUND_ENGINEER_TELONICUS 11258
-
-#define SAY_THALADRED_THE_DARKENER "Let us see how your nerves hold up against the Darkener, Thaladred"
-#define SOUND_THALADRED_THE_DARKENER 11259
-
-#define SAY_LORD_SANGUINAR "You have persevered against some of my best advisors... but none can withstand the might of the Blood Hammer. Behold, Lord Sanguinar!"
-#define SOUND_LORD_SANGUINAR 11260
-
-#define SAY_PHASE2 "As you see, I have many weapons in my arsenal...."
-#define SOUND_PHASE2 11261
-
-#define SAY_PHASE3 "Perhaps I underestimated you. It would be unfair to make you fight all four advisors at once, but... fair treatment was never shown to my people. I'm just returning the favor."
-#define SOUND_PHASE3 11262
-
-#define SAY_PHASE4 "Alas, sometimes one must take matters into one's own hands. Balamore shanal!"
-#define SOUND_PHASE4 11263
-
-#define SAY_PHASE5 "I have not come this far to be stopped! The future I have planned will not be jeopardized! Now you will taste true power!!"
-#define SOUND_PHASE5 11273
-
-#define SAY_SLAY1 "You will not prevail."
-#define SOUND_SLAY1 11270
-
-#define SAY_SLAY2 "You gambled...and lost."
-#define SOUND_SLAY2 11271
-
-#define SAY_MINDCONTROL1 "Obey me."
-#define SOUND_MINDCONTROL1 11268
-
-#define SAY_MINDCONTROL2 "Bow to my will."
-#define SOUND_MINDCONTROL2 11269
-
-#define SAY_GRAVITYLAPSE1 "Let us see how you fare when your world is turned upside down."
-#define SOUND_GRAVITYLAPSE1 11264
-
-#define SAY_GRAVITYLAPSE2 "Having trouble staying grounded?"
-#define SOUND_GRAVITYLAPSE2 11265
-
-#define SAY_SUMMON_PHOENIX1 "Anara'nel belore!"
-#define SOUND_SUMMON_PHOENIX1 11267
-
-#define SAY_SUMMON_PHOENIX2 "By the power of the sun!"
-#define SOUND_SUMMON_PHOENIX2 11266
-
-#define SAY_DEATH "For...Quel...thalas!"
-#define SOUND_DEATH 11274
-
-//Thaladred the Darkener speech
-#define SAY_THALADRED_AGGRO "Prepare yourselves!"
-#define SOUND_THALADRED_AGGRO 11203
-#define SAY_THALADRED_DEATH "Forgive me, my prince! I have... failed."
-#define SOUND_THALADRED_DEATH 11204
-#define EMOTE_THALADRED_GAZE "sets his gaze on $N!"
-
-//Lord Sanguinar speech
-#define SAY_SANGUINAR_AGGRO "Blood for blood!"
-#define SOUND_SANGUINAR_AGGRO 11152
-#define SAY_SANGUINAR_DEATH "NO! I ...will... not..."
-#define SOUND_SANGUINAR_DEATH 11153
-
-//Grand Astromancer Capernian speech
-#define SAY_CAPERNIAN_AGGRO "The sin'dore reign supreme!"
-#define SOUND_CAPERNIAN_AGGRO 11117
-#define SAY_CAPERNIAN_DEATH "This is not over!"
-#define SOUND_CAPERNIAN_DEATH 11118
-
-//Master Engineer Telonicus speech
-#define SAY_TELONICUS_AGGRO "Anar'alah belore!"
-#define SOUND_TELONICUS_AGGRO 11157
-#define SAY_TELONICUS_DEATH "More perils... await"
-#define SOUND_TELONICUS_DEATH 11158
-
-//Creature IDs
-#define PHOENIX 21362
-#define PHOENIX_EGG 21364
-
-//Phoenix egg and phoenix model
-#define PHOENIX_MODEL 19682
-#define PHOENIX_EGG_MODEL 20245
-
-//#define PI 3.141592
-#define TEMP_MC_WHISPER "[SD2 Debug] You would be mind controlled here!"
-
-//weapon id + position
-float KaelthasWeapons[7][5] =
-{
- {21270, 794.38, 15, 48.72, 2.9}, //[Cosmic Infuser]
- {21269, 785.47, 12.12, 48.72, 3.14}, //[Devastation]
- {21271, 781.25, 4.39, 48.72, 3.14}, //[Infinity Blade]
- {21273, 777.38, -0.81, 48.72, 3.06}, //[Phaseshift Bulwark]
- {21274, 781.48, -6.08, 48.72, 3.9}, //[Staff of Disintegration]
- {21272, 785.42, -13.59, 48.72, 3.4}, //[Warp Slicer]
- {21268, 793.06, -16.61, 48.72, 3.10} //[Netherstrand Longbow]
-};
-
-#define GRAVITY_X 795.0f
-#define GRAVITY_Y 0.0f
-#define GRAVITY_Z 70.0f
-
-#define TIME_PHASE_2_3 120000
-#define TIME_PHASE_3_4 120000
-
-#define KAEL_VISIBLE_RANGE 50.0f
-
-//Base AI for Advisors
-struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
-{
- ScriptedInstance* pInstance;
- bool FakeDeath;
- uint32 DelayRes_Timer;
- uint64 DelayRes_Target;
-
- advisorbase_ai(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void AttackStart(Unit* who)
- {
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void Reset()
- {
- FakeDeath = false;
- DelayRes_Timer = 0;
- DelayRes_Target = 0;
-
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- //reset encounter
- if(pInstance && (pInstance->GetData(DATA_KAELTHASEVENT) == 1 || pInstance->GetData(DATA_KAELTHASEVENT) == 3))
- {
- Creature *Kaelthas = NULL;
- Kaelthas = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KAELTHAS)));
-
- if(Kaelthas)
- Kaelthas->AI()->EnterEvadeMode();
- }
- }
-
- void Revive(Unit* Target)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- DoCast(m_creature, SPELL_RES_VISUAL, false);
- DelayRes_Timer = 2000;
- }
-
- void DamageTaken(Unit* pKiller, uint32 &damage)
- {
- if (damage < m_creature->GetHealth())
- return;
-
- //Prevent glitch if in fake death
- if (FakeDeath)
- {
- damage = 0;
- return;
- }
- //Don't really die in phase 1 & 3, only die after that
- if(pInstance && pInstance->GetData(DATA_KAELTHASEVENT) != 0)
- {
- //prevent death
- damage = 0;
- FakeDeath = true;
-
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetHealth(0);
- m_creature->StopMoving();
- m_creature->ClearComboPointHolders();
- m_creature->RemoveAllAurasOnDeath();
- m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
- m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->ClearAllReactives();
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
-
- if (pInstance->GetData(DATA_KAELTHASEVENT) == 3)
- JustDied(pKiller);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (DelayRes_Timer)
- if (DelayRes_Timer <= diff)
- {
- DelayRes_Timer = 0;
- FakeDeath = false;
-
- Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target);
- if (!Target)Target = m_creature->getVictim();
- DoResetThreat();
- AttackStart(Target);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(Target);
- m_creature->AddThreat(Target, 0.0f);
- }else DelayRes_Timer -= diff;
- }
-
-};
-
-//Kael'thas AI
-struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
-{
- boss_kaelthasAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- AdvisorGuid[0] = 0;
- AdvisorGuid[1] = 0;
- AdvisorGuid[2] = 0;
- AdvisorGuid[3] = 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 Fireball_Timer;
- uint32 ArcaneDisruption_Timer;
- uint32 Phoenix_Timer;
- uint32 ShockBarrier_Timer;
- uint32 GravityLapse_Timer;
- uint32 GravityLapse_Phase;
- uint32 NetherBeam_Timer;
- uint32 NetherVapor_Timer;
- uint32 FlameStrike_Timer;
- uint32 MindControl_Timer;
- uint32 Phase;
- uint32 PhaseSubphase; //generic
- uint32 Phase_Timer; //generic timer
- uint32 PyrosCasted;
-
- bool InGravityLapse;
- bool IsCastingFireball;
- bool ChainPyros;
-
- uint64 AdvisorGuid[4];
-
- void Reset()
- {
- Fireball_Timer = 5000+rand()%10000;
- ArcaneDisruption_Timer = 45000;
- MindControl_Timer = 40000;
- Phoenix_Timer = 50000;
- ShockBarrier_Timer = 60000;
- FlameStrike_Timer = 30000;
- GravityLapse_Timer = 20000;
- GravityLapse_Phase = 0;
- NetherBeam_Timer = 8000;
- NetherVapor_Timer = 10000;
- PyrosCasted = 0;
- Phase = 0;
- InGravityLapse = false;
- IsCastingFireball = false;
- ChainPyros = false;
-
- if(InCombat)
- PrepareAdvisors();
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- if(pInstance)
- pInstance->SetData(DATA_KAELTHASEVENT, 0);
- }
-
- void PrepareAdvisors()
- {
- Creature *pCreature;
- for(uint8 i = 0; i < 4; i++)
- {
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
- if(pCreature)
- {
- pCreature->Respawn();
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->setFaction(m_creature->getFaction());
- pCreature->AI()->EnterEvadeMode();
- }
- }
- }
-
- void StartEvent()
- {
- if(!pInstance)
- return;
-
- AdvisorGuid[0] = pInstance->GetData64(DATA_THALADREDTHEDARKENER);
- AdvisorGuid[1] = pInstance->GetData64(DATA_LORDSANGUINAR);
- AdvisorGuid[2] = pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN);
- AdvisorGuid[3] = pInstance->GetData64(DATA_MASTERENGINEERTELONICUS);
-
- if(!AdvisorGuid[0] || !AdvisorGuid[1] || !AdvisorGuid[2] || !AdvisorGuid[3])
- {
- error_log("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3");
- DoYell("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3", LANG_UNIVERSAL, NULL);
-
- DoYell(SAY_PHASE4, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE4);
- Phase = 4;
-
- 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);
-
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- }else
- {
- PrepareAdvisors();
-
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
-
- pInstance->SetData(DATA_KAELTHASEVENT, 1);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- PhaseSubphase = 0;
- Phase_Timer = 23000;
- Phase = 1;
- }
- }
-
- void KilledUnit()
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_KAELTHASEVENT, 0);
-
- Creature *pCreature;
- for(uint8 i = 0; i < 4; i++)
- {
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
- if(pCreature)
- {
- pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- if (pInstance && !pInstance->GetData(DATA_KAELTHASEVENT) && !Phase)
- StartEvent();
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (Phase >= 4 && m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- }
- else if(who->isAlive())
- {
- if (pInstance && !pInstance->GetData(DATA_KAELTHASEVENT) && !Phase && m_creature->IsWithinDistInMap(who, 60.0f))
- StartEvent();
-
- //add to the threat list, so we can use SelectTarget
- m_creature->AddThreat(who,0.0f);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Phase 1
- switch (Phase)
- {
- case 1:
- {
- Unit *target;
- Creature* Advisor;
-
- //Subphase switch
- switch(PhaseSubphase)
- {
- //Subphase 1 - Start
- case 0:
- if(Phase_Timer < diff)
- {
- DoYell(SAY_THALADRED_THE_DARKENER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_THALADRED_THE_DARKENER);
-
- //start advisor within 7 seconds
- Phase_Timer = 7000;
-
- PhaseSubphase++;
- }else Phase_Timer -= diff;
- break;
-
- //Subphase 1 - Unlock advisor
- case 1:
- if(Phase_Timer < diff)
- {
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
-
- if(Advisor)
- {
- Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
-
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Advisor->AI()->AttackStart(target);
- }
-
- PhaseSubphase++;
- }else Phase_Timer -= diff;
- break;
-
- //Subphase 2 - Start
- case 2:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
- {
- DoYell(SAY_LORD_SANGUINAR, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LORD_SANGUINAR);
-
- //start advisor within 12.5 seconds
- Phase_Timer = 12500;
-
- PhaseSubphase++;
- }
- break;
-
- //Subphase 2 - Unlock advisor
- case 3:
- if(Phase_Timer < diff)
- {
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
-
- if(Advisor)
- {
- Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
-
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Advisor->AI()->AttackStart(target);
- }
-
- PhaseSubphase++;
- }else Phase_Timer -= diff;
- break;
-
- //Subphase 3 - Start
- case 4:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
- {
- DoYell(SAY_ASTROMANCER_CAPERNIAN, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ASTROMANCER_CAPERNIAN);
-
- //start advisor within 7 seconds
- Phase_Timer = 7000;
-
- PhaseSubphase++;
- }
- break;
-
- //Subphase 3 - Unlock advisor
- case 5:
- if(Phase_Timer < diff)
- {
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
-
- if(Advisor)
- {
- Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
-
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Advisor->AI()->AttackStart(target);
- }
-
- PhaseSubphase++;
- }else Phase_Timer -= diff;
- break;
-
- //Subphase 4 - Start
- case 6:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
- {
- DoYell(SAY_ENGINEER_TELONICUS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENGINEER_TELONICUS);
-
- //start advisor within 8.4 seconds
- Phase_Timer = 8400;
-
- PhaseSubphase++;
- }
- break;
-
- //Subphase 4 - Unlock advisor
- case 7:
- if(Phase_Timer < diff)
- {
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
-
- if(Advisor)
- {
- Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Advisor->setFaction(m_creature->getFaction());
-
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- Advisor->AI()->AttackStart(target);
- }
-
- Phase_Timer = 3000;
-
- PhaseSubphase++;
- }else Phase_Timer -= diff;
- break;
-
- //End of phase 1
- case 8:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
- {
- Phase = 2;
- pInstance->SetData(DATA_KAELTHASEVENT, 2);
-
- DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE2);
- PhaseSubphase = 0;
- Phase_Timer = 3500;
- DoCast(m_creature, SPELL_SUMMON_WEAPONS);
- }
- break;
- }
- }break;
-
- case 2:
- {
- if (PhaseSubphase == 0)
- {
- if (Phase_Timer < diff)
- {
- PhaseSubphase = 1;
- }else Phase_Timer -= diff;
- }
-
- //Spawn weapons
- if (PhaseSubphase == 1)
- {
- Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- Creature* Weapon;
- for (uint32 i = 0; i < 7; i++)
- {
- Weapon = m_creature->SummonCreature(((uint32)KaelthasWeapons[i][0]),KaelthasWeapons[i][1],KaelthasWeapons[i][2],KaelthasWeapons[i][3],0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
-
- if (!Weapon)
- error_log("SD2: Kael'thas weapon %i could not be spawned", i);
- else
- {
- Weapon->setFaction(m_creature->getFaction());
- Weapon->AI()->AttackStart(Target);
- Weapon->CastSpell(Weapon, SPELL_WEAPON_SPAWN, false);
- }
- }
-
- PhaseSubphase = 2;
- Phase_Timer = TIME_PHASE_2_3;
- }
-
- if (PhaseSubphase == 2)
- if (Phase_Timer < diff)
- {
- DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE3);
- pInstance->SetData(DATA_KAELTHASEVENT, 3);
- Phase = 3;
- PhaseSubphase = 0;
- }else Phase_Timer -= diff;
- }break;
-
- case 3:
- {
- if (PhaseSubphase == 0)
- {
- //Respawn advisors
- Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- Creature* Advisor;
- for (uint32 i = 0; i < 4; i++)
- {
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
- if (!Advisor)
- error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
- else ((advisorbase_ai*)Advisor->AI())->Revive(Target);
- }
-
- PhaseSubphase = 1;
- Phase_Timer = TIME_PHASE_3_4;
- }
-
- if(Phase_Timer < diff)
- {
- DoYell(SAY_PHASE4, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE4);
- Phase = 4;
-
- pInstance->SetData(DATA_KAELTHASEVENT, 4);
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoStartAttackAndMovement(target);
- }
- Phase_Timer = 30000;
- }else Phase_Timer -= diff;
- }
- break;
-
- case 4:
- case 5:
- case 6:
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Fireball_Timer
- if(!InGravityLapse && !ChainPyros && Phase != 5)
- {
- if(Fireball_Timer < diff)
- {
- if(!IsCastingFireball)
- {
- if(!m_creature->IsNonMeleeSpellCasted(false))
- {
- //interruptable
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
- int32 dmg = 20000+rand()%5000;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false);
- IsCastingFireball = true;
- Fireball_Timer = 2500;
- }
- }
- else
- {
- //apply resistance
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
- IsCastingFireball = false;
- Fireball_Timer = 5000+rand()%10000;
- }
- }else Fireball_Timer -= diff;
-
- //ArcaneDisruption_Timer
- if(ArcaneDisruption_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true);
-
- ArcaneDisruption_Timer = 60000;
- }else ArcaneDisruption_Timer -= diff;
-
- if (FlameStrike_Timer < diff)
- {
- Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(pUnit, SPELL_FLAME_STRIKE);
-
- FlameStrike_Timer = 30000;
- }FlameStrike_Timer -= diff;
-
- if (MindControl_Timer < diff)
- {
- if (m_creature->getThreatManager().getThreatList().size() >= 2)
- for (uint32 i = 0; i < 3; i++)
- {
- debug_log("SD2: Kael'Thas mind control not supported.");
- //DoCast(pUnit, SPELL_MIND_CONTROL);
- }
-
- MindControl_Timer = 60000;
- }MindControl_Timer -= diff;
- }
-
- //Phoenix_Timer
- if(Phoenix_Timer < diff)
- {
- DoCast(m_creature, SPELL_PHOENIX_ANIMATION);
- Creature *Phoenix = DoSpawnCreature(PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
-
- if(Phoenix)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (target)
- Phoenix->AI()->AttackStart(target);
- }else error_log("SD2: Kael'Thas Phoenix could not be spawned");
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SUMMON_PHOENIX1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX1);
- break;
- case 1:
- DoYell(SAY_SUMMON_PHOENIX2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX2);
- break;
- }
-
- Phoenix_Timer = 60000;
- }else Phoenix_Timer -= diff;
-
- //Phase 4 specific spells
- if(Phase == 4)
- {
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
- {
- pInstance->SetData(DATA_KAELTHASEVENT, 4);
- Phase = 5;
- Phase_Timer = 10000;
-
- DoYell(SAY_PHASE5, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_PHASE5);
-
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0);
- m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y,GRAVITY_Z, 0, 0, 0);
-
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_FULLPOWER);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- //ShockBarrier_Timer
- if(ShockBarrier_Timer < diff)
- {
- DoCast(m_creature, SPELL_SHOCK_BARRIER);
- ChainPyros = true;
- PyrosCasted = 0;
-
- ShockBarrier_Timer = 60000;
- }else ShockBarrier_Timer -= diff;
-
- //Chain Pyros (3 of them max)
- if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false))
- {
- if (PyrosCasted < 3)
- {
- DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
- PyrosCasted++;
-
- }else
- {
- ChainPyros = false;
- Fireball_Timer = 2500;
- ArcaneDisruption_Timer = 60000;
- }
- }
- }
-
- if (Phase == 5)
- {
- if(Phase_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER);
- DoCast(m_creature, SPELL_EXPLODE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Phase = 6;
- DoStartAttackAndMovement(m_creature->getVictim());
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
-
- }else Phase_Timer -= diff;
- }
-
- //Phase 5
- if(Phase == 6)
- {
-
- //GravityLapse_Timer
- if(GravityLapse_Timer < diff)
- {
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- switch(GravityLapse_Phase)
- {
- case 0:
- m_creature->StopMoving();
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0);
- m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0, 0, 0);
- // 1) Kael'thas will portal the whole raid right into his body
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- //Use work around packet to prevent player from being dropped from combat
- DoTeleportPlayer(pUnit, GRAVITY_X, GRAVITY_Y, GRAVITY_Z, pUnit->GetOrientation());
- }
- }
- GravityLapse_Timer = 500;
- ++GravityLapse_Phase;
- InGravityLapse = true;
- ShockBarrier_Timer = 1000;
- NetherBeam_Timer = 5000;
- break;
-
- case 1:
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_GRAVITYLAPSE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_GRAVITYLAPSE1);
- break;
-
- case 1:
- DoYell(SAY_GRAVITYLAPSE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_GRAVITYLAPSE2);
- break;
- }
-
- // 2) At that point he will put a Gravity Lapse debuff on everyone
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit)
- {
- m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true);
- //Gravity lapse - needs an exception in Spell system to work
-
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID());
- pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID());
-
- //Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
- data.append(pUnit->GetPackGUID());
- data << uint32(0);
- pUnit->SendMessageToSet(&data, true);
- }
- }
- GravityLapse_Timer = 10000;
- GravityLapse_Phase++;
- break;
-
- case 2:
- //Cast nether vapor aura on self
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_NETHER_VAPOR);
-
- GravityLapse_Timer = 20000;
- GravityLapse_Phase++;
- break;
-
- case 3:
- //Remove flight
- for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit)
- {
- //Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
- data.append(pUnit->GetPackGUID());
- data << uint32(0);
- pUnit->SendMessageToSet(&data, true);
- }
- }
- m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR);
- InGravityLapse = false;
- GravityLapse_Timer = 60000;
- GravityLapse_Phase = 0;
- DoStartAttackAndMovement(m_creature->getVictim());
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- DoResetThreat();
- break;
- }
- }else GravityLapse_Timer -= diff;
-
- if(InGravityLapse)
- {
- //ShockBarrier_Timer
- if(ShockBarrier_Timer < diff)
- {
- DoCast(m_creature, SPELL_SHOCK_BARRIER);
-
- ShockBarrier_Timer = 20000;
- }else ShockBarrier_Timer -= diff;
-
- //NetherBeam_Timer
- if(NetherBeam_Timer < diff)
- {
- Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(pUnit, SPELL_NETHER_BEAM);
-
- NetherBeam_Timer = 4000;
- }else NetherBeam_Timer -= diff;
- }
- }
-
- if (!InGravityLapse)
- DoMeleeAttackIfReady();
- }
- }
- }
-};
-
-//Thaladred the Darkener AI
-struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai
-{
- boss_thaladred_the_darkenerAI(Creature *c) : advisorbase_ai(c) {}
-
- uint32 Gaze_Timer;
- uint32 Silence_Timer;
- uint32 PsychicBlow_Timer;
-
- void Reset()
- {
- Gaze_Timer = 100;
- Silence_Timer = 20000;
- PsychicBlow_Timer = 10000;
-
- advisorbase_ai::Reset();
- }
-
- void JustDied(Unit* pKiller)
- {
- DoPlaySoundToSet(m_creature, SOUND_THALADRED_DEATH);
- DoYell(SAY_THALADRED_DEATH, LANG_UNIVERSAL, NULL);
- }
-
- void Aggro(Unit *who)
- {
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (!who || FakeDeath)
- return;
-
- DoYell(SAY_THALADRED_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_THALADRED_AGGRO);
- m_creature->AddThreat(who, 5000000.0f);
- }
-
- void UpdateAI(const uint32 diff)
- {
- advisorbase_ai::UpdateAI(diff);
-
- //Faking death, don't do anything
- if (FakeDeath)
- return;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Gaze_Timer
- if(Gaze_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoResetThreat();
- m_creature->AddThreat(target, 5000000.0f);
- DoTextEmote(EMOTE_THALADRED_GAZE, target);
- Gaze_Timer = 8500;
- }
- }else Gaze_Timer -= diff;
-
- //Silence_Timer
- if(Silence_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SILENCE);
- Silence_Timer = 20000;
- }else Silence_Timer -= diff;
-
- //PsychicBlow_Timer
- if(PsychicBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW);
- PsychicBlow_Timer = 20000+rand()%5000;
- }else PsychicBlow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Lord Sanguinar AI
-struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai
-{
- boss_lord_sanguinarAI(Creature *c) : advisorbase_ai(c){}
-
- uint32 Fear_Timer;
-
- void Reset()
- {
- Fear_Timer = 20000;
- advisorbase_ai::Reset();
- }
-
- void JustDied(Unit* Killer)
- {
- DoPlaySoundToSet(m_creature, SOUND_SANGUINAR_DEATH);
- DoYell(SAY_SANGUINAR_DEATH, LANG_UNIVERSAL, NULL);
- }
-
- void Aggro(Unit *who)
- {
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (!who || FakeDeath)
- return;
-
- DoYell(SAY_SANGUINAR_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SANGUINAR_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- advisorbase_ai::UpdateAI(diff);
-
- //Faking death, don't do anything
- if (FakeDeath)
- return;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Fear_Timer
- if(Fear_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR);
- Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds
- }else Fear_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Grand Astromancer Capernian AI
-struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai
-{
- boss_grand_astromancer_capernianAI(Creature *c) : advisorbase_ai(c){}
-
- uint32 Fireball_Timer;
- uint32 Conflagration_Timer;
- uint32 ArcaneExplosion_Timer;
- uint32 Yell_Timer;
- bool Yell;
-
- void Reset()
- {
- Fireball_Timer = 2000;
- Conflagration_Timer = 20000;
- ArcaneExplosion_Timer = 5000;
- Yell_Timer = 2000;
- Yell = false;
-
- advisorbase_ai::Reset();
- }
-
- void JustDied(Unit* pKiller)
- {
- DoPlaySoundToSet(m_creature, SOUND_CAPERNIAN_DEATH);
- DoYell(SAY_CAPERNIAN_DEATH, LANG_UNIVERSAL, NULL);
- }
-
- void AttackStart(Unit* who)
- {
- if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- DoStartAttackAndMovement(who, CAPERNIAN_DISTANCE, M_PI/2);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (!who || FakeDeath)
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- advisorbase_ai::UpdateAI(diff);
-
- //Faking Death, don't do anything
- if (FakeDeath)
- return;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Yell_Timer
- if(!Yell)
- if(Yell_Timer < diff)
- {
- DoYell(SAY_CAPERNIAN_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_CAPERNIAN_AGGRO);
-
- Yell = true;
- }else Yell_Timer -= diff;
-
- //Fireball_Timer
- if(Fireball_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL);
- Fireball_Timer = 4000;
- }else Fireball_Timer -= diff;
-
- //Conflagration_Timer
- if(Conflagration_Timer < diff)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(target && m_creature->IsWithinDistInMap(target, 30))
- DoCast(target, SPELL_CONFLAGRATION);
- else
- DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION);
-
- Conflagration_Timer = 10000+rand()%5000;
- }else Conflagration_Timer -= diff;
-
- //ArcaneExplosion_Timer
- if(ArcaneExplosion_Timer < diff)
- {
- bool InMeleeRange = false;
- Unit *target = NULL;
- std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- for (std::list<HostilReference*>::iterator i = m_threatlist.begin(); i!= m_threatlist.end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- //if in melee range
- if(pUnit && pUnit->IsWithinDistInMap(m_creature, 5))
- {
- InMeleeRange = true;
- target = pUnit;
- break;
- }
- }
-
- if(InMeleeRange)
- DoCast(target, SPELL_ARCANE_EXPLOSION);
-
- ArcaneExplosion_Timer = 4000+rand()%2000;
- }else ArcaneExplosion_Timer -= diff;
-
- //Do NOT deal any melee damage.
- }
-};
-
-//Master Engineer Telonicus AI
-struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai
-{
- boss_master_engineer_telonicusAI(Creature *c) : advisorbase_ai(c){}
-
- uint32 Bomb_Timer;
- uint32 RemoteToy_Timer;
-
- void Reset()
- {
- Bomb_Timer = 10000;
- RemoteToy_Timer = 5000;
-
- advisorbase_ai::Reset();
- }
-
- void JustDied(Unit* pKiller)
- {
- DoPlaySoundToSet(m_creature, SOUND_TELONICUS_DEATH);
- DoYell(SAY_TELONICUS_DEATH, LANG_UNIVERSAL, NULL);
- }
-
- void Aggro(Unit *who)
- {
- if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
-
- if (!who || FakeDeath)
- return;
-
- DoYell(SAY_TELONICUS_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TELONICUS_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- advisorbase_ai::UpdateAI(diff);
-
- //Faking Death, do nothing
- if (FakeDeath)
- return;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Bomb_Timer
- if(Bomb_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BOMB);
- Bomb_Timer = 25000;
- }else Bomb_Timer -= diff;
-
- //RemoteToy_Timer
- if(RemoteToy_Timer < diff)
- {
- Unit *target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(target)
- DoCast(target, SPELL_REMOTE_TOY);
-
- RemoteToy_Timer = 10000+rand()%5000;
- }else RemoteToy_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Flame Strike AI
-struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI
-{
- mob_kael_flamestrikeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Timer;
- bool Casting;
- bool KillSelf;
-
- void Reset()
- {
- Timer = 5000;
- Casting = false;
- KillSelf = false;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!Casting)
- {
- DoCast(m_creature, SPELL_FLAME_STRIKE_VIS);
- Casting = true;
- }
-
- //Timer
- if(Timer < diff)
- {
- if (!KillSelf)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_FLAME_STRIKE_DMG);
- }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- KillSelf = true;
- Timer = 1000;
- }else Timer -= diff;
- }
-};
-
-//Phoenix AI
-struct TRINITY_DLL_DECL mob_phoenixAI : public ScriptedAI
-{
- mob_phoenixAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Burn_Timer;
- uint32 Hatch_Timer;
- uint32 EggVis_Timer;
- bool IsEgg;
-
- void Reset()
- {
- Burn_Timer = 1000;
- Hatch_Timer = 15000;
- EggVis_Timer = 0;
- IsEgg = false;
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_MODEL);
- }
-
- void Hatch()
- {
- IsEgg = false;
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_MODEL);
- Burn_Timer = 1000;
- Hatch_Timer = 15000;
- EggVis_Timer = 0;
- AttackStart(m_creature->getVictim());
- }
-
- void DamageTaken(Unit* pKiller, uint32 &damage)
- {
- if (damage < m_creature->GetHealth())
- return;
-
- //Bird cannot die, only egg
- if (!IsEgg)
- {
- //prevent death
- damage = 0;
- IsEgg = true;
-
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetHealth(m_creature->GetMaxHealth());
- EggVis_Timer = 1000;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a current target
- if (!IsEgg)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (Burn_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BURN);
- Burn_Timer = 1000;
- }else Burn_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- else
- {
- if (EggVis_Timer)
- if (EggVis_Timer <= diff)
- {
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_EGG_MODEL);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- EggVis_Timer = 0;
- }else EggVis_Timer -= diff;
-
- if (Hatch_Timer < diff)
- {
- Hatch();
- }else Hatch_Timer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_boss_kaelthas(Creature *_Creature)
-{
- return new boss_kaelthasAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_thaladred_the_darkener(Creature *_Creature)
-{
- return new boss_thaladred_the_darkenerAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_lord_sanguinar(Creature *_Creature)
-{
- return new boss_lord_sanguinarAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature *_Creature)
-{
- return new boss_grand_astromancer_capernianAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_master_engineer_telonicus(Creature *_Creature)
-{
- return new boss_master_engineer_telonicusAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_kael_flamestrike(Creature *_Creature)
-{
- return new mob_kael_flamestrikeAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_phoenix(Creature *_Creature)
-{
- return new mob_phoenixAI (_Creature);
-}
-
-void AddSC_boss_kaelthas()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kaelthas";
- newscript->GetAI = GetAI_boss_kaelthas;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_thaladred_the_darkener";
- newscript->GetAI = GetAI_boss_thaladred_the_darkener;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lord_sanguinar";
- newscript->GetAI = GetAI_boss_lord_sanguinar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_grand_astromancer_capernian";
- newscript->GetAI = GetAI_boss_grand_astromancer_capernian;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_master_engineer_telonicus";
- newscript->GetAI = GetAI_boss_master_engineer_telonicus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name= "mob_kael_flamestrike";
- newscript->GetAI = GetAI_mob_kael_flamestrike;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_phoenix";
- newscript->GetAI = GetAI_mob_phoenix;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_Kaelthas
+SD%Complete: 60
+SDComment: SQL, phase 2, phase 3, Mind Control, taunt immunity
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+#include "WorldPacket.h"
+
+//Phase 2 spells (Not used)
+#define SPELL_SUMMON_WEAPONS 36976
+#define SPELL_SUMMON_WEAPONA 36958
+#define SPELL_SUMMON_WEAPONB 36959
+#define SPELL_SUMMON_WEAPONC 36960
+#define SPELL_SUMMON_WEAPOND 36961
+#define SPELL_SUMMON_WEAPONE 36962
+#define SPELL_SUMMON_WEAPONF 36963
+#define SPELL_SUMMON_WEAPONG 36964
+#define SPELL_RES_VISUAL 24171
+#define SPELL_WEAPON_SPAWN 41236
+//Phase 4 spells
+#define SPELL_FIREBALL 22088 //wrong but works with CastCustomSpell
+#define SPELL_PYROBLAST 36819
+#define SPELL_FLAME_STRIKE 36735
+#define SPELL_FLAME_STRIKE_VIS 36730
+#define SPELL_FLAME_STRIKE_DMG 36731
+#define SPELL_ARCANE_DISRUPTION 36834
+#define SPELL_SHOCK_BARRIER 36815
+#define SPELL_PHOENIX_ANIMATION 36723
+#define SPELL_MIND_CONTROL 32830
+//Phase 5 spells
+#define SPELL_EXPLODE 36092
+#define SPELL_FULLPOWER 36187
+#define SPELL_KNOCKBACK 11027
+#define SPELL_GRAVITY_LAPSE 34480
+#define SPELL_GRAVITY_LAPSE_AURA 39432
+#define SPELL_NETHER_BEAM 35873
+//Thaladred the Darkener spells
+#define SPELL_PSYCHIC_BLOW 10689
+#define SPELL_SILENCE 30225
+//Lord Sanguinar spells
+#define SPELL_BELLOWING_ROAR 40636
+//Grand Astromancer Capernian spells
+#define CAPERNIAN_DISTANCE 20 //she casts away from the target
+#define SPELL_CAPERNIAN_FIREBALL 36971
+#define SPELL_CONFLAGRATION 37018
+#define SPELL_ARCANE_EXPLOSION 36970
+//Master Engineer Telonicus spells
+#define SPELL_BOMB 37036
+#define SPELL_REMOTE_TOY 37027
+//Nether Vapor spell
+#define SPELL_NETHER_VAPOR 35859
+//Phoenix spell
+#define SPELL_BURN 36721
+
+//kael'thas Speech
+#define SAY_INTRO "Energy. Power. My people are addicted to it... a dependence made manifest after the Sunwell was destroyed. Welcome... to the future. A pity you are too late to stop it. No one can stop me now! Selama ashal'anore!"
+#define SOUND_INTRO 11256
+
+#define SAY_ASTROMANCER_CAPERNIAN "Capernian will see to it that your stay here is a short one."
+#define SOUND_ASTROMANCER_CAPERNIAN 11257
+
+#define SAY_ENGINEER_TELONICUS "Well done, you have proven worthy to test your skills against my master engineer, Telonicus."
+#define SOUND_ENGINEER_TELONICUS 11258
+
+#define SAY_THALADRED_THE_DARKENER "Let us see how your nerves hold up against the Darkener, Thaladred"
+#define SOUND_THALADRED_THE_DARKENER 11259
+
+#define SAY_LORD_SANGUINAR "You have persevered against some of my best advisors... but none can withstand the might of the Blood Hammer. Behold, Lord Sanguinar!"
+#define SOUND_LORD_SANGUINAR 11260
+
+#define SAY_PHASE2 "As you see, I have many weapons in my arsenal...."
+#define SOUND_PHASE2 11261
+
+#define SAY_PHASE3 "Perhaps I underestimated you. It would be unfair to make you fight all four advisors at once, but... fair treatment was never shown to my people. I'm just returning the favor."
+#define SOUND_PHASE3 11262
+
+#define SAY_PHASE4 "Alas, sometimes one must take matters into one's own hands. Balamore shanal!"
+#define SOUND_PHASE4 11263
+
+#define SAY_PHASE5 "I have not come this far to be stopped! The future I have planned will not be jeopardized! Now you will taste true power!!"
+#define SOUND_PHASE5 11273
+
+#define SAY_SLAY1 "You will not prevail."
+#define SOUND_SLAY1 11270
+
+#define SAY_SLAY2 "You gambled...and lost."
+#define SOUND_SLAY2 11271
+
+#define SAY_MINDCONTROL1 "Obey me."
+#define SOUND_MINDCONTROL1 11268
+
+#define SAY_MINDCONTROL2 "Bow to my will."
+#define SOUND_MINDCONTROL2 11269
+
+#define SAY_GRAVITYLAPSE1 "Let us see how you fare when your world is turned upside down."
+#define SOUND_GRAVITYLAPSE1 11264
+
+#define SAY_GRAVITYLAPSE2 "Having trouble staying grounded?"
+#define SOUND_GRAVITYLAPSE2 11265
+
+#define SAY_SUMMON_PHOENIX1 "Anara'nel belore!"
+#define SOUND_SUMMON_PHOENIX1 11267
+
+#define SAY_SUMMON_PHOENIX2 "By the power of the sun!"
+#define SOUND_SUMMON_PHOENIX2 11266
+
+#define SAY_DEATH "For...Quel...thalas!"
+#define SOUND_DEATH 11274
+
+//Thaladred the Darkener speech
+#define SAY_THALADRED_AGGRO "Prepare yourselves!"
+#define SOUND_THALADRED_AGGRO 11203
+#define SAY_THALADRED_DEATH "Forgive me, my prince! I have... failed."
+#define SOUND_THALADRED_DEATH 11204
+#define EMOTE_THALADRED_GAZE "sets his gaze on $N!"
+
+//Lord Sanguinar speech
+#define SAY_SANGUINAR_AGGRO "Blood for blood!"
+#define SOUND_SANGUINAR_AGGRO 11152
+#define SAY_SANGUINAR_DEATH "NO! I ...will... not..."
+#define SOUND_SANGUINAR_DEATH 11153
+
+//Grand Astromancer Capernian speech
+#define SAY_CAPERNIAN_AGGRO "The sin'dore reign supreme!"
+#define SOUND_CAPERNIAN_AGGRO 11117
+#define SAY_CAPERNIAN_DEATH "This is not over!"
+#define SOUND_CAPERNIAN_DEATH 11118
+
+//Master Engineer Telonicus speech
+#define SAY_TELONICUS_AGGRO "Anar'alah belore!"
+#define SOUND_TELONICUS_AGGRO 11157
+#define SAY_TELONICUS_DEATH "More perils... await"
+#define SOUND_TELONICUS_DEATH 11158
+
+//Creature IDs
+#define PHOENIX 21362
+#define PHOENIX_EGG 21364
+
+//Phoenix egg and phoenix model
+#define PHOENIX_MODEL 19682
+#define PHOENIX_EGG_MODEL 20245
+
+//#define PI 3.141592
+#define TEMP_MC_WHISPER "[SD2 Debug] You would be mind controlled here!"
+
+//weapon id + position
+float KaelthasWeapons[7][5] =
+{
+ {21270, 794.38, 15, 48.72, 2.9}, //[Cosmic Infuser]
+ {21269, 785.47, 12.12, 48.72, 3.14}, //[Devastation]
+ {21271, 781.25, 4.39, 48.72, 3.14}, //[Infinity Blade]
+ {21273, 777.38, -0.81, 48.72, 3.06}, //[Phaseshift Bulwark]
+ {21274, 781.48, -6.08, 48.72, 3.9}, //[Staff of Disintegration]
+ {21272, 785.42, -13.59, 48.72, 3.4}, //[Warp Slicer]
+ {21268, 793.06, -16.61, 48.72, 3.10} //[Netherstrand Longbow]
+};
+
+#define GRAVITY_X 795.0f
+#define GRAVITY_Y 0.0f
+#define GRAVITY_Z 70.0f
+
+#define TIME_PHASE_2_3 120000
+#define TIME_PHASE_3_4 120000
+
+#define KAEL_VISIBLE_RANGE 50.0f
+
+//Base AI for Advisors
+struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
+{
+ ScriptedInstance* pInstance;
+ bool FakeDeath;
+ uint32 DelayRes_Timer;
+ uint64 DelayRes_Target;
+
+ advisorbase_ai(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void Reset()
+ {
+ FakeDeath = false;
+ DelayRes_Timer = 0;
+ DelayRes_Target = 0;
+
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ //reset encounter
+ if(pInstance && (pInstance->GetData(DATA_KAELTHASEVENT) == 1 || pInstance->GetData(DATA_KAELTHASEVENT) == 3))
+ {
+ Creature *Kaelthas = NULL;
+ Kaelthas = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KAELTHAS)));
+
+ if(Kaelthas)
+ Kaelthas->AI()->EnterEvadeMode();
+ }
+ }
+
+ void Revive(Unit* Target)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ DoCast(m_creature, SPELL_RES_VISUAL, false);
+ DelayRes_Timer = 2000;
+ }
+
+ void DamageTaken(Unit* pKiller, uint32 &damage)
+ {
+ if (damage < m_creature->GetHealth())
+ return;
+
+ //Prevent glitch if in fake death
+ if (FakeDeath)
+ {
+ damage = 0;
+ return;
+ }
+ //Don't really die in phase 1 & 3, only die after that
+ if(pInstance && pInstance->GetData(DATA_KAELTHASEVENT) != 0)
+ {
+ //prevent death
+ damage = 0;
+ FakeDeath = true;
+
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->SetHealth(0);
+ m_creature->StopMoving();
+ m_creature->ClearComboPointHolders();
+ m_creature->RemoveAllAurasOnDeath();
+ m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
+ m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->ClearAllReactives();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+
+ if (pInstance->GetData(DATA_KAELTHASEVENT) == 3)
+ JustDied(pKiller);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (DelayRes_Timer)
+ if (DelayRes_Timer <= diff)
+ {
+ DelayRes_Timer = 0;
+ FakeDeath = false;
+
+ Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target);
+ if (!Target)Target = m_creature->getVictim();
+ DoResetThreat();
+ AttackStart(Target);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(Target);
+ m_creature->AddThreat(Target, 0.0f);
+ }else DelayRes_Timer -= diff;
+ }
+
+};
+
+//Kael'thas AI
+struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
+{
+ boss_kaelthasAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ AdvisorGuid[0] = 0;
+ AdvisorGuid[1] = 0;
+ AdvisorGuid[2] = 0;
+ AdvisorGuid[3] = 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 Fireball_Timer;
+ uint32 ArcaneDisruption_Timer;
+ uint32 Phoenix_Timer;
+ uint32 ShockBarrier_Timer;
+ uint32 GravityLapse_Timer;
+ uint32 GravityLapse_Phase;
+ uint32 NetherBeam_Timer;
+ uint32 NetherVapor_Timer;
+ uint32 FlameStrike_Timer;
+ uint32 MindControl_Timer;
+ uint32 Phase;
+ uint32 PhaseSubphase; //generic
+ uint32 Phase_Timer; //generic timer
+ uint32 PyrosCasted;
+
+ bool InGravityLapse;
+ bool IsCastingFireball;
+ bool ChainPyros;
+
+ uint64 AdvisorGuid[4];
+
+ void Reset()
+ {
+ Fireball_Timer = 5000+rand()%10000;
+ ArcaneDisruption_Timer = 45000;
+ MindControl_Timer = 40000;
+ Phoenix_Timer = 50000;
+ ShockBarrier_Timer = 60000;
+ FlameStrike_Timer = 30000;
+ GravityLapse_Timer = 20000;
+ GravityLapse_Phase = 0;
+ NetherBeam_Timer = 8000;
+ NetherVapor_Timer = 10000;
+ PyrosCasted = 0;
+ Phase = 0;
+ InGravityLapse = false;
+ IsCastingFireball = false;
+ ChainPyros = false;
+
+ if(InCombat)
+ PrepareAdvisors();
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ if(pInstance)
+ pInstance->SetData(DATA_KAELTHASEVENT, 0);
+ }
+
+ void PrepareAdvisors()
+ {
+ Creature *pCreature;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ if(pCreature)
+ {
+ pCreature->Respawn();
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->setFaction(m_creature->getFaction());
+ pCreature->AI()->EnterEvadeMode();
+ }
+ }
+ }
+
+ void StartEvent()
+ {
+ if(!pInstance)
+ return;
+
+ AdvisorGuid[0] = pInstance->GetData64(DATA_THALADREDTHEDARKENER);
+ AdvisorGuid[1] = pInstance->GetData64(DATA_LORDSANGUINAR);
+ AdvisorGuid[2] = pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN);
+ AdvisorGuid[3] = pInstance->GetData64(DATA_MASTERENGINEERTELONICUS);
+
+ if(!AdvisorGuid[0] || !AdvisorGuid[1] || !AdvisorGuid[2] || !AdvisorGuid[3])
+ {
+ error_log("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3");
+ DoYell("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3", LANG_UNIVERSAL, NULL);
+
+ DoYell(SAY_PHASE4, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE4);
+ Phase = 4;
+
+ 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);
+
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ }else
+ {
+ PrepareAdvisors();
+
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+
+ pInstance->SetData(DATA_KAELTHASEVENT, 1);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ PhaseSubphase = 0;
+ Phase_Timer = 23000;
+ Phase = 1;
+ }
+ }
+
+ void KilledUnit()
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_KAELTHASEVENT, 0);
+
+ Creature *pCreature;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ if(pCreature)
+ {
+ pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (pInstance && !pInstance->GetData(DATA_KAELTHASEVENT) && !Phase)
+ StartEvent();
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (Phase >= 4 && m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ }
+ else if(who->isAlive())
+ {
+ if (pInstance && !pInstance->GetData(DATA_KAELTHASEVENT) && !Phase && m_creature->IsWithinDistInMap(who, 60.0f))
+ StartEvent();
+
+ //add to the threat list, so we can use SelectTarget
+ m_creature->AddThreat(who,0.0f);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Phase 1
+ switch (Phase)
+ {
+ case 1:
+ {
+ Unit *target;
+ Creature* Advisor;
+
+ //Subphase switch
+ switch(PhaseSubphase)
+ {
+ //Subphase 1 - Start
+ case 0:
+ if(Phase_Timer < diff)
+ {
+ DoYell(SAY_THALADRED_THE_DARKENER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_THALADRED_THE_DARKENER);
+
+ //start advisor within 7 seconds
+ Phase_Timer = 7000;
+
+ PhaseSubphase++;
+ }else Phase_Timer -= diff;
+ break;
+
+ //Subphase 1 - Unlock advisor
+ case 1:
+ if(Phase_Timer < diff)
+ {
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
+
+ if(Advisor)
+ {
+ Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Advisor->setFaction(m_creature->getFaction());
+
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Advisor->AI()->AttackStart(target);
+ }
+
+ PhaseSubphase++;
+ }else Phase_Timer -= diff;
+ break;
+
+ //Subphase 2 - Start
+ case 2:
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ {
+ DoYell(SAY_LORD_SANGUINAR, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LORD_SANGUINAR);
+
+ //start advisor within 12.5 seconds
+ Phase_Timer = 12500;
+
+ PhaseSubphase++;
+ }
+ break;
+
+ //Subphase 2 - Unlock advisor
+ case 3:
+ if(Phase_Timer < diff)
+ {
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
+
+ if(Advisor)
+ {
+ Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Advisor->setFaction(m_creature->getFaction());
+
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Advisor->AI()->AttackStart(target);
+ }
+
+ PhaseSubphase++;
+ }else Phase_Timer -= diff;
+ break;
+
+ //Subphase 3 - Start
+ case 4:
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ {
+ DoYell(SAY_ASTROMANCER_CAPERNIAN, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ASTROMANCER_CAPERNIAN);
+
+ //start advisor within 7 seconds
+ Phase_Timer = 7000;
+
+ PhaseSubphase++;
+ }
+ break;
+
+ //Subphase 3 - Unlock advisor
+ case 5:
+ if(Phase_Timer < diff)
+ {
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
+
+ if(Advisor)
+ {
+ Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Advisor->setFaction(m_creature->getFaction());
+
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Advisor->AI()->AttackStart(target);
+ }
+
+ PhaseSubphase++;
+ }else Phase_Timer -= diff;
+ break;
+
+ //Subphase 4 - Start
+ case 6:
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ {
+ DoYell(SAY_ENGINEER_TELONICUS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENGINEER_TELONICUS);
+
+ //start advisor within 8.4 seconds
+ Phase_Timer = 8400;
+
+ PhaseSubphase++;
+ }
+ break;
+
+ //Subphase 4 - Unlock advisor
+ case 7:
+ if(Phase_Timer < diff)
+ {
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
+
+ if(Advisor)
+ {
+ Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Advisor->setFaction(m_creature->getFaction());
+
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Advisor->AI()->AttackStart(target);
+ }
+
+ Phase_Timer = 3000;
+
+ PhaseSubphase++;
+ }else Phase_Timer -= diff;
+ break;
+
+ //End of phase 1
+ case 8:
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ {
+ Phase = 2;
+ pInstance->SetData(DATA_KAELTHASEVENT, 2);
+
+ DoYell(SAY_PHASE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE2);
+ PhaseSubphase = 0;
+ Phase_Timer = 3500;
+ DoCast(m_creature, SPELL_SUMMON_WEAPONS);
+ }
+ break;
+ }
+ }break;
+
+ case 2:
+ {
+ if (PhaseSubphase == 0)
+ {
+ if (Phase_Timer < diff)
+ {
+ PhaseSubphase = 1;
+ }else Phase_Timer -= diff;
+ }
+
+ //Spawn weapons
+ if (PhaseSubphase == 1)
+ {
+ Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ Creature* Weapon;
+ for (uint32 i = 0; i < 7; i++)
+ {
+ Weapon = m_creature->SummonCreature(((uint32)KaelthasWeapons[i][0]),KaelthasWeapons[i][1],KaelthasWeapons[i][2],KaelthasWeapons[i][3],0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+
+ if (!Weapon)
+ error_log("SD2: Kael'thas weapon %i could not be spawned", i);
+ else
+ {
+ Weapon->setFaction(m_creature->getFaction());
+ Weapon->AI()->AttackStart(Target);
+ Weapon->CastSpell(Weapon, SPELL_WEAPON_SPAWN, false);
+ }
+ }
+
+ PhaseSubphase = 2;
+ Phase_Timer = TIME_PHASE_2_3;
+ }
+
+ if (PhaseSubphase == 2)
+ if (Phase_Timer < diff)
+ {
+ DoYell(SAY_PHASE3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE3);
+ pInstance->SetData(DATA_KAELTHASEVENT, 3);
+ Phase = 3;
+ PhaseSubphase = 0;
+ }else Phase_Timer -= diff;
+ }break;
+
+ case 3:
+ {
+ if (PhaseSubphase == 0)
+ {
+ //Respawn advisors
+ Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ Creature* Advisor;
+ for (uint32 i = 0; i < 4; i++)
+ {
+ Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ if (!Advisor)
+ error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
+ else ((advisorbase_ai*)Advisor->AI())->Revive(Target);
+ }
+
+ PhaseSubphase = 1;
+ Phase_Timer = TIME_PHASE_3_4;
+ }
+
+ if(Phase_Timer < diff)
+ {
+ DoYell(SAY_PHASE4, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE4);
+ Phase = 4;
+
+ pInstance->SetData(DATA_KAELTHASEVENT, 4);
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoStartAttackAndMovement(target);
+ }
+ Phase_Timer = 30000;
+ }else Phase_Timer -= diff;
+ }
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Fireball_Timer
+ if(!InGravityLapse && !ChainPyros && Phase != 5)
+ {
+ if(Fireball_Timer < diff)
+ {
+ if(!IsCastingFireball)
+ {
+ if(!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //interruptable
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
+ int32 dmg = 20000+rand()%5000;
+ m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false);
+ IsCastingFireball = true;
+ Fireball_Timer = 2500;
+ }
+ }
+ else
+ {
+ //apply resistance
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
+ IsCastingFireball = false;
+ Fireball_Timer = 5000+rand()%10000;
+ }
+ }else Fireball_Timer -= diff;
+
+ //ArcaneDisruption_Timer
+ if(ArcaneDisruption_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true);
+
+ ArcaneDisruption_Timer = 60000;
+ }else ArcaneDisruption_Timer -= diff;
+
+ if (FlameStrike_Timer < diff)
+ {
+ Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(pUnit, SPELL_FLAME_STRIKE);
+
+ FlameStrike_Timer = 30000;
+ }FlameStrike_Timer -= diff;
+
+ if (MindControl_Timer < diff)
+ {
+ if (m_creature->getThreatManager().getThreatList().size() >= 2)
+ for (uint32 i = 0; i < 3; i++)
+ {
+ debug_log("SD2: Kael'Thas mind control not supported.");
+ //DoCast(pUnit, SPELL_MIND_CONTROL);
+ }
+
+ MindControl_Timer = 60000;
+ }MindControl_Timer -= diff;
+ }
+
+ //Phoenix_Timer
+ if(Phoenix_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_PHOENIX_ANIMATION);
+ Creature *Phoenix = DoSpawnCreature(PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+
+ if(Phoenix)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (target)
+ Phoenix->AI()->AttackStart(target);
+ }else error_log("SD2: Kael'Thas Phoenix could not be spawned");
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SUMMON_PHOENIX1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX1);
+ break;
+ case 1:
+ DoYell(SAY_SUMMON_PHOENIX2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX2);
+ break;
+ }
+
+ Phoenix_Timer = 60000;
+ }else Phoenix_Timer -= diff;
+
+ //Phase 4 specific spells
+ if(Phase == 4)
+ {
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ {
+ pInstance->SetData(DATA_KAELTHASEVENT, 4);
+ Phase = 5;
+ Phase_Timer = 10000;
+
+ DoYell(SAY_PHASE5, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_PHASE5);
+
+ m_creature->StopMoving();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0);
+ m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y,GRAVITY_Z, 0, 0, 0);
+
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_FULLPOWER);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ //ShockBarrier_Timer
+ if(ShockBarrier_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_SHOCK_BARRIER);
+ ChainPyros = true;
+ PyrosCasted = 0;
+
+ ShockBarrier_Timer = 60000;
+ }else ShockBarrier_Timer -= diff;
+
+ //Chain Pyros (3 of them max)
+ if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ if (PyrosCasted < 3)
+ {
+ DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
+ PyrosCasted++;
+
+ }else
+ {
+ ChainPyros = false;
+ Fireball_Timer = 2500;
+ ArcaneDisruption_Timer = 60000;
+ }
+ }
+ }
+
+ if (Phase == 5)
+ {
+ if(Phase_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER);
+ DoCast(m_creature, SPELL_EXPLODE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Phase = 6;
+ DoStartAttackAndMovement(m_creature->getVictim());
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+
+ }else Phase_Timer -= diff;
+ }
+
+ //Phase 5
+ if(Phase == 6)
+ {
+
+ //GravityLapse_Timer
+ if(GravityLapse_Timer < diff)
+ {
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ switch(GravityLapse_Phase)
+ {
+ case 0:
+ m_creature->StopMoving();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0);
+ m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0, 0, 0);
+ // 1) Kael'thas will portal the whole raid right into his body
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ //Use work around packet to prevent player from being dropped from combat
+ DoTeleportPlayer(pUnit, GRAVITY_X, GRAVITY_Y, GRAVITY_Z, pUnit->GetOrientation());
+ }
+ }
+ GravityLapse_Timer = 500;
+ ++GravityLapse_Phase;
+ InGravityLapse = true;
+ ShockBarrier_Timer = 1000;
+ NetherBeam_Timer = 5000;
+ break;
+
+ case 1:
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_GRAVITYLAPSE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_GRAVITYLAPSE1);
+ break;
+
+ case 1:
+ DoYell(SAY_GRAVITYLAPSE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_GRAVITYLAPSE2);
+ break;
+ }
+
+ // 2) At that point he will put a Gravity Lapse debuff on everyone
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit)
+ {
+ m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true);
+ //Gravity lapse - needs an exception in Spell system to work
+
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID());
+
+ //Using packet workaround
+ WorldPacket data(12);
+ data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ data.append(pUnit->GetPackGUID());
+ data << uint32(0);
+ pUnit->SendMessageToSet(&data, true);
+ }
+ }
+ GravityLapse_Timer = 10000;
+ GravityLapse_Phase++;
+ break;
+
+ case 2:
+ //Cast nether vapor aura on self
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_NETHER_VAPOR);
+
+ GravityLapse_Timer = 20000;
+ GravityLapse_Phase++;
+ break;
+
+ case 3:
+ //Remove flight
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit)
+ {
+ //Using packet workaround
+ WorldPacket data(12);
+ data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ data.append(pUnit->GetPackGUID());
+ data << uint32(0);
+ pUnit->SendMessageToSet(&data, true);
+ }
+ }
+ m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR);
+ InGravityLapse = false;
+ GravityLapse_Timer = 60000;
+ GravityLapse_Phase = 0;
+ DoStartAttackAndMovement(m_creature->getVictim());
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ DoResetThreat();
+ break;
+ }
+ }else GravityLapse_Timer -= diff;
+
+ if(InGravityLapse)
+ {
+ //ShockBarrier_Timer
+ if(ShockBarrier_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_SHOCK_BARRIER);
+
+ ShockBarrier_Timer = 20000;
+ }else ShockBarrier_Timer -= diff;
+
+ //NetherBeam_Timer
+ if(NetherBeam_Timer < diff)
+ {
+ Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ DoCast(pUnit, SPELL_NETHER_BEAM);
+
+ NetherBeam_Timer = 4000;
+ }else NetherBeam_Timer -= diff;
+ }
+ }
+
+ if (!InGravityLapse)
+ DoMeleeAttackIfReady();
+ }
+ }
+ }
+};
+
+//Thaladred the Darkener AI
+struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai
+{
+ boss_thaladred_the_darkenerAI(Creature *c) : advisorbase_ai(c) {}
+
+ uint32 Gaze_Timer;
+ uint32 Silence_Timer;
+ uint32 PsychicBlow_Timer;
+
+ void Reset()
+ {
+ Gaze_Timer = 100;
+ Silence_Timer = 20000;
+ PsychicBlow_Timer = 10000;
+
+ advisorbase_ai::Reset();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_THALADRED_DEATH);
+ DoYell(SAY_THALADRED_DEATH, LANG_UNIVERSAL, NULL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (!who || FakeDeath)
+ return;
+
+ DoYell(SAY_THALADRED_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_THALADRED_AGGRO);
+ m_creature->AddThreat(who, 5000000.0f);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ advisorbase_ai::UpdateAI(diff);
+
+ //Faking death, don't do anything
+ if (FakeDeath)
+ return;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Gaze_Timer
+ if(Gaze_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoResetThreat();
+ m_creature->AddThreat(target, 5000000.0f);
+ DoTextEmote(EMOTE_THALADRED_GAZE, target);
+ Gaze_Timer = 8500;
+ }
+ }else Gaze_Timer -= diff;
+
+ //Silence_Timer
+ if(Silence_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SILENCE);
+ Silence_Timer = 20000;
+ }else Silence_Timer -= diff;
+
+ //PsychicBlow_Timer
+ if(PsychicBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW);
+ PsychicBlow_Timer = 20000+rand()%5000;
+ }else PsychicBlow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Lord Sanguinar AI
+struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai
+{
+ boss_lord_sanguinarAI(Creature *c) : advisorbase_ai(c){}
+
+ uint32 Fear_Timer;
+
+ void Reset()
+ {
+ Fear_Timer = 20000;
+ advisorbase_ai::Reset();
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_SANGUINAR_DEATH);
+ DoYell(SAY_SANGUINAR_DEATH, LANG_UNIVERSAL, NULL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (!who || FakeDeath)
+ return;
+
+ DoYell(SAY_SANGUINAR_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SANGUINAR_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ advisorbase_ai::UpdateAI(diff);
+
+ //Faking death, don't do anything
+ if (FakeDeath)
+ return;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Fear_Timer
+ if(Fear_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR);
+ Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds
+ }else Fear_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Grand Astromancer Capernian AI
+struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai
+{
+ boss_grand_astromancer_capernianAI(Creature *c) : advisorbase_ai(c){}
+
+ uint32 Fireball_Timer;
+ uint32 Conflagration_Timer;
+ uint32 ArcaneExplosion_Timer;
+ uint32 Yell_Timer;
+ bool Yell;
+
+ void Reset()
+ {
+ Fireball_Timer = 2000;
+ Conflagration_Timer = 20000;
+ ArcaneExplosion_Timer = 5000;
+ Yell_Timer = 2000;
+ Yell = false;
+
+ advisorbase_ai::Reset();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_CAPERNIAN_DEATH);
+ DoYell(SAY_CAPERNIAN_DEATH, LANG_UNIVERSAL, NULL);
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ DoStartAttackAndMovement(who, CAPERNIAN_DISTANCE, M_PI/2);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (!who || FakeDeath)
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ advisorbase_ai::UpdateAI(diff);
+
+ //Faking Death, don't do anything
+ if (FakeDeath)
+ return;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Yell_Timer
+ if(!Yell)
+ if(Yell_Timer < diff)
+ {
+ DoYell(SAY_CAPERNIAN_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_CAPERNIAN_AGGRO);
+
+ Yell = true;
+ }else Yell_Timer -= diff;
+
+ //Fireball_Timer
+ if(Fireball_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL);
+ Fireball_Timer = 4000;
+ }else Fireball_Timer -= diff;
+
+ //Conflagration_Timer
+ if(Conflagration_Timer < diff)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(target && m_creature->IsWithinDistInMap(target, 30))
+ DoCast(target, SPELL_CONFLAGRATION);
+ else
+ DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION);
+
+ Conflagration_Timer = 10000+rand()%5000;
+ }else Conflagration_Timer -= diff;
+
+ //ArcaneExplosion_Timer
+ if(ArcaneExplosion_Timer < diff)
+ {
+ bool InMeleeRange = false;
+ Unit *target = NULL;
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ for (std::list<HostilReference*>::iterator i = m_threatlist.begin(); i!= m_threatlist.end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ //if in melee range
+ if(pUnit && pUnit->IsWithinDistInMap(m_creature, 5))
+ {
+ InMeleeRange = true;
+ target = pUnit;
+ break;
+ }
+ }
+
+ if(InMeleeRange)
+ DoCast(target, SPELL_ARCANE_EXPLOSION);
+
+ ArcaneExplosion_Timer = 4000+rand()%2000;
+ }else ArcaneExplosion_Timer -= diff;
+
+ //Do NOT deal any melee damage.
+ }
+};
+
+//Master Engineer Telonicus AI
+struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai
+{
+ boss_master_engineer_telonicusAI(Creature *c) : advisorbase_ai(c){}
+
+ uint32 Bomb_Timer;
+ uint32 RemoteToy_Timer;
+
+ void Reset()
+ {
+ Bomb_Timer = 10000;
+ RemoteToy_Timer = 5000;
+
+ advisorbase_ai::Reset();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ DoPlaySoundToSet(m_creature, SOUND_TELONICUS_DEATH);
+ DoYell(SAY_TELONICUS_DEATH, LANG_UNIVERSAL, NULL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ if (!who || FakeDeath)
+ return;
+
+ DoYell(SAY_TELONICUS_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TELONICUS_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ advisorbase_ai::UpdateAI(diff);
+
+ //Faking Death, do nothing
+ if (FakeDeath)
+ return;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Bomb_Timer
+ if(Bomb_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BOMB);
+ Bomb_Timer = 25000;
+ }else Bomb_Timer -= diff;
+
+ //RemoteToy_Timer
+ if(RemoteToy_Timer < diff)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(target)
+ DoCast(target, SPELL_REMOTE_TOY);
+
+ RemoteToy_Timer = 10000+rand()%5000;
+ }else RemoteToy_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Flame Strike AI
+struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI
+{
+ mob_kael_flamestrikeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Timer;
+ bool Casting;
+ bool KillSelf;
+
+ void Reset()
+ {
+ Timer = 5000;
+ Casting = false;
+ KillSelf = false;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(14);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!Casting)
+ {
+ DoCast(m_creature, SPELL_FLAME_STRIKE_VIS);
+ Casting = true;
+ }
+
+ //Timer
+ if(Timer < diff)
+ {
+ if (!KillSelf)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_FLAME_STRIKE_DMG);
+ }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ KillSelf = true;
+ Timer = 1000;
+ }else Timer -= diff;
+ }
+};
+
+//Phoenix AI
+struct TRINITY_DLL_DECL mob_phoenixAI : public ScriptedAI
+{
+ mob_phoenixAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Burn_Timer;
+ uint32 Hatch_Timer;
+ uint32 EggVis_Timer;
+ bool IsEgg;
+
+ void Reset()
+ {
+ Burn_Timer = 1000;
+ Hatch_Timer = 15000;
+ EggVis_Timer = 0;
+ IsEgg = false;
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_MODEL);
+ }
+
+ void Hatch()
+ {
+ IsEgg = false;
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_MODEL);
+ Burn_Timer = 1000;
+ Hatch_Timer = 15000;
+ EggVis_Timer = 0;
+ AttackStart(m_creature->getVictim());
+ }
+
+ void DamageTaken(Unit* pKiller, uint32 &damage)
+ {
+ if (damage < m_creature->GetHealth())
+ return;
+
+ //Bird cannot die, only egg
+ if (!IsEgg)
+ {
+ //prevent death
+ damage = 0;
+ IsEgg = true;
+
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ EggVis_Timer = 1000;
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a current target
+ if (!IsEgg)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (Burn_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BURN);
+ Burn_Timer = 1000;
+ }else Burn_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else
+ {
+ if (EggVis_Timer)
+ if (EggVis_Timer <= diff)
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, PHOENIX_EGG_MODEL);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ EggVis_Timer = 0;
+ }else EggVis_Timer -= diff;
+
+ if (Hatch_Timer < diff)
+ {
+ Hatch();
+ }else Hatch_Timer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_kaelthas(Creature *_Creature)
+{
+ return new boss_kaelthasAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_thaladred_the_darkener(Creature *_Creature)
+{
+ return new boss_thaladred_the_darkenerAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_lord_sanguinar(Creature *_Creature)
+{
+ return new boss_lord_sanguinarAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature *_Creature)
+{
+ return new boss_grand_astromancer_capernianAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_master_engineer_telonicus(Creature *_Creature)
+{
+ return new boss_master_engineer_telonicusAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_kael_flamestrike(Creature *_Creature)
+{
+ return new mob_kael_flamestrikeAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_phoenix(Creature *_Creature)
+{
+ return new mob_phoenixAI (_Creature);
+}
+
+void AddSC_boss_kaelthas()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kaelthas";
+ newscript->GetAI = GetAI_boss_kaelthas;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_thaladred_the_darkener";
+ newscript->GetAI = GetAI_boss_thaladred_the_darkener;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lord_sanguinar";
+ newscript->GetAI = GetAI_boss_lord_sanguinar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_grand_astromancer_capernian";
+ newscript->GetAI = GetAI_boss_grand_astromancer_capernian;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_master_engineer_telonicus";
+ newscript->GetAI = GetAI_boss_master_engineer_telonicus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name= "mob_kael_flamestrike";
+ newscript->GetAI = GetAI_mob_kael_flamestrike;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_phoenix";
+ newscript->GetAI = GetAI_mob_phoenix;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
index e3efa2606ca..d77ea934715 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
@@ -1,199 +1,199 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Void_Reaver
-SD%Complete: 100
-SDComment:
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-
-#define SPELL_POUNDING 34162
-#define SPELL_ARCANE_ORB 34172
-#define SPELL_KNOCK_AWAY 25778
-#define SPELL_BERSERK 27680
-
-#define SAY_AGGRO "Alert, you are marked for extermination!"
-#define SAY_SLAY1 "Extermination, successful."
-#define SAY_SLAY2 "Imbecile life form, no longer functional."
-#define SAY_SLAY3 "Threat neutralized."
-#define SAY_DEATH "Systems... shutting... down..."
-#define SAY_POUNDING1 "Alternative measure commencing..."
-#define SAY_POUNDING2 "Calculating force parameters..."
-
-#define SOUND_AGGRO 11213
-#define SOUND_SLAY1 11215
-#define SOUND_SLAY2 11216
-#define SOUND_SLAY3 11217
-#define SOUND_DEATH 11214
-#define SOUND_POUNDING1 11218
-#define SOUND_POUNDING2 11219
-
-struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
-{
- boss_void_reaverAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 Pounding_Timer;
- uint32 ArcaneOrb_Timer;
- uint32 KnockAway_Timer;
- uint32 Berserk_Timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
-
- Pounding_Timer = 12000;
- ArcaneOrb_Timer = 6000;
- KnockAway_Timer = 30000;
- Berserk_Timer = 600000;
-
- if(pInstance)
- pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- if(pInstance)
- pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- // Pounding
- if(Pounding_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POUNDING);
-
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_POUNDING1);
- DoYell(SAY_POUNDING1, LANG_UNIVERSAL, NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_POUNDING2);
- DoYell(SAY_POUNDING2, LANG_UNIVERSAL, NULL);
- break;
- }
- Pounding_Timer = 12000;
- }else Pounding_Timer -= diff;
-
- // Arcane Orb
- if(ArcaneOrb_Timer < diff)
- {
- Unit *target;
- std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
- std::vector<Unit *> target_list;
- for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //18 yard radius minimum
- if(target && target->GetDistance2d(m_creature) > 18)
- target_list.push_back(target);
- target = NULL;
- }
- if(target_list.size())
- target = *(target_list.begin()+rand()%target_list.size());
-
- if (target)
- m_creature->CastSpell(target, SPELL_ARCANE_ORB, true);
-
- ArcaneOrb_Timer = 6000;
- }else ArcaneOrb_Timer -= diff;
-
- // Single Target knock back, reduces aggro
- if(KnockAway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY);
-
- //Drop 25% aggro
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-25);
-
- KnockAway_Timer = 30000;
- }else KnockAway_Timer -= diff;
-
- //Berserk
- if(Berserk_Timer < diff)
- {
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(m_creature,SPELL_BERSERK);
- Berserk_Timer = 600000;
- }else Berserk_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_void_reaver(Creature *_Creature)
-{
- return new boss_void_reaverAI (_Creature);
-}
-
-void AddSC_boss_void_reaver()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_void_reaver";
- newscript->GetAI = GetAI_boss_void_reaver;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Void_Reaver
+SD%Complete: 100
+SDComment:
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+
+#define SPELL_POUNDING 34162
+#define SPELL_ARCANE_ORB 34172
+#define SPELL_KNOCK_AWAY 25778
+#define SPELL_BERSERK 27680
+
+#define SAY_AGGRO "Alert, you are marked for extermination!"
+#define SAY_SLAY1 "Extermination, successful."
+#define SAY_SLAY2 "Imbecile life form, no longer functional."
+#define SAY_SLAY3 "Threat neutralized."
+#define SAY_DEATH "Systems... shutting... down..."
+#define SAY_POUNDING1 "Alternative measure commencing..."
+#define SAY_POUNDING2 "Calculating force parameters..."
+
+#define SOUND_AGGRO 11213
+#define SOUND_SLAY1 11215
+#define SOUND_SLAY2 11216
+#define SOUND_SLAY3 11217
+#define SOUND_DEATH 11214
+#define SOUND_POUNDING1 11218
+#define SOUND_POUNDING2 11219
+
+struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
+{
+ boss_void_reaverAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 Pounding_Timer;
+ uint32 ArcaneOrb_Timer;
+ uint32 KnockAway_Timer;
+ uint32 Berserk_Timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
+
+ Pounding_Timer = 12000;
+ ArcaneOrb_Timer = 6000;
+ KnockAway_Timer = 30000;
+ Berserk_Timer = 600000;
+
+ if(pInstance)
+ pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ if(pInstance)
+ pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ // Pounding
+ if(Pounding_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POUNDING);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_POUNDING1);
+ DoYell(SAY_POUNDING1, LANG_UNIVERSAL, NULL);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature, SOUND_POUNDING2);
+ DoYell(SAY_POUNDING2, LANG_UNIVERSAL, NULL);
+ break;
+ }
+ Pounding_Timer = 12000;
+ }else Pounding_Timer -= diff;
+
+ // Arcane Orb
+ if(ArcaneOrb_Timer < diff)
+ {
+ Unit *target;
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::vector<Unit *> target_list;
+ for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //18 yard radius minimum
+ if(target && target->GetDistance2d(m_creature) > 18)
+ target_list.push_back(target);
+ target = NULL;
+ }
+ if(target_list.size())
+ target = *(target_list.begin()+rand()%target_list.size());
+
+ if (target)
+ m_creature->CastSpell(target, SPELL_ARCANE_ORB, true);
+
+ ArcaneOrb_Timer = 6000;
+ }else ArcaneOrb_Timer -= diff;
+
+ // Single Target knock back, reduces aggro
+ if(KnockAway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY);
+
+ //Drop 25% aggro
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-25);
+
+ KnockAway_Timer = 30000;
+ }else KnockAway_Timer -= diff;
+
+ //Berserk
+ if(Berserk_Timer < diff)
+ {
+ if (m_creature->IsNonMeleeSpellCasted(false))
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(m_creature,SPELL_BERSERK);
+ Berserk_Timer = 600000;
+ }else Berserk_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_void_reaver(Creature *_Creature)
+{
+ return new boss_void_reaverAI (_Creature);
+}
+
+void AddSC_boss_void_reaver()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_void_reaver";
+ newscript->GetAI = GetAI_boss_void_reaver;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
index 9e9fe4c8b51..d2b3fd61f18 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
@@ -1,21 +1,21 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_THE_EYE_H
-#define DEF_THE_EYE_H
-
-#define DATA_ALAREVENT 1
-#define DATA_ASTROMANCER 2
-#define DATA_GRANDASTROMANCERCAPERNIAN 3
-#define DATA_HIGHASTROMANCERSOLARIANEVENT 4
-#define DATA_FATHOMLORDKARATHRESSEVENT 5
-#define DATA_KAELTHAS 6
-#define DATA_KAELTHASEVENT 7
-#define DATA_LORDSANGUINAR 8
-#define DATA_MASTERENGINEERTELONICUS 9
-#define DATA_SOLARIANEVENT 10
-#define DATA_THALADREDTHEDARKENER 11
-#define DATA_VOIDREAVEREVENT 12
-#define DATA_ALAR 13
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_THE_EYE_H
+#define DEF_THE_EYE_H
+
+#define DATA_ALAREVENT 1
+#define DATA_ASTROMANCER 2
+#define DATA_GRANDASTROMANCERCAPERNIAN 3
+#define DATA_HIGHASTROMANCERSOLARIANEVENT 4
+#define DATA_FATHOMLORDKARATHRESSEVENT 5
+#define DATA_KAELTHAS 6
+#define DATA_KAELTHASEVENT 7
+#define DATA_LORDSANGUINAR 8
+#define DATA_MASTERENGINEERTELONICUS 9
+#define DATA_SOLARIANEVENT 10
+#define DATA_THALADREDTHEDARKENER 11
+#define DATA_VOIDREAVEREVENT 12
+#define DATA_ALAR 13
+#endif
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
index b2b3f76cbe6..d4dfcd82752 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
@@ -1,190 +1,190 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_The_Eye
-SD%Complete: 100
-SDComment:
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-
-#define ENCOUNTERS 5
-
-/* The Eye encounters:
-0 - Kael'thas event
-1 - Al' ar event
-2 - Solarian Event
-3 - Void Reaver event
-*/
-
-struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
-{
- instance_the_eye(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 ThaladredTheDarkener;
- uint64 LordSanguinar;
- uint64 GrandAstromancerCapernian;
- uint64 MasterEngineerTelonicus;
- uint64 Kaelthas;
- uint64 Astromancer;
- uint64 Alar;
-
- uint8 KaelthasEventPhase;
- uint8 AlarEventPhase;
-
- bool Encounters[ENCOUNTERS];
-
- void Initialize()
- {
- ThaladredTheDarkener = 0;
- LordSanguinar = 0;
- GrandAstromancerCapernian = 0;
- MasterEngineerTelonicus = 0;
- Kaelthas = 0;
- Astromancer = 0;
- Alar = 0;
-
- KaelthasEventPhase = 0;
- AlarEventPhase = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i]) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 20064: ThaladredTheDarkener = creature->GetGUID(); break;
- case 20063: MasterEngineerTelonicus = creature->GetGUID(); break;
- case 20062: GrandAstromancerCapernian = creature->GetGUID(); break;
- case 20060: LordSanguinar = creature->GetGUID(); break;
- case 19622: Kaelthas = creature->GetGUID(); break;
- case 18805: Astromancer = creature->GetGUID(); break;
-
- case 19514:
- Alar = creature->GetGUID();
- break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_THALADREDTHEDARKENER:
- return ThaladredTheDarkener;
-
- case DATA_LORDSANGUINAR:
- return LordSanguinar;
-
- case DATA_GRANDASTROMANCERCAPERNIAN:
- return GrandAstromancerCapernian;
-
- case DATA_MASTERENGINEERTELONICUS:
- return MasterEngineerTelonicus;
-
- case DATA_KAELTHAS:
- return Kaelthas;
-
- case DATA_ASTROMANCER:
- return Astromancer;
-
- case DATA_ALAR:
- return Alar;
- }
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_ALAREVENT:
- AlarEventPhase = data;
- Encounters[0] = (data) ? true : false;
- break;
-
- case DATA_SOLARIANEVENT:
- Encounters[1] = (data) ? true : false;
- break;
-
- case DATA_VOIDREAVEREVENT:
- Encounters[2] = (data) ? true : false;
- break;
-
- //Kael'thas
- case DATA_KAELTHASEVENT:
- KaelthasEventPhase = data;
- Encounters[3] = (data) ? true : false;
- break;
-
- case DATA_HIGHASTROMANCERSOLARIANEVENT:
- Encounters[4] = (data) ? true : false;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_ALAREVENT:
- return AlarEventPhase;
-
- case DATA_SOLARIANEVENT:
- return Encounters[1];
-
- case DATA_VOIDREAVEREVENT:
- return Encounters[2];
-
- case DATA_HIGHASTROMANCERSOLARIANEVENT:
- return Encounters[4];
-
- //Kael'thas
- case DATA_KAELTHASEVENT:
- return KaelthasEventPhase;
- }
-
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_the_eye(Map* map)
-{
- return new instance_the_eye(map);
-}
-
-void AddSC_instance_the_eye()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_the_eye";
- newscript->GetInstanceData = GetInstanceData_instance_the_eye;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_The_Eye
+SD%Complete: 100
+SDComment:
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+
+#define ENCOUNTERS 5
+
+/* The Eye encounters:
+0 - Kael'thas event
+1 - Al' ar event
+2 - Solarian Event
+3 - Void Reaver event
+*/
+
+struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
+{
+ instance_the_eye(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 ThaladredTheDarkener;
+ uint64 LordSanguinar;
+ uint64 GrandAstromancerCapernian;
+ uint64 MasterEngineerTelonicus;
+ uint64 Kaelthas;
+ uint64 Astromancer;
+ uint64 Alar;
+
+ uint8 KaelthasEventPhase;
+ uint8 AlarEventPhase;
+
+ bool Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ ThaladredTheDarkener = 0;
+ LordSanguinar = 0;
+ GrandAstromancerCapernian = 0;
+ MasterEngineerTelonicus = 0;
+ Kaelthas = 0;
+ Astromancer = 0;
+ Alar = 0;
+
+ KaelthasEventPhase = 0;
+ AlarEventPhase = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i]) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 20064: ThaladredTheDarkener = creature->GetGUID(); break;
+ case 20063: MasterEngineerTelonicus = creature->GetGUID(); break;
+ case 20062: GrandAstromancerCapernian = creature->GetGUID(); break;
+ case 20060: LordSanguinar = creature->GetGUID(); break;
+ case 19622: Kaelthas = creature->GetGUID(); break;
+ case 18805: Astromancer = creature->GetGUID(); break;
+
+ case 19514:
+ Alar = creature->GetGUID();
+ break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_THALADREDTHEDARKENER:
+ return ThaladredTheDarkener;
+
+ case DATA_LORDSANGUINAR:
+ return LordSanguinar;
+
+ case DATA_GRANDASTROMANCERCAPERNIAN:
+ return GrandAstromancerCapernian;
+
+ case DATA_MASTERENGINEERTELONICUS:
+ return MasterEngineerTelonicus;
+
+ case DATA_KAELTHAS:
+ return Kaelthas;
+
+ case DATA_ASTROMANCER:
+ return Astromancer;
+
+ case DATA_ALAR:
+ return Alar;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_ALAREVENT:
+ AlarEventPhase = data;
+ Encounters[0] = (data) ? true : false;
+ break;
+
+ case DATA_SOLARIANEVENT:
+ Encounters[1] = (data) ? true : false;
+ break;
+
+ case DATA_VOIDREAVEREVENT:
+ Encounters[2] = (data) ? true : false;
+ break;
+
+ //Kael'thas
+ case DATA_KAELTHASEVENT:
+ KaelthasEventPhase = data;
+ Encounters[3] = (data) ? true : false;
+ break;
+
+ case DATA_HIGHASTROMANCERSOLARIANEVENT:
+ Encounters[4] = (data) ? true : false;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_ALAREVENT:
+ return AlarEventPhase;
+
+ case DATA_SOLARIANEVENT:
+ return Encounters[1];
+
+ case DATA_VOIDREAVEREVENT:
+ return Encounters[2];
+
+ case DATA_HIGHASTROMANCERSOLARIANEVENT:
+ return Encounters[4];
+
+ //Kael'thas
+ case DATA_KAELTHASEVENT:
+ return KaelthasEventPhase;
+ }
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_the_eye(Map* map)
+{
+ return new instance_the_eye(map);
+}
+
+void AddSC_instance_the_eye()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_the_eye";
+ newscript->GetInstanceData = GetInstanceData_instance_the_eye;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
index 1156f263abb..cd2962b509a 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
@@ -1,98 +1,98 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: The_Eye
-SD%Complete: 100
-SDComment:
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
-/* ContentData
-mob_crystalcore_devastator
-EndContentData */
-
-#include "precompiled.h"
-#include "def_the_eye.h"
-
-#define SPELL_COUNTERCHARGE 35035
-#define SPELL_KNOCKAWAY 22893
-
-struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI
-{
- mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Knockaway_Timer;
- uint32 Countercharge_Timer;
-
- void Reset()
- {
- Countercharge_Timer = 9000;
- Knockaway_Timer = 25000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Check if we have a current target
- //Knockaway_Timer
- if (Knockaway_Timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true);
-
- // current aggro target is knocked away pick new target
- Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
-
- if (!Target || Target == m_creature->getVictim())
- Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
-
- if (Target)
- m_creature->TauntApply(Target);
-
- Knockaway_Timer = 23000;
- }
- else Knockaway_Timer -= diff;
-
- //Countercharge_Timer
- if (Countercharge_Timer < diff)
- {
- DoCast(this->m_creature,SPELL_COUNTERCHARGE);
- Countercharge_Timer = 45000;
- }else Countercharge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_crystalcore_devastator(Creature *_Creature)
-{
- return new mob_crystalcore_devastatorAI (_Creature);
-}
-
-void AddSC_the_eye()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="mob_crystalcore_devastator";
- newscript->GetAI = GetAI_mob_crystalcore_devastator;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: The_Eye
+SD%Complete: 100
+SDComment:
+SDCategory: Tempest Keep, The Eye
+EndScriptData */
+
+/* ContentData
+mob_crystalcore_devastator
+EndContentData */
+
+#include "precompiled.h"
+#include "def_the_eye.h"
+
+#define SPELL_COUNTERCHARGE 35035
+#define SPELL_KNOCKAWAY 22893
+
+struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI
+{
+ mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Knockaway_Timer;
+ uint32 Countercharge_Timer;
+
+ void Reset()
+ {
+ Countercharge_Timer = 9000;
+ Knockaway_Timer = 25000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Check if we have a current target
+ //Knockaway_Timer
+ if (Knockaway_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true);
+
+ // current aggro target is knocked away pick new target
+ Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
+
+ if (!Target || Target == m_creature->getVictim())
+ Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+
+ if (Target)
+ m_creature->TauntApply(Target);
+
+ Knockaway_Timer = 23000;
+ }
+ else Knockaway_Timer -= diff;
+
+ //Countercharge_Timer
+ if (Countercharge_Timer < diff)
+ {
+ DoCast(this->m_creature,SPELL_COUNTERCHARGE);
+ Countercharge_Timer = 45000;
+ }else Countercharge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_crystalcore_devastator(Creature *_Creature)
+{
+ return new mob_crystalcore_devastatorAI (_Creature);
+}
+
+void AddSC_the_eye()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="mob_crystalcore_devastator";
+ newscript->GetAI = GetAI_mob_crystalcore_devastator;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
index 4f934b82d98..04f540fdcde 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss Gatewatcher Gyrokill
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Tempest Keep, The Mechanar
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss Gatewatcher Gyrokill
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Tempest Keep, The Mechanar
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
index 6acd9736859..235bd733a9b 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
@@ -1,147 +1,147 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss Gatewatcher Ironhand
-SD%Complete: 100
-SDComment:
-SDCategory: Tempest Keep, The Mechanar
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOW_POWER 35322
-#define SPELL_JACKHAMMER 35326
-#define SPELL_STREAM_OF_MACHINE_FLUID 35311
-
-#define SAY_SPELL_JACKHAMMER_1 "With the precise angle and velocity... "
-#define SOUND_SPELL_JACKHAMMER_1 11112
-#define SAY_SPELL_JACKHAMMER_2 "Low tech yet quiet effective!"
-#define SOUND_SPELL_JACKHAMMER_2 11113
-
-#define SAY_AGGRO_1 "You have approximately five seconds to live."
-#define SOUND_SAY_AGGRO_1 11109
-
-#define SAY_SLAY_1 "A foregone conclusion."
-#define SOUND_SLAY_1 11110
-#define SAY_SLAY_2 "The processing will continue a schedule!"
-#define SOUND_SLAY_2 11111
-
-#define SAY_DEATH_1 "My calculations did not... "
-#define SOUND_DEATH_1 11114
-
-
-struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI
-{
- boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 Shadow_Power_Timer;
- uint32 Jackhammer_Timer;
- uint32 Stream_of_Machine_Fluid_Timer;
-
- void Reset()
- {
- Shadow_Power_Timer = 25000;
- Jackhammer_Timer = 45000;
- Stream_of_Machine_Fluid_Timer = 55000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH_1);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shadow Power
- if(Shadow_Power_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOW_POWER);
- Shadow_Power_Timer = 25000;
- }else Shadow_Power_Timer -= diff;
-
- //Jack Hammer
- if(Jackhammer_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_JACKHAMMER);
-
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL_JACKHAMMER_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_1);
- break;
- case 1:
- DoYell(SAY_SPELL_JACKHAMMER_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_2);
- break;
- }
-
- Jackhammer_Timer = 45000;
- }else Jackhammer_Timer -= diff;
-
- //Stream of Machine Fluid
- if(Stream_of_Machine_Fluid_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID);
- Stream_of_Machine_Fluid_Timer = 55000;
- }else Stream_of_Machine_Fluid_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature *_Creature)
-{
- return new boss_gatewatcher_iron_handAI (_Creature);
-}
-
-void AddSC_boss_gatewatcher_iron_hand()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gatewatcher_iron_hand";
- newscript->GetAI = GetAI_boss_gatewatcher_iron_hand;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss Gatewatcher Ironhand
+SD%Complete: 100
+SDComment:
+SDCategory: Tempest Keep, The Mechanar
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOW_POWER 35322
+#define SPELL_JACKHAMMER 35326
+#define SPELL_STREAM_OF_MACHINE_FLUID 35311
+
+#define SAY_SPELL_JACKHAMMER_1 "With the precise angle and velocity... "
+#define SOUND_SPELL_JACKHAMMER_1 11112
+#define SAY_SPELL_JACKHAMMER_2 "Low tech yet quiet effective!"
+#define SOUND_SPELL_JACKHAMMER_2 11113
+
+#define SAY_AGGRO_1 "You have approximately five seconds to live."
+#define SOUND_SAY_AGGRO_1 11109
+
+#define SAY_SLAY_1 "A foregone conclusion."
+#define SOUND_SLAY_1 11110
+#define SAY_SLAY_2 "The processing will continue a schedule!"
+#define SOUND_SLAY_2 11111
+
+#define SAY_DEATH_1 "My calculations did not... "
+#define SOUND_DEATH_1 11114
+
+
+struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI
+{
+ boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 Shadow_Power_Timer;
+ uint32 Jackhammer_Timer;
+ uint32 Stream_of_Machine_Fluid_Timer;
+
+ void Reset()
+ {
+ Shadow_Power_Timer = 25000;
+ Jackhammer_Timer = 45000;
+ Stream_of_Machine_Fluid_Timer = 55000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH_1);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shadow Power
+ if(Shadow_Power_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOW_POWER);
+ Shadow_Power_Timer = 25000;
+ }else Shadow_Power_Timer -= diff;
+
+ //Jack Hammer
+ if(Jackhammer_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_JACKHAMMER);
+
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL_JACKHAMMER_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_1);
+ break;
+ case 1:
+ DoYell(SAY_SPELL_JACKHAMMER_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_2);
+ break;
+ }
+
+ Jackhammer_Timer = 45000;
+ }else Jackhammer_Timer -= diff;
+
+ //Stream of Machine Fluid
+ if(Stream_of_Machine_Fluid_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID);
+ Stream_of_Machine_Fluid_Timer = 55000;
+ }else Stream_of_Machine_Fluid_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature *_Creature)
+{
+ return new boss_gatewatcher_iron_handAI (_Creature);
+}
+
+void AddSC_boss_gatewatcher_iron_hand()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gatewatcher_iron_hand";
+ newscript->GetAI = GetAI_boss_gatewatcher_iron_hand;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
index e071bc3c021..ea8defffba3 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
@@ -1,223 +1,223 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss Nethermancer Sepethrea
-SD%Complete: 100
-SDComment:
-SDCategory: Tempest Keep, The Mechanar
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SUMMON_RAGIN_FLAMES 35275
-#define SPELL_INFERNO 19695
-#define SPELL_FIRE_TAIL 35278
-
-#define SPELL_FROST_ATTACK 35263
-#define SPELL_ARCANE_BLAST 35314
-#define SPELL_DRAGONS_BREATH 35250
-#define SPELL_KNOCKBACK 37317
-#define SPELL_SOLARBURN 35267
-
-#define SAY_SPELL_DRAGONS_BREATH_1 "Think you can take the heat?"
-#define SOUND_SPELL_DRAGONS_BREATH_1 11189
-#define SAY_SPELL_DRAGONS_BREATH_2 "Anar'endal dracon!"
-#define SOUND_SPELL_DRAGONS_BREATH_2 11190
-
-#define SAY_AGGRO "Don't value your life very much, do you?"
-#define SOUND_SAY_AGGRO 11186
-
-#define SAY_SLAY "And don't come back!"
-#define SOUND_SLAY 11187
-
-#define SAY_DEATH "Anu... bala belore...alon."
-#define SOUND_DEATH 11192
-
-struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
-{
- boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 frost_attack_Timer;
- uint32 arcane_blast_Timer;
- uint32 dragons_breath_Timer;
- uint32 knockback_Timer;
- uint32 solarburn_Timer;
-
- void Reset()
- {
- frost_attack_Timer = 10000;
- arcane_blast_Timer = 15000;
- dragons_breath_Timer = 20000;
- knockback_Timer = 25000;
- solarburn_Timer = 30000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Frost Attack
- if(frost_attack_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK);
- frost_attack_Timer = 10000;
- }else frost_attack_Timer -= diff;
-
- //Arcane Blast
- if(arcane_blast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
- arcane_blast_Timer = 15000;
- }else arcane_blast_Timer -= diff;
-
- //Dragons Breath
- if(dragons_breath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH);
- dragons_breath_Timer = 20000;
-
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL_DRAGONS_BREATH_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_1);
- break;
- case 1:
- DoYell(SAY_SPELL_DRAGONS_BREATH_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_2);
- break;
- }
- }else dragons_breath_Timer -= diff;
-
- //Knockback
- if(knockback_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
- knockback_Timer = 25000;
- }else knockback_Timer -= diff;
-
- //Solarburn
- if(solarburn_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SOLARBURN);
- solarburn_Timer = 30000;
- }else solarburn_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature *_Creature)
-{
- return new boss_nethermancer_sepethreaAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
-{
- mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 inferno_Timer;
- uint32 flame_timer;
-
- bool onlyonce;
-
- void Reset()
- {
- inferno_Timer = 10000;
- flame_timer = 200;
- onlyonce = false;
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- Unit* target = NULL;
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (!onlyonce)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- m_creature->GetMotionMaster()->MoveChase(target);
- onlyonce = true;
- }
-
- if(inferno_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_INFERNO);
- inferno_Timer = 10000;
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- m_creature->GetMotionMaster()->MoveChase(target);
- }else inferno_Timer -= diff;
-
- if(flame_timer < diff)
- {
- DoCast(m_creature,SPELL_FIRE_TAIL);
- flame_timer = 200;
- }else flame_timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mob_ragin_flames(Creature *_Creature)
-{
- return new mob_ragin_flamesAI (_Creature);
-}
-
-void AddSC_boss_nethermancer_sepethrea()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_nethermancer_sepethrea";
- newscript->GetAI = GetAI_boss_nethermancer_sepethrea;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ragin_flames";
- newscript->GetAI = GetAI_mob_ragin_flames;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss Nethermancer Sepethrea
+SD%Complete: 100
+SDComment:
+SDCategory: Tempest Keep, The Mechanar
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SUMMON_RAGIN_FLAMES 35275
+#define SPELL_INFERNO 19695
+#define SPELL_FIRE_TAIL 35278
+
+#define SPELL_FROST_ATTACK 35263
+#define SPELL_ARCANE_BLAST 35314
+#define SPELL_DRAGONS_BREATH 35250
+#define SPELL_KNOCKBACK 37317
+#define SPELL_SOLARBURN 35267
+
+#define SAY_SPELL_DRAGONS_BREATH_1 "Think you can take the heat?"
+#define SOUND_SPELL_DRAGONS_BREATH_1 11189
+#define SAY_SPELL_DRAGONS_BREATH_2 "Anar'endal dracon!"
+#define SOUND_SPELL_DRAGONS_BREATH_2 11190
+
+#define SAY_AGGRO "Don't value your life very much, do you?"
+#define SOUND_SAY_AGGRO 11186
+
+#define SAY_SLAY "And don't come back!"
+#define SOUND_SLAY 11187
+
+#define SAY_DEATH "Anu... bala belore...alon."
+#define SOUND_DEATH 11192
+
+struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
+{
+ boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 frost_attack_Timer;
+ uint32 arcane_blast_Timer;
+ uint32 dragons_breath_Timer;
+ uint32 knockback_Timer;
+ uint32 solarburn_Timer;
+
+ void Reset()
+ {
+ frost_attack_Timer = 10000;
+ arcane_blast_Timer = 15000;
+ dragons_breath_Timer = 20000;
+ knockback_Timer = 25000;
+ solarburn_Timer = 30000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Frost Attack
+ if(frost_attack_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK);
+ frost_attack_Timer = 10000;
+ }else frost_attack_Timer -= diff;
+
+ //Arcane Blast
+ if(arcane_blast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
+ arcane_blast_Timer = 15000;
+ }else arcane_blast_Timer -= diff;
+
+ //Dragons Breath
+ if(dragons_breath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH);
+ dragons_breath_Timer = 20000;
+
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL_DRAGONS_BREATH_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_1);
+ break;
+ case 1:
+ DoYell(SAY_SPELL_DRAGONS_BREATH_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_2);
+ break;
+ }
+ }else dragons_breath_Timer -= diff;
+
+ //Knockback
+ if(knockback_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
+ knockback_Timer = 25000;
+ }else knockback_Timer -= diff;
+
+ //Solarburn
+ if(solarburn_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SOLARBURN);
+ solarburn_Timer = 30000;
+ }else solarburn_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature *_Creature)
+{
+ return new boss_nethermancer_sepethreaAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
+{
+ mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 inferno_Timer;
+ uint32 flame_timer;
+
+ bool onlyonce;
+
+ void Reset()
+ {
+ inferno_Timer = 10000;
+ flame_timer = 200;
+ onlyonce = false;
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ Unit* target = NULL;
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (!onlyonce)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ m_creature->GetMotionMaster()->MoveChase(target);
+ onlyonce = true;
+ }
+
+ if(inferno_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_INFERNO);
+ inferno_Timer = 10000;
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ m_creature->GetMotionMaster()->MoveChase(target);
+ }else inferno_Timer -= diff;
+
+ if(flame_timer < diff)
+ {
+ DoCast(m_creature,SPELL_FIRE_TAIL);
+ flame_timer = 200;
+ }else flame_timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mob_ragin_flames(Creature *_Creature)
+{
+ return new mob_ragin_flamesAI (_Creature);
+}
+
+void AddSC_boss_nethermancer_sepethrea()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_nethermancer_sepethrea";
+ newscript->GetAI = GetAI_boss_nethermancer_sepethrea;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ragin_flames";
+ newscript->GetAI = GetAI_mob_ragin_flames;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
index c64dfeadcca..220b05fb752 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
@@ -1,348 +1,348 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio
-SD%Complete: 100
-SDComment:
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-
-#define SPELL_CLEAVE 26350
-#define SPELL_TOXIC_VOLLEY 25812
-#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg.
-#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors.
-
-#define SPELL_CHARGE 26561
-#define SPELL_KNOCKBACK 26027
-
-#define SPELL_HEAL 25807
-#define SPELL_FEAR 19408
-
-struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI
-{
- boss_kriAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Cleave_Timer;
- uint32 ToxicVolley_Timer;
- uint32 Check_Timer;
-
- bool VemDead;
- bool Death;
-
- void Reset()
- {
- Cleave_Timer = 4000 + rand()%4000;
- ToxicVolley_Timer = 6000 + rand()%6000;
- Check_Timer = 2000;
-
- VemDead = false;
- Death = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustDied(Unit* killer)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
-
- pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 5000 + rand()%7000;
- }else Cleave_Timer -= diff;
-
- //ToxicVolley_Timer
- if (ToxicVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY);
- ToxicVolley_Timer = 10000 + rand()%5000;
- }else ToxicVolley_Timer -= diff;
-
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death)
- {
- DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD);
- Death = true;
- }
-
- if(!VemDead)
- {
- //Checking if Vem is dead. If yes we will enrage.
- if(Check_Timer < diff)
- {
- if(pInstance && pInstance->GetData(DATA_VEMISDEAD))
- {
- DoCast(m_creature, SPELL_ENRAGE);
- VemDead = true;
- }
- Check_Timer = 2000;
- }else Check_Timer -=diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI
-{
- boss_vemAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Charge_Timer;
- uint32 KnockBack_Timer;
- uint32 Enrage_Timer;
-
- bool Enraged;
-
- void Reset()
- {
- Charge_Timer = 15000 + rand()%12000;
- KnockBack_Timer = 8000 + rand()%12000;
- Enrage_Timer = 120000;
-
- Enraged = false;
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_VEM_DEATH, 0);
- if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Charge_Timer
- if (Charge_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(target)
- {
- DoCast(target, SPELL_CHARGE);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
- DoStartAttackAndMovement(target);
- }
-
- Charge_Timer = 8000 + rand()%8000;
- }else Charge_Timer -= diff;
-
- //KnockBack_Timer
- if (KnockBack_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
- KnockBack_Timer = 15000 + rand()%10000;
- }else KnockBack_Timer -= diff;
-
- //Enrage_Timer
- if (!Enraged && Enrage_Timer < diff)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enraged = true;
- }else Charge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI
-{
- boss_yaujAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Heal_Timer;
- uint32 Fear_Timer;
- uint32 Check_Timer;
-
- bool VemDead;
-
- void Reset()
- {
- Heal_Timer = 25000 + rand()%15000;
- Fear_Timer = 12000 + rand()%12000;
- Check_Timer = 2000;
-
- VemDead = false;
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
-
- for(int i = 0; i < 10;i++)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
- Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(target);
- }
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Fear_Timer
- if (Fear_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FEAR);
- DoResetThreat();
- Fear_Timer = 20000;
- }else Fear_Timer -= diff;
-
- //Casting Heal to other twins or herself.
- if(Heal_Timer < diff)
- {
- if(pInstance)
- {
- Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI));
- Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM));
-
- switch(rand()%3)
- {
- case 0:
- if(pKri)
- DoCast(pKri, SPELL_HEAL);
- break;
- case 1:
- if(pVem)
- DoCast(pVem, SPELL_HEAL);
- break;
- case 2:
- DoCast(m_creature, SPELL_HEAL);
- break;
- }
- }
-
- Heal_Timer = 15000+rand()%15000;
- }else Heal_Timer -= diff;
-
- //Checking if Vem is dead. If yes we will enrage.
- if(Check_Timer < diff)
- {
- if (!VemDead)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_VEMISDEAD))
- {
- DoCast(m_creature, SPELL_ENRAGE);
- VemDead = true;
- }
- }
- }
- Check_Timer = 2000;
- }else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_yauj(Creature *_Creature)
-{
- return new boss_yaujAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_vem(Creature *_Creature)
-{
- return new boss_vemAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_kri(Creature *_Creature)
-{
- return new boss_kriAI (_Creature);
-}
-
-void AddSC_bug_trio()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kri";
- newscript->GetAI = GetAI_boss_kri;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_vem";
- newscript->GetAI = GetAI_boss_vem;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_yauj";
- newscript->GetAI = GetAI_boss_yauj;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio
+SD%Complete: 100
+SDComment:
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+
+#define SPELL_CLEAVE 26350
+#define SPELL_TOXIC_VOLLEY 25812
+#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg.
+#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors.
+
+#define SPELL_CHARGE 26561
+#define SPELL_KNOCKBACK 26027
+
+#define SPELL_HEAL 25807
+#define SPELL_FEAR 19408
+
+struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI
+{
+ boss_kriAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Cleave_Timer;
+ uint32 ToxicVolley_Timer;
+ uint32 Check_Timer;
+
+ bool VemDead;
+ bool Death;
+
+ void Reset()
+ {
+ Cleave_Timer = 4000 + rand()%4000;
+ ToxicVolley_Timer = 6000 + rand()%6000;
+ Check_Timer = 2000;
+
+ VemDead = false;
+ Death = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
+ // Unlootable if death
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+
+ pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
+ }
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 5000 + rand()%7000;
+ }else Cleave_Timer -= diff;
+
+ //ToxicVolley_Timer
+ if (ToxicVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY);
+ ToxicVolley_Timer = 10000 + rand()%5000;
+ }else ToxicVolley_Timer -= diff;
+
+ if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD);
+ Death = true;
+ }
+
+ if(!VemDead)
+ {
+ //Checking if Vem is dead. If yes we will enrage.
+ if(Check_Timer < diff)
+ {
+ if(pInstance && pInstance->GetData(DATA_VEMISDEAD))
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ VemDead = true;
+ }
+ Check_Timer = 2000;
+ }else Check_Timer -=diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI
+{
+ boss_vemAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Charge_Timer;
+ uint32 KnockBack_Timer;
+ uint32 Enrage_Timer;
+
+ bool Enraged;
+
+ void Reset()
+ {
+ Charge_Timer = 15000 + rand()%12000;
+ KnockBack_Timer = 8000 + rand()%12000;
+ Enrage_Timer = 120000;
+
+ Enraged = false;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_VEM_DEATH, 0);
+ if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
+ // Unlootable if death
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Charge_Timer
+ if (Charge_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(target)
+ {
+ DoCast(target, SPELL_CHARGE);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+ DoStartAttackAndMovement(target);
+ }
+
+ Charge_Timer = 8000 + rand()%8000;
+ }else Charge_Timer -= diff;
+
+ //KnockBack_Timer
+ if (KnockBack_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
+ KnockBack_Timer = 15000 + rand()%10000;
+ }else KnockBack_Timer -= diff;
+
+ //Enrage_Timer
+ if (!Enraged && Enrage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enraged = true;
+ }else Charge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI
+{
+ boss_yaujAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Heal_Timer;
+ uint32 Fear_Timer;
+ uint32 Check_Timer;
+
+ bool VemDead;
+
+ void Reset()
+ {
+ Heal_Timer = 25000 + rand()%15000;
+ Fear_Timer = 12000 + rand()%12000;
+ Check_Timer = 2000;
+
+ VemDead = false;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
+ // Unlootable if death
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
+ }
+
+ for(int i = 0; i < 10;i++)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(target);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Fear_Timer
+ if (Fear_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+ DoResetThreat();
+ Fear_Timer = 20000;
+ }else Fear_Timer -= diff;
+
+ //Casting Heal to other twins or herself.
+ if(Heal_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI));
+ Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM));
+
+ switch(rand()%3)
+ {
+ case 0:
+ if(pKri)
+ DoCast(pKri, SPELL_HEAL);
+ break;
+ case 1:
+ if(pVem)
+ DoCast(pVem, SPELL_HEAL);
+ break;
+ case 2:
+ DoCast(m_creature, SPELL_HEAL);
+ break;
+ }
+ }
+
+ Heal_Timer = 15000+rand()%15000;
+ }else Heal_Timer -= diff;
+
+ //Checking if Vem is dead. If yes we will enrage.
+ if(Check_Timer < diff)
+ {
+ if (!VemDead)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_VEMISDEAD))
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ VemDead = true;
+ }
+ }
+ }
+ Check_Timer = 2000;
+ }else Check_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_yauj(Creature *_Creature)
+{
+ return new boss_yaujAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_vem(Creature *_Creature)
+{
+ return new boss_vemAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_kri(Creature *_Creature)
+{
+ return new boss_kriAI (_Creature);
+}
+
+void AddSC_bug_trio()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kri";
+ newscript->GetAI = GetAI_boss_kri;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_vem";
+ newscript->GetAI = GetAI_boss_vem;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_yauj";
+ newscript->GetAI = GetAI_boss_yauj;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
index f53798232b1..266c0de4cee 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
@@ -1,1360 +1,1360 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Cthun
-SD%Complete: 95
-SDComment: Darkglare tracking issue
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-
-#define PI 3.14
-
-//****** Out of Combat ******
-//Random Wispers - No txt only sound
-#define RND_WISPER_1 8580 //Death is close
-#define RND_WISPER_2 8581 //You are already dead
-#define RND_WISPER_3 8582 //Your courage will fail
-#define RND_WISPER_4 8583 //Your friends will abandon you
-#define RND_WISPER_5 8584 //You will betray your friends
-#define RND_WISPER_6 8585 //You will die
-#define RND_WISPER_7 8586 //You are weak
-#define RND_WISPER_8 8587 //Your heart will explode
-
-//***** Phase 1 ********
-
-//Mobs
-#define BOSS_EYE_OF_CTHUN 15589
-#define MOB_CLAW_TENTACLE 15725
-#define MOB_EYE_TENTACLE 15726
-#define MOB_SMALL_PORTAL 15904
-
-//Eye Spells
-#define SPELL_GREEN_BEAM 26134
-#define SPELL_DARK_GLARE 26029
-#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar
-
-//Eye Tentacles Spells
-#define SPELL_MIND_FLAY 26143
-
-//Claw Tentacles Spells
-#define SPELL_GROUND_RUPTURE 26139
-#define SPELL_HAMSTRING 26141
-
-#define MOB_
-
-//*****Phase 2******
-//Body spells
-//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs
-#define SPELL_TRANSFORM 26232
-
-//Eye Tentacles Spells
-//SAME AS PHASE1
-
-//Giant Claw Tentacles
-#define SPELL_MASSIVE_GROUND_RUPTURE 26100
-
-//Also casts Hamstring
-#define SPELL_THRASH 3391
-
-//Giant Eye Tentacles
-//CHAIN CASTS "SPELL_GREEN_BEAM"
-
-//Stomach Spells
-#define SPELL_MOUTH_TENTACLE 26332
-#define SPELL_EXIT_STOMACH_KNOCKBACK 25383
-#define SPELL_DIGESTIVE_ACID 26476
-
-//Mobs
-#define MOB_BODY_OF_CTHUN 15809
-#define MOB_GIANT_CLAW_TENTACLE 15728
-#define MOB_GIANT_EYE_TENTACLE 15334
-#define MOB_FLESH_TENTACLE 15802
-#define MOB_GIANT_PORTAL 15910
-
-//Text emote
-#define EMOTE_WEAKENED "is weakened!"
-
-//Stomach Teleport positions
-#define STOMACH_X -8562.0f
-#define STOMACH_Y 2037.0f
-#define STOMACH_Z -70.0f
-#define STOMACH_O 5.05f
-
-//Flesh tentacle positions
-#define TENTACLE_POS1_X -8571.0f
-#define TENTACLE_POS1_Y 1990.0f
-#define TENTACLE_POS1_Z -98.0f
-#define TENTACLE_POS1_O 1.22f
-
-#define TENTACLE_POS2_X -8525.0f
-#define TENTACLE_POS2_Y 1994.0f
-#define TENTACLE_POS2_Z -98.0f
-#define TENTACLE_POS2_O 2.12f
-
-//Kick out position
-#define KICK_X -8545.0f
-#define KICK_Y 1984.0f
-#define KICK_Z -96.0f
-
-struct TRINITY_DLL_DECL flesh_tentacleAI : public Scripted_NoMovementAI
-{
- flesh_tentacleAI(Creature *c) : Scripted_NoMovementAI(c), Parent(0) {Reset();}
-
- uint64 Parent;
- uint32 CheckTimer;
-
- void SpawnedByCthun(uint64 p)
- {
- Parent = p;
- }
-
- void Reset()
- {
- CheckTimer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff);
-
- void JustDied(Unit* killer);
-};
-
-struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI
-{
- eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- pInst = (ScriptedInstance*)c->GetInstanceData();
- if (!pInst)
- error_log("SD2: No Instance eye_of_cthunAI");
-
- Reset();
- }
-
- ScriptedInstance* pInst;
-
- //Global variables
- uint32 PhaseTimer;
-
- //Eye beam phase
- uint32 BeamTimer;
- uint32 EyeTentacleTimer;
- uint32 ClawTentacleTimer;
-
- //Dark Glare phase
- uint32 DarkGlareTick;
- uint32 DarkGlareTickTimer;
- float DarkGlareAngle;
- bool ClockWise;
-
- void Reset()
- {
- //Phase information
- PhaseTimer = 50000; //First dark glare in 50 seconds
-
- //Eye beam phase 50 seconds
- BeamTimer = 3000;
- EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
- ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam)
-
- //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks)
- DarkGlareTick = 0;
- DarkGlareTickTimer = 1000;
- DarkGlareAngle = 0;
- ClockWise = false;
-
- //Reset flags
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
-
- //Reset Phase
- if (pInst)
- pInst->SetData(DATA_CTHUN_PHASE, 0);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void SpawnEyeTentacle(float x, float y)
- {
- Creature* Spawned;
- Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
- if (Spawned)
- {
- Unit* target;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if (target)
- Spawned->AI()->AttackStart(target);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //No instance
- if (!pInst)
- return;
-
- switch (pInst->GetData(DATA_CTHUN_PHASE))
- {
- case 0:
- {
- //BeamTimer
- if (BeamTimer < diff)
- {
- //SPELL_GREEN_BEAM
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(target,SPELL_GREEN_BEAM);
-
- //Correctly update our target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
- }
-
- //Beam every 3 seconds
- BeamTimer = 3000;
- }else BeamTimer -= diff;
-
- //ClawTentacleTimer
- if (ClawTentacleTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- {
- Creature* Spawned = NULL;
-
- //Spawn claw tentacle on the random target
- Spawned = (Creature*)m_creature->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
-
- if (Spawned)
- Spawned->AI()->AttackStart(target);
- }
-
- //One claw tentacle every 12.5 seconds
- ClawTentacleTimer = 12500;
- }else ClawTentacleTimer -= diff;
-
- //EyeTentacleTimer
- if (EyeTentacleTimer < diff)
- {
- //Spawn the 8 Eye Tentacles in the corret spots
- SpawnEyeTentacle(0, 20); //south
- SpawnEyeTentacle(10, 10); //south west
- SpawnEyeTentacle(20, 0); //west
- SpawnEyeTentacle(10, -10); //north west
-
- SpawnEyeTentacle(0, -20); //north
- SpawnEyeTentacle(-10, -10); //north east
- SpawnEyeTentacle(-20, 0); // east
- SpawnEyeTentacle(-10, 10); // south east
-
- //No point actually putting a timer here since
- //These shouldn't trigger agian until after phase shifts
- EyeTentacleTimer = 45000;
- }else EyeTentacleTimer -= diff;
-
- //PhaseTimer
- if (PhaseTimer < diff)
- {
- //Switch to Dark Beam
- pInst->SetData(DATA_CTHUN_PHASE, 1);
-
- m_creature->InterruptNonMeleeSpells(false);
-
- //Select random target for dark beam to start on
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if (target)
- {
- //Correctly update our target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
-
- //Face our target
- DarkGlareAngle = m_creature->GetAngle(target);
- DarkGlareTickTimer = 1000;
- DarkGlareTick = 0;
- ClockWise = rand()%2;
- }
-
- //Add red coloration to C'thun
- DoCast(m_creature,SPELL_RED_COLORATION);
-
- //Freeze animation
- m_creature->setEmoteState(53);
-
- //Darkbeam for 35 seconds
- PhaseTimer = 35000;
- }else PhaseTimer -= diff;
-
- }
- break;
- case 1:
- {
- //EyeTentacleTimer
- if (DarkGlareTick < 35)
- if (DarkGlareTickTimer < diff)
- {
- //Remove any target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
-
- //Set angle and cast
- if (ClockWise)
- m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
- else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
-
- m_creature->StopMoving();
-
- //Actual dark glare cast, maybe something missing here?
- m_creature->CastSpell(NULL, SPELL_DARK_GLARE, false);
-
- //Increase tick
- DarkGlareTick++;
-
- //1 second per tick
- DarkGlareTickTimer = 1000;
- }else DarkGlareTickTimer -= diff;
-
- //PhaseTimer
- if (PhaseTimer < diff)
- {
- //Switch to Eye Beam
- pInst->SetData(DATA_CTHUN_PHASE, 0);
-
- BeamTimer = 3000;
- EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
- ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam)
-
- m_creature->InterruptNonMeleeSpells(false);
-
- //Remove Red coloration from c'thun
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
-
- //Freeze animation
- m_creature->setEmoteState(0);
- m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
-
- //Eye Beam for 50 seconds
- PhaseTimer = 50000;
- }else PhaseTimer -= diff;
- }break;
-
- //Transition phase
- case 2:
- {
- //Remove any target
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- m_creature->SetHealth(0);
- }
-
- //Dead phase
- case 5:
- {
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- }
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- //No instance
- if (!pInst)
- return;
-
- switch (pInst->GetData(DATA_CTHUN_PHASE))
- {
- case 0:
- case 1:
- {
- //Only if it will kill
- if (damage < m_creature->GetHealth())
- return;
-
- //Fake death in phase 0 or 1 (green beam or dark glare phase)
- m_creature->InterruptNonMeleeSpells(false);
-
- //Remove Red coloration from c'thun
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
-
- //Reset to normal emote state and prevent select and attack
- m_creature->setEmoteState(0);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
-
- //Remove Target field
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
-
- //Death animation/respawning;
- pInst->SetData(DATA_CTHUN_PHASE, 2);
-
- m_creature->SetHealth(0);
- damage = 0;
-
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- }
- break;
-
- case 5:
- {
- //Allow death here
- return;
- }
-
- default:
- {
- //Prevent death in this phase
- damage = 0;
- return;
- }
- break;
- }
- }
-};
-
-struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI
-{
- cthunAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- pInst = (ScriptedInstance*)c->GetInstanceData();
- if (!pInst)
- error_log("SD2: No Instance eye_of_cthunAI");
-
- Reset();
- }
-
- ScriptedInstance* pInst;
-
- //Out of combat whisper timer
- uint32 WisperTimer;
-
- //Global variables
- uint32 PhaseTimer;
-
- //-------------------
-
- //Phase transition
- uint64 HoldPlayer;
-
- //Body Phase
- uint32 EyeTentacleTimer;
- uint8 FleshTentaclesKilled;
- uint32 GiantClawTentacleTimer;
- uint32 GiantEyeTentacleTimer;
- uint32 StomachAcidTimer;
- uint32 StomachEnterTimer;
- uint32 StomachEnterVisTimer;
- uint64 StomachEnterTarget;
-
- //Stomach map, bool = true then in stomach
- HM_NAMESPACE::hash_map<uint64, bool> Stomach_Map;
-
- void Reset()
- {
- //One random wisper every 90 - 300 seconds
- WisperTimer = 90000;
-
- //Phase information
- PhaseTimer = 10000; //Emerge in 10 seconds
-
- //No hold player for transition
- HoldPlayer = 0;
-
- //Body Phase
- EyeTentacleTimer = 30000;
- FleshTentaclesKilled = 0;
- GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat)
- GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat)
- StomachAcidTimer = 4000; //Every 4 seconds
- StomachEnterTimer = 10000; //Every 10 seconds
- StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
- StomachEnterTarget = 0; //Target to be teleported to stomach
-
- //Clear players in stomach and outside
- Stomach_Map.clear();
-
- //Reset flags
- m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
-
- if (pInst)
- pInst->SetData(DATA_CTHUN_PHASE, 0);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void SpawnEyeTentacle(float x, float y)
- {
- Creature* Spawned;
- Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
- if (Spawned)
- {
- Unit* target;
-
- target = SelectRandomNotStomach();
-
- if (target)
- Spawned->AI()->AttackStart(target);
- }
- }
-
- Unit* SelectRandomNotStomach()
- {
- if (Stomach_Map.empty())
- return NULL;
-
- HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
-
- std::list<Unit*> temp;
- std::list<Unit*>::iterator j;
-
- //Get all players in map
- while (i != Stomach_Map.end())
- {
- //Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
-
- //Only units out of stomach
- if (pUnit && i->second == false)
- {
- temp.push_back(pUnit);
- }
- ++i;
- }
-
- if (temp.empty())
- return NULL;
-
- j = temp.begin();
-
- //Get random but only if we have more than one unit on threat list
- if (temp.size() > 1)
- advance ( i , rand() % (temp.size() - 1) );
-
- return (*j);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- {
- //No target so we'll use this section to do our random wispers instance wide
- //WisperTimer
- if (WisperTimer < diff)
- {
- Map *map = m_creature->GetMap();
- if(!map->IsDungeon()) return;
-
- InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
- for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- //Play random sound to the zone
- switch (rand()%8)
- {
- case 0: (*i)->SendPlaySound(RND_WISPER_1, true); break;
- case 1: (*i)->SendPlaySound(RND_WISPER_2, true); break;
- case 2: (*i)->SendPlaySound(RND_WISPER_3, true); break;
- case 3: (*i)->SendPlaySound(RND_WISPER_4, true); break;
- case 4: (*i)->SendPlaySound(RND_WISPER_5, true); break;
- case 5: (*i)->SendPlaySound(RND_WISPER_6, true); break;
- case 6: (*i)->SendPlaySound(RND_WISPER_7, true); break;
- case 7: (*i)->SendPlaySound(RND_WISPER_8, true); break;
- }
- }
-
- //One random wisper every 90 - 300 seconds
- WisperTimer = 90000 + (rand()% 210000);
- }else WisperTimer -= diff;
-
- return;
- }
-
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
-
- //No instance
- if (!pInst)
- return;
-
- switch (pInst->GetData(DATA_CTHUN_PHASE))
- {
- //Transition phase
- case 2:
- {
- //PhaseTimer
- if (PhaseTimer < diff)
- {
- //Switch
- pInst->SetData(DATA_CTHUN_PHASE, 3);
-
- //Switch to c'thun model
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_TRANSFORM, false);
- m_creature->SetHealth(m_creature->GetMaxHealth());
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
-
- //Emerging phase
- //AttackStart(Unit::GetUnit(*m_creature, HoldPlayer));
- DoZoneInCombat();
-
- //Place all units in threat list on outside of stomach
- Stomach_Map.clear();
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- //Outside stomach
- Stomach_Map[(*i)->getUnitGuid()] = false;
- }
-
- //Spawn 2 flesh tentacles
- FleshTentaclesKilled = 0;
-
- Creature* Spawned;
-
- //Spawn flesh tentacle
- Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (!Spawned)
- FleshTentaclesKilled++;
- else
- ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
-
- //Spawn flesh tentacle
- Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (!Spawned)
- FleshTentaclesKilled++;
- else
- ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
-
- PhaseTimer = 0;
- }else PhaseTimer -= diff;
-
- }break;
-
- //Body Phase
- case 3:
- {
- //Remove Target field
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
-
- //Weaken
- if (FleshTentaclesKilled > 1)
- {
- pInst->SetData(DATA_CTHUN_PHASE, 4);
-
- DoTextEmote(EMOTE_WEAKENED, NULL);
- PhaseTimer = 45000;
-
- DoCast(m_creature, SPELL_RED_COLORATION, true);
-
- HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
-
- //Kick all players out of stomach
- while (i != Stomach_Map.end())
- {
- //Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
-
- //Only move units in stomach
- if (pUnit && i->second == true)
- {
- //Teleport each player out
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
-
- //Cast knockback on them
- DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
-
- //Remove the acid debuff
- pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
-
- i->second = false;
- }
- ++i;
- }
-
- return;
- }
-
- //Stomach acid
- if (StomachAcidTimer < diff)
- {
- //Apply aura to all players in stomach
- HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
-
- while (i != Stomach_Map.end())
- {
- //Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
-
- //Only apply to units in stomach
- if (pUnit && i->second == true)
- {
- //Cast digestive acid on them
- DoCast(pUnit, SPELL_DIGESTIVE_ACID, true);
-
- //Check if player should be kicked from stomach
- if (pUnit->GetDistance(KICK_X, KICK_Y, KICK_Z) < 15)
- {
- //Teleport each player out
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
-
- //Cast knockback on them
- DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
-
- //Remove the acid debuff
- pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
-
- i->second = false;
- }
- }
- ++i;
- }
-
- StomachAcidTimer = 4000;
- }else StomachAcidTimer -= diff;
-
- //Stomach Enter Timer
- if (StomachEnterTimer < diff)
- {
- Unit* target = NULL;
- target = SelectRandomNotStomach();
-
- if (target)
- {
- //Set target in stomach
- Stomach_Map[target->GetGUID()] = true;
- target->InterruptNonMeleeSpells(false);
- target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID());
- StomachEnterTarget = target->GetGUID();
- StomachEnterVisTimer = 3800;
- }
-
- StomachEnterTimer = 13800;
- }else StomachEnterTimer -= diff;
-
- if (StomachEnterVisTimer && StomachEnterTarget)
- if (StomachEnterVisTimer <= diff)
- {
- //Check for valid player
- Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget);
-
- if (pUnit)
- {
- DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O);
- }
-
- StomachEnterTarget = 0;
- StomachEnterVisTimer = 0;
- }else StomachEnterVisTimer -= diff;
-
- //GientClawTentacleTimer
- if (GiantClawTentacleTimer < diff)
- {
- Unit* target = NULL;
- target = SelectRandomNotStomach();
- if (target)
- {
- Creature* Spawned = NULL;
-
- //Spawn claw tentacle on the random target
- Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
-
- if (Spawned)
- Spawned->AI()->AttackStart(target);
- }
-
- //One giant claw tentacle every minute
- GiantClawTentacleTimer = 60000;
- }else GiantClawTentacleTimer -= diff;
-
- //GiantEyeTentacleTimer
- if (GiantEyeTentacleTimer < diff)
- {
- Unit* target = NULL;
- target = SelectRandomNotStomach();
- if (target)
- {
-
- Creature* Spawned = NULL;
-
- //Spawn claw tentacle on the random target
- Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
-
- if (Spawned)
- Spawned->AI()->AttackStart(target);
- }
-
- //One giant eye tentacle every minute
- GiantEyeTentacleTimer = 60000;
- }else GiantEyeTentacleTimer -= diff;
-
- //EyeTentacleTimer
- if (EyeTentacleTimer < diff)
- {
- //Spawn the 8 Eye Tentacles in the corret spots
- SpawnEyeTentacle(0, 25); //south
- SpawnEyeTentacle(12, 12); //south west
- SpawnEyeTentacle(25, 0); //west
- SpawnEyeTentacle(12, -12); //north west
-
- SpawnEyeTentacle(0, -25); //north
- SpawnEyeTentacle(-12, -12); //north east
- SpawnEyeTentacle(-25, 0); // east
- SpawnEyeTentacle(-12, 12); // south east
-
- //These spawn at every 30 seconds
- EyeTentacleTimer = 30000;
- }else EyeTentacleTimer -= diff;
-
- }break;
-
- //Weakened state
- case 4:
- {
- //PhaseTimer
- if (PhaseTimer < diff)
- {
- //Switch
- pInst->SetData(DATA_CTHUN_PHASE, 3);
-
- //Remove red coloration
- m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
-
- //Spawn 2 flesh tentacles
- FleshTentaclesKilled = 0;
-
- Creature* Spawned;
-
- //Spawn flesh tentacle
- Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (!Spawned)
- FleshTentaclesKilled++;
- else
- ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
-
- //Spawn flesh tentacle
- Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (!Spawned)
- FleshTentaclesKilled++;
- else
- ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
-
- PhaseTimer = 0;
- }else PhaseTimer -= diff;
- }
- }
- }
-
- void JustDied(Unit* pKiller)
- {
- //Switch
- if( pInst )
- pInst->SetData(DATA_CTHUN_PHASE, 5);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- //No instance
- if (!pInst)
- return;
-
- switch (pInst->GetData(DATA_CTHUN_PHASE))
- {
- case 3:
- {
- //Not weakened so reduce damage by 99%
- if (damage / 99 > 0) damage/= 99;
- else damage = 1;
-
- //Prevent death in non-weakened state
- if (damage >= m_creature->GetHealth())
- damage = 0;
-
- return;
- }
- break;
-
- case 4:
- {
- //Weakened - takes normal damage
- return;
- }
-
- default:
- damage = 0;
- break;
- }
- }
-
- void FleshTentcleKilled()
- {
- FleshTentaclesKilled++;
- }
-};
-
-struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
-{
- eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- Reset();
- Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
- }
-
- uint32 MindflayTimer;
- uint32 KillSelfTimer;
- uint64 Portal;
-
- void JustDied(Unit*)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- }
-
- void Reset()
- {
- //Mind flay half a second after we spawn
- MindflayTimer = 500;
-
- //This prevents eyes from overlapping
- KillSelfTimer = 35000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //KillSelfTimer
- if (KillSelfTimer < diff)
- {
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
-
- return;
- }else KillSelfTimer -= diff;
-
- //MindflayTimer
- if (MindflayTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
- DoCast(target,SPELL_MIND_FLAY);
-
- //Mindflay every 10 seconds
- MindflayTimer = 10100;
- }else MindflayTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
-{
- claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- Reset();
- Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
- }
-
- uint32 GroundRuptureTimer;
- uint32 HamstringTimer;
- uint32 EvadeTimer;
- uint64 Portal;
-
- void JustDied(Unit*)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- }
-
- void Reset()
- {
- //First rupture should happen half a second after we spawn
- GroundRuptureTimer = 500;
- HamstringTimer = 2000;
- EvadeTimer = 5000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //EvadeTimer
- if (m_creature->GetDistance(m_creature->getVictim()) > ATTACK_DISTANCE)
- if (EvadeTimer < diff)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
-
- //Dissapear and reappear at new position
- m_creature->SetVisibility(VISIBILITY_OFF);
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (!target)
- {
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- return;
- }
-
- if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
- {
- m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
-
- GroundRuptureTimer = 500;
- HamstringTimer = 2000;
- EvadeTimer = 5000;
- AttackStart(target);
- }
-
- m_creature->SetVisibility(VISIBILITY_ON);
-
- }else EvadeTimer -= diff;
-
- //GroundRuptureTimer
- if (GroundRuptureTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE);
- GroundRuptureTimer = 30000;
- }else GroundRuptureTimer -= diff;
-
- //HamstringTimer
- if (HamstringTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamstringTimer = 5000;
- }else HamstringTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
-{
- giant_claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- Reset();
- Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
- }
-
- uint32 GroundRuptureTimer;
- uint32 ThrashTimer;
- uint32 HamstringTimer;
- uint32 EvadeTimer;
- uint64 Portal;
-
- void JustDied(Unit*)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- }
-
- void Reset()
- {
- //First rupture should happen half a second after we spawn
- GroundRuptureTimer = 500;
- HamstringTimer = 2000;
- ThrashTimer = 5000;
- EvadeTimer = 5000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //EvadeTimer
- if (m_creature->GetDistance(m_creature->getVictim()) > ATTACK_DISTANCE)
- if (EvadeTimer < diff)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
-
- //Dissapear and reappear at new position
- m_creature->SetVisibility(VISIBILITY_OFF);
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!target)
- {
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- return;
- }
-
- if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
- {
- m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
-
- GroundRuptureTimer = 500;
- HamstringTimer = 2000;
- ThrashTimer = 5000;
- EvadeTimer = 5000;
- AttackStart(target);
- }
-
- m_creature->SetVisibility(VISIBILITY_ON);
-
- }else EvadeTimer -= diff;
-
- //GroundRuptureTimer
- if (GroundRuptureTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE);
- GroundRuptureTimer = 30000;
- }else GroundRuptureTimer -= diff;
-
- //ThrashTimer
- if (ThrashTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THRASH);
- ThrashTimer = 10000;
- }else ThrashTimer -= diff;
-
- //HamstringTimer
- if (HamstringTimer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamstringTimer = 10000;
- }else HamstringTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
-{
- giant_eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- Reset();
- Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (p)
- Portal = p->GetGUID();
- }
-
- uint32 BeamTimer;
- uint64 Portal;
-
- void JustDied(Unit*)
- {
- Unit* p = Unit::GetUnit(*m_creature, Portal);
- if (p)
- p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- }
-
- void Reset()
- {
- //Green Beam half a second after we spawn
- BeamTimer = 500;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //BeamTimer
- if (BeamTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
- DoCast(target,SPELL_GREEN_BEAM);
-
- //Beam every 2 seconds
- BeamTimer = 2100;
- }else BeamTimer -= diff;
- }
-};
-
-//Flesh tentacle functions
-void flesh_tentacleAI::UpdateAI(const uint32 diff)
-{
- //Check if we have a target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (Parent)
- if (CheckTimer < diff)
- {
- Unit* pUnit = Unit::GetUnit(*m_creature, Parent);
-
- if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat())
- {
- Parent = 0;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
- return;
- }
-
- CheckTimer = 1000;
- }else CheckTimer -= diff;
-
- DoMeleeAttackIfReady();
-}
-
-void flesh_tentacleAI::JustDied(Unit* killer)
-{
- if (!Parent)
- {
- DoYell("Error: No Parent variable", LANG_UNIVERSAL, NULL);
- return;
- }
-
- Creature* Cthun = (Creature*)Unit::GetUnit(*m_creature, Parent);
-
- if (Cthun)
- ((cthunAI*)(Cthun->AI()))->FleshTentcleKilled();
- else DoYell("Error: No Cthun", LANG_UNIVERSAL, NULL);
-}
-
-//GetAIs
-CreatureAI* GetAI_eye_of_cthun(Creature *_Creature)
-{
- return new eye_of_cthunAI (_Creature);
-}
-
-CreatureAI* GetAI_cthun(Creature *_Creature)
-{
- return new cthunAI (_Creature);
-}
-
-CreatureAI* GetAI_eye_tentacle(Creature *_Creature)
-{
- return new eye_tentacleAI (_Creature);
-}
-
-CreatureAI* GetAI_claw_tentacle(Creature *_Creature)
-{
- return new claw_tentacleAI (_Creature);
-}
-
-CreatureAI* GetAI_giant_claw_tentacle(Creature *_Creature)
-{
- return new giant_claw_tentacleAI (_Creature);
-}
-
-CreatureAI* GetAI_giant_eye_tentacle(Creature *_Creature)
-{
- return new giant_eye_tentacleAI (_Creature);
-}
-
-CreatureAI* GetAI_flesh_tentacle(Creature *_Creature)
-{
- return new flesh_tentacleAI (_Creature);
-}
-
-void AddSC_boss_cthun()
-{
- Script *newscript;
-
- //Eye
- newscript = new Script;
- newscript->Name="boss_eye_of_cthun";
- newscript->GetAI = GetAI_eye_of_cthun;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_cthun";
- newscript->GetAI = GetAI_cthun;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_eye_tentacle";
- newscript->GetAI = GetAI_eye_tentacle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_claw_tentacle";
- newscript->GetAI = GetAI_claw_tentacle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_giant_claw_tentacle";
- newscript->GetAI = GetAI_giant_claw_tentacle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_giant_eye_tentacle";
- newscript->GetAI = GetAI_giant_eye_tentacle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_giant_flesh_tentacle";
- newscript->GetAI = GetAI_flesh_tentacle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Cthun
+SD%Complete: 95
+SDComment: Darkglare tracking issue
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+
+#define PI 3.14
+
+//****** Out of Combat ******
+//Random Wispers - No txt only sound
+#define RND_WISPER_1 8580 //Death is close
+#define RND_WISPER_2 8581 //You are already dead
+#define RND_WISPER_3 8582 //Your courage will fail
+#define RND_WISPER_4 8583 //Your friends will abandon you
+#define RND_WISPER_5 8584 //You will betray your friends
+#define RND_WISPER_6 8585 //You will die
+#define RND_WISPER_7 8586 //You are weak
+#define RND_WISPER_8 8587 //Your heart will explode
+
+//***** Phase 1 ********
+
+//Mobs
+#define BOSS_EYE_OF_CTHUN 15589
+#define MOB_CLAW_TENTACLE 15725
+#define MOB_EYE_TENTACLE 15726
+#define MOB_SMALL_PORTAL 15904
+
+//Eye Spells
+#define SPELL_GREEN_BEAM 26134
+#define SPELL_DARK_GLARE 26029
+#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar
+
+//Eye Tentacles Spells
+#define SPELL_MIND_FLAY 26143
+
+//Claw Tentacles Spells
+#define SPELL_GROUND_RUPTURE 26139
+#define SPELL_HAMSTRING 26141
+
+#define MOB_
+
+//*****Phase 2******
+//Body spells
+//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs
+#define SPELL_TRANSFORM 26232
+
+//Eye Tentacles Spells
+//SAME AS PHASE1
+
+//Giant Claw Tentacles
+#define SPELL_MASSIVE_GROUND_RUPTURE 26100
+
+//Also casts Hamstring
+#define SPELL_THRASH 3391
+
+//Giant Eye Tentacles
+//CHAIN CASTS "SPELL_GREEN_BEAM"
+
+//Stomach Spells
+#define SPELL_MOUTH_TENTACLE 26332
+#define SPELL_EXIT_STOMACH_KNOCKBACK 25383
+#define SPELL_DIGESTIVE_ACID 26476
+
+//Mobs
+#define MOB_BODY_OF_CTHUN 15809
+#define MOB_GIANT_CLAW_TENTACLE 15728
+#define MOB_GIANT_EYE_TENTACLE 15334
+#define MOB_FLESH_TENTACLE 15802
+#define MOB_GIANT_PORTAL 15910
+
+//Text emote
+#define EMOTE_WEAKENED "is weakened!"
+
+//Stomach Teleport positions
+#define STOMACH_X -8562.0f
+#define STOMACH_Y 2037.0f
+#define STOMACH_Z -70.0f
+#define STOMACH_O 5.05f
+
+//Flesh tentacle positions
+#define TENTACLE_POS1_X -8571.0f
+#define TENTACLE_POS1_Y 1990.0f
+#define TENTACLE_POS1_Z -98.0f
+#define TENTACLE_POS1_O 1.22f
+
+#define TENTACLE_POS2_X -8525.0f
+#define TENTACLE_POS2_Y 1994.0f
+#define TENTACLE_POS2_Z -98.0f
+#define TENTACLE_POS2_O 2.12f
+
+//Kick out position
+#define KICK_X -8545.0f
+#define KICK_Y 1984.0f
+#define KICK_Z -96.0f
+
+struct TRINITY_DLL_DECL flesh_tentacleAI : public Scripted_NoMovementAI
+{
+ flesh_tentacleAI(Creature *c) : Scripted_NoMovementAI(c), Parent(0) {Reset();}
+
+ uint64 Parent;
+ uint32 CheckTimer;
+
+ void SpawnedByCthun(uint64 p)
+ {
+ Parent = p;
+ }
+
+ void Reset()
+ {
+ CheckTimer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff);
+
+ void JustDied(Unit* killer);
+};
+
+struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI
+{
+ eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ pInst = (ScriptedInstance*)c->GetInstanceData();
+ if (!pInst)
+ error_log("SD2: No Instance eye_of_cthunAI");
+
+ Reset();
+ }
+
+ ScriptedInstance* pInst;
+
+ //Global variables
+ uint32 PhaseTimer;
+
+ //Eye beam phase
+ uint32 BeamTimer;
+ uint32 EyeTentacleTimer;
+ uint32 ClawTentacleTimer;
+
+ //Dark Glare phase
+ uint32 DarkGlareTick;
+ uint32 DarkGlareTickTimer;
+ float DarkGlareAngle;
+ bool ClockWise;
+
+ void Reset()
+ {
+ //Phase information
+ PhaseTimer = 50000; //First dark glare in 50 seconds
+
+ //Eye beam phase 50 seconds
+ BeamTimer = 3000;
+ EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
+ ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam)
+
+ //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks)
+ DarkGlareTick = 0;
+ DarkGlareTickTimer = 1000;
+ DarkGlareAngle = 0;
+ ClockWise = false;
+
+ //Reset flags
+ m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+
+ //Reset Phase
+ if (pInst)
+ pInst->SetData(DATA_CTHUN_PHASE, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void SpawnEyeTentacle(float x, float y)
+ {
+ Creature* Spawned;
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
+ if (Spawned)
+ {
+ Unit* target;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if (target)
+ Spawned->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //No instance
+ if (!pInst)
+ return;
+
+ switch (pInst->GetData(DATA_CTHUN_PHASE))
+ {
+ case 0:
+ {
+ //BeamTimer
+ if (BeamTimer < diff)
+ {
+ //SPELL_GREEN_BEAM
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(target,SPELL_GREEN_BEAM);
+
+ //Correctly update our target
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
+ }
+
+ //Beam every 3 seconds
+ BeamTimer = 3000;
+ }else BeamTimer -= diff;
+
+ //ClawTentacleTimer
+ if (ClawTentacleTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ {
+ Creature* Spawned = NULL;
+
+ //Spawn claw tentacle on the random target
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
+
+ if (Spawned)
+ Spawned->AI()->AttackStart(target);
+ }
+
+ //One claw tentacle every 12.5 seconds
+ ClawTentacleTimer = 12500;
+ }else ClawTentacleTimer -= diff;
+
+ //EyeTentacleTimer
+ if (EyeTentacleTimer < diff)
+ {
+ //Spawn the 8 Eye Tentacles in the corret spots
+ SpawnEyeTentacle(0, 20); //south
+ SpawnEyeTentacle(10, 10); //south west
+ SpawnEyeTentacle(20, 0); //west
+ SpawnEyeTentacle(10, -10); //north west
+
+ SpawnEyeTentacle(0, -20); //north
+ SpawnEyeTentacle(-10, -10); //north east
+ SpawnEyeTentacle(-20, 0); // east
+ SpawnEyeTentacle(-10, 10); // south east
+
+ //No point actually putting a timer here since
+ //These shouldn't trigger agian until after phase shifts
+ EyeTentacleTimer = 45000;
+ }else EyeTentacleTimer -= diff;
+
+ //PhaseTimer
+ if (PhaseTimer < diff)
+ {
+ //Switch to Dark Beam
+ pInst->SetData(DATA_CTHUN_PHASE, 1);
+
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Select random target for dark beam to start on
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ if (target)
+ {
+ //Correctly update our target
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
+
+ //Face our target
+ DarkGlareAngle = m_creature->GetAngle(target);
+ DarkGlareTickTimer = 1000;
+ DarkGlareTick = 0;
+ ClockWise = rand()%2;
+ }
+
+ //Add red coloration to C'thun
+ DoCast(m_creature,SPELL_RED_COLORATION);
+
+ //Freeze animation
+ m_creature->setEmoteState(53);
+
+ //Darkbeam for 35 seconds
+ PhaseTimer = 35000;
+ }else PhaseTimer -= diff;
+
+ }
+ break;
+ case 1:
+ {
+ //EyeTentacleTimer
+ if (DarkGlareTick < 35)
+ if (DarkGlareTickTimer < diff)
+ {
+ //Remove any target
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ //Set angle and cast
+ if (ClockWise)
+ m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
+ else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
+
+ m_creature->StopMoving();
+
+ //Actual dark glare cast, maybe something missing here?
+ m_creature->CastSpell(NULL, SPELL_DARK_GLARE, false);
+
+ //Increase tick
+ DarkGlareTick++;
+
+ //1 second per tick
+ DarkGlareTickTimer = 1000;
+ }else DarkGlareTickTimer -= diff;
+
+ //PhaseTimer
+ if (PhaseTimer < diff)
+ {
+ //Switch to Eye Beam
+ pInst->SetData(DATA_CTHUN_PHASE, 0);
+
+ BeamTimer = 3000;
+ EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
+ ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam)
+
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Remove Red coloration from c'thun
+ m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+
+ //Freeze animation
+ m_creature->setEmoteState(0);
+ m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
+
+ //Eye Beam for 50 seconds
+ PhaseTimer = 50000;
+ }else PhaseTimer -= diff;
+ }break;
+
+ //Transition phase
+ case 2:
+ {
+ //Remove any target
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ m_creature->SetHealth(0);
+ }
+
+ //Dead phase
+ case 5:
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ }
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ //No instance
+ if (!pInst)
+ return;
+
+ switch (pInst->GetData(DATA_CTHUN_PHASE))
+ {
+ case 0:
+ case 1:
+ {
+ //Only if it will kill
+ if (damage < m_creature->GetHealth())
+ return;
+
+ //Fake death in phase 0 or 1 (green beam or dark glare phase)
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Remove Red coloration from c'thun
+ m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+
+ //Reset to normal emote state and prevent select and attack
+ m_creature->setEmoteState(0);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+
+ //Remove Target field
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ //Death animation/respawning;
+ pInst->SetData(DATA_CTHUN_PHASE, 2);
+
+ m_creature->SetHealth(0);
+ damage = 0;
+
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ }
+ break;
+
+ case 5:
+ {
+ //Allow death here
+ return;
+ }
+
+ default:
+ {
+ //Prevent death in this phase
+ damage = 0;
+ return;
+ }
+ break;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI
+{
+ cthunAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ pInst = (ScriptedInstance*)c->GetInstanceData();
+ if (!pInst)
+ error_log("SD2: No Instance eye_of_cthunAI");
+
+ Reset();
+ }
+
+ ScriptedInstance* pInst;
+
+ //Out of combat whisper timer
+ uint32 WisperTimer;
+
+ //Global variables
+ uint32 PhaseTimer;
+
+ //-------------------
+
+ //Phase transition
+ uint64 HoldPlayer;
+
+ //Body Phase
+ uint32 EyeTentacleTimer;
+ uint8 FleshTentaclesKilled;
+ uint32 GiantClawTentacleTimer;
+ uint32 GiantEyeTentacleTimer;
+ uint32 StomachAcidTimer;
+ uint32 StomachEnterTimer;
+ uint32 StomachEnterVisTimer;
+ uint64 StomachEnterTarget;
+
+ //Stomach map, bool = true then in stomach
+ HM_NAMESPACE::hash_map<uint64, bool> Stomach_Map;
+
+ void Reset()
+ {
+ //One random wisper every 90 - 300 seconds
+ WisperTimer = 90000;
+
+ //Phase information
+ PhaseTimer = 10000; //Emerge in 10 seconds
+
+ //No hold player for transition
+ HoldPlayer = 0;
+
+ //Body Phase
+ EyeTentacleTimer = 30000;
+ FleshTentaclesKilled = 0;
+ GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat)
+ GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat)
+ StomachAcidTimer = 4000; //Every 4 seconds
+ StomachEnterTimer = 10000; //Every 10 seconds
+ StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
+ StomachEnterTarget = 0; //Target to be teleported to stomach
+
+ //Clear players in stomach and outside
+ Stomach_Map.clear();
+
+ //Reset flags
+ m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+
+ if (pInst)
+ pInst->SetData(DATA_CTHUN_PHASE, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void SpawnEyeTentacle(float x, float y)
+ {
+ Creature* Spawned;
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
+ if (Spawned)
+ {
+ Unit* target;
+
+ target = SelectRandomNotStomach();
+
+ if (target)
+ Spawned->AI()->AttackStart(target);
+ }
+ }
+
+ Unit* SelectRandomNotStomach()
+ {
+ if (Stomach_Map.empty())
+ return NULL;
+
+ HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
+
+ std::list<Unit*> temp;
+ std::list<Unit*>::iterator j;
+
+ //Get all players in map
+ while (i != Stomach_Map.end())
+ {
+ //Check for valid player
+ Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+
+ //Only units out of stomach
+ if (pUnit && i->second == false)
+ {
+ temp.push_back(pUnit);
+ }
+ ++i;
+ }
+
+ if (temp.empty())
+ return NULL;
+
+ j = temp.begin();
+
+ //Get random but only if we have more than one unit on threat list
+ if (temp.size() > 1)
+ advance ( i , rand() % (temp.size() - 1) );
+
+ return (*j);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ {
+ //No target so we'll use this section to do our random wispers instance wide
+ //WisperTimer
+ if (WisperTimer < diff)
+ {
+ Map *map = m_creature->GetMap();
+ if(!map->IsDungeon()) return;
+
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
+ for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ //Play random sound to the zone
+ switch (rand()%8)
+ {
+ case 0: (*i)->SendPlaySound(RND_WISPER_1, true); break;
+ case 1: (*i)->SendPlaySound(RND_WISPER_2, true); break;
+ case 2: (*i)->SendPlaySound(RND_WISPER_3, true); break;
+ case 3: (*i)->SendPlaySound(RND_WISPER_4, true); break;
+ case 4: (*i)->SendPlaySound(RND_WISPER_5, true); break;
+ case 5: (*i)->SendPlaySound(RND_WISPER_6, true); break;
+ case 6: (*i)->SendPlaySound(RND_WISPER_7, true); break;
+ case 7: (*i)->SendPlaySound(RND_WISPER_8, true); break;
+ }
+ }
+
+ //One random wisper every 90 - 300 seconds
+ WisperTimer = 90000 + (rand()% 210000);
+ }else WisperTimer -= diff;
+
+ return;
+ }
+
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ //No instance
+ if (!pInst)
+ return;
+
+ switch (pInst->GetData(DATA_CTHUN_PHASE))
+ {
+ //Transition phase
+ case 2:
+ {
+ //PhaseTimer
+ if (PhaseTimer < diff)
+ {
+ //Switch
+ pInst->SetData(DATA_CTHUN_PHASE, 3);
+
+ //Switch to c'thun model
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_TRANSFORM, false);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+
+ //Emerging phase
+ //AttackStart(Unit::GetUnit(*m_creature, HoldPlayer));
+ DoZoneInCombat();
+
+ //Place all units in threat list on outside of stomach
+ Stomach_Map.clear();
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ //Outside stomach
+ Stomach_Map[(*i)->getUnitGuid()] = false;
+ }
+
+ //Spawn 2 flesh tentacles
+ FleshTentaclesKilled = 0;
+
+ Creature* Spawned;
+
+ //Spawn flesh tentacle
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ if (!Spawned)
+ FleshTentaclesKilled++;
+ else
+ ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
+
+ //Spawn flesh tentacle
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ if (!Spawned)
+ FleshTentaclesKilled++;
+ else
+ ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
+
+ PhaseTimer = 0;
+ }else PhaseTimer -= diff;
+
+ }break;
+
+ //Body Phase
+ case 3:
+ {
+ //Remove Target field
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ //Weaken
+ if (FleshTentaclesKilled > 1)
+ {
+ pInst->SetData(DATA_CTHUN_PHASE, 4);
+
+ DoTextEmote(EMOTE_WEAKENED, NULL);
+ PhaseTimer = 45000;
+
+ DoCast(m_creature, SPELL_RED_COLORATION, true);
+
+ HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
+
+ //Kick all players out of stomach
+ while (i != Stomach_Map.end())
+ {
+ //Check for valid player
+ Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+
+ //Only move units in stomach
+ if (pUnit && i->second == true)
+ {
+ //Teleport each player out
+ DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
+
+ //Cast knockback on them
+ DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
+
+ //Remove the acid debuff
+ pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
+
+ i->second = false;
+ }
+ ++i;
+ }
+
+ return;
+ }
+
+ //Stomach acid
+ if (StomachAcidTimer < diff)
+ {
+ //Apply aura to all players in stomach
+ HM_NAMESPACE::hash_map<uint64, bool>::iterator i = Stomach_Map.begin();
+
+ while (i != Stomach_Map.end())
+ {
+ //Check for valid player
+ Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
+
+ //Only apply to units in stomach
+ if (pUnit && i->second == true)
+ {
+ //Cast digestive acid on them
+ DoCast(pUnit, SPELL_DIGESTIVE_ACID, true);
+
+ //Check if player should be kicked from stomach
+ if (pUnit->GetDistance(KICK_X, KICK_Y, KICK_Z) < 15)
+ {
+ //Teleport each player out
+ DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
+
+ //Cast knockback on them
+ DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
+
+ //Remove the acid debuff
+ pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
+
+ i->second = false;
+ }
+ }
+ ++i;
+ }
+
+ StomachAcidTimer = 4000;
+ }else StomachAcidTimer -= diff;
+
+ //Stomach Enter Timer
+ if (StomachEnterTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectRandomNotStomach();
+
+ if (target)
+ {
+ //Set target in stomach
+ Stomach_Map[target->GetGUID()] = true;
+ target->InterruptNonMeleeSpells(false);
+ target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID());
+ StomachEnterTarget = target->GetGUID();
+ StomachEnterVisTimer = 3800;
+ }
+
+ StomachEnterTimer = 13800;
+ }else StomachEnterTimer -= diff;
+
+ if (StomachEnterVisTimer && StomachEnterTarget)
+ if (StomachEnterVisTimer <= diff)
+ {
+ //Check for valid player
+ Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget);
+
+ if (pUnit)
+ {
+ DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O);
+ }
+
+ StomachEnterTarget = 0;
+ StomachEnterVisTimer = 0;
+ }else StomachEnterVisTimer -= diff;
+
+ //GientClawTentacleTimer
+ if (GiantClawTentacleTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectRandomNotStomach();
+ if (target)
+ {
+ Creature* Spawned = NULL;
+
+ //Spawn claw tentacle on the random target
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
+
+ if (Spawned)
+ Spawned->AI()->AttackStart(target);
+ }
+
+ //One giant claw tentacle every minute
+ GiantClawTentacleTimer = 60000;
+ }else GiantClawTentacleTimer -= diff;
+
+ //GiantEyeTentacleTimer
+ if (GiantEyeTentacleTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectRandomNotStomach();
+ if (target)
+ {
+
+ Creature* Spawned = NULL;
+
+ //Spawn claw tentacle on the random target
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500);
+
+ if (Spawned)
+ Spawned->AI()->AttackStart(target);
+ }
+
+ //One giant eye tentacle every minute
+ GiantEyeTentacleTimer = 60000;
+ }else GiantEyeTentacleTimer -= diff;
+
+ //EyeTentacleTimer
+ if (EyeTentacleTimer < diff)
+ {
+ //Spawn the 8 Eye Tentacles in the corret spots
+ SpawnEyeTentacle(0, 25); //south
+ SpawnEyeTentacle(12, 12); //south west
+ SpawnEyeTentacle(25, 0); //west
+ SpawnEyeTentacle(12, -12); //north west
+
+ SpawnEyeTentacle(0, -25); //north
+ SpawnEyeTentacle(-12, -12); //north east
+ SpawnEyeTentacle(-25, 0); // east
+ SpawnEyeTentacle(-12, 12); // south east
+
+ //These spawn at every 30 seconds
+ EyeTentacleTimer = 30000;
+ }else EyeTentacleTimer -= diff;
+
+ }break;
+
+ //Weakened state
+ case 4:
+ {
+ //PhaseTimer
+ if (PhaseTimer < diff)
+ {
+ //Switch
+ pInst->SetData(DATA_CTHUN_PHASE, 3);
+
+ //Remove red coloration
+ m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
+
+ //Spawn 2 flesh tentacles
+ FleshTentaclesKilled = 0;
+
+ Creature* Spawned;
+
+ //Spawn flesh tentacle
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ if (!Spawned)
+ FleshTentaclesKilled++;
+ else
+ ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
+
+ //Spawn flesh tentacle
+ Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ if (!Spawned)
+ FleshTentaclesKilled++;
+ else
+ ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID());
+
+ PhaseTimer = 0;
+ }else PhaseTimer -= diff;
+ }
+ }
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ //Switch
+ if( pInst )
+ pInst->SetData(DATA_CTHUN_PHASE, 5);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ //No instance
+ if (!pInst)
+ return;
+
+ switch (pInst->GetData(DATA_CTHUN_PHASE))
+ {
+ case 3:
+ {
+ //Not weakened so reduce damage by 99%
+ if (damage / 99 > 0) damage/= 99;
+ else damage = 1;
+
+ //Prevent death in non-weakened state
+ if (damage >= m_creature->GetHealth())
+ damage = 0;
+
+ return;
+ }
+ break;
+
+ case 4:
+ {
+ //Weakened - takes normal damage
+ return;
+ }
+
+ default:
+ damage = 0;
+ break;
+ }
+ }
+
+ void FleshTentcleKilled()
+ {
+ FleshTentaclesKilled++;
+ }
+};
+
+struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
+{
+ eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ Reset();
+ Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+ }
+
+ uint32 MindflayTimer;
+ uint32 KillSelfTimer;
+ uint64 Portal;
+
+ void JustDied(Unit*)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ }
+
+ void Reset()
+ {
+ //Mind flay half a second after we spawn
+ MindflayTimer = 500;
+
+ //This prevents eyes from overlapping
+ KillSelfTimer = 35000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //KillSelfTimer
+ if (KillSelfTimer < diff)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+
+ return;
+ }else KillSelfTimer -= diff;
+
+ //MindflayTimer
+ if (MindflayTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ DoCast(target,SPELL_MIND_FLAY);
+
+ //Mindflay every 10 seconds
+ MindflayTimer = 10100;
+ }else MindflayTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
+{
+ claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ Reset();
+ Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+ }
+
+ uint32 GroundRuptureTimer;
+ uint32 HamstringTimer;
+ uint32 EvadeTimer;
+ uint64 Portal;
+
+ void JustDied(Unit*)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ }
+
+ void Reset()
+ {
+ //First rupture should happen half a second after we spawn
+ GroundRuptureTimer = 500;
+ HamstringTimer = 2000;
+ EvadeTimer = 5000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //EvadeTimer
+ if (m_creature->GetDistance(m_creature->getVictim()) > ATTACK_DISTANCE)
+ if (EvadeTimer < diff)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+
+ //Dissapear and reappear at new position
+ m_creature->SetVisibility(VISIBILITY_OFF);
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (!target)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ return;
+ }
+
+ if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ {
+ m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+
+ GroundRuptureTimer = 500;
+ HamstringTimer = 2000;
+ EvadeTimer = 5000;
+ AttackStart(target);
+ }
+
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ }else EvadeTimer -= diff;
+
+ //GroundRuptureTimer
+ if (GroundRuptureTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE);
+ GroundRuptureTimer = 30000;
+ }else GroundRuptureTimer -= diff;
+
+ //HamstringTimer
+ if (HamstringTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamstringTimer = 5000;
+ }else HamstringTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
+{
+ giant_claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ Reset();
+ Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+ }
+
+ uint32 GroundRuptureTimer;
+ uint32 ThrashTimer;
+ uint32 HamstringTimer;
+ uint32 EvadeTimer;
+ uint64 Portal;
+
+ void JustDied(Unit*)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ }
+
+ void Reset()
+ {
+ //First rupture should happen half a second after we spawn
+ GroundRuptureTimer = 500;
+ HamstringTimer = 2000;
+ ThrashTimer = 5000;
+ EvadeTimer = 5000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //EvadeTimer
+ if (m_creature->GetDistance(m_creature->getVictim()) > ATTACK_DISTANCE)
+ if (EvadeTimer < diff)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+
+ //Dissapear and reappear at new position
+ m_creature->SetVisibility(VISIBILITY_OFF);
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (!target)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ return;
+ }
+
+ if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ {
+ m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+
+ GroundRuptureTimer = 500;
+ HamstringTimer = 2000;
+ ThrashTimer = 5000;
+ EvadeTimer = 5000;
+ AttackStart(target);
+ }
+
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ }else EvadeTimer -= diff;
+
+ //GroundRuptureTimer
+ if (GroundRuptureTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE);
+ GroundRuptureTimer = 30000;
+ }else GroundRuptureTimer -= diff;
+
+ //ThrashTimer
+ if (ThrashTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THRASH);
+ ThrashTimer = 10000;
+ }else ThrashTimer -= diff;
+
+ //HamstringTimer
+ if (HamstringTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamstringTimer = 10000;
+ }else HamstringTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
+{
+ giant_eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ Reset();
+ Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (p)
+ Portal = p->GetGUID();
+ }
+
+ uint32 BeamTimer;
+ uint64 Portal;
+
+ void JustDied(Unit*)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, Portal);
+ if (p)
+ p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ }
+
+ void Reset()
+ {
+ //Green Beam half a second after we spawn
+ BeamTimer = 500;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //BeamTimer
+ if (BeamTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ DoCast(target,SPELL_GREEN_BEAM);
+
+ //Beam every 2 seconds
+ BeamTimer = 2100;
+ }else BeamTimer -= diff;
+ }
+};
+
+//Flesh tentacle functions
+void flesh_tentacleAI::UpdateAI(const uint32 diff)
+{
+ //Check if we have a target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (Parent)
+ if (CheckTimer < diff)
+ {
+ Unit* pUnit = Unit::GetUnit(*m_creature, Parent);
+
+ if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat())
+ {
+ Parent = 0;
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
+ return;
+ }
+
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+}
+
+void flesh_tentacleAI::JustDied(Unit* killer)
+{
+ if (!Parent)
+ {
+ DoYell("Error: No Parent variable", LANG_UNIVERSAL, NULL);
+ return;
+ }
+
+ Creature* Cthun = (Creature*)Unit::GetUnit(*m_creature, Parent);
+
+ if (Cthun)
+ ((cthunAI*)(Cthun->AI()))->FleshTentcleKilled();
+ else DoYell("Error: No Cthun", LANG_UNIVERSAL, NULL);
+}
+
+//GetAIs
+CreatureAI* GetAI_eye_of_cthun(Creature *_Creature)
+{
+ return new eye_of_cthunAI (_Creature);
+}
+
+CreatureAI* GetAI_cthun(Creature *_Creature)
+{
+ return new cthunAI (_Creature);
+}
+
+CreatureAI* GetAI_eye_tentacle(Creature *_Creature)
+{
+ return new eye_tentacleAI (_Creature);
+}
+
+CreatureAI* GetAI_claw_tentacle(Creature *_Creature)
+{
+ return new claw_tentacleAI (_Creature);
+}
+
+CreatureAI* GetAI_giant_claw_tentacle(Creature *_Creature)
+{
+ return new giant_claw_tentacleAI (_Creature);
+}
+
+CreatureAI* GetAI_giant_eye_tentacle(Creature *_Creature)
+{
+ return new giant_eye_tentacleAI (_Creature);
+}
+
+CreatureAI* GetAI_flesh_tentacle(Creature *_Creature)
+{
+ return new flesh_tentacleAI (_Creature);
+}
+
+void AddSC_boss_cthun()
+{
+ Script *newscript;
+
+ //Eye
+ newscript = new Script;
+ newscript->Name="boss_eye_of_cthun";
+ newscript->GetAI = GetAI_eye_of_cthun;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_cthun";
+ newscript->GetAI = GetAI_cthun;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_eye_tentacle";
+ newscript->GetAI = GetAI_eye_tentacle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_claw_tentacle";
+ newscript->GetAI = GetAI_claw_tentacle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_giant_claw_tentacle";
+ newscript->GetAI = GetAI_giant_claw_tentacle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_giant_eye_tentacle";
+ newscript->GetAI = GetAI_giant_eye_tentacle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_giant_flesh_tentacle";
+ newscript->GetAI = GetAI_flesh_tentacle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
index 81f8b1d7756..331e43d83ef 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
@@ -1,190 +1,190 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Fankriss
-SD%Complete: 100
-SDComment: sound not implemented
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SOUND_SENTENCE_YOU 8588
-#define SOUND_SERVE_TO 8589
-#define SOUND_LAWS 8590
-#define SOUND_TRESPASS 8591
-#define SOUND_WILL_BE 8592
-
-#define SPELL_MORTAL_WOUND 28467
-#define SPELL_ROOT 28858
-
-// Enrage for his spawns
-#define SPELL_ENRAGE 28798
-
-struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI
-{
- boss_fankrissAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MortalWound_Timer;
- uint32 SpawnHatchlings_Timer;
- uint32 SpawnSpawns_Timer;
- int Rand;
- int RandX;
- int RandY;
-
- Creature* Hatchling;
- Creature* Spawn;
-
- void Reset()
- {
- MortalWound_Timer = 10000 + rand()%5000;
- SpawnHatchlings_Timer = 6000 + rand()%6000;
- SpawnSpawns_Timer = 15000 + rand()%30000;
- }
-
- void SummonSpawn(Unit* victim)
- {
- Rand = 10 + (rand()%10);
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = 10 + (rand()%10);
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- if(Spawn)
- ((CreatureAI*)Spawn->AI())->AttackStart(victim);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //MortalWound_Timer
- if (MortalWound_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND);
- MortalWound_Timer = 10000 + rand()%10000;
- }else MortalWound_Timer -= diff;
-
- //Summon 1-3 Spawns of Fankriss at random time.
- if (SpawnSpawns_Timer < diff)
- {
- switch(rand()%3)
- {
- case 0:
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- break;
- case 1:
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- break;
- case 2:
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
- break;
- }
- SpawnSpawns_Timer = 30000 + rand()%30000;
- }else SpawnSpawns_Timer -= diff;
-
- // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer.
- //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot.
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3 )
- {
- if(SpawnHatchlings_Timer< diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoCast(target, SPELL_ROOT);
-
- if(m_creature->getThreatManager().getThreat(target))
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
-
- switch(rand()%3)
- {
- case 0:
- DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- break;
- case 1:
- DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- break;
- case 2:
- DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- ((CreatureAI*)Hatchling->AI())->AttackStart(target);
- break;
- }
- }
- SpawnHatchlings_Timer = 45000 + rand()%15000;
- }else SpawnHatchlings_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_fankriss(Creature *_Creature)
-{
- return new boss_fankrissAI (_Creature);
-}
-
-void AddSC_boss_fankriss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_fankriss";
- newscript->GetAI = GetAI_boss_fankriss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Fankriss
+SD%Complete: 100
+SDComment: sound not implemented
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SOUND_SENTENCE_YOU 8588
+#define SOUND_SERVE_TO 8589
+#define SOUND_LAWS 8590
+#define SOUND_TRESPASS 8591
+#define SOUND_WILL_BE 8592
+
+#define SPELL_MORTAL_WOUND 28467
+#define SPELL_ROOT 28858
+
+// Enrage for his spawns
+#define SPELL_ENRAGE 28798
+
+struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI
+{
+ boss_fankrissAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MortalWound_Timer;
+ uint32 SpawnHatchlings_Timer;
+ uint32 SpawnSpawns_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+
+ Creature* Hatchling;
+ Creature* Spawn;
+
+ void Reset()
+ {
+ MortalWound_Timer = 10000 + rand()%5000;
+ SpawnHatchlings_Timer = 6000 + rand()%6000;
+ SpawnSpawns_Timer = 15000 + rand()%30000;
+ }
+
+ void SummonSpawn(Unit* victim)
+ {
+ Rand = 10 + (rand()%10);
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = 10 + (rand()%10);
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ if(Spawn)
+ ((CreatureAI*)Spawn->AI())->AttackStart(victim);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //MortalWound_Timer
+ if (MortalWound_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND);
+ MortalWound_Timer = 10000 + rand()%10000;
+ }else MortalWound_Timer -= diff;
+
+ //Summon 1-3 Spawns of Fankriss at random time.
+ if (SpawnSpawns_Timer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ break;
+ case 1:
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ break;
+ case 2:
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0));
+ break;
+ }
+ SpawnSpawns_Timer = 30000 + rand()%30000;
+ }else SpawnSpawns_Timer -= diff;
+
+ // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer.
+ //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot.
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3 )
+ {
+ if(SpawnHatchlings_Timer< diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(target, SPELL_ROOT);
+
+ if(m_creature->getThreatManager().getThreat(target))
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+
+ switch(rand()%3)
+ {
+ case 0:
+ DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ break;
+ case 1:
+ DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ break;
+ case 2:
+ DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ ((CreatureAI*)Hatchling->AI())->AttackStart(target);
+ break;
+ }
+ }
+ SpawnHatchlings_Timer = 45000 + rand()%15000;
+ }else SpawnHatchlings_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_fankriss(Creature *_Creature)
+{
+ return new boss_fankrissAI (_Creature);
+}
+
+void AddSC_boss_fankriss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_fankriss";
+ newscript->GetAI = GetAI_boss_fankriss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
index 2de642f96c1..7fb10528dff 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
@@ -1,143 +1,143 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Huhuran
-SD%Complete: 100
-SDComment:
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FRENZY 26051
-#define SPELL_BERSERK 26068
-#define SPELL_POISONBOLT 26052
-#define SPELL_NOXIOUSPOISON 26053
-#define SPELL_WYVERNSTING 26180
-#define SPELL_ACIDSPIT 26050
-
-struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI
-{
- boss_huhuranAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Frenzy_Timer;
- uint32 Wyvern_Timer;
- uint32 Spit_Timer;
- uint32 PoisonBolt_Timer;
- uint32 NoxiousPoison_Timer;
- uint32 FrenzyBack_Timer;
-
- bool Frenzy;
- bool Berserk;
-
- void Reset()
- {
- Frenzy_Timer = 25000 + rand()%10000;
- Wyvern_Timer = 18000 + rand()%10000;
- Spit_Timer = 8000;
- PoisonBolt_Timer = 4000;
- NoxiousPoison_Timer = 10000 + rand()%10000;
- FrenzyBack_Timer = 15000;
-
- Frenzy = false;
- Berserk = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Frenzy_Timer
- if (!Frenzy && Frenzy_Timer < diff)
- {
- DoCast(m_creature, SPELL_FRENZY);
- Frenzy = true;
- PoisonBolt_Timer = 3000;
- Frenzy_Timer = 25000 + rand()%10000;
- }else Frenzy_Timer -= diff;
-
- // Wyvern Timer
- if (Wyvern_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_WYVERNSTING);
- Wyvern_Timer = 15000 + rand()%17000;
- }else Wyvern_Timer -= diff;
-
- //Spit Timer
- if (Spit_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ACIDSPIT);
- Spit_Timer = 5000 + rand()%5000;
- }else Spit_Timer -= diff;
-
- //NoxiousPoison_Timer
- if (NoxiousPoison_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON);
- NoxiousPoison_Timer = 12000 + rand()%12000;
- }else NoxiousPoison_Timer -= diff;
-
- //PoisonBolt only if frenzy or berserk
- if (Frenzy || Berserk)
- {
- if (PoisonBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POISONBOLT);
- PoisonBolt_Timer = 3000;
- }else PoisonBolt_Timer -= diff;
- }
-
- //FrenzyBack_Timer
- if (Frenzy && FrenzyBack_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- Frenzy = false;
- FrenzyBack_Timer = 15000;
- }else FrenzyBack_Timer -= diff;
-
- if ( !Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31 )
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoTextEmote("is going berserk", NULL);
- DoCast(m_creature, SPELL_BERSERK);
- Berserk = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_huhuran(Creature *_Creature)
-{
- return new boss_huhuranAI (_Creature);
-}
-
-void AddSC_boss_huhuran()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_huhuran";
- newscript->GetAI = GetAI_boss_huhuran;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Huhuran
+SD%Complete: 100
+SDComment:
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FRENZY 26051
+#define SPELL_BERSERK 26068
+#define SPELL_POISONBOLT 26052
+#define SPELL_NOXIOUSPOISON 26053
+#define SPELL_WYVERNSTING 26180
+#define SPELL_ACIDSPIT 26050
+
+struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI
+{
+ boss_huhuranAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Frenzy_Timer;
+ uint32 Wyvern_Timer;
+ uint32 Spit_Timer;
+ uint32 PoisonBolt_Timer;
+ uint32 NoxiousPoison_Timer;
+ uint32 FrenzyBack_Timer;
+
+ bool Frenzy;
+ bool Berserk;
+
+ void Reset()
+ {
+ Frenzy_Timer = 25000 + rand()%10000;
+ Wyvern_Timer = 18000 + rand()%10000;
+ Spit_Timer = 8000;
+ PoisonBolt_Timer = 4000;
+ NoxiousPoison_Timer = 10000 + rand()%10000;
+ FrenzyBack_Timer = 15000;
+
+ Frenzy = false;
+ Berserk = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Frenzy_Timer
+ if (!Frenzy && Frenzy_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_FRENZY);
+ Frenzy = true;
+ PoisonBolt_Timer = 3000;
+ Frenzy_Timer = 25000 + rand()%10000;
+ }else Frenzy_Timer -= diff;
+
+ // Wyvern Timer
+ if (Wyvern_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_WYVERNSTING);
+ Wyvern_Timer = 15000 + rand()%17000;
+ }else Wyvern_Timer -= diff;
+
+ //Spit Timer
+ if (Spit_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ACIDSPIT);
+ Spit_Timer = 5000 + rand()%5000;
+ }else Spit_Timer -= diff;
+
+ //NoxiousPoison_Timer
+ if (NoxiousPoison_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON);
+ NoxiousPoison_Timer = 12000 + rand()%12000;
+ }else NoxiousPoison_Timer -= diff;
+
+ //PoisonBolt only if frenzy or berserk
+ if (Frenzy || Berserk)
+ {
+ if (PoisonBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POISONBOLT);
+ PoisonBolt_Timer = 3000;
+ }else PoisonBolt_Timer -= diff;
+ }
+
+ //FrenzyBack_Timer
+ if (Frenzy && FrenzyBack_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ Frenzy = false;
+ FrenzyBack_Timer = 15000;
+ }else FrenzyBack_Timer -= diff;
+
+ if ( !Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31 )
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoTextEmote("is going berserk", NULL);
+ DoCast(m_creature, SPELL_BERSERK);
+ Berserk = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_huhuran(Creature *_Creature)
+{
+ return new boss_huhuranAI (_Creature);
+}
+
+void AddSC_boss_huhuran()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_huhuran";
+ newscript->GetAI = GetAI_boss_huhuran;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
index 6da31133926..df7efb8f123 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
@@ -1,140 +1,140 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ouro
-SD%Complete: 85
-SDComment: No model for submerging. Currently just invisible.
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-
-#define SPELL_SWEEP 26103
-#define SPELL_SANDBLAST 26102
-#define SPELL_GROUND_RUPTURE 26100
-#define SPELL_BIRTH 26262 //The Birth Animation
-
-#define SPELL_DIRTMOUND_PASSIVE 26092
-
-struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI
-{
- boss_ouroAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sweep_Timer;
- uint32 SandBlast_Timer;
- uint32 Submerge_Timer;
- uint32 Back_Timer;
- uint32 ChangeTarget_Timer;
- uint32 Spawn_Timer;
-
- bool Enrage;
- bool Submerged;
- bool InCombat;
-
- void Reset()
- {
- Sweep_Timer = 5000 + rand()%5000;
- SandBlast_Timer = 20000 + rand()%15000;
- Submerge_Timer = 90000 + rand()%60000;
- Back_Timer = 30000 + rand()%15000;
- ChangeTarget_Timer = 5000 + rand()%3000;
- Spawn_Timer = 10000 + rand()%10000;
-
- Enrage = false;
- Submerged = false;
- }
-
- void Aggro(Unit *who)
- {
- DoCast(m_creature->getVictim(), SPELL_BIRTH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sweep_Timer
- if (!Submerged && Sweep_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SWEEP);
- Sweep_Timer = 15000 + rand()%15000;
- }else Sweep_Timer -= diff;
-
- //SandBlast_Timer
- if (!Submerged && SandBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SANDBLAST);
- SandBlast_Timer = 20000 + rand()%15000;
- }else SandBlast_Timer -= diff;
-
- //Submerge_Timer
- if (!Submerged && Submerge_Timer < diff)
- {
- //Cast
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(35);
- DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE);
-
- Submerged = true;
- Back_Timer = 30000 + rand()%15000;
- }else Submerge_Timer -= diff;
-
- //ChangeTarget_Timer
- if (Submerged && ChangeTarget_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
-
- ChangeTarget_Timer = 10000 + rand()%10000;
- }else ChangeTarget_Timer -= diff;
-
- //Back_Timer
- if (Submerged && Back_Timer < diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setFaction(14);
-
- DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
-
- Submerged = false;
- Submerge_Timer = 60000 + rand()%60000;
- }else Back_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_ouro(Creature *_Creature)
-{
- return new boss_ouroAI (_Creature);
-}
-
-void AddSC_boss_ouro()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ouro";
- newscript->GetAI = GetAI_boss_ouro;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ouro
+SD%Complete: 85
+SDComment: No model for submerging. Currently just invisible.
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+
+#define SPELL_SWEEP 26103
+#define SPELL_SANDBLAST 26102
+#define SPELL_GROUND_RUPTURE 26100
+#define SPELL_BIRTH 26262 //The Birth Animation
+
+#define SPELL_DIRTMOUND_PASSIVE 26092
+
+struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI
+{
+ boss_ouroAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sweep_Timer;
+ uint32 SandBlast_Timer;
+ uint32 Submerge_Timer;
+ uint32 Back_Timer;
+ uint32 ChangeTarget_Timer;
+ uint32 Spawn_Timer;
+
+ bool Enrage;
+ bool Submerged;
+ bool InCombat;
+
+ void Reset()
+ {
+ Sweep_Timer = 5000 + rand()%5000;
+ SandBlast_Timer = 20000 + rand()%15000;
+ Submerge_Timer = 90000 + rand()%60000;
+ Back_Timer = 30000 + rand()%15000;
+ ChangeTarget_Timer = 5000 + rand()%3000;
+ Spawn_Timer = 10000 + rand()%10000;
+
+ Enrage = false;
+ Submerged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BIRTH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sweep_Timer
+ if (!Submerged && Sweep_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SWEEP);
+ Sweep_Timer = 15000 + rand()%15000;
+ }else Sweep_Timer -= diff;
+
+ //SandBlast_Timer
+ if (!Submerged && SandBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SANDBLAST);
+ SandBlast_Timer = 20000 + rand()%15000;
+ }else SandBlast_Timer -= diff;
+
+ //Submerge_Timer
+ if (!Submerged && Submerge_Timer < diff)
+ {
+ //Cast
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(35);
+ DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE);
+
+ Submerged = true;
+ Back_Timer = 30000 + rand()%15000;
+ }else Submerge_Timer -= diff;
+
+ //ChangeTarget_Timer
+ if (Submerged && ChangeTarget_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+
+ ChangeTarget_Timer = 10000 + rand()%10000;
+ }else ChangeTarget_Timer -= diff;
+
+ //Back_Timer
+ if (Submerged && Back_Timer < diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setFaction(14);
+
+ DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
+
+ Submerged = false;
+ Submerge_Timer = 60000 + rand()%60000;
+ }else Back_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_ouro(Creature *_Creature)
+{
+ return new boss_ouroAI (_Creature);
+}
+
+void AddSC_boss_ouro()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ouro";
+ newscript->GetAI = GetAI_boss_ouro;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
index e9b305d4063..e91b3f4d071 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
@@ -1,271 +1,271 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Sartura
-SD%Complete: 99
-SDComment:
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WHIRLWIND 26083
-#define SPELL_ENRAGE 28747 //Not sure if right ID.
-#define SPELL_ENRAGEHARD 28798
-
-//Guard Spell
-#define SPELL_WHIRLWINDADD 26038
-#define SPELL_KNOCKBACK 26027
-
-struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
-{
- boss_sarturaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 WhirlWindRandom_Timer;
- uint32 WhirlWindEnd_Timer;
- uint32 AggroReset_Timer;
- uint32 AggroResetEnd_Timer;
- uint32 EnrageHard_Timer;
-
- bool Enraged;
- bool EnragedHard;
- bool WhirlWind;
- bool AggroReset;
-
- void Reset()
- {
- WhirlWind_Timer = 30000;
- WhirlWindRandom_Timer = 3000 + rand()%4000;
- WhirlWindEnd_Timer = 15000;
- AggroReset_Timer = 45000 + rand()%10000;
- AggroResetEnd_Timer = 5000;
- EnrageHard_Timer = 10*60000;
-
- WhirlWind = false;
- AggroReset = false;
- Enraged = false;
- EnragedHard = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (WhirlWind)
- {
- if (WhirlWindRandom_Timer < diff)
- {
- //Attack random Gamers
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- DoStartAttackAndMovement(target);
-
- WhirlWindRandom_Timer = 3000 + rand()%4000;
- }else WhirlWindRandom_Timer -= diff;
-
- if (WhirlWindEnd_Timer < diff)
- {
- WhirlWind = false;
- WhirlWind_Timer = 25000 + rand()%15000;
- }else WhirlWindEnd_Timer -= diff;
- }
-
- if (!WhirlWind)
- {
- if (WhirlWind_Timer < diff)
- {
- DoCast(m_creature, SPELL_WHIRLWIND);
- WhirlWind = true;
- WhirlWindEnd_Timer = 15000;
- }else WhirlWind_Timer -= diff;
-
- if (AggroReset_Timer < diff)
- {
- //Attack random Gamers
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- m_creature->TauntApply(target);
-
- AggroReset = true;
- AggroReset_Timer = 2000 + rand()%3000;
- }else AggroReset_Timer -= diff;
-
- if (AggroReset)
- {
- if (AggroResetEnd_Timer <diff)
- {
- AggroReset = false;
- AggroResetEnd_Timer = 5000;
- }AggroResetEnd_Timer -= diff;
- }
-
- //If she is 20% enrage
- if (!Enraged)
- {
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false))
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }
- }
-
- //After 10 minutes hard enrage
- if (!EnragedHard)
- {
- if (EnrageHard_Timer < diff)
- {
- DoCast(m_creature, SPELL_ENRAGEHARD);
- EnragedHard = true;
- }EnrageHard_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
-{
- mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 WhirlWindRandom_Timer;
- uint32 WhirlWindEnd_Timer;
- uint32 AggroReset_Timer;
- uint32 AggroResetEnd_Timer;
- uint32 KnockBack_Timer;
-
- bool WhirlWind;
- bool AggroReset;
-
- void Reset()
- {
- WhirlWind_Timer = 30000;
- WhirlWindRandom_Timer = 3000 + rand()%4000;
- WhirlWindEnd_Timer = 15000;
- AggroReset_Timer = 45000 + rand()%10000;
- AggroResetEnd_Timer = 5000;
- KnockBack_Timer = 10000;
-
- WhirlWind = false;
- AggroReset = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (!WhirlWind && WhirlWind_Timer < diff)
- {
- DoCast(m_creature, SPELL_WHIRLWINDADD);
- WhirlWind = true;
- WhirlWind_Timer = 25000 + rand()%15000;
- WhirlWindEnd_Timer = 15000;
- }else WhirlWind_Timer -= diff;
-
- if (WhirlWind)
- {
- if (WhirlWindRandom_Timer < diff)
- {
- //Attack random Gamers
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- m_creature->TauntApply(target);
-
- WhirlWindRandom_Timer = 3000 + rand()%4000;
- }else WhirlWindRandom_Timer -= diff;
-
- if (WhirlWindEnd_Timer < diff)
- {
- WhirlWind = false;
- }else WhirlWindEnd_Timer -= diff;
- }
-
- if (!WhirlWind)
- {
- if(AggroReset_Timer < diff)
- {
- //Attack random Gamers
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- DoStartAttackAndMovement(target);
-
- AggroReset = true;
- AggroReset_Timer = 2000 + rand()%3000;
- }else AggroReset_Timer -= diff;
-
- if (KnockBack_Timer < diff)
- {
- DoCast(m_creature, SPELL_WHIRLWINDADD);
- KnockBack_Timer = 10000 + rand()%10000;
- }else KnockBack_Timer -= diff;
- }
-
- if (AggroReset)
- {
- if (AggroResetEnd_Timer <diff)
- {
- AggroReset = false;
- AggroResetEnd_Timer = 5000;
- }AggroResetEnd_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_sartura(Creature *_Creature)
-{
- return new boss_sarturaAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_sartura_royal_guard(Creature *_Creature)
-{
- return new mob_sartura_royal_guardAI (_Creature);
-}
-
-void AddSC_boss_sartura()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_sartura";
- newscript->GetAI = GetAI_boss_sartura;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_sartura_royal_guard";
- newscript->GetAI = GetAI_mob_sartura_royal_guard;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Sartura
+SD%Complete: 99
+SDComment:
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WHIRLWIND 26083
+#define SPELL_ENRAGE 28747 //Not sure if right ID.
+#define SPELL_ENRAGEHARD 28798
+
+//Guard Spell
+#define SPELL_WHIRLWINDADD 26038
+#define SPELL_KNOCKBACK 26027
+
+struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
+{
+ boss_sarturaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 WhirlWindRandom_Timer;
+ uint32 WhirlWindEnd_Timer;
+ uint32 AggroReset_Timer;
+ uint32 AggroResetEnd_Timer;
+ uint32 EnrageHard_Timer;
+
+ bool Enraged;
+ bool EnragedHard;
+ bool WhirlWind;
+ bool AggroReset;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 30000;
+ WhirlWindRandom_Timer = 3000 + rand()%4000;
+ WhirlWindEnd_Timer = 15000;
+ AggroReset_Timer = 45000 + rand()%10000;
+ AggroResetEnd_Timer = 5000;
+ EnrageHard_Timer = 10*60000;
+
+ WhirlWind = false;
+ AggroReset = false;
+ Enraged = false;
+ EnragedHard = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (WhirlWind)
+ {
+ if (WhirlWindRandom_Timer < diff)
+ {
+ //Attack random Gamers
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ DoStartAttackAndMovement(target);
+
+ WhirlWindRandom_Timer = 3000 + rand()%4000;
+ }else WhirlWindRandom_Timer -= diff;
+
+ if (WhirlWindEnd_Timer < diff)
+ {
+ WhirlWind = false;
+ WhirlWind_Timer = 25000 + rand()%15000;
+ }else WhirlWindEnd_Timer -= diff;
+ }
+
+ if (!WhirlWind)
+ {
+ if (WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WHIRLWIND);
+ WhirlWind = true;
+ WhirlWindEnd_Timer = 15000;
+ }else WhirlWind_Timer -= diff;
+
+ if (AggroReset_Timer < diff)
+ {
+ //Attack random Gamers
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->TauntApply(target);
+
+ AggroReset = true;
+ AggroReset_Timer = 2000 + rand()%3000;
+ }else AggroReset_Timer -= diff;
+
+ if (AggroReset)
+ {
+ if (AggroResetEnd_Timer <diff)
+ {
+ AggroReset = false;
+ AggroResetEnd_Timer = 5000;
+ }AggroResetEnd_Timer -= diff;
+ }
+
+ //If she is 20% enrage
+ if (!Enraged)
+ {
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enraged = true;
+ }
+ }
+
+ //After 10 minutes hard enrage
+ if (!EnragedHard)
+ {
+ if (EnrageHard_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_ENRAGEHARD);
+ EnragedHard = true;
+ }EnrageHard_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
+{
+ mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 WhirlWindRandom_Timer;
+ uint32 WhirlWindEnd_Timer;
+ uint32 AggroReset_Timer;
+ uint32 AggroResetEnd_Timer;
+ uint32 KnockBack_Timer;
+
+ bool WhirlWind;
+ bool AggroReset;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 30000;
+ WhirlWindRandom_Timer = 3000 + rand()%4000;
+ WhirlWindEnd_Timer = 15000;
+ AggroReset_Timer = 45000 + rand()%10000;
+ AggroResetEnd_Timer = 5000;
+ KnockBack_Timer = 10000;
+
+ WhirlWind = false;
+ AggroReset = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (!WhirlWind && WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WHIRLWINDADD);
+ WhirlWind = true;
+ WhirlWind_Timer = 25000 + rand()%15000;
+ WhirlWindEnd_Timer = 15000;
+ }else WhirlWind_Timer -= diff;
+
+ if (WhirlWind)
+ {
+ if (WhirlWindRandom_Timer < diff)
+ {
+ //Attack random Gamers
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->TauntApply(target);
+
+ WhirlWindRandom_Timer = 3000 + rand()%4000;
+ }else WhirlWindRandom_Timer -= diff;
+
+ if (WhirlWindEnd_Timer < diff)
+ {
+ WhirlWind = false;
+ }else WhirlWindEnd_Timer -= diff;
+ }
+
+ if (!WhirlWind)
+ {
+ if(AggroReset_Timer < diff)
+ {
+ //Attack random Gamers
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ DoStartAttackAndMovement(target);
+
+ AggroReset = true;
+ AggroReset_Timer = 2000 + rand()%3000;
+ }else AggroReset_Timer -= diff;
+
+ if (KnockBack_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WHIRLWINDADD);
+ KnockBack_Timer = 10000 + rand()%10000;
+ }else KnockBack_Timer -= diff;
+ }
+
+ if (AggroReset)
+ {
+ if (AggroResetEnd_Timer <diff)
+ {
+ AggroReset = false;
+ AggroResetEnd_Timer = 5000;
+ }AggroResetEnd_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_sartura(Creature *_Creature)
+{
+ return new boss_sarturaAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_sartura_royal_guard(Creature *_Creature)
+{
+ return new mob_sartura_royal_guardAI (_Creature);
+}
+
+void AddSC_boss_sartura()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_sartura";
+ newscript->GetAI = GetAI_boss_sartura;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_sartura_royal_guard";
+ newscript->GetAI = GetAI_mob_sartura_royal_guard;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
index 89f4a283e34..9e66b9aca89 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
@@ -1,314 +1,314 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Skeram
-SD%Complete: 75
-SDComment: Mind Control buggy.
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-#include "Group.h"
-
-#define SPELL_ARCANE_EXPLOSION 25679
-#define SPELL_EARTH_SHOCK 26194
-#define SPELL_TRUE_FULFILLMENT4 26526
-#define SPELL_BLINK 28391
-
-#define SOUND_AGGRO1 8615 //8615 Are you so eager to die? I would be happy to accomodate you.
-#define SOUND_AGGRO2 8616 //8616 Cower mortals! The age of darkness is at hand.
-#define SOUND_AGGRO3 8621 //8621 Tremble! The end is upon you.
-#define SOUND_SLAY1 8617 //8617 Let your death serve as an example!
-#define SOUND_SLAY2 8619 //8619 Spineless wretchers you will drown in rivers of blood!
-#define SOUND_SLAY3 8620 //8620 The screams of the dying will fill the air. A symphony of terror is about to begin!
-#define SOUND_SPLIT 8618 //8618 Prepare for the return of the ancient ones!
-#define SOUND_DEATH 8622 //8622 You only delay... the inevetable
-
-class ov_mycoordinates
-{
- public:
- float x,y,z,r;
- ov_mycoordinates(float cx, float cy, float cz, float cr)
- {
- x = cx; y = cy; z = cz; r = cr;
- }
-};
-
-struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
-{
- boss_skeramAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- IsImage = false;
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 ArcaneExplosion_Timer;
- uint32 EarthShock_Timer;
- uint32 FullFillment_Timer;
- uint32 Blink_Timer;
- uint32 Invisible_Timer;
-
- Creature *Image1, *Image2;
-
- bool Images75;
- bool Images50;
- bool Images25;
- bool IsImage;
- bool Invisible;
-
- void Reset()
- {
- ArcaneExplosion_Timer = 6000 + rand()%6000;
- EarthShock_Timer = 2000;
- FullFillment_Timer = 15000;
- Blink_Timer = 8000 + rand()%12000;
- Invisible_Timer = 500;
-
- Images75 = false;
- Images50 = false;
- Images25 = false;
- Invisible = false;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_ON);
-
- if (IsImage)
- m_creature->setDeathState(JUST_DIED);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- case 2:
- DoPlaySoundToSet(m_creature,SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if (!IsImage)
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- if (IsImage || Images75)
- return;
- switch(rand()%3)
- {
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ArcaneExplosion_Timer
- if (ArcaneExplosion_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
- ArcaneExplosion_Timer = 8000 + rand()%10000;
- }else ArcaneExplosion_Timer -= diff;
-
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- //Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }else
- {
- //EarthShock_Timer
- if (EarthShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK);
- EarthShock_Timer = 1000;
- }else EarthShock_Timer -= diff;
- }
-
- //Blink_Timer
- if (Blink_Timer < diff)
- {
- //DoCast(m_creature, SPELL_BLINK);
- switch(rand()%3)
- {
- case 0:
- m_creature->Relocate(-8340.782227,2083.814453,125.648788,0);
- DoResetThreat();
- break;
- case 1:
- m_creature->Relocate(-8341.546875,2118.504639,133.058151,0);
- DoResetThreat();
- break;
- case 2:
- m_creature->Relocate(-8318.822266,2058.231201,133.058151,0);
- DoResetThreat();
- break;
- }
- DoStopAttack();
-
- Blink_Timer= 20000 + rand()%20000;
- }else Blink_Timer -= diff;
-
- int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5);
-
- //Summoning 2 Images and teleporting to a random position on 75% health
- if ( (!Images75 && !IsImage) &&
- (procent <= 75 && procent > 70) )
- DoSplit(75);
-
- //Summoning 2 Images and teleporting to a random position on 50% health
- if ( (!Images50 && !IsImage) &&
- (procent <= 50 && procent > 45) )
- DoSplit(50);
-
- //Summoning 2 Images and teleporting to a random position on 25% health
- if ( (!Images25 && !IsImage) &&
- (procent <= 25 && procent > 20) )
- DoSplit(25);
-
- //Invisible_Timer
- if (Invisible)
- {
- if (Invisible_Timer < diff)
- {
- //Making Skeram visible after telporting
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- Invisible_Timer = 2500;
- Invisible = false;
- }else Invisible_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-
- void DoSplit(int atPercent /* 75 50 25 */)
- {
- DoPlaySoundToSet(m_creature,SOUND_SPLIT);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0);
- ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0);
- ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0);
-
- ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3;
-
- switch(rand()%3)
- {
- case 0:
- bossc=place1;i1=place2;i2=place3;
- break;
- case 1:
- bossc=place2;i1=place1;i2=place3;
- break;
- case 2:
- bossc=place3;i1=place1;i2=place2;
- break;
- }
-
- for (int tryi = 0; tryi < 41; tryi ++)
- {
- Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (targetpl->isType(TYPEMASK_PLAYER))
- {
- Group *grp = ((Player *)targetpl)->GetGroup();
- if (grp)
- {
- for (int ici = 0; ici < TARGETICONCOUNT; ici++)
- {
- //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:(
- grp->SetTargetIcon(ici, 0);
- }
- }
- break;
- }
- }
-
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r);
- Invisible = true;
- DoResetThreat();
- DoStopAttack();
-
- switch (atPercent)
- {
- case 75: Images75 = true; break;
- case 50: Images50 = true; break;
- case 25: Images25 = true; break;
- }
-
- Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
- Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image1->SetHealth(m_creature->GetHealth() / 5);
- Image1->AI()->AttackStart(target);
-
- Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
- Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image2->SetHealth(m_creature->GetHealth() / 5);
- Image2->AI()->AttackStart(target);
-
- ((boss_skeramAI*)Image1->AI())->IsImage = true;
- ((boss_skeramAI*)Image2->AI())->IsImage = true;
-
- Invisible = true;
- }
-};
-
-CreatureAI* GetAI_boss_skeram(Creature *_Creature)
-{
- return new boss_skeramAI (_Creature);
-}
-
-void AddSC_boss_skeram()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_skeram";
- newscript->GetAI = GetAI_boss_skeram;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Skeram
+SD%Complete: 75
+SDComment: Mind Control buggy.
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+#include "Group.h"
+
+#define SPELL_ARCANE_EXPLOSION 25679
+#define SPELL_EARTH_SHOCK 26194
+#define SPELL_TRUE_FULFILLMENT4 26526
+#define SPELL_BLINK 28391
+
+#define SOUND_AGGRO1 8615 //8615 Are you so eager to die? I would be happy to accomodate you.
+#define SOUND_AGGRO2 8616 //8616 Cower mortals! The age of darkness is at hand.
+#define SOUND_AGGRO3 8621 //8621 Tremble! The end is upon you.
+#define SOUND_SLAY1 8617 //8617 Let your death serve as an example!
+#define SOUND_SLAY2 8619 //8619 Spineless wretchers you will drown in rivers of blood!
+#define SOUND_SLAY3 8620 //8620 The screams of the dying will fill the air. A symphony of terror is about to begin!
+#define SOUND_SPLIT 8618 //8618 Prepare for the return of the ancient ones!
+#define SOUND_DEATH 8622 //8622 You only delay... the inevetable
+
+class ov_mycoordinates
+{
+ public:
+ float x,y,z,r;
+ ov_mycoordinates(float cx, float cy, float cz, float cr)
+ {
+ x = cx; y = cy; z = cz; r = cr;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
+{
+ boss_skeramAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ IsImage = false;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 ArcaneExplosion_Timer;
+ uint32 EarthShock_Timer;
+ uint32 FullFillment_Timer;
+ uint32 Blink_Timer;
+ uint32 Invisible_Timer;
+
+ Creature *Image1, *Image2;
+
+ bool Images75;
+ bool Images50;
+ bool Images25;
+ bool IsImage;
+ bool Invisible;
+
+ void Reset()
+ {
+ ArcaneExplosion_Timer = 6000 + rand()%6000;
+ EarthShock_Timer = 2000;
+ FullFillment_Timer = 15000;
+ Blink_Timer = 8000 + rand()%12000;
+ Invisible_Timer = 500;
+
+ Images75 = false;
+ Images50 = false;
+ Images25 = false;
+ Invisible = false;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ if (IsImage)
+ m_creature->setDeathState(JUST_DIED);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_SLAY1);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_SLAY2);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature,SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (!IsImage)
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (IsImage || Images75)
+ return;
+ switch(rand()%3)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
+ break;
+ case 1:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
+ break;
+ case 2:
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ArcaneExplosion_Timer
+ if (ArcaneExplosion_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ ArcaneExplosion_Timer = 8000 + rand()%10000;
+ }else ArcaneExplosion_Timer -= diff;
+
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ //Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }else
+ {
+ //EarthShock_Timer
+ if (EarthShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK);
+ EarthShock_Timer = 1000;
+ }else EarthShock_Timer -= diff;
+ }
+
+ //Blink_Timer
+ if (Blink_Timer < diff)
+ {
+ //DoCast(m_creature, SPELL_BLINK);
+ switch(rand()%3)
+ {
+ case 0:
+ m_creature->Relocate(-8340.782227,2083.814453,125.648788,0);
+ DoResetThreat();
+ break;
+ case 1:
+ m_creature->Relocate(-8341.546875,2118.504639,133.058151,0);
+ DoResetThreat();
+ break;
+ case 2:
+ m_creature->Relocate(-8318.822266,2058.231201,133.058151,0);
+ DoResetThreat();
+ break;
+ }
+ DoStopAttack();
+
+ Blink_Timer= 20000 + rand()%20000;
+ }else Blink_Timer -= diff;
+
+ int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5);
+
+ //Summoning 2 Images and teleporting to a random position on 75% health
+ if ( (!Images75 && !IsImage) &&
+ (procent <= 75 && procent > 70) )
+ DoSplit(75);
+
+ //Summoning 2 Images and teleporting to a random position on 50% health
+ if ( (!Images50 && !IsImage) &&
+ (procent <= 50 && procent > 45) )
+ DoSplit(50);
+
+ //Summoning 2 Images and teleporting to a random position on 25% health
+ if ( (!Images25 && !IsImage) &&
+ (procent <= 25 && procent > 20) )
+ DoSplit(25);
+
+ //Invisible_Timer
+ if (Invisible)
+ {
+ if (Invisible_Timer < diff)
+ {
+ //Making Skeram visible after telporting
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ Invisible_Timer = 2500;
+ Invisible = false;
+ }else Invisible_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void DoSplit(int atPercent /* 75 50 25 */)
+ {
+ DoPlaySoundToSet(m_creature,SOUND_SPLIT);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0);
+ ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0);
+ ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0);
+
+ ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3;
+
+ switch(rand()%3)
+ {
+ case 0:
+ bossc=place1;i1=place2;i2=place3;
+ break;
+ case 1:
+ bossc=place2;i1=place1;i2=place3;
+ break;
+ case 2:
+ bossc=place3;i1=place1;i2=place2;
+ break;
+ }
+
+ for (int tryi = 0; tryi < 41; tryi ++)
+ {
+ Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (targetpl->isType(TYPEMASK_PLAYER))
+ {
+ Group *grp = ((Player *)targetpl)->GetGroup();
+ if (grp)
+ {
+ for (int ici = 0; ici < TARGETICONCOUNT; ici++)
+ {
+ //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:(
+ grp->SetTargetIcon(ici, 0);
+ }
+ }
+ break;
+ }
+ }
+
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r);
+ Invisible = true;
+ DoResetThreat();
+ DoStopAttack();
+
+ switch (atPercent)
+ {
+ case 75: Images75 = true; break;
+ case 50: Images50 = true; break;
+ case 25: Images25 = true; break;
+ }
+
+ Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
+ Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
+ Image1->SetHealth(m_creature->GetHealth() / 5);
+ Image1->AI()->AttackStart(target);
+
+ Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
+ Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
+ Image2->SetHealth(m_creature->GetHealth() / 5);
+ Image2->AI()->AttackStart(target);
+
+ ((boss_skeramAI*)Image1->AI())->IsImage = true;
+ ((boss_skeramAI*)Image2->AI())->IsImage = true;
+
+ Invisible = true;
+ }
+};
+
+CreatureAI* GetAI_boss_skeram(Creature *_Creature)
+{
+ return new boss_skeramAI (_Creature);
+}
+
+void AddSC_boss_skeram()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_skeram";
+ newscript->GetAI = GetAI_boss_skeram;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
index a0adfc9ed09..d1397d8dcfd 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
@@ -1,698 +1,698 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Twinemperors
-SD%Complete: 95
-SDComment:
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-#include "WorldPacket.h"
-
-#include "Item.h"
-#include "Spell.h"
-
-#define SPELL_HEAL_BROTHER 7393
-#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer
-#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual
-
-#define SPELL_EXPLODEBUG 804
-#define SPELL_MUTATE_BUG 802
-
-#define SOUND_VN_DEATH 8660 //8660 - Death - Feel
-#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none
-#define SOUND_VN_KILL 8662 //8661 - Kill - your fate
-
-#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late
-#define SOUND_VL_KILL 8658 //8658 - Kill - You will not
-#define SOUND_VL_DEATH 8659 //8659 - Death
-
-#define PULL_RANGE 50
-#define ABUSE_BUG_RANGE 20
-#define SPELL_BERSERK 26662
-#define TELEPORTTIME 30000
-
-#define SPELL_UPPERCUT 26007
-#define SPELL_UNBALANCING_STRIKE 26613
-
-#define VEKLOR_DIST 20 // VL will not come to melee when attacking
-
-#define SPELL_SHADOWBOLT 26006
-#define SPELL_BLIZZARD 26607
-#define SPELL_ARCANEBURST 568
-
-struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
-{
- ScriptedInstance *pInstance;
- uint32 Heal_Timer;
- uint32 Teleport_Timer;
- bool AfterTeleport;
- uint32 AfterTeleportTimer;
- bool DontYellWhenDead;
- uint32 Abuse_Bug_Timer, BugsTimer;
- bool tspellcasted;
- uint32 EnrageTimer;
-
- virtual bool IAmVeklor() = 0;
- virtual void Reset() = 0;
- virtual void CastSpellOnBug(Creature *target) = 0;
-
- boss_twinemperorsAI(Creature *c): ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- }
-
- void TwinReset()
- {
- Heal_Timer = 0; // first heal immediately when they get close together
- Teleport_Timer = TELEPORTTIME;
- AfterTeleport = false;
- tspellcasted = false;
- AfterTeleportTimer = 0;
- Abuse_Bug_Timer = 10000 + rand()%7000;
- BugsTimer = 2000;
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
- DontYellWhenDead = false;
- EnrageTimer = 15*60000;
- }
-
- Creature *GetOtherBoss()
- {
- if(pInstance)
- {
- return (Creature *)Unit::GetUnit((*m_creature), pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
- }
- else
- {
- return (Creature *)0;
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- Unit *pOtherBoss = GetOtherBoss();
- if (pOtherBoss)
- {
- float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth());
- int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth()));
- int ohealth = pOtherBoss->GetHealth()-odmg;
- pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0);
- if (ohealth <= 0)
- {
- pOtherBoss->setDeathState(JUST_DIED);
- pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
- }
- }
-
- void JustDied(Unit* Killer)
- {
- Creature *pOtherBoss = GetOtherBoss();
- if (pOtherBoss)
- {
- pOtherBoss->SetHealth(0);
- pOtherBoss->setDeathState(JUST_DIED);
- pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- ((boss_twinemperorsAI *)pOtherBoss->AI())->DontYellWhenDead = true;
- }
- if (!DontYellWhenDead) // I hope AI is not threaded
- DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- InCombat = true;
- Creature *pOtherBoss = GetOtherBoss();
- if (pOtherBoss)
- {
- // TODO: we should activate the other boss location so he can start attackning even if nobody
- // is near I dont know how to do that
- ScriptedAI *otherAI = (ScriptedAI*)pOtherBoss->AI();
- if (!otherAI->InCombat)
- {
- DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
- otherAI->AttackStart(who);
- otherAI->DoZoneInCombat();
- }
- }
- }
-
- void SpellHit(Unit *caster, const SpellEntry *entry)
- {
- if (caster == m_creature)
- return;
-
- Creature *pOtherBoss = GetOtherBoss();
- if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss)
- return;
-
- // add health so we keep same percentage for both brothers
- uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
- float mult = ((float)mytotal) / ((float)histotal);
- if (mult < 1)
- mult = 1.0f/mult;
- #define HEAL_BROTHER_AMOUNT 30000.0f
- uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT);
-
- uint32 myh = m_creature->GetHealth();
- uint32 hish = pOtherBoss->GetHealth();
- if (mytotal > histotal)
- {
- uint32 h = m_creature->GetHealth()+largerAmount;
- m_creature->SetHealth(std::min(mytotal, h));
- }
- else
- {
- uint32 h = pOtherBoss->GetHealth()+largerAmount;
- pOtherBoss->SetHealth(std::min(histotal, h));
- }
- }
-
- void TryHealBrother(uint32 diff)
- {
- if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it
- return;
-
- if (Heal_Timer < diff)
- {
- Unit *pOtherBoss = GetOtherBoss();
- if (pOtherBoss && (pOtherBoss->GetDistance((const Creature *)m_creature) <= 60))
- {
- DoCast(pOtherBoss, SPELL_HEAL_BROTHER);
- Heal_Timer = 1000;
- }
- } else Heal_Timer -= diff;
- }
-
- Unit *GetAnyoneCloseEnough(float dist, bool totallyRandom)
- {
- int cnt = 0;
- std::list<HostilReference*>::iterator i;
- std::list<HostilReference*> candidates;
-
- for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if (m_creature->IsWithinDistInMap(pUnit, dist))
- {
- if (!totallyRandom)
- return pUnit;
- candidates.push_back((*i));
- cnt ++;
- }
- }
- if (!cnt)
- return NULL;
- for (int randomi = rand() % cnt; randomi > 0; randomi --)
- candidates.pop_front();
-
- i = candidates.begin();
- Unit *ret = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- candidates.clear();
- return ret;
- }
-
- Unit *PickNearestPlayer()
- {
- Unit *nearp = NULL;
- float neardist = 0.0f;
- std::list<HostilReference*>::iterator i;
- for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if (!pUnit)
- continue;
- float pudist = pUnit->GetDistance((const Creature *)m_creature);
- if (!nearp || (neardist > pudist))
- {
- nearp = pUnit;
- neardist = pudist;
- }
- }
- return nearp;
- }
-
- void TeleportToMyBrother()
- {
- if (!pInstance)
- return;
-
- Teleport_Timer = TELEPORTTIME;
-
- if(IAmVeklor())
- return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates
-
- Creature *pOtherBoss = GetOtherBoss();
- if (pOtherBoss)
- {
- //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
- float other_x = pOtherBoss->GetPositionX();
- float other_y = pOtherBoss->GetPositionY();
- float other_z = pOtherBoss->GetPositionZ();
- float other_o = pOtherBoss->GetOrientation();
-
- Map *thismap = m_creature->GetMap();
- thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(),
- m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation());
- thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o);
-
- SetAfterTeleport();
- ((boss_twinemperorsAI*) pOtherBoss->AI())->SetAfterTeleport();
- }
- }
-
- void SetAfterTeleport()
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoStopAttack();
- DoResetThreat();
- DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- AfterTeleport = true;
- AfterTeleportTimer = 2000;
- tspellcasted = false;
- }
-
- bool TryActivateAfterTTelep(uint32 diff)
- {
- if (AfterTeleport)
- {
- if (!tspellcasted)
- {
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
- DoCast(m_creature, SPELL_TWIN_TELEPORT);
- m_creature->addUnitState(UNIT_STAT_STUNNED);
- }
-
- tspellcasted = true;
-
- if (AfterTeleportTimer < diff)
- {
- AfterTeleport = false;
- m_creature->clearUnitState(UNIT_STAT_STUNNED);
- Unit *nearu = PickNearestPlayer();
- //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
- AttackStart(nearu);
- m_creature->getThreatManager().addThreat(nearu, 10000);
- return true;
- }
- else
- {
- AfterTeleportTimer -= diff;
- // update important timers which would otherwise get skipped
- if (EnrageTimer > diff)
- EnrageTimer -= diff;
- else
- EnrageTimer = 0;
- if (Teleport_Timer > diff)
- Teleport_Timer -= diff;
- else
- Teleport_Timer = 0;
- return false;
- }
- }
- else
- {
- return true;
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
- if (attackRadius < PULL_RANGE)
- attackRadius = PULL_RANGE;
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- AttackStart(who);
- }
- }
- }
-
- class AnyBugCheck
- {
- public:
- AnyBugCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
- bool operator()(Unit* u)
- {
- Creature *c = (Creature *)u;
- if (!i_obj->IsWithinDistInMap(c, i_range))
- return false;
- return (c->GetEntry() == 15316 || c->GetEntry() == 15317);
- }
- private:
- WorldObject const* i_obj;
- float i_range;
- };
-
- Creature *RespawnNearbyBugsAndGetOne()
- {
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list<Creature*> unitList;
-
- AnyBugCheck u_check(m_creature, 150);
- Trinity::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check);
- TypeContainerVisitor<Trinity::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap()));
-
- Creature *nearb = NULL;
-
- for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
- {
- Creature *c = (Creature *)(*iter);
- if (c->isDead())
- {
- c->Respawn();
- c->setFaction(7);
- c->RemoveAllAuras();
- }
- if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
- {
- if (!nearb || (rand()%4)==0)
- nearb = c;
- }
- }
- return nearb;
- }
-
- void HandleBugs(uint32 diff)
- {
- if (BugsTimer < diff || Abuse_Bug_Timer < diff)
- {
- Creature *c = RespawnNearbyBugsAndGetOne();
- if (Abuse_Bug_Timer < diff)
- {
- if (c)
- {
- CastSpellOnBug(c);
- Abuse_Bug_Timer = 10000 + rand()%7000;
- }
- else
- {
- Abuse_Bug_Timer = 1000;
- }
- }
- else
- {
- Abuse_Bug_Timer -= diff;
- }
- BugsTimer = 2000;
- }
- else
- {
- BugsTimer -= diff;
- Abuse_Bug_Timer -= diff;
- }
- }
-
- void CheckEnrage(uint32 diff)
- {
- if (EnrageTimer < diff)
- {
- if (!m_creature->IsNonMeleeSpellCasted(true))
- {
- DoCast(m_creature, SPELL_BERSERK);
- EnrageTimer = 60*60000;
- } else EnrageTimer = 0;
- } else EnrageTimer-=diff;
- }
-};
-
-class TRINITY_DLL_DECL BugAura : public Aura
-{
- public:
- BugAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
- {}
-};
-
-struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
-{
- bool IAmVeklor() {return false;}
- boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c)
- {
- Reset();
- }
-
- uint32 UpperCut_Timer;
- uint32 UnbalancingStrike_Timer;
- uint32 Scarabs_Timer;
- int Rand;
- int RandX;
- int RandY;
-
- Creature* Summoned;
-
- void Reset()
- {
- TwinReset();
- UpperCut_Timer = 14000 + rand()%15000;
- UnbalancingStrike_Timer = 8000 + rand()%10000;
- Scarabs_Timer = 7000 + rand()%7000;
-
- //Added. Can be removed if its included in DB.
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
- }
-
- void CastSpellOnBug(Creature *target)
- {
- target->setFaction(14);
- ((CreatureAI*)target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget());
- SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MUTATE_BUG);
- for (int i=0; i<3; i++)
- {
- if (!spell->Effect[i])
- continue;
- target->AddAura(new BugAura(spell, i, NULL, target, target));
- }
- target->SetHealth(target->GetMaxHealth());
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (!TryActivateAfterTTelep(diff))
- return;
-
- //UnbalancingStrike_Timer
- if (UnbalancingStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE);
- UnbalancingStrike_Timer = 8000+rand()%12000;
- }else UnbalancingStrike_Timer -= diff;
-
- if (UpperCut_Timer < diff)
- {
- Unit* randomMelee = GetAnyoneCloseEnough(ATTACK_DISTANCE, true);
- if (randomMelee)
- DoCast(randomMelee,SPELL_UPPERCUT);
- UpperCut_Timer = 15000+rand()%15000;
- }else UpperCut_Timer -= diff;
-
- HandleBugs(diff);
-
- //Heal brother when 60yrds close
- TryHealBrother(diff);
-
- //Teleporting to brother
- if(Teleport_Timer < diff)
- {
- TeleportToMyBrother();
- }else Teleport_Timer -= diff;
-
- CheckEnrage(diff);
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI
-{
- bool IAmVeklor() {return true;}
- boss_veklorAI(Creature *c) : boss_twinemperorsAI(c)
- {
- Reset();
- }
-
- uint32 ShadowBolt_Timer;
- uint32 Blizzard_Timer;
- uint32 ArcaneBurst_Timer;
- uint32 Scorpions_Timer;
- int Rand;
- int RandX;
- int RandY;
-
- Creature* Summoned;
-
- void Reset()
- {
- TwinReset();
- ShadowBolt_Timer = 0;
- Blizzard_Timer = 15000 + rand()%5000;;
- ArcaneBurst_Timer = 1000;
- Scorpions_Timer = 7000 + rand()%7000;
-
- //Added. Can be removed if its included in DB.
- m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
- m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
- }
-
- void CastSpellOnBug(Creature *target)
- {
- target->setFaction(14);
- SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_EXPLODEBUG);
- for (int i=0; i<3; i++)
- {
- if (!spell->Effect[i])
- continue;
- target->AddAura(new BugAura(spell, i, NULL, target, target));
- }
- target->SetHealth(target->GetMaxHealth());
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // reset arcane burst after teleport - we need to do this because
- // when VL jumps to VN's location there will be a warrior who will get only 2s to run away
- // which is almost impossible
- if (AfterTeleport)
- ArcaneBurst_Timer = 5000;
- if (!TryActivateAfterTTelep(diff))
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- if (m_creature->GetDistance(m_creature->getVictim()) > 45)
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0);
- else
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 2000;
- }else ShadowBolt_Timer -= diff;
-
- //Blizzard_Timer
- if (Blizzard_Timer < diff)
- {
- Unit* target = NULL;
- target = GetAnyoneCloseEnough(45, true);
- if (target)
- DoCast(target,SPELL_BLIZZARD);
- Blizzard_Timer = 15000+rand()%15000;
- }else Blizzard_Timer -= diff;
-
- if (ArcaneBurst_Timer < diff)
- {
- Unit *mvic;
- if ((mvic=GetAnyoneCloseEnough(ATTACK_DISTANCE, false))!=NULL)
- {
- DoCast(mvic,SPELL_ARCANEBURST);
- ArcaneBurst_Timer = 5000;
- }
- }else ArcaneBurst_Timer -= diff;
-
- HandleBugs(diff);
-
- //Heal brother when 60yrds close
- TryHealBrother(diff);
-
- //Teleporting to brother
- if(Teleport_Timer < diff)
- {
- TeleportToMyBrother();
- }else Teleport_Timer -= diff;
-
- CheckEnrage(diff);
-
- //VL doesn't melee
- //DoMeleeAttackIfReady();
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- // VL doesn't melee
- if ( m_creature->Attack(who, false) )
- {
- m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-};
-
-CreatureAI* GetAI_boss_veknilash(Creature *_Creature)
-{
- return new boss_veknilashAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_veklor(Creature *_Creature)
-{
- return new boss_veklorAI (_Creature);
-}
-
-void AddSC_boss_twinemperors()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_veknilash";
- newscript->GetAI = GetAI_boss_veknilash;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_veklor";
- newscript->GetAI = GetAI_boss_veklor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Twinemperors
+SD%Complete: 95
+SDComment:
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+#include "WorldPacket.h"
+
+#include "Item.h"
+#include "Spell.h"
+
+#define SPELL_HEAL_BROTHER 7393
+#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer
+#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual
+
+#define SPELL_EXPLODEBUG 804
+#define SPELL_MUTATE_BUG 802
+
+#define SOUND_VN_DEATH 8660 //8660 - Death - Feel
+#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none
+#define SOUND_VN_KILL 8662 //8661 - Kill - your fate
+
+#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late
+#define SOUND_VL_KILL 8658 //8658 - Kill - You will not
+#define SOUND_VL_DEATH 8659 //8659 - Death
+
+#define PULL_RANGE 50
+#define ABUSE_BUG_RANGE 20
+#define SPELL_BERSERK 26662
+#define TELEPORTTIME 30000
+
+#define SPELL_UPPERCUT 26007
+#define SPELL_UNBALANCING_STRIKE 26613
+
+#define VEKLOR_DIST 20 // VL will not come to melee when attacking
+
+#define SPELL_SHADOWBOLT 26006
+#define SPELL_BLIZZARD 26607
+#define SPELL_ARCANEBURST 568
+
+struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
+{
+ ScriptedInstance *pInstance;
+ uint32 Heal_Timer;
+ uint32 Teleport_Timer;
+ bool AfterTeleport;
+ uint32 AfterTeleportTimer;
+ bool DontYellWhenDead;
+ uint32 Abuse_Bug_Timer, BugsTimer;
+ bool tspellcasted;
+ uint32 EnrageTimer;
+
+ virtual bool IAmVeklor() = 0;
+ virtual void Reset() = 0;
+ virtual void CastSpellOnBug(Creature *target) = 0;
+
+ boss_twinemperorsAI(Creature *c): ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ void TwinReset()
+ {
+ Heal_Timer = 0; // first heal immediately when they get close together
+ Teleport_Timer = TELEPORTTIME;
+ AfterTeleport = false;
+ tspellcasted = false;
+ AfterTeleportTimer = 0;
+ Abuse_Bug_Timer = 10000 + rand()%7000;
+ BugsTimer = 2000;
+ m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ DontYellWhenDead = false;
+ EnrageTimer = 15*60000;
+ }
+
+ Creature *GetOtherBoss()
+ {
+ if(pInstance)
+ {
+ return (Creature *)Unit::GetUnit((*m_creature), pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
+ }
+ else
+ {
+ return (Creature *)0;
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ Unit *pOtherBoss = GetOtherBoss();
+ if (pOtherBoss)
+ {
+ float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth());
+ int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth()));
+ int ohealth = pOtherBoss->GetHealth()-odmg;
+ pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0);
+ if (ohealth <= 0)
+ {
+ pOtherBoss->setDeathState(JUST_DIED);
+ pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ Creature *pOtherBoss = GetOtherBoss();
+ if (pOtherBoss)
+ {
+ pOtherBoss->SetHealth(0);
+ pOtherBoss->setDeathState(JUST_DIED);
+ pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ ((boss_twinemperorsAI *)pOtherBoss->AI())->DontYellWhenDead = true;
+ }
+ if (!DontYellWhenDead) // I hope AI is not threaded
+ DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ InCombat = true;
+ Creature *pOtherBoss = GetOtherBoss();
+ if (pOtherBoss)
+ {
+ // TODO: we should activate the other boss location so he can start attackning even if nobody
+ // is near I dont know how to do that
+ ScriptedAI *otherAI = (ScriptedAI*)pOtherBoss->AI();
+ if (!otherAI->InCombat)
+ {
+ DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
+ otherAI->AttackStart(who);
+ otherAI->DoZoneInCombat();
+ }
+ }
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *entry)
+ {
+ if (caster == m_creature)
+ return;
+
+ Creature *pOtherBoss = GetOtherBoss();
+ if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss)
+ return;
+
+ // add health so we keep same percentage for both brothers
+ uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
+ float mult = ((float)mytotal) / ((float)histotal);
+ if (mult < 1)
+ mult = 1.0f/mult;
+ #define HEAL_BROTHER_AMOUNT 30000.0f
+ uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT);
+
+ uint32 myh = m_creature->GetHealth();
+ uint32 hish = pOtherBoss->GetHealth();
+ if (mytotal > histotal)
+ {
+ uint32 h = m_creature->GetHealth()+largerAmount;
+ m_creature->SetHealth(std::min(mytotal, h));
+ }
+ else
+ {
+ uint32 h = pOtherBoss->GetHealth()+largerAmount;
+ pOtherBoss->SetHealth(std::min(histotal, h));
+ }
+ }
+
+ void TryHealBrother(uint32 diff)
+ {
+ if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it
+ return;
+
+ if (Heal_Timer < diff)
+ {
+ Unit *pOtherBoss = GetOtherBoss();
+ if (pOtherBoss && (pOtherBoss->GetDistance((const Creature *)m_creature) <= 60))
+ {
+ DoCast(pOtherBoss, SPELL_HEAL_BROTHER);
+ Heal_Timer = 1000;
+ }
+ } else Heal_Timer -= diff;
+ }
+
+ Unit *GetAnyoneCloseEnough(float dist, bool totallyRandom)
+ {
+ int cnt = 0;
+ std::list<HostilReference*>::iterator i;
+ std::list<HostilReference*> candidates;
+
+ for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (m_creature->IsWithinDistInMap(pUnit, dist))
+ {
+ if (!totallyRandom)
+ return pUnit;
+ candidates.push_back((*i));
+ cnt ++;
+ }
+ }
+ if (!cnt)
+ return NULL;
+ for (int randomi = rand() % cnt; randomi > 0; randomi --)
+ candidates.pop_front();
+
+ i = candidates.begin();
+ Unit *ret = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ candidates.clear();
+ return ret;
+ }
+
+ Unit *PickNearestPlayer()
+ {
+ Unit *nearp = NULL;
+ float neardist = 0.0f;
+ std::list<HostilReference*>::iterator i;
+ for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (!pUnit)
+ continue;
+ float pudist = pUnit->GetDistance((const Creature *)m_creature);
+ if (!nearp || (neardist > pudist))
+ {
+ nearp = pUnit;
+ neardist = pudist;
+ }
+ }
+ return nearp;
+ }
+
+ void TeleportToMyBrother()
+ {
+ if (!pInstance)
+ return;
+
+ Teleport_Timer = TELEPORTTIME;
+
+ if(IAmVeklor())
+ return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates
+
+ Creature *pOtherBoss = GetOtherBoss();
+ if (pOtherBoss)
+ {
+ //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
+ float other_x = pOtherBoss->GetPositionX();
+ float other_y = pOtherBoss->GetPositionY();
+ float other_z = pOtherBoss->GetPositionZ();
+ float other_o = pOtherBoss->GetOrientation();
+
+ Map *thismap = m_creature->GetMap();
+ thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(),
+ m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation());
+ thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o);
+
+ SetAfterTeleport();
+ ((boss_twinemperorsAI*) pOtherBoss->AI())->SetAfterTeleport();
+ }
+ }
+
+ void SetAfterTeleport()
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoStopAttack();
+ DoResetThreat();
+ DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL);
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ AfterTeleport = true;
+ AfterTeleportTimer = 2000;
+ tspellcasted = false;
+ }
+
+ bool TryActivateAfterTTelep(uint32 diff)
+ {
+ if (AfterTeleport)
+ {
+ if (!tspellcasted)
+ {
+ m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ DoCast(m_creature, SPELL_TWIN_TELEPORT);
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ }
+
+ tspellcasted = true;
+
+ if (AfterTeleportTimer < diff)
+ {
+ AfterTeleport = false;
+ m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ Unit *nearu = PickNearestPlayer();
+ //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
+ AttackStart(nearu);
+ m_creature->getThreatManager().addThreat(nearu, 10000);
+ return true;
+ }
+ else
+ {
+ AfterTeleportTimer -= diff;
+ // update important timers which would otherwise get skipped
+ if (EnrageTimer > diff)
+ EnrageTimer -= diff;
+ else
+ EnrageTimer = 0;
+ if (Teleport_Timer > diff)
+ Teleport_Timer -= diff;
+ else
+ Teleport_Timer = 0;
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (attackRadius < PULL_RANGE)
+ attackRadius = PULL_RANGE;
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ AttackStart(who);
+ }
+ }
+ }
+
+ class AnyBugCheck
+ {
+ public:
+ AnyBugCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
+ bool operator()(Unit* u)
+ {
+ Creature *c = (Creature *)u;
+ if (!i_obj->IsWithinDistInMap(c, i_range))
+ return false;
+ return (c->GetEntry() == 15316 || c->GetEntry() == 15317);
+ }
+ private:
+ WorldObject const* i_obj;
+ float i_range;
+ };
+
+ Creature *RespawnNearbyBugsAndGetOne()
+ {
+ CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list<Creature*> unitList;
+
+ AnyBugCheck u_check(m_creature, 150);
+ Trinity::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check);
+ TypeContainerVisitor<Trinity::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap()));
+
+ Creature *nearb = NULL;
+
+ for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
+ {
+ Creature *c = (Creature *)(*iter);
+ if (c->isDead())
+ {
+ c->Respawn();
+ c->setFaction(7);
+ c->RemoveAllAuras();
+ }
+ if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
+ {
+ if (!nearb || (rand()%4)==0)
+ nearb = c;
+ }
+ }
+ return nearb;
+ }
+
+ void HandleBugs(uint32 diff)
+ {
+ if (BugsTimer < diff || Abuse_Bug_Timer < diff)
+ {
+ Creature *c = RespawnNearbyBugsAndGetOne();
+ if (Abuse_Bug_Timer < diff)
+ {
+ if (c)
+ {
+ CastSpellOnBug(c);
+ Abuse_Bug_Timer = 10000 + rand()%7000;
+ }
+ else
+ {
+ Abuse_Bug_Timer = 1000;
+ }
+ }
+ else
+ {
+ Abuse_Bug_Timer -= diff;
+ }
+ BugsTimer = 2000;
+ }
+ else
+ {
+ BugsTimer -= diff;
+ Abuse_Bug_Timer -= diff;
+ }
+ }
+
+ void CheckEnrage(uint32 diff)
+ {
+ if (EnrageTimer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(true))
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ EnrageTimer = 60*60000;
+ } else EnrageTimer = 0;
+ } else EnrageTimer-=diff;
+ }
+};
+
+class TRINITY_DLL_DECL BugAura : public Aura
+{
+ public:
+ BugAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
+ {}
+};
+
+struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
+{
+ bool IAmVeklor() {return false;}
+ boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c)
+ {
+ Reset();
+ }
+
+ uint32 UpperCut_Timer;
+ uint32 UnbalancingStrike_Timer;
+ uint32 Scarabs_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+
+ Creature* Summoned;
+
+ void Reset()
+ {
+ TwinReset();
+ UpperCut_Timer = 14000 + rand()%15000;
+ UnbalancingStrike_Timer = 8000 + rand()%10000;
+ Scarabs_Timer = 7000 + rand()%7000;
+
+ //Added. Can be removed if its included in DB.
+ m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+ }
+
+ void CastSpellOnBug(Creature *target)
+ {
+ target->setFaction(14);
+ ((CreatureAI*)target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget());
+ SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MUTATE_BUG);
+ for (int i=0; i<3; i++)
+ {
+ if (!spell->Effect[i])
+ continue;
+ target->AddAura(new BugAura(spell, i, NULL, target, target));
+ }
+ target->SetHealth(target->GetMaxHealth());
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (!TryActivateAfterTTelep(diff))
+ return;
+
+ //UnbalancingStrike_Timer
+ if (UnbalancingStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE);
+ UnbalancingStrike_Timer = 8000+rand()%12000;
+ }else UnbalancingStrike_Timer -= diff;
+
+ if (UpperCut_Timer < diff)
+ {
+ Unit* randomMelee = GetAnyoneCloseEnough(ATTACK_DISTANCE, true);
+ if (randomMelee)
+ DoCast(randomMelee,SPELL_UPPERCUT);
+ UpperCut_Timer = 15000+rand()%15000;
+ }else UpperCut_Timer -= diff;
+
+ HandleBugs(diff);
+
+ //Heal brother when 60yrds close
+ TryHealBrother(diff);
+
+ //Teleporting to brother
+ if(Teleport_Timer < diff)
+ {
+ TeleportToMyBrother();
+ }else Teleport_Timer -= diff;
+
+ CheckEnrage(diff);
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI
+{
+ bool IAmVeklor() {return true;}
+ boss_veklorAI(Creature *c) : boss_twinemperorsAI(c)
+ {
+ Reset();
+ }
+
+ uint32 ShadowBolt_Timer;
+ uint32 Blizzard_Timer;
+ uint32 ArcaneBurst_Timer;
+ uint32 Scorpions_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+
+ Creature* Summoned;
+
+ void Reset()
+ {
+ TwinReset();
+ ShadowBolt_Timer = 0;
+ Blizzard_Timer = 15000 + rand()%5000;;
+ ArcaneBurst_Timer = 1000;
+ Scorpions_Timer = 7000 + rand()%7000;
+
+ //Added. Can be removed if its included in DB.
+ m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
+ m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
+ m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
+ }
+
+ void CastSpellOnBug(Creature *target)
+ {
+ target->setFaction(14);
+ SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_EXPLODEBUG);
+ for (int i=0; i<3; i++)
+ {
+ if (!spell->Effect[i])
+ continue;
+ target->AddAura(new BugAura(spell, i, NULL, target, target));
+ }
+ target->SetHealth(target->GetMaxHealth());
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // reset arcane burst after teleport - we need to do this because
+ // when VL jumps to VN's location there will be a warrior who will get only 2s to run away
+ // which is almost impossible
+ if (AfterTeleport)
+ ArcaneBurst_Timer = 5000;
+ if (!TryActivateAfterTTelep(diff))
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ if (m_creature->GetDistance(m_creature->getVictim()) > 45)
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0);
+ else
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 2000;
+ }else ShadowBolt_Timer -= diff;
+
+ //Blizzard_Timer
+ if (Blizzard_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = GetAnyoneCloseEnough(45, true);
+ if (target)
+ DoCast(target,SPELL_BLIZZARD);
+ Blizzard_Timer = 15000+rand()%15000;
+ }else Blizzard_Timer -= diff;
+
+ if (ArcaneBurst_Timer < diff)
+ {
+ Unit *mvic;
+ if ((mvic=GetAnyoneCloseEnough(ATTACK_DISTANCE, false))!=NULL)
+ {
+ DoCast(mvic,SPELL_ARCANEBURST);
+ ArcaneBurst_Timer = 5000;
+ }
+ }else ArcaneBurst_Timer -= diff;
+
+ HandleBugs(diff);
+
+ //Heal brother when 60yrds close
+ TryHealBrother(diff);
+
+ //Teleporting to brother
+ if(Teleport_Timer < diff)
+ {
+ TeleportToMyBrother();
+ }else Teleport_Timer -= diff;
+
+ CheckEnrage(diff);
+
+ //VL doesn't melee
+ //DoMeleeAttackIfReady();
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ // VL doesn't melee
+ if ( m_creature->Attack(who, false) )
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_veknilash(Creature *_Creature)
+{
+ return new boss_veknilashAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_veklor(Creature *_Creature)
+{
+ return new boss_veklorAI (_Creature);
+}
+
+void AddSC_boss_twinemperors()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_veknilash";
+ newscript->GetAI = GetAI_boss_veknilash;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_veklor";
+ newscript->GetAI = GetAI_boss_veklor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
index a258cc2ac71..16a9655862c 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
@@ -1,29 +1,29 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Viscidus
-SD%Complete: 0
-SDComment: place holder
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_POISON_SHOCK 25993
-#define SPELL_POISONBOLT_VOLLEY 25991
-
-#define SPELL_TOXIN_CLOUD 25989
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Viscidus
+SD%Complete: 0
+SDComment: place holder
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_POISON_SHOCK 25993
+#define SPELL_POISONBOLT_VOLLEY 25991
+
+#define SPELL_TOXIN_CLOUD 25989
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
index 935a1587c2a..fdc6d30a0cb 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
@@ -1,22 +1,22 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_TEMPLE_OF_AHNQIRAJ_H
-#define DEF_TEMPLE_OF_AHNQIRAJ_H
-
-#define DATA_SKERAM 1
-#define DATA_KRI 2
-#define DATA_VEM 3
-#define DATA_VEMISDEAD 4
-#define DATA_VEM_DEATH 5
-#define DATA_VEKLOR 6
-#define DATA_VEKLORISDEAD 7
-#define DATA_VEKLOR_DEATH 8
-#define DATA_VEKNILASH 9
-#define DATA_VEKNILASHISDEAD 10
-#define DATA_VEKNILASH_DEATH 11
-#define DATA_BUG_TRIO_DEATH 14
-
-#define DATA_CTHUN_PHASE 20
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_TEMPLE_OF_AHNQIRAJ_H
+#define DEF_TEMPLE_OF_AHNQIRAJ_H
+
+#define DATA_SKERAM 1
+#define DATA_KRI 2
+#define DATA_VEM 3
+#define DATA_VEMISDEAD 4
+#define DATA_VEM_DEATH 5
+#define DATA_VEKLOR 6
+#define DATA_VEKLORISDEAD 7
+#define DATA_VEKLOR_DEATH 8
+#define DATA_VEKNILASH 9
+#define DATA_VEKNILASHISDEAD 10
+#define DATA_VEKNILASH_DEATH 11
+#define DATA_BUG_TRIO_DEATH 14
+
+#define DATA_CTHUN_PHASE 20
+#endif
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
index 1bd2048b4df..f502b2aa23d 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
@@ -1,165 +1,165 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Temple_of_Ahnqiraj
-SD%Complete: 80
-SDComment:
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_temple_of_ahnqiraj.h"
-
-struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance
-{
- instance_temple_of_ahnqiraj(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- //If Vem is dead...
- bool IsBossDied[3];
-
- //Storing Skeram, Vem and Kri.
- uint64 SkeramGUID;
- uint64 VemGUID;
- uint64 KriGUID;
- uint64 VeklorGUID;
- uint64 VeknilashGUID;
-
- uint32 BugTrioDeathCount;
-
- uint32 CthunPhase;
-
- void Initialize()
- {
- IsBossDied[0] = false;
- IsBossDied[1] = false;
- IsBossDied[2] = false;
-
- SkeramGUID = 0;
- VemGUID = 0;
- KriGUID = 0;
- VeklorGUID = 0;
- VeknilashGUID = 0;
-
- BugTrioDeathCount = 0;
-
- CthunPhase = 0;
- }
-
- void OnCreatureCreate (Creature *creature, uint32 creature_entry)
- {
- switch (creature_entry)
- {
- case 15263: SkeramGUID = creature->GetGUID(); break;
- case 15544: VemGUID = creature->GetGUID(); break;
- case 15511: KriGUID = creature->GetGUID(); break;
- case 15276: VeklorGUID = creature->GetGUID(); break;
- case 15275: VeknilashGUID = creature->GetGUID(); break;
- }
- }
-
- bool IsEncounterInProgress() const
- {
- //not active in AQ40
- return false;
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_VEMISDEAD:
- if(IsBossDied[0])
- return 1;
- break;
-
- case DATA_VEKLORISDEAD:
- if(IsBossDied[1])
- return 1;
- break;
-
- case DATA_VEKNILASHISDEAD:
- if(IsBossDied[2])
- return 1;
- break;
-
- case DATA_BUG_TRIO_DEATH:
- return BugTrioDeathCount;
-
- case DATA_CTHUN_PHASE:
- return CthunPhase;
- }
- return 0;
- }
-
- uint64 GetData64 (uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_SKERAM:
- return SkeramGUID;
- case DATA_VEM:
- return VemGUID;
- case DATA_KRI:
- return KriGUID;
- case DATA_VEKLOR:
- return VeklorGUID;
- case DATA_VEKNILASH:
- return VeknilashGUID;
- }
- return 0;
- } // end GetData64
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_VEM_DEATH:
- IsBossDied[0] = true;
- break;
-
- case DATA_BUG_TRIO_DEATH:
- BugTrioDeathCount++;
- break;
-
- case DATA_VEKLOR_DEATH:
- IsBossDied[1] = true;
- break;
-
- case DATA_VEKNILASH_DEATH:
- IsBossDied[2] = true;
- break;
-
- case DATA_CTHUN_PHASE:
- CthunPhase = data;
- break;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* map)
-{
- return new instance_temple_of_ahnqiraj(map);
-}
-
-void AddSC_instance_temple_of_ahnqiraj()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_temple_of_ahnqiraj";
- newscript->GetInstanceData = GetInstanceData_instance_temple_of_ahnqiraj;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Temple_of_Ahnqiraj
+SD%Complete: 80
+SDComment:
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_temple_of_ahnqiraj.h"
+
+struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance
+{
+ instance_temple_of_ahnqiraj(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ //If Vem is dead...
+ bool IsBossDied[3];
+
+ //Storing Skeram, Vem and Kri.
+ uint64 SkeramGUID;
+ uint64 VemGUID;
+ uint64 KriGUID;
+ uint64 VeklorGUID;
+ uint64 VeknilashGUID;
+
+ uint32 BugTrioDeathCount;
+
+ uint32 CthunPhase;
+
+ void Initialize()
+ {
+ IsBossDied[0] = false;
+ IsBossDied[1] = false;
+ IsBossDied[2] = false;
+
+ SkeramGUID = 0;
+ VemGUID = 0;
+ KriGUID = 0;
+ VeklorGUID = 0;
+ VeknilashGUID = 0;
+
+ BugTrioDeathCount = 0;
+
+ CthunPhase = 0;
+ }
+
+ void OnCreatureCreate (Creature *creature, uint32 creature_entry)
+ {
+ switch (creature_entry)
+ {
+ case 15263: SkeramGUID = creature->GetGUID(); break;
+ case 15544: VemGUID = creature->GetGUID(); break;
+ case 15511: KriGUID = creature->GetGUID(); break;
+ case 15276: VeklorGUID = creature->GetGUID(); break;
+ case 15275: VeknilashGUID = creature->GetGUID(); break;
+ }
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ //not active in AQ40
+ return false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_VEMISDEAD:
+ if(IsBossDied[0])
+ return 1;
+ break;
+
+ case DATA_VEKLORISDEAD:
+ if(IsBossDied[1])
+ return 1;
+ break;
+
+ case DATA_VEKNILASHISDEAD:
+ if(IsBossDied[2])
+ return 1;
+ break;
+
+ case DATA_BUG_TRIO_DEATH:
+ return BugTrioDeathCount;
+
+ case DATA_CTHUN_PHASE:
+ return CthunPhase;
+ }
+ return 0;
+ }
+
+ uint64 GetData64 (uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_SKERAM:
+ return SkeramGUID;
+ case DATA_VEM:
+ return VemGUID;
+ case DATA_KRI:
+ return KriGUID;
+ case DATA_VEKLOR:
+ return VeklorGUID;
+ case DATA_VEKNILASH:
+ return VeknilashGUID;
+ }
+ return 0;
+ } // end GetData64
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_VEM_DEATH:
+ IsBossDied[0] = true;
+ break;
+
+ case DATA_BUG_TRIO_DEATH:
+ BugTrioDeathCount++;
+ break;
+
+ case DATA_VEKLOR_DEATH:
+ IsBossDied[1] = true;
+ break;
+
+ case DATA_VEKNILASH_DEATH:
+ IsBossDied[2] = true;
+ break;
+
+ case DATA_CTHUN_PHASE:
+ CthunPhase = data;
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* map)
+{
+ return new instance_temple_of_ahnqiraj(map);
+}
+
+void AddSC_instance_temple_of_ahnqiraj()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_temple_of_ahnqiraj";
+ newscript->GetInstanceData = GetInstanceData_instance_temple_of_ahnqiraj;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
index 6957b1ad737..1c009721428 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
@@ -1,344 +1,344 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: mob_anubisath_sentinel
-SD%Complete: 95
-SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
-SDCategory: Temple of Ahn'Qiraj
-EndScriptData */
-
-#include "precompiled.h"
-#include "WorldPacket.h"
-
-#include "Item.h"
-#include "Player.h"
-#include "Spell.h"
-
-#include "Cell.h"
-#include "CellImpl.h"
-#include "GridNotifiers.h"
-#include "GridNotifiersImpl.h"
-
-#define SPELL_MENDING_BUFF 2147
-
-#define SPELL_KNOCK_BUFF 21737
-#define SPELL_KNOCK 25778
-#define SPELL_MANAB_BUFF 812
-#define SPELL_MANAB 25779
-
-#define SPELL_REFLECTAF_BUFF 13022
-#define SPELL_REFLECTSFr_BUFF 19595
-#define SPELL_THORNS_BUFF 25777
-
-#define SPELL_THUNDER_BUFF 2834
-#define SPELL_THUNDER 8732
-
-#define SPELL_MSTRIKE_BUFF 9347
-#define SPELL_MSTRIKE 24573
-
-#define SPELL_STORM_BUFF 2148
-#define SPELL_STORM 26546
-
-class NearbyAQSentinel
-{
- public:
- NearbyAQSentinel(Unit const* obj) : i_obj(obj) {}
- bool operator()(Unit* u)
- {
- if (u->GetEntry() == 15264 && i_obj->IsWithinDistInMap(u, 70) && !u->isDead())
- return true;
- else
- return false;
- }
- private:
- Unit const* i_obj;
-};
-
-struct TRINITY_DLL_DECL aqsentinelAI;
-class TRINITY_DLL_DECL SentinelAbilityAura : public Aura
-{
- public:
- ~SentinelAbilityAura();
- Unit* GetTriggerTarget() const;
- SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff);
- protected:
- aqsentinelAI *aOwner;
- int32 currentBasePoints;
- uint32 abilityId;
-};
-
-struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
-{
- uint32 ability;
- int abselected;
-
- void selectAbility(int asel)
- {
- switch (asel)
- {
- case 0: ability = SPELL_MENDING_BUFF;break;
- case 1: ability = SPELL_KNOCK_BUFF;break;
- case 2: ability = SPELL_MANAB_BUFF;break;
- case 3: ability = SPELL_REFLECTAF_BUFF;break;
- case 4: ability = SPELL_REFLECTSFr_BUFF;break;
- case 5: ability = SPELL_THORNS_BUFF;break;
- case 6: ability = SPELL_THUNDER_BUFF;break;
- case 7: ability = SPELL_MSTRIKE_BUFF;break;
- case 8: ability = SPELL_STORM_BUFF;break;
- }
- }
-
- aqsentinelAI(Creature *c) : ScriptedAI(c)
- {
- ClearBudyList();
- abselected = 0; // just initialization of variable
- Reset();
- }
-
- Creature *nearby[3];
-
- void ClearBudyList()
- {
- nearby[0] = nearby[1] = nearby[2] = NULL;
- }
-
- void AddBuddyToList(Creature *c)
- {
- if (c==m_creature)
- return;
- for (int i=0; i<3; i++)
- {
- if (nearby[i] == c)
- return;
- if (!nearby[i])
- {
- nearby[i] = c;
- return;
- }
- }
- }
-
- void GiveBuddyMyList(Creature *c)
- {
- aqsentinelAI *cai = (aqsentinelAI *)(c->AI());
- for (int i=0; i<3; i++)
- if (nearby[i] && nearby[i]!=c)
- cai->AddBuddyToList(nearby[i]);
- cai->AddBuddyToList(m_creature);
- }
-
- void SendMyListToBuddies()
- {
- for (int i=0; i<3; i++)
- if (nearby[i])
- GiveBuddyMyList(nearby[i]);
- }
-
- void CallBuddiesToAttack(Unit *who)
- {
- for (int i=0; i<3; i++)
- {
- Creature *c = nearby[i];
- if (c)
- {
- if (!c->isInCombat())
- {
- c->SetNoCallAssistence(true);
- if(c->AI())
- c->AI()->AttackStart(who);
- }
- }
- }
- }
-
- void AddSentinelsNear(Unit *nears)
- {
- CellPair p(Trinity::ComputeCellPair(nears->GetPositionX(), nears->GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list<Creature*> assistList;
-
- NearbyAQSentinel u_check(nears);
- Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(assistList, u_check);
- TypeContainerVisitor<Trinity::CreatureListSearcher<NearbyAQSentinel>, GridTypeMapContainer > grid_creature_searcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, grid_creature_searcher, *(nears->GetMap()));
-
- for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
- AddBuddyToList((*iter));
- }
-
- int pickAbilityRandom(bool *chosenAbilities)
- {
- for (int t = 0; t < 2; t++)
- {
- for (int i = !t ? (rand()%9) : 0; i < 9; i++)
- {
- if (!chosenAbilities[i])
- {
- chosenAbilities[i] = true;
- return i;
- }
- }
- }
- return 0; // should never happen
- }
-
- void GetOtherSentinels(Unit *who)
- {
- bool *chosenAbilities = new bool[9];
- memset(chosenAbilities, 0, 9*sizeof(bool));
- selectAbility(pickAbilityRandom(chosenAbilities));
-
- ClearBudyList();
- AddSentinelsNear(m_creature);
- int bli;
- for (bli = 0; bli < 3;bli++)
- {
- if (!nearby[bli])
- break;
- AddSentinelsNear(nearby[bli]);
- ((aqsentinelAI *)nearby[bli]->AI())->gatherOthersWhenAggro = false;
- ((aqsentinelAI *)nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities));
- }
- /*if (bli < 3)
- DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
- SendMyListToBuddies();
- CallBuddiesToAttack(who);
- }
-
- bool gatherOthersWhenAggro;
-
- void Reset()
- {
- if (!m_creature->isDead())
- {
- for (int i=0; i<3; i++)
- {
- if (!nearby[i])
- continue;
- if (nearby[i]->isDead())
- nearby[i]->Respawn();
- }
- }
- ClearBudyList();
- gatherOthersWhenAggro = true;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
- }
-
- void GainSentinelAbility(uint32 id)
- {
- const SpellEntry *spell = GetSpellStore()->LookupEntry(id);
- for (int i=0; i<3; i++)
- {
- if (!spell->Effect[i])
- continue;
- SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, i);
- m_creature->AddAura(a);
- }
- if (id == SPELL_KNOCK_BUFF)
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
- }
- }
-
- void Aggro(Unit *who)
- {
- if (gatherOthersWhenAggro)
- GetOtherSentinels(who);
-
- GainSentinelAbility(ability);
- DoZoneInCombat();
- }
-
- void JustDied(Unit*)
- {
- for (int ni=0; ni<3; ni++)
- {
- Creature *sent = nearby[ni];
- if (!sent)
- continue;
- if (sent->isDead())
- continue;
- int h = sent->GetHealth() + (sent->GetMaxHealth() / 2);
- if (h > sent->GetMaxHealth())
- h = sent->GetMaxHealth();
- sent->SetHealth(h);
- ((aqsentinelAI *)sent->AI())->GainSentinelAbility(ability);
- }
- }
-
- Unit *GetHatedManaUser()
- {
- std::list<HostilReference*>::iterator i;
- for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if (pUnit->getPowerType()==POWER_MANA)
- return pUnit;
- }
- return NULL;
- }
-};
-CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature *_Creature)
-{
- return new aqsentinelAI (_Creature);
-}
-
-void AddSC_mob_anubisath_sentinel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="mob_anubisath_sentinel";
- newscript->GetAI = GetAI_mob_anubisath_sentinelAI;
- m_scripts[nrscripts++] = newscript;
-}
-
-SentinelAbilityAura::~SentinelAbilityAura() {}
-Unit* SentinelAbilityAura::GetTriggerTarget() const
-{
- switch (abilityId)
- {
- case SPELL_KNOCK_BUFF:
- case SPELL_THUNDER_BUFF:
- case SPELL_MSTRIKE_BUFF:
- case SPELL_STORM_BUFF:
- return aOwner->m_creature->getVictim();
-
- case SPELL_MANAB_BUFF:
- return aOwner->GetHatedManaUser();
-
- case SPELL_MENDING_BUFF:
- case SPELL_REFLECTAF_BUFF:
- case SPELL_REFLECTSFr_BUFF:
- case SPELL_THORNS_BUFF:
- default:
- return aOwner->m_creature;
- }
-}
-
-SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff)
-: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL)
-{
- aOwner = abilityOwner;
- abilityId = ability;
- currentBasePoints = 0;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: mob_anubisath_sentinel
+SD%Complete: 95
+SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
+SDCategory: Temple of Ahn'Qiraj
+EndScriptData */
+
+#include "precompiled.h"
+#include "WorldPacket.h"
+
+#include "Item.h"
+#include "Player.h"
+#include "Spell.h"
+
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+
+#define SPELL_MENDING_BUFF 2147
+
+#define SPELL_KNOCK_BUFF 21737
+#define SPELL_KNOCK 25778
+#define SPELL_MANAB_BUFF 812
+#define SPELL_MANAB 25779
+
+#define SPELL_REFLECTAF_BUFF 13022
+#define SPELL_REFLECTSFr_BUFF 19595
+#define SPELL_THORNS_BUFF 25777
+
+#define SPELL_THUNDER_BUFF 2834
+#define SPELL_THUNDER 8732
+
+#define SPELL_MSTRIKE_BUFF 9347
+#define SPELL_MSTRIKE 24573
+
+#define SPELL_STORM_BUFF 2148
+#define SPELL_STORM 26546
+
+class NearbyAQSentinel
+{
+ public:
+ NearbyAQSentinel(Unit const* obj) : i_obj(obj) {}
+ bool operator()(Unit* u)
+ {
+ if (u->GetEntry() == 15264 && i_obj->IsWithinDistInMap(u, 70) && !u->isDead())
+ return true;
+ else
+ return false;
+ }
+ private:
+ Unit const* i_obj;
+};
+
+struct TRINITY_DLL_DECL aqsentinelAI;
+class TRINITY_DLL_DECL SentinelAbilityAura : public Aura
+{
+ public:
+ ~SentinelAbilityAura();
+ Unit* GetTriggerTarget() const;
+ SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff);
+ protected:
+ aqsentinelAI *aOwner;
+ int32 currentBasePoints;
+ uint32 abilityId;
+};
+
+struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
+{
+ uint32 ability;
+ int abselected;
+
+ void selectAbility(int asel)
+ {
+ switch (asel)
+ {
+ case 0: ability = SPELL_MENDING_BUFF;break;
+ case 1: ability = SPELL_KNOCK_BUFF;break;
+ case 2: ability = SPELL_MANAB_BUFF;break;
+ case 3: ability = SPELL_REFLECTAF_BUFF;break;
+ case 4: ability = SPELL_REFLECTSFr_BUFF;break;
+ case 5: ability = SPELL_THORNS_BUFF;break;
+ case 6: ability = SPELL_THUNDER_BUFF;break;
+ case 7: ability = SPELL_MSTRIKE_BUFF;break;
+ case 8: ability = SPELL_STORM_BUFF;break;
+ }
+ }
+
+ aqsentinelAI(Creature *c) : ScriptedAI(c)
+ {
+ ClearBudyList();
+ abselected = 0; // just initialization of variable
+ Reset();
+ }
+
+ Creature *nearby[3];
+
+ void ClearBudyList()
+ {
+ nearby[0] = nearby[1] = nearby[2] = NULL;
+ }
+
+ void AddBuddyToList(Creature *c)
+ {
+ if (c==m_creature)
+ return;
+ for (int i=0; i<3; i++)
+ {
+ if (nearby[i] == c)
+ return;
+ if (!nearby[i])
+ {
+ nearby[i] = c;
+ return;
+ }
+ }
+ }
+
+ void GiveBuddyMyList(Creature *c)
+ {
+ aqsentinelAI *cai = (aqsentinelAI *)(c->AI());
+ for (int i=0; i<3; i++)
+ if (nearby[i] && nearby[i]!=c)
+ cai->AddBuddyToList(nearby[i]);
+ cai->AddBuddyToList(m_creature);
+ }
+
+ void SendMyListToBuddies()
+ {
+ for (int i=0; i<3; i++)
+ if (nearby[i])
+ GiveBuddyMyList(nearby[i]);
+ }
+
+ void CallBuddiesToAttack(Unit *who)
+ {
+ for (int i=0; i<3; i++)
+ {
+ Creature *c = nearby[i];
+ if (c)
+ {
+ if (!c->isInCombat())
+ {
+ c->SetNoCallAssistence(true);
+ if(c->AI())
+ c->AI()->AttackStart(who);
+ }
+ }
+ }
+ }
+
+ void AddSentinelsNear(Unit *nears)
+ {
+ CellPair p(Trinity::ComputeCellPair(nears->GetPositionX(), nears->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list<Creature*> assistList;
+
+ NearbyAQSentinel u_check(nears);
+ Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(assistList, u_check);
+ TypeContainerVisitor<Trinity::CreatureListSearcher<NearbyAQSentinel>, GridTypeMapContainer > grid_creature_searcher(searcher);
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, grid_creature_searcher, *(nears->GetMap()));
+
+ for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
+ AddBuddyToList((*iter));
+ }
+
+ int pickAbilityRandom(bool *chosenAbilities)
+ {
+ for (int t = 0; t < 2; t++)
+ {
+ for (int i = !t ? (rand()%9) : 0; i < 9; i++)
+ {
+ if (!chosenAbilities[i])
+ {
+ chosenAbilities[i] = true;
+ return i;
+ }
+ }
+ }
+ return 0; // should never happen
+ }
+
+ void GetOtherSentinels(Unit *who)
+ {
+ bool *chosenAbilities = new bool[9];
+ memset(chosenAbilities, 0, 9*sizeof(bool));
+ selectAbility(pickAbilityRandom(chosenAbilities));
+
+ ClearBudyList();
+ AddSentinelsNear(m_creature);
+ int bli;
+ for (bli = 0; bli < 3;bli++)
+ {
+ if (!nearby[bli])
+ break;
+ AddSentinelsNear(nearby[bli]);
+ ((aqsentinelAI *)nearby[bli]->AI())->gatherOthersWhenAggro = false;
+ ((aqsentinelAI *)nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities));
+ }
+ /*if (bli < 3)
+ DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
+ SendMyListToBuddies();
+ CallBuddiesToAttack(who);
+ }
+
+ bool gatherOthersWhenAggro;
+
+ void Reset()
+ {
+ if (!m_creature->isDead())
+ {
+ for (int i=0; i<3; i++)
+ {
+ if (!nearby[i])
+ continue;
+ if (nearby[i]->isDead())
+ nearby[i]->Respawn();
+ }
+ }
+ ClearBudyList();
+ gatherOthersWhenAggro = true;
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
+ }
+
+ void GainSentinelAbility(uint32 id)
+ {
+ const SpellEntry *spell = GetSpellStore()->LookupEntry(id);
+ for (int i=0; i<3; i++)
+ {
+ if (!spell->Effect[i])
+ continue;
+ SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, i);
+ m_creature->AddAura(a);
+ }
+ if (id == SPELL_KNOCK_BUFF)
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (gatherOthersWhenAggro)
+ GetOtherSentinels(who);
+
+ GainSentinelAbility(ability);
+ DoZoneInCombat();
+ }
+
+ void JustDied(Unit*)
+ {
+ for (int ni=0; ni<3; ni++)
+ {
+ Creature *sent = nearby[ni];
+ if (!sent)
+ continue;
+ if (sent->isDead())
+ continue;
+ int h = sent->GetHealth() + (sent->GetMaxHealth() / 2);
+ if (h > sent->GetMaxHealth())
+ h = sent->GetMaxHealth();
+ sent->SetHealth(h);
+ ((aqsentinelAI *)sent->AI())->GainSentinelAbility(ability);
+ }
+ }
+
+ Unit *GetHatedManaUser()
+ {
+ std::list<HostilReference*>::iterator i;
+ for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (pUnit->getPowerType()==POWER_MANA)
+ return pUnit;
+ }
+ return NULL;
+ }
+};
+CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature *_Creature)
+{
+ return new aqsentinelAI (_Creature);
+}
+
+void AddSC_mob_anubisath_sentinel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="mob_anubisath_sentinel";
+ newscript->GetAI = GetAI_mob_anubisath_sentinelAI;
+ m_scripts[nrscripts++] = newscript;
+}
+
+SentinelAbilityAura::~SentinelAbilityAura() {}
+Unit* SentinelAbilityAura::GetTriggerTarget() const
+{
+ switch (abilityId)
+ {
+ case SPELL_KNOCK_BUFF:
+ case SPELL_THUNDER_BUFF:
+ case SPELL_MSTRIKE_BUFF:
+ case SPELL_STORM_BUFF:
+ return aOwner->m_creature->getVictim();
+
+ case SPELL_MANAB_BUFF:
+ return aOwner->GetHatedManaUser();
+
+ case SPELL_MENDING_BUFF:
+ case SPELL_REFLECTAF_BUFF:
+ case SPELL_REFLECTSFr_BUFF:
+ case SPELL_THORNS_BUFF:
+ default:
+ return aOwner->m_creature;
+ }
+}
+
+SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff)
+: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL)
+{
+ aOwner = abilityOwner;
+ abilityId = ability;
+ currentBasePoints = 0;
+}
diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
index 1e81012bbd2..d38b7186172 100644
--- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
@@ -1,399 +1,399 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Terokkar_Forest
-SD%Complete: 80
-SDComment: Quest support: 9889(test script only, sql inside script), 10009, 10873, 10896, 11096. Skettis->Ogri'la Flight
-SDCategory: Terokkar Forest
-EndScriptData */
-
-/* ContentData
-mob_unkor_the_ruthless
-mob_infested_root_walker
-mob_rotting_forest_rager
-mob_netherweb_victim
-npc_floon
-npc_skyguard_handler_deesak
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_unkor_the_ruthless
-######*/
-
-/*
-UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
-*/
-
-#define SAY_SUBMIT "I give up! Please don't kill me!"
-
-#define FACTION_HOSTILE 45
-#define FACTION_FRIENDLY 35
-#define QUEST_DONTKILLTHEFATONE 9889
-
-#define SPELL_PULVERIZE 2676
-//#define SPELL_QUID9889 32174
-
-struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
-{
- mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- bool CanDoQuest;
- uint32 UnkorUnfriendly_Timer;
- uint32 Pulverize_Timer;
-
- void Reset()
- {
- CanDoQuest = false;
- UnkorUnfriendly_Timer = 0;
- Pulverize_Timer = 3000;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
- m_creature->setFaction(FACTION_HOSTILE);
- }
-
- void Aggro(Unit *who) {}
-
- void DoNice()
- {
- DoSay(SAY_SUBMIT,LANG_UNIVERSAL,NULL);
- m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- UnkorUnfriendly_Timer = 60000;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( done_by->GetTypeId() == TYPEID_PLAYER )
- if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30 )
- {
- if( Group* pGroup = ((Player*)done_by)->GetGroup() )
- {
- for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player *pGroupie = itr->getSource();
- if( pGroupie &&
- pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
- {
- pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
- if( !CanDoQuest )
- CanDoQuest = true;
- }
- }
- } else
- if( ((Player*)done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- ((Player*)done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
- {
- ((Player*)done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
- CanDoQuest = true;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( CanDoQuest )
- {
- if( !UnkorUnfriendly_Timer )
- {
- //DoCast(m_creature,SPELL_QUID9889); //not using spell for now
- DoNice();
- }
- else
- {
- if( UnkorUnfriendly_Timer < diff )
- {
- EnterEvadeMode();
- }else UnkorUnfriendly_Timer -= diff;
- }
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Pulverize_Timer < diff )
- {
- DoCast(m_creature,SPELL_PULVERIZE);
- Pulverize_Timer = 9000;
- }else Pulverize_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_unkor_the_ruthless(Creature *_Creature)
-{
- return new mob_unkor_the_ruthlessAI (_Creature);
-}
-
-/*######
-## mob_infested_root_walker
-######*/
-
-struct TRINITY_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI
-{
- mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() { }
- void Aggro(Unit *who) { }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
- if (m_creature->GetHealth() <= damage)
- if (rand()%100 < 75)
- //Summon Wood Mites
- m_creature->CastSpell(m_creature,39130,true);
- }
-};
-CreatureAI* GetAI_mob_infested_root_walker(Creature *_Creature)
-{
- return new mob_infested_root_walkerAI (_Creature);
-}
-
-/*######
-## mob_rotting_forest_rager
-######*/
-
-struct TRINITY_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI
-{
- mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() { }
- void Aggro(Unit *who) { }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (done_by->GetTypeId() == TYPEID_PLAYER)
- if (m_creature->GetHealth() <= damage)
- if (rand()%100 < 75)
- //Summon Lots of Wood Mights
- m_creature->CastSpell(m_creature,39134,true);
- }
-};
-CreatureAI* GetAI_mob_rotting_forest_rager(Creature *_Creature)
-{
- return new mob_rotting_forest_ragerAI (_Creature);
-}
-
-/*######
-## mob_netherweb_victim
-######*/
-
-#define QUEST_TARGET 22459
-//#define SPELL_FREE_WEBBED 38950
-
-const uint32 netherwebVictims[6] =
-{
- 18470, 16805, 21242, 18452, 22482, 21285
-};
-struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
-{
- mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() { }
- void Aggro(Unit *who) { }
- void MoveInLineOfSight(Unit *who) { }
-
- void JustDied(Unit* Killer)
- {
- if( Killer->GetTypeId() == TYPEID_PLAYER )
- {
- if( ((Player*)Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE )
- {
- if( rand()%100 < 25 )
- {
- DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
- ((Player*)Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID());
- }else
- DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
-
- if( rand()%100 < 75 )
- DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
- DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
- }
- }
- }
-};
-CreatureAI* GetAI_mob_netherweb_victim(Creature *_Creature)
-{
- return new mob_netherweb_victimAI (_Creature);
-}
-
-/*######
-## npc_floon
-######*/
-
-#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
-#define GOSSIP_FLOON2 "Hand over the money or die...again!"
-#define SAY_FLOON_ATTACK "I choose the third option: KILLING YOU!"
-
-#define FACTION_HOSTILE_FL 1738
-#define FACTION_FRIENDLY_FL 35
-
-#define SPELL_SILENCE 6726
-#define SPELL_FROSTBOLT 9672
-#define SPELL_FROST_NOVA 11831
-
-struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI
-{
- npc_floonAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 Silence_Timer;
- uint32 Frostbolt_Timer;
- uint32 FrostNova_Timer;
-
- void Reset()
- {
- Silence_Timer = 2000;
- Frostbolt_Timer = 4000;
- FrostNova_Timer = 9000;
- m_creature->setFaction(FACTION_FRIENDLY_FL);
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Silence_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_SILENCE);
- Silence_Timer = 30000;
- }else Silence_Timer -= diff;
-
- if( FrostNova_Timer < diff )
- {
- DoCast(m_creature,SPELL_FROST_NOVA);
- FrostNova_Timer = 20000;
- }else FrostNova_Timer -= diff;
-
- if( Frostbolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- Frostbolt_Timer = 5000;
- }else Frostbolt_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_floon(Creature *_Creature)
-{
- return new npc_floonAI (_Creature);
-}
-
-bool GossipHello_npc_floon(Player *player, Creature *_Creature )
-{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9442, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_floon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(9443, _Creature->GetGUID());
- }
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(FACTION_HOSTILE_FL);
- ((npc_floonAI*)_Creature->AI())->DoSay(SAY_FLOON_ATTACK,LANG_UNIVERSAL,player);
- ((npc_floonAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-## npc_skyguard_handler_deesak
-######*/
-
-#define GOSSIP_SKYGUARD "Fly me to Ogri'la please"
-
-bool GossipHello_npc_skyguard_handler_deesak(Player *player, Creature *_Creature )
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetReputationRank(1031) >= REP_HONORED)
- player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_skyguard_handler_deesak(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_terokkar_forest()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_unkor_the_ruthless";
- newscript->GetAI = GetAI_mob_unkor_the_ruthless;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_infested_root_walker";
- newscript->GetAI = GetAI_mob_infested_root_walker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_rotting_forest_rager";
- newscript->GetAI = GetAI_mob_rotting_forest_rager;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_netherweb_victim";
- newscript->GetAI = GetAI_mob_netherweb_victim;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_floon";
- newscript->pGossipHello = &GossipHello_npc_floon;
- newscript->pGossipSelect = &GossipSelect_npc_floon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_skyguard_handler_deesak";
- newscript->pGossipHello = &GossipHello_npc_skyguard_handler_deesak;
- newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_deesak;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Terokkar_Forest
+SD%Complete: 80
+SDComment: Quest support: 9889(test script only, sql inside script), 10009, 10873, 10896, 11096. Skettis->Ogri'la Flight
+SDCategory: Terokkar Forest
+EndScriptData */
+
+/* ContentData
+mob_unkor_the_ruthless
+mob_infested_root_walker
+mob_rotting_forest_rager
+mob_netherweb_victim
+npc_floon
+npc_skyguard_handler_deesak
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_unkor_the_ruthless
+######*/
+
+/*
+UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
+*/
+
+#define SAY_SUBMIT "I give up! Please don't kill me!"
+
+#define FACTION_HOSTILE 45
+#define FACTION_FRIENDLY 35
+#define QUEST_DONTKILLTHEFATONE 9889
+
+#define SPELL_PULVERIZE 2676
+//#define SPELL_QUID9889 32174
+
+struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
+{
+ mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ bool CanDoQuest;
+ uint32 UnkorUnfriendly_Timer;
+ uint32 Pulverize_Timer;
+
+ void Reset()
+ {
+ CanDoQuest = false;
+ UnkorUnfriendly_Timer = 0;
+ Pulverize_Timer = 3000;
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->setFaction(FACTION_HOSTILE);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void DoNice()
+ {
+ DoSay(SAY_SUBMIT,LANG_UNIVERSAL,NULL);
+ m_creature->setFaction(FACTION_FRIENDLY);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ UnkorUnfriendly_Timer = 60000;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( done_by->GetTypeId() == TYPEID_PLAYER )
+ if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30 )
+ {
+ if( Group* pGroup = ((Player*)done_by)->GetGroup() )
+ {
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player *pGroupie = itr->getSource();
+ if( pGroupie &&
+ pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
+ pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
+ {
+ pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
+ if( !CanDoQuest )
+ CanDoQuest = true;
+ }
+ }
+ } else
+ if( ((Player*)done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
+ ((Player*)done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
+ {
+ ((Player*)done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
+ CanDoQuest = true;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( CanDoQuest )
+ {
+ if( !UnkorUnfriendly_Timer )
+ {
+ //DoCast(m_creature,SPELL_QUID9889); //not using spell for now
+ DoNice();
+ }
+ else
+ {
+ if( UnkorUnfriendly_Timer < diff )
+ {
+ EnterEvadeMode();
+ }else UnkorUnfriendly_Timer -= diff;
+ }
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Pulverize_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_PULVERIZE);
+ Pulverize_Timer = 9000;
+ }else Pulverize_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_unkor_the_ruthless(Creature *_Creature)
+{
+ return new mob_unkor_the_ruthlessAI (_Creature);
+}
+
+/*######
+## mob_infested_root_walker
+######*/
+
+struct TRINITY_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI
+{
+ mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+ void Aggro(Unit *who) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
+ if (m_creature->GetHealth() <= damage)
+ if (rand()%100 < 75)
+ //Summon Wood Mites
+ m_creature->CastSpell(m_creature,39130,true);
+ }
+};
+CreatureAI* GetAI_mob_infested_root_walker(Creature *_Creature)
+{
+ return new mob_infested_root_walkerAI (_Creature);
+}
+
+/*######
+## mob_rotting_forest_rager
+######*/
+
+struct TRINITY_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI
+{
+ mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+ void Aggro(Unit *who) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by->GetTypeId() == TYPEID_PLAYER)
+ if (m_creature->GetHealth() <= damage)
+ if (rand()%100 < 75)
+ //Summon Lots of Wood Mights
+ m_creature->CastSpell(m_creature,39134,true);
+ }
+};
+CreatureAI* GetAI_mob_rotting_forest_rager(Creature *_Creature)
+{
+ return new mob_rotting_forest_ragerAI (_Creature);
+}
+
+/*######
+## mob_netherweb_victim
+######*/
+
+#define QUEST_TARGET 22459
+//#define SPELL_FREE_WEBBED 38950
+
+const uint32 netherwebVictims[6] =
+{
+ 18470, 16805, 21242, 18452, 22482, 21285
+};
+struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
+{
+ mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+ void Aggro(Unit *who) { }
+ void MoveInLineOfSight(Unit *who) { }
+
+ void JustDied(Unit* Killer)
+ {
+ if( Killer->GetTypeId() == TYPEID_PLAYER )
+ {
+ if( ((Player*)Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE )
+ {
+ if( rand()%100 < 25 )
+ {
+ DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
+ ((Player*)Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID());
+ }else
+ DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
+
+ if( rand()%100 < 75 )
+ DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
+ DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
+ }
+ }
+ }
+};
+CreatureAI* GetAI_mob_netherweb_victim(Creature *_Creature)
+{
+ return new mob_netherweb_victimAI (_Creature);
+}
+
+/*######
+## npc_floon
+######*/
+
+#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
+#define GOSSIP_FLOON2 "Hand over the money or die...again!"
+#define SAY_FLOON_ATTACK "I choose the third option: KILLING YOU!"
+
+#define FACTION_HOSTILE_FL 1738
+#define FACTION_FRIENDLY_FL 35
+
+#define SPELL_SILENCE 6726
+#define SPELL_FROSTBOLT 9672
+#define SPELL_FROST_NOVA 11831
+
+struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI
+{
+ npc_floonAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 Silence_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 FrostNova_Timer;
+
+ void Reset()
+ {
+ Silence_Timer = 2000;
+ Frostbolt_Timer = 4000;
+ FrostNova_Timer = 9000;
+ m_creature->setFaction(FACTION_FRIENDLY_FL);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Silence_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_SILENCE);
+ Silence_Timer = 30000;
+ }else Silence_Timer -= diff;
+
+ if( FrostNova_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_FROST_NOVA);
+ FrostNova_Timer = 20000;
+ }else FrostNova_Timer -= diff;
+
+ if( Frostbolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ Frostbolt_Timer = 5000;
+ }else Frostbolt_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_floon(Creature *_Creature)
+{
+ return new npc_floonAI (_Creature);
+}
+
+bool GossipHello_npc_floon(Player *player, Creature *_Creature )
+{
+ if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(9442, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_floon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(9443, _Creature->GetGUID());
+ }
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(FACTION_HOSTILE_FL);
+ ((npc_floonAI*)_Creature->AI())->DoSay(SAY_FLOON_ATTACK,LANG_UNIVERSAL,player);
+ ((npc_floonAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+## npc_skyguard_handler_deesak
+######*/
+
+#define GOSSIP_SKYGUARD "Fly me to Ogri'la please"
+
+bool GossipHello_npc_skyguard_handler_deesak(Player *player, Creature *_Creature )
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetReputationRank(1031) >= REP_HONORED)
+ player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_skyguard_handler_deesak(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_terokkar_forest()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_unkor_the_ruthless";
+ newscript->GetAI = GetAI_mob_unkor_the_ruthless;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_infested_root_walker";
+ newscript->GetAI = GetAI_mob_infested_root_walker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_rotting_forest_rager";
+ newscript->GetAI = GetAI_mob_rotting_forest_rager;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_netherweb_victim";
+ newscript->GetAI = GetAI_mob_netherweb_victim;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_floon";
+ newscript->pGossipHello = &GossipHello_npc_floon;
+ newscript->pGossipSelect = &GossipSelect_npc_floon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_skyguard_handler_deesak";
+ newscript->pGossipHello = &GossipHello_npc_skyguard_handler_deesak;
+ newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_deesak;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
index 9a862fa7c6a..ae65bd9d232 100644
--- a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
+++ b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
@@ -1,136 +1,136 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Thunder_Bluff
-SD%Complete: 100
-SDComment: Quest support: 925
-SDCategory: Thunder Bluff
-EndScriptData */
-
-#include "precompiled.h"
-
-/*#####
-# npc_cairne_bloodhoof
-######*/
-
-#define SPELL_BERSERKER_CHARGE 16636
-#define SPELL_CLEAVE 16044
-#define SPELL_MORTAL_STRIKE 16856
-#define SPELL_THUNDERCLAP 23931
-#define SPELL_UPPERCUT 22916
-
-//TODO: verify abilities/timers
-struct TRINITY_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI
-{
- npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 BerserkerCharge_Timer;
- uint32 Cleave_Timer;
- uint32 MortalStrike_Timer;
- uint32 Thunderclap_Timer;
- uint32 Uppercut_Timer;
-
- void Reset()
- {
- BerserkerCharge_Timer = 30000;
- Cleave_Timer = 5000;
- MortalStrike_Timer = 10000;
- Thunderclap_Timer = 15000;
- Uppercut_Timer = 10000;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( BerserkerCharge_Timer < diff )
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if( target )
- DoCast(target,SPELL_BERSERKER_CHARGE);
- BerserkerCharge_Timer = 25000;
- }else BerserkerCharge_Timer -= diff;
-
- if( Uppercut_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
- Uppercut_Timer = 20000;
- }else Uppercut_Timer -= diff;
-
- if( Thunderclap_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- Thunderclap_Timer = 15000;
- }else Thunderclap_Timer -= diff;
-
- if( MortalStrike_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE);
- MortalStrike_Timer = 15000;
- }else MortalStrike_Timer -= diff;
-
- if( Cleave_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_cairne_bloodhoof(Creature *_Creature)
-{
- return new npc_cairne_bloodhoofAI (_Creature);
-}
-
-bool GossipHello_npc_cairne_bloodhoof(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "I know this is rather silly but a young ward who is a bit shy would like your hoofprint.", GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO );
-
- player->SEND_GOSSIP_MENU(7013, _Creature->GetGUID() );
-
- return true;
-}
-
-bool GossipSelect_npc_cairne_bloodhoof(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_SENDER_INFO )
- {
- player->CastSpell(player, 23123, false);
- player->SEND_GOSSIP_MENU(7014, _Creature->GetGUID() );
- }
- return true;
-}
-
-void AddSC_thunder_bluff()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_cairne_bloodhoof";
- newscript->GetAI = GetAI_npc_cairne_bloodhoof;
- newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof;
- newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Thunder_Bluff
+SD%Complete: 100
+SDComment: Quest support: 925
+SDCategory: Thunder Bluff
+EndScriptData */
+
+#include "precompiled.h"
+
+/*#####
+# npc_cairne_bloodhoof
+######*/
+
+#define SPELL_BERSERKER_CHARGE 16636
+#define SPELL_CLEAVE 16044
+#define SPELL_MORTAL_STRIKE 16856
+#define SPELL_THUNDERCLAP 23931
+#define SPELL_UPPERCUT 22916
+
+//TODO: verify abilities/timers
+struct TRINITY_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI
+{
+ npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 BerserkerCharge_Timer;
+ uint32 Cleave_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 Thunderclap_Timer;
+ uint32 Uppercut_Timer;
+
+ void Reset()
+ {
+ BerserkerCharge_Timer = 30000;
+ Cleave_Timer = 5000;
+ MortalStrike_Timer = 10000;
+ Thunderclap_Timer = 15000;
+ Uppercut_Timer = 10000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( BerserkerCharge_Timer < diff )
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if( target )
+ DoCast(target,SPELL_BERSERKER_CHARGE);
+ BerserkerCharge_Timer = 25000;
+ }else BerserkerCharge_Timer -= diff;
+
+ if( Uppercut_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
+ Uppercut_Timer = 20000;
+ }else Uppercut_Timer -= diff;
+
+ if( Thunderclap_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ Thunderclap_Timer = 15000;
+ }else Thunderclap_Timer -= diff;
+
+ if( MortalStrike_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE);
+ MortalStrike_Timer = 15000;
+ }else MortalStrike_Timer -= diff;
+
+ if( Cleave_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_cairne_bloodhoof(Creature *_Creature)
+{
+ return new npc_cairne_bloodhoofAI (_Creature);
+}
+
+bool GossipHello_npc_cairne_bloodhoof(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "I know this is rather silly but a young ward who is a bit shy would like your hoofprint.", GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO );
+
+ player->SEND_GOSSIP_MENU(7013, _Creature->GetGUID() );
+
+ return true;
+}
+
+bool GossipSelect_npc_cairne_bloodhoof(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_SENDER_INFO )
+ {
+ player->CastSpell(player, 23123, false);
+ player->SEND_GOSSIP_MENU(7014, _Creature->GetGUID() );
+ }
+ return true;
+}
+
+void AddSC_thunder_bluff()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_cairne_bloodhoof";
+ newscript->GetAI = GetAI_npc_cairne_bloodhoof;
+ newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof;
+ newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
index 518163942fc..f95bc029752 100644
--- a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
+++ b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
@@ -1,88 +1,88 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Tirisfal_Glades
-SD%Complete: 100
-SDComment: Quest support: 590
-SDCategory: Tirisfal Glades
-EndScriptData */
-
-/* ContentData
-npc_calvin_montague
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_calvin_montague
-######*/
-
-#define QUEST_590 590
-#define FACTION_FRIENDLY 68
-#define FACTION_HOSTILE 16
-
-struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI
-{
- npc_calvin_montagueAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- void Reset()
- {
- m_creature->setFaction(FACTION_FRIENDLY);
- }
-
- void Aggro(Unit* who) { }
-
- void JustDied(Unit* Killer)
- {
- if( Killer->GetTypeId() == TYPEID_PLAYER )
- if( ((Player*)Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE )
- ((Player*)Killer)->AreaExploredOrEventHappens(QUEST_590);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_calvin_montague(Creature *_Creature)
-{
- return new npc_calvin_montagueAI (_Creature);
-}
-
-bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest const* quest)
-{
- if( quest->GetQuestId() == QUEST_590 )
- {
- creature->setFaction(FACTION_HOSTILE);
- ((npc_calvin_montagueAI*)creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-void AddSC_tirisfal_glades()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_calvin_montague";
- newscript->GetAI = GetAI_npc_calvin_montague;
- newscript->pQuestAccept = &QuestAccept_npc_calvin_montague;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Tirisfal_Glades
+SD%Complete: 100
+SDComment: Quest support: 590
+SDCategory: Tirisfal Glades
+EndScriptData */
+
+/* ContentData
+npc_calvin_montague
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_calvin_montague
+######*/
+
+#define QUEST_590 590
+#define FACTION_FRIENDLY 68
+#define FACTION_HOSTILE 16
+
+struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI
+{
+ npc_calvin_montagueAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ void Reset()
+ {
+ m_creature->setFaction(FACTION_FRIENDLY);
+ }
+
+ void Aggro(Unit* who) { }
+
+ void JustDied(Unit* Killer)
+ {
+ if( Killer->GetTypeId() == TYPEID_PLAYER )
+ if( ((Player*)Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE )
+ ((Player*)Killer)->AreaExploredOrEventHappens(QUEST_590);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_calvin_montague(Creature *_Creature)
+{
+ return new npc_calvin_montagueAI (_Creature);
+}
+
+bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest const* quest)
+{
+ if( quest->GetQuestId() == QUEST_590 )
+ {
+ creature->setFaction(FACTION_HOSTILE);
+ ((npc_calvin_montagueAI*)creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+void AddSC_tirisfal_glades()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_calvin_montague";
+ newscript->GetAI = GetAI_npc_calvin_montague;
+ newscript->pQuestAccept = &QuestAccept_npc_calvin_montague;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
index 3f882fce3de..34f8fda78cf 100644
--- a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
+++ b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
@@ -1,107 +1,107 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ironaya
-SD%Complete: 100
-SDComment:
-SDCategory: Uldaman
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ARCINGSMASH 39144
-#define SPELL_KNOCKAWAY 22893
-#define SPELL_WSTOMP 16727
-
-#define SAY_AGGRO "None may steal the secrets of the makers!"
-#define SOUND_AGGRO 5851
-
-struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI
-{
- boss_ironayaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Arcing_Timer;
- bool hasCastedWstomp;
- bool hasCastedKnockaway;
-
- void Reset()
- {
- Arcing_Timer = 3000;
- hasCastedKnockaway = false;
- hasCastedWstomp = false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //If we are <50% hp do knockaway ONCE
- if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth())
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true);
-
- // current aggro target is knocked away pick new target
- Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
-
- if (!Target || Target == m_creature->getVictim())
- Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
-
- if (Target)
- m_creature->TauntApply(Target);
-
- //Shouldn't cast this agian
- hasCastedKnockaway = true;
- }
-
- //Arcing_Timer
- if (Arcing_Timer < diff)
- {
- DoCast(m_creature,SPELL_ARCINGSMASH);
- Arcing_Timer = 13000;
- }else Arcing_Timer -= diff;
-
- if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth())
- {
- DoCast(m_creature,SPELL_WSTOMP);
- hasCastedWstomp = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_ironaya(Creature *_Creature)
-{
- return new boss_ironayaAI (_Creature);
-}
-
-void AddSC_boss_ironaya()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ironaya";
- newscript->GetAI = GetAI_boss_ironaya;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ironaya
+SD%Complete: 100
+SDComment:
+SDCategory: Uldaman
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ARCINGSMASH 39144
+#define SPELL_KNOCKAWAY 22893
+#define SPELL_WSTOMP 16727
+
+#define SAY_AGGRO "None may steal the secrets of the makers!"
+#define SOUND_AGGRO 5851
+
+struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI
+{
+ boss_ironayaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Arcing_Timer;
+ bool hasCastedWstomp;
+ bool hasCastedKnockaway;
+
+ void Reset()
+ {
+ Arcing_Timer = 3000;
+ hasCastedKnockaway = false;
+ hasCastedWstomp = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //If we are <50% hp do knockaway ONCE
+ if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth())
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true);
+
+ // current aggro target is knocked away pick new target
+ Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
+
+ if (!Target || Target == m_creature->getVictim())
+ Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+
+ if (Target)
+ m_creature->TauntApply(Target);
+
+ //Shouldn't cast this agian
+ hasCastedKnockaway = true;
+ }
+
+ //Arcing_Timer
+ if (Arcing_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ARCINGSMASH);
+ Arcing_Timer = 13000;
+ }else Arcing_Timer -= diff;
+
+ if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth())
+ {
+ DoCast(m_creature,SPELL_WSTOMP);
+ hasCastedWstomp = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_ironaya(Creature *_Creature)
+{
+ return new boss_ironayaAI (_Creature);
+}
+
+void AddSC_boss_ironaya()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ironaya";
+ newscript->GetAI = GetAI_boss_ironaya;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
index 5e233aca0a3..1e1a6eb8462 100644
--- a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
+++ b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
@@ -1,187 +1,187 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Uldaman
-SD%Complete: 100
-SDComment: Quest support: 2278 + 1 trash mob.
-SDCategory: Uldaman
-EndScriptData */
-
-/* ContentData
-mob_jadespine_basilisk
-npc_lore_keeper_of_norgannon
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_jadespine_basilisk
-######*/
-
-#define SPELL_CSLUMBER 3636
-
-struct TRINITY_DLL_DECL mob_jadespine_basiliskAI : public ScriptedAI
-{
- mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cslumber_Timer;
-
- void Reset()
- {
- Cslumber_Timer = 2000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Cslumber_Timer
- if (Cslumber_Timer < diff)
- {
- //Cast
- // DoCast(m_creature->getVictim(),SPELL_CSLUMBER);
- m_creature->CastSpell(m_creature->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())
- Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if (Target)
- m_creature->TauntApply(Target);
-
- }else Cslumber_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_jadespine_basilisk(Creature *_Creature)
-{
- return new mob_jadespine_basiliskAI (_Creature);
-}
-
-/*######
-## npc_lore_keeper_of_norgannon
-######*/
-
-bool GossipHello_npc_lore_keeper_of_norgannon(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Who are the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(1079, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lore_keeper_of_norgannon(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "What is a \"subterranean being matrix\"?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(1080, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "What are the anomalies you speak of?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(1081, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "What is a resilient foundation of construction?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(1082, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "So... the Earthen were made out of stone?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(1083, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "Anything else I should know about the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(1084, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM( 0, "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(1085, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM( 0, "What high-stress environments would cause the Earthen to destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- player->SEND_GOSSIP_MENU(1086, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM( 0, "What happens when the Earthen destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- player->SEND_GOSSIP_MENU(1087, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM( 0, "Troggs?! Are the troggs you mention the same as the ones in the world today?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
- player->SEND_GOSSIP_MENU(1088, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM( 0, "You mentioned two results when the Earthen destabilize. What is the second?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
- player->SEND_GOSSIP_MENU(1089, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->ADD_GOSSIP_ITEM( 0, "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
- player->SEND_GOSSIP_MENU(1090, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- player->ADD_GOSSIP_ITEM( 0, "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
- player->SEND_GOSSIP_MENU(1091, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- player->ADD_GOSSIP_ITEM( 0, "Who are the Creators?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
- player->SEND_GOSSIP_MENU(1092, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- player->ADD_GOSSIP_ITEM( 0, "This is a lot to think about.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
- player->SEND_GOSSIP_MENU(1093, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+15:
- player->ADD_GOSSIP_ITEM( 0, "I will access the discs now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
- player->SEND_GOSSIP_MENU(1094, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+16:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2278);
- break;
- }
- return true;
-}
-
-void AddSC_uldaman()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_jadespine_basilisk";
- newscript->GetAI = GetAI_mob_jadespine_basilisk;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lore_keeper_of_norgannon";
- newscript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon;
- newscript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Uldaman
+SD%Complete: 100
+SDComment: Quest support: 2278 + 1 trash mob.
+SDCategory: Uldaman
+EndScriptData */
+
+/* ContentData
+mob_jadespine_basilisk
+npc_lore_keeper_of_norgannon
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_jadespine_basilisk
+######*/
+
+#define SPELL_CSLUMBER 3636
+
+struct TRINITY_DLL_DECL mob_jadespine_basiliskAI : public ScriptedAI
+{
+ mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cslumber_Timer;
+
+ void Reset()
+ {
+ Cslumber_Timer = 2000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Cslumber_Timer
+ if (Cslumber_Timer < diff)
+ {
+ //Cast
+ // DoCast(m_creature->getVictim(),SPELL_CSLUMBER);
+ m_creature->CastSpell(m_creature->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())
+ Target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if (Target)
+ m_creature->TauntApply(Target);
+
+ }else Cslumber_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_jadespine_basilisk(Creature *_Creature)
+{
+ return new mob_jadespine_basiliskAI (_Creature);
+}
+
+/*######
+## npc_lore_keeper_of_norgannon
+######*/
+
+bool GossipHello_npc_lore_keeper_of_norgannon(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Who are the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(1079, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lore_keeper_of_norgannon(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "What is a \"subterranean being matrix\"?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(1080, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "What are the anomalies you speak of?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(1081, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "What is a resilient foundation of construction?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(1082, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "So... the Earthen were made out of stone?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(1083, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "Anything else I should know about the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(1084, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM( 0, "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ player->SEND_GOSSIP_MENU(1085, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->ADD_GOSSIP_ITEM( 0, "What high-stress environments would cause the Earthen to destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
+ player->SEND_GOSSIP_MENU(1086, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ player->ADD_GOSSIP_ITEM( 0, "What happens when the Earthen destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
+ player->SEND_GOSSIP_MENU(1087, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ player->ADD_GOSSIP_ITEM( 0, "Troggs?! Are the troggs you mention the same as the ones in the world today?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
+ player->SEND_GOSSIP_MENU(1088, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+10:
+ player->ADD_GOSSIP_ITEM( 0, "You mentioned two results when the Earthen destabilize. What is the second?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
+ player->SEND_GOSSIP_MENU(1089, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->ADD_GOSSIP_ITEM( 0, "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
+ player->SEND_GOSSIP_MENU(1090, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+12:
+ player->ADD_GOSSIP_ITEM( 0, "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
+ player->SEND_GOSSIP_MENU(1091, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+13:
+ player->ADD_GOSSIP_ITEM( 0, "Who are the Creators?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
+ player->SEND_GOSSIP_MENU(1092, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+14:
+ player->ADD_GOSSIP_ITEM( 0, "This is a lot to think about.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
+ player->SEND_GOSSIP_MENU(1093, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+15:
+ player->ADD_GOSSIP_ITEM( 0, "I will access the discs now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
+ player->SEND_GOSSIP_MENU(1094, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+16:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2278);
+ break;
+ }
+ return true;
+}
+
+void AddSC_uldaman()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_jadespine_basilisk";
+ newscript->GetAI = GetAI_mob_jadespine_basilisk;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lore_keeper_of_norgannon";
+ newscript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon;
+ newscript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
index 1de361e5f91..b395121c73c 100644
--- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
+++ b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
@@ -1,260 +1,260 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Undercity
-SD%Complete: 95
-SDComment: Quest support: 6628(Parqual Fintallas questions/'answers' might have more to it, need more info), 9180(post-event).
-SDCategory: Undercity
-EndScriptData */
-
-/* ContentData
-npc_lady_sylvanas_windrunner
-npc_highborne_lamenter
-npc_parqual_fintallas
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_lady_sylvanas_windrunner
-######*/
-
-#define SAY_LAMENT_END "Belore..."
-#define EMOTE_LAMENT_END "kneels down and pick up the amulet."
-
-#define SOUND_CREDIT 10896
-#define ENTRY_HIGHBORNE_LAMENTER 21628
-#define ENTRY_HIGHBORNE_BUNNY 21641
-
-#define SPELL_HIGHBORNE_AURA 37090
-#define SPELL_SYLVANAS_CAST 36568
-#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099
-
-float HighborneLoc[4][3]=
-{
- {1285.41, 312.47, 0.51},
- {1286.96, 310.40, 1.00},
- {1289.66, 309.66, 1.52},
- {1292.51, 310.50, 1.99},
-};
-#define HIGHBORNE_LOC_Y -61.00
-#define HIGHBORNE_LOC_Y_NEW -55.50
-
-struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
-{
- npc_lady_sylvanas_windrunnerAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 LamentEvent_Timer;
- bool LamentEvent;
- uint64 targetGUID;
-
- float myX;
- float myY;
- float myZ;
-
- void Reset()
- {
- myX = m_creature->GetPositionX();
- myY = m_creature->GetPositionY();
- myZ = m_creature->GetPositionZ();
-
- LamentEvent_Timer = 5000;
- LamentEvent = false;
- targetGUID = 0;
- }
-
- void Aggro(Unit *who) {}
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY )
- {
- if( Unit* target = Unit::GetUnit(*summoned,targetGUID) )
- {
- target->SendMonsterMove(target->GetPositionX(),target->GetPositionY(),myZ+15.0,0,0,0);
- target->Relocate(target->GetPositionX(),target->GetPositionY(),myZ+15.0);
- summoned->CastSpell(target,SPELL_RIBBON_OF_SOULS,false);
- }
-
- summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- targetGUID = summoned->GetGUID();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( LamentEvent )
- {
- if( LamentEvent_Timer < diff )
- {
- float raX = myX;
- float raY = myY;
- float raZ = myZ;
-
- m_creature->GetRandomPoint(myX,myY,myZ,20.0,raX,raY,raZ);
- m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY,raX,raY,myZ,0,TEMPSUMMON_TIMED_DESPAWN,3000);
-
- LamentEvent_Timer = 2000;
- if( !m_creature->HasAura(SPELL_SYLVANAS_CAST,0) )
- {
- DoSay(SAY_LAMENT_END,LANG_UNIVERSAL,NULL);
- DoTextEmote(EMOTE_LAMENT_END,NULL);
- LamentEvent = false;
- }
- }else LamentEvent_Timer -= diff;
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature *_Creature)
-{
- return new npc_lady_sylvanas_windrunnerAI (_Creature);
-}
-
-bool ChooseReward_npc_lady_sylvanas_windrunner(Player *player, Creature *_Creature, const Quest *_Quest, uint32 slot)
-{
- if( _Quest->GetQuestId() == 9180 )
- {
- ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->LamentEvent = true;
- ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_CREDIT);
- _Creature->CastSpell(_Creature,SPELL_SYLVANAS_CAST,false);
-
- for( uint8 i = 0; i < 4; i++ )
- _Creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000);
- }
-
- return true;
-}
-
-/*######
-## npc_highborne_lamenter
-######*/
-
-struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI
-{
- npc_highborne_lamenterAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 EventMove_Timer;
- uint32 EventCast_Timer;
- bool EventMove;
- bool EventCast;
-
- void Reset()
- {
- EventMove_Timer = 10000;
- EventCast_Timer = 17500;
- EventMove = true;
- EventCast = true;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if( EventMove )
- {
- if( EventMove_Timer < diff )
- {
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
- m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,MOVEMENTFLAG_ONTRANSPORT,5000);
- m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation());
- EventMove = false;
- }else EventMove_Timer -= diff;
- }
- if( EventCast )
- {
- if( EventCast_Timer < diff )
- {
- DoCast(m_creature,SPELL_HIGHBORNE_AURA);
- EventCast = false;
- }else EventCast_Timer -= diff;
- }
- }
-};
-CreatureAI* GetAI_npc_highborne_lamenter(Creature *_Creature)
-{
- return new npc_highborne_lamenterAI (_Creature);
-}
-
-/*######
-## npc_parqual_fintallas
-######*/
-
-#define SPELL_MARK_OF_SHAME 6767
-
-bool GossipHello_npc_parqual_fintallas(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME,0) )
- {
- player->ADD_GOSSIP_ITEM( 0, "Gul'dan", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM( 0, "Kel'Thuzad", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM( 0, "Ner'zhul", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(5822, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(5821, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_parqual_fintallas(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player,SPELL_MARK_OF_SHAME,false);
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(6628);
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_undercity()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_lady_sylvanas_windrunner";
- newscript->GetAI = GetAI_npc_lady_sylvanas_windrunner;
- newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_highborne_lamenter";
- newscript->GetAI = GetAI_npc_highborne_lamenter;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_parqual_fintallas";
- newscript->pGossipHello = &GossipHello_npc_parqual_fintallas;
- newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Undercity
+SD%Complete: 95
+SDComment: Quest support: 6628(Parqual Fintallas questions/'answers' might have more to it, need more info), 9180(post-event).
+SDCategory: Undercity
+EndScriptData */
+
+/* ContentData
+npc_lady_sylvanas_windrunner
+npc_highborne_lamenter
+npc_parqual_fintallas
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_lady_sylvanas_windrunner
+######*/
+
+#define SAY_LAMENT_END "Belore..."
+#define EMOTE_LAMENT_END "kneels down and pick up the amulet."
+
+#define SOUND_CREDIT 10896
+#define ENTRY_HIGHBORNE_LAMENTER 21628
+#define ENTRY_HIGHBORNE_BUNNY 21641
+
+#define SPELL_HIGHBORNE_AURA 37090
+#define SPELL_SYLVANAS_CAST 36568
+#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099
+
+float HighborneLoc[4][3]=
+{
+ {1285.41, 312.47, 0.51},
+ {1286.96, 310.40, 1.00},
+ {1289.66, 309.66, 1.52},
+ {1292.51, 310.50, 1.99},
+};
+#define HIGHBORNE_LOC_Y -61.00
+#define HIGHBORNE_LOC_Y_NEW -55.50
+
+struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
+{
+ npc_lady_sylvanas_windrunnerAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 LamentEvent_Timer;
+ bool LamentEvent;
+ uint64 targetGUID;
+
+ float myX;
+ float myY;
+ float myZ;
+
+ void Reset()
+ {
+ myX = m_creature->GetPositionX();
+ myY = m_creature->GetPositionY();
+ myZ = m_creature->GetPositionZ();
+
+ LamentEvent_Timer = 5000;
+ LamentEvent = false;
+ targetGUID = 0;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY )
+ {
+ if( Unit* target = Unit::GetUnit(*summoned,targetGUID) )
+ {
+ target->SendMonsterMove(target->GetPositionX(),target->GetPositionY(),myZ+15.0,0,0,0);
+ target->Relocate(target->GetPositionX(),target->GetPositionY(),myZ+15.0);
+ summoned->CastSpell(target,SPELL_RIBBON_OF_SOULS,false);
+ }
+
+ summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ targetGUID = summoned->GetGUID();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( LamentEvent )
+ {
+ if( LamentEvent_Timer < diff )
+ {
+ float raX = myX;
+ float raY = myY;
+ float raZ = myZ;
+
+ m_creature->GetRandomPoint(myX,myY,myZ,20.0,raX,raY,raZ);
+ m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY,raX,raY,myZ,0,TEMPSUMMON_TIMED_DESPAWN,3000);
+
+ LamentEvent_Timer = 2000;
+ if( !m_creature->HasAura(SPELL_SYLVANAS_CAST,0) )
+ {
+ DoSay(SAY_LAMENT_END,LANG_UNIVERSAL,NULL);
+ DoTextEmote(EMOTE_LAMENT_END,NULL);
+ LamentEvent = false;
+ }
+ }else LamentEvent_Timer -= diff;
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature *_Creature)
+{
+ return new npc_lady_sylvanas_windrunnerAI (_Creature);
+}
+
+bool ChooseReward_npc_lady_sylvanas_windrunner(Player *player, Creature *_Creature, const Quest *_Quest, uint32 slot)
+{
+ if( _Quest->GetQuestId() == 9180 )
+ {
+ ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->LamentEvent = true;
+ ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_CREDIT);
+ _Creature->CastSpell(_Creature,SPELL_SYLVANAS_CAST,false);
+
+ for( uint8 i = 0; i < 4; i++ )
+ _Creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000);
+ }
+
+ return true;
+}
+
+/*######
+## npc_highborne_lamenter
+######*/
+
+struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI
+{
+ npc_highborne_lamenterAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 EventMove_Timer;
+ uint32 EventCast_Timer;
+ bool EventMove;
+ bool EventCast;
+
+ void Reset()
+ {
+ EventMove_Timer = 10000;
+ EventCast_Timer = 17500;
+ EventMove = true;
+ EventCast = true;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( EventMove )
+ {
+ if( EventMove_Timer < diff )
+ {
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
+ m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,MOVEMENTFLAG_ONTRANSPORT,5000);
+ m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation());
+ EventMove = false;
+ }else EventMove_Timer -= diff;
+ }
+ if( EventCast )
+ {
+ if( EventCast_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_HIGHBORNE_AURA);
+ EventCast = false;
+ }else EventCast_Timer -= diff;
+ }
+ }
+};
+CreatureAI* GetAI_npc_highborne_lamenter(Creature *_Creature)
+{
+ return new npc_highborne_lamenterAI (_Creature);
+}
+
+/*######
+## npc_parqual_fintallas
+######*/
+
+#define SPELL_MARK_OF_SHAME 6767
+
+bool GossipHello_npc_parqual_fintallas(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME,0) )
+ {
+ player->ADD_GOSSIP_ITEM( 0, "Gul'dan", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Kel'Thuzad", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Ner'zhul", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(5822, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(5821, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_parqual_fintallas(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player,SPELL_MARK_OF_SHAME,false);
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(6628);
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_undercity()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lady_sylvanas_windrunner";
+ newscript->GetAI = GetAI_npc_lady_sylvanas_windrunner;
+ newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_highborne_lamenter";
+ newscript->GetAI = GetAI_npc_highborne_lamenter;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_parqual_fintallas";
+ newscript->pGossipHello = &GossipHello_npc_parqual_fintallas;
+ newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
index 6e9f65904ae..bfdb05a94bb 100644
--- a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
+++ b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Wailing_Caverns
-SD%Complete: 0
-SDComment: Placeholder
-SDCategory: Wailing Caverns
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Wailing_Caverns
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Wailing Caverns
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
index 73697ef141e..c3725b0afc9 100644
--- a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
+++ b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
@@ -1,176 +1,176 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Western_Plaguelands
-SD%Complete: 90
-SDComment: Quest support: 5216,5219,5222,5225,5229,5231,5233,5235. To obtain Vitreous Focuser (could use more spesifics about gossip items)
-SDCategory: Western Plaguelands
-EndScriptData */
-
-/* ContentData
-npcs_dithers_and_arbington
-npc_the_scourge_cauldron
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npcs_dithers_and_arbington
-######*/
-
-bool GossipHello_npcs_dithers_and_arbington(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if(player->GetQuestRewardStatus(5237) || player->GetQuestRewardStatus(5238))
- {
- player->ADD_GOSSIP_ITEM(0, "What does the Felstone Field Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(0, "What does the Dalson's Tears Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(0, "What does the Writhing Haunt Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->ADD_GOSSIP_ITEM(0, "What does the Gahrron's Withering Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(3985, _Creature->GetGUID());
- }else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npcs_dithers_and_arbington(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(3980, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(3981, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(3982, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(3983, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 17529, false);
- break;
- }
- return true;
-}
-
-/*######
-## npc_the_scourge_cauldron
-######*/
-
-struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
-{
- npc_the_scourge_cauldronAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset() {}
-
- void Aggro(Unit* who) {}
-
- void DoDie()
- {
- //summoner dies here
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- //override any database `spawntimesecs` to prevent duplicated summons
- uint32 rTime = m_creature->GetRespawnDelay();
- if( rTime<600 )
- m_creature->SetRespawnDelay(600);
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || who->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER)
- {
- switch(m_creature->GetAreaId())
- {
- case 199: //felstone
- if( ((Player*)who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
- ((Player*)who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE )
- {
- DoSpawnCreature(11075,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoDie();
- }
- break;
- case 200: //dalson
- if( ((Player*)who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
- ((Player*)who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE )
- {
- DoSpawnCreature(11077,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoDie();
- }
- break;
- case 201: //gahrron
- if( ((Player*)who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
- ((Player*)who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE )
- {
- DoSpawnCreature(11078,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoDie();
- }
- break;
- case 202: //writhing
- if( ((Player*)who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
- ((Player*)who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE )
- {
- DoSpawnCreature(11076,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
- DoDie();
- }
- break;
- }
- }
- }
-};
-CreatureAI* GetAI_npc_the_scourge_cauldron(Creature *_Creature)
-{
- return new npc_the_scourge_cauldronAI (_Creature);
-}
-
-/*######
-##
-######*/
-
-void AddSC_western_plaguelands()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npcs_dithers_and_arbington";
- newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington;
- newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_the_scourge_cauldron";
- newscript->GetAI = GetAI_npc_the_scourge_cauldron;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Western_Plaguelands
+SD%Complete: 90
+SDComment: Quest support: 5216,5219,5222,5225,5229,5231,5233,5235. To obtain Vitreous Focuser (could use more spesifics about gossip items)
+SDCategory: Western Plaguelands
+EndScriptData */
+
+/* ContentData
+npcs_dithers_and_arbington
+npc_the_scourge_cauldron
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npcs_dithers_and_arbington
+######*/
+
+bool GossipHello_npcs_dithers_and_arbington(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if(player->GetQuestRewardStatus(5237) || player->GetQuestRewardStatus(5238))
+ {
+ player->ADD_GOSSIP_ITEM(0, "What does the Felstone Field Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, "What does the Dalson's Tears Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, "What does the Writhing Haunt Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->ADD_GOSSIP_ITEM(0, "What does the Gahrron's Withering Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(3985, _Creature->GetGUID());
+ }else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npcs_dithers_and_arbington(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(3980, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(3981, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(3982, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(3983, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 17529, false);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_the_scourge_cauldron
+######*/
+
+struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
+{
+ npc_the_scourge_cauldronAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() {}
+
+ void Aggro(Unit* who) {}
+
+ void DoDie()
+ {
+ //summoner dies here
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ //override any database `spawntimesecs` to prevent duplicated summons
+ uint32 rTime = m_creature->GetRespawnDelay();
+ if( rTime<600 )
+ m_creature->SetRespawnDelay(600);
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(who->GetTypeId() == TYPEID_PLAYER)
+ {
+ switch(m_creature->GetAreaId())
+ {
+ case 199: //felstone
+ if( ((Player*)who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
+ ((Player*)who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE )
+ {
+ DoSpawnCreature(11075,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoDie();
+ }
+ break;
+ case 200: //dalson
+ if( ((Player*)who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
+ ((Player*)who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE )
+ {
+ DoSpawnCreature(11077,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoDie();
+ }
+ break;
+ case 201: //gahrron
+ if( ((Player*)who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
+ ((Player*)who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE )
+ {
+ DoSpawnCreature(11078,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoDie();
+ }
+ break;
+ case 202: //writhing
+ if( ((Player*)who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
+ ((Player*)who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE )
+ {
+ DoSpawnCreature(11076,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ DoDie();
+ }
+ break;
+ }
+ }
+ }
+};
+CreatureAI* GetAI_npc_the_scourge_cauldron(Creature *_Creature)
+{
+ return new npc_the_scourge_cauldronAI (_Creature);
+}
+
+/*######
+##
+######*/
+
+void AddSC_western_plaguelands()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npcs_dithers_and_arbington";
+ newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington;
+ newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_the_scourge_cauldron";
+ newscript->GetAI = GetAI_npc_the_scourge_cauldron;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
index ad8d83b00ac..7d6f8ea30fb 100644
--- a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
+++ b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
@@ -1,157 +1,157 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Winterspring
-SD%Complete: 90
-SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari
-SDCategory: Winterspring
-EndScriptData */
-
-/* ContentData
-npc_lorax
-npc_rivern_frostwind
-npc_witch_doctor_mauari
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_lorax
-######*/
-
-bool GossipHello_npc_lorax(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Talk to me", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lorax(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "What do you do here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(3759, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "I can help you", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(3760, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "What deal?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(3761, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "Then what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(3762, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "He is not safe, i'll make sure of that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(3763, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(5126);
- break;
- }
- return true;
-}
-
-/*######
-## npc_rivern_frostwind
-######*/
-
-bool GossipHello_npc_rivern_frostwind(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (_Creature->isVendor() && player->GetReputationRank(589) == REP_EXALTED)
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_rivern_frostwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-## npc_witch_doctor_mauari
-######*/
-
-bool GossipHello_npc_witch_doctor_mauari(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if(player->GetQuestRewardStatus(975))
- {
- player->ADD_GOSSIP_ITEM(0, "I'd like you to make me a new Cache of Mau'ari please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(3377, _Creature->GetGUID());
- }else
- player->SEND_GOSSIP_MENU(3375, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_witch_doctor_mauari(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action==GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 16351, false);
- }
-
- return true;
-}
-
-void AddSC_winterspring()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_lorax";
- newscript->pGossipHello = &GossipHello_npc_lorax;
- newscript->pGossipSelect = &GossipSelect_npc_lorax;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_rivern_frostwind";
- newscript->pGossipHello = &GossipHello_npc_rivern_frostwind;
- newscript->pGossipSelect = &GossipSelect_npc_rivern_frostwind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_witch_doctor_mauari";
- newscript->pGossipHello = &GossipHello_npc_witch_doctor_mauari;
- newscript->pGossipSelect = &GossipSelect_npc_witch_doctor_mauari;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Winterspring
+SD%Complete: 90
+SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari
+SDCategory: Winterspring
+EndScriptData */
+
+/* ContentData
+npc_lorax
+npc_rivern_frostwind
+npc_witch_doctor_mauari
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_lorax
+######*/
+
+bool GossipHello_npc_lorax(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Talk to me", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lorax(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "What do you do here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(3759, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "I can help you", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(3760, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "What deal?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(3761, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "Then what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(3762, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "He is not safe, i'll make sure of that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(3763, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(5126);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_rivern_frostwind
+######*/
+
+bool GossipHello_npc_rivern_frostwind(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (_Creature->isVendor() && player->GetReputationRank(589) == REP_EXALTED)
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_rivern_frostwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+## npc_witch_doctor_mauari
+######*/
+
+bool GossipHello_npc_witch_doctor_mauari(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if(player->GetQuestRewardStatus(975))
+ {
+ player->ADD_GOSSIP_ITEM(0, "I'd like you to make me a new Cache of Mau'ari please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(3377, _Creature->GetGUID());
+ }else
+ player->SEND_GOSSIP_MENU(3375, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_witch_doctor_mauari(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action==GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 16351, false);
+ }
+
+ return true;
+}
+
+void AddSC_winterspring()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lorax";
+ newscript->pGossipHello = &GossipHello_npc_lorax;
+ newscript->pGossipSelect = &GossipSelect_npc_lorax;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_rivern_frostwind";
+ newscript->pGossipHello = &GossipHello_npc_rivern_frostwind;
+ newscript->pGossipSelect = &GossipSelect_npc_rivern_frostwind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_witch_doctor_mauari";
+ newscript->pGossipHello = &GossipHello_npc_witch_doctor_mauari;
+ newscript->pGossipSelect = &GossipSelect_npc_witch_doctor_mauari;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
index 98f194df2df..621d3e5da49 100644
--- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
+++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
@@ -1,283 +1,283 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Zangarmarsh
-SD%Complete: 100
-SDComment: Quest support: 9785, 9803, 10009. Mark Of ... buffs.
-SDCategory: Zangarmarsh
-EndScriptData */
-
-/* ContentData
-npcs_ashyen_and_keleth
-npc_cooshcoosh
-npc_elder_kuruti
-npc_mortog_steamhead
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npcs_ashyen_and_keleth
-######*/
-
-#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient."
-#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient."
-#define GOSSIP_REWARD_BLESS "You have my blessing"
-//#define TEXT_BLESSINGS "<You need higher standing with Cenarion Expedition to recive a blessing.>"
-
-bool GossipHello_npcs_ashyen_and_keleth(Player *player, Creature *_Creature )
-{
- if (player->GetReputationRank(942) > REP_NEUTRAL)
- {
- if ( _Creature->GetEntry() == 17900)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- if ( _Creature->GetEntry() == 17901)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- }
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npcs_ashyen_and_keleth(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- _Creature->setPowerType(POWER_MANA);
- _Creature->SetMaxPower(POWER_MANA,200); //set a "fake" mana value, we can't depend on database doing it in this case
- _Creature->SetPower(POWER_MANA,200);
-
- if ( _Creature->GetEntry() == 17900) //check which creature we are dealing with
- {
- switch (player->GetReputationRank(942))
- { //mark of lore
- case REP_FRIENDLY:
- _Creature->CastSpell(player, 31808, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_HONORED:
- _Creature->CastSpell(player, 31810, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_REVERED:
- _Creature->CastSpell(player, 31811, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_EXALTED:
- _Creature->CastSpell(player, 31815, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- }
- }
-
- if ( _Creature->GetEntry() == 17901)
- {
- switch (player->GetReputationRank(942)) //mark of war
- {
- case REP_FRIENDLY:
- _Creature->CastSpell(player, 31807, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_HONORED:
- _Creature->CastSpell(player, 31812, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_REVERED:
- _Creature->CastSpell(player, 31813, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- case REP_EXALTED:
- _Creature->CastSpell(player, 31814, true);
- _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
- break;
- }
- }
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- }
- return true;
-}
-
-/*######
-## npc_cooshcoosh
-######*/
-
-#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!"
-
-#define FACTION_HOSTILE_CO 45
-#define FACTION_FRIENDLY_CO 35
-
-#define SPELL_LIGHTNING_BOLT 9532
-
-struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI
-{
- npc_cooshcooshAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint32 LightningBolt_Timer;
-
- void Reset()
- {
- LightningBolt_Timer = 2000;
- m_creature->setFaction(FACTION_FRIENDLY_CO);
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( LightningBolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_LIGHTNING_BOLT);
- LightningBolt_Timer = 5000;
- }else LightningBolt_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_cooshcoosh(Creature *_Creature)
-{
- return new npc_cooshcooshAI (_Creature);
-}
-
-bool GossipHello_npc_cooshcoosh(Player *player, Creature *_Creature )
-{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9441, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_cooshcoosh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(FACTION_HOSTILE_CO);
- ((npc_cooshcooshAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-## npc_elder_kuruti
-######*/
-
-#define GOSSIP_ITEM_KUR1 "Offer treat"
-#define GOSSIP_ITEM_KUR2 "Im a messenger for Draenei"
-#define GOSSIP_ITEM_KUR3 "Get message"
-
-bool GossipHello_npc_elder_kuruti(Player *player, Creature *_Creature )
-{
- if( player->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9226,_Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_elder_kuruti(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9227, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9229, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- {
- if( !player->HasItemCount(24573,1) )
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 24573, 1, false);
- if( msg == EQUIP_ERR_OK )
- {
- player->StoreNewItem( dest, 24573, true);
- }
- else
- player->SendEquipError( msg,NULL,NULL );
- }
- player->SEND_GOSSIP_MENU(9231, _Creature->GetGUID());
- break;
- }
- }
- return true;
-}
-
-/*######
-## npc_mortog_steamhead
-######*/
-
-bool GossipHello_npc_mortog_steamhead(Player *player, Creature *_Creature)
-{
- if (_Creature->isVendor() && player->GetReputationRank(942) == REP_EXALTED)
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_TRADE)
- {
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_zangarmarsh()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npcs_ashyen_and_keleth";
- newscript->pGossipHello = &GossipHello_npcs_ashyen_and_keleth;
- newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_cooshcoosh";
- newscript->pGossipHello = &GossipHello_npc_cooshcoosh;
- newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_elder_kuruti";
- newscript->pGossipHello = &GossipHello_npc_elder_kuruti;
- newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_mortog_steamhead";
- newscript->pGossipHello = &GossipHello_npc_mortog_steamhead;
- newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Zangarmarsh
+SD%Complete: 100
+SDComment: Quest support: 9785, 9803, 10009. Mark Of ... buffs.
+SDCategory: Zangarmarsh
+EndScriptData */
+
+/* ContentData
+npcs_ashyen_and_keleth
+npc_cooshcoosh
+npc_elder_kuruti
+npc_mortog_steamhead
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npcs_ashyen_and_keleth
+######*/
+
+#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient."
+#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient."
+#define GOSSIP_REWARD_BLESS "You have my blessing"
+//#define TEXT_BLESSINGS "<You need higher standing with Cenarion Expedition to recive a blessing.>"
+
+bool GossipHello_npcs_ashyen_and_keleth(Player *player, Creature *_Creature )
+{
+ if (player->GetReputationRank(942) > REP_NEUTRAL)
+ {
+ if ( _Creature->GetEntry() == 17900)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if ( _Creature->GetEntry() == 17901)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ }
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npcs_ashyen_and_keleth(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ _Creature->setPowerType(POWER_MANA);
+ _Creature->SetMaxPower(POWER_MANA,200); //set a "fake" mana value, we can't depend on database doing it in this case
+ _Creature->SetPower(POWER_MANA,200);
+
+ if ( _Creature->GetEntry() == 17900) //check which creature we are dealing with
+ {
+ switch (player->GetReputationRank(942))
+ { //mark of lore
+ case REP_FRIENDLY:
+ _Creature->CastSpell(player, 31808, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_HONORED:
+ _Creature->CastSpell(player, 31810, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_REVERED:
+ _Creature->CastSpell(player, 31811, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_EXALTED:
+ _Creature->CastSpell(player, 31815, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ }
+ }
+
+ if ( _Creature->GetEntry() == 17901)
+ {
+ switch (player->GetReputationRank(942)) //mark of war
+ {
+ case REP_FRIENDLY:
+ _Creature->CastSpell(player, 31807, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_HONORED:
+ _Creature->CastSpell(player, 31812, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_REVERED:
+ _Creature->CastSpell(player, 31813, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ case REP_EXALTED:
+ _Creature->CastSpell(player, 31814, true);
+ _Creature->Say(GOSSIP_REWARD_BLESS, LANG_UNIVERSAL, 0);
+ break;
+ }
+ }
+ player->CLOSE_GOSSIP_MENU();
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ }
+ return true;
+}
+
+/*######
+## npc_cooshcoosh
+######*/
+
+#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!"
+
+#define FACTION_HOSTILE_CO 45
+#define FACTION_FRIENDLY_CO 35
+
+#define SPELL_LIGHTNING_BOLT 9532
+
+struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI
+{
+ npc_cooshcooshAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint32 LightningBolt_Timer;
+
+ void Reset()
+ {
+ LightningBolt_Timer = 2000;
+ m_creature->setFaction(FACTION_FRIENDLY_CO);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( LightningBolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_LIGHTNING_BOLT);
+ LightningBolt_Timer = 5000;
+ }else LightningBolt_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_cooshcoosh(Creature *_Creature)
+{
+ return new npc_cooshcooshAI (_Creature);
+}
+
+bool GossipHello_npc_cooshcoosh(Player *player, Creature *_Creature )
+{
+ if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(9441, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_cooshcoosh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(FACTION_HOSTILE_CO);
+ ((npc_cooshcooshAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+## npc_elder_kuruti
+######*/
+
+#define GOSSIP_ITEM_KUR1 "Offer treat"
+#define GOSSIP_ITEM_KUR2 "Im a messenger for Draenei"
+#define GOSSIP_ITEM_KUR3 "Get message"
+
+bool GossipHello_npc_elder_kuruti(Player *player, Creature *_Creature )
+{
+ if( player->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(9226,_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_elder_kuruti(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(9227, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9229, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ {
+ if( !player->HasItemCount(24573,1) )
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 24573, 1, false);
+ if( msg == EQUIP_ERR_OK )
+ {
+ player->StoreNewItem( dest, 24573, true);
+ }
+ else
+ player->SendEquipError( msg,NULL,NULL );
+ }
+ player->SEND_GOSSIP_MENU(9231, _Creature->GetGUID());
+ break;
+ }
+ }
+ return true;
+}
+
+/*######
+## npc_mortog_steamhead
+######*/
+
+bool GossipHello_npc_mortog_steamhead(Player *player, Creature *_Creature)
+{
+ if (_Creature->isVendor() && player->GetReputationRank(942) == REP_EXALTED)
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_TRADE)
+ {
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_zangarmarsh()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npcs_ashyen_and_keleth";
+ newscript->pGossipHello = &GossipHello_npcs_ashyen_and_keleth;
+ newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_cooshcoosh";
+ newscript->pGossipHello = &GossipHello_npc_cooshcoosh;
+ newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_elder_kuruti";
+ newscript->pGossipHello = &GossipHello_npc_elder_kuruti;
+ newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_mortog_steamhead";
+ newscript->pGossipHello = &GossipHello_npc_mortog_steamhead;
+ newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
index d175a4a2143..50d6dff6849 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
@@ -1,524 +1,524 @@
-/* Copyright ?2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_Akilzon
-SD%Complete: 75%
-SDComment: Missing timer for Call Lightning and Sound ID's
-SQLUpdate:
-#Temporary fix for Soaring Eagles
-
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-#include "Spell.h"
-#include "Weather.h"
-
-#define SPELL_STATIC_DISRUPTION 43622
-#define SPELL_STATIC_VISUAL 45265
-#define SPELL_CALL_LIGHTNING 43661 //Missing timer
-#define SPELL_GUST_OF_WIND 43621
-#define SPELL_ELECTRICAL_STORM 43648
-#define SPELL_BERSERK 45078
-
-#define SPELL_EAGLE_SWOOP 44732
-
-//"Your death gonna be quick, strangers. You shoulda never have come to this place..."
-#define SAY_ONAGGRO "I be da predator! You da prey..."
-#define SAY_ONDEATH "You can't... kill... me spirit!"
-#define SAY_ONSLAY1 "Ya got nothin'!"
-#define SAY_ONSLAY2 "Stop your cryin'!"
-#define SAY_ONSUMMON "Feed, me bruddahs!"
-#define SAY_ONENRAGE "All you be doing is wasting my time!"
-#define SOUND_ONAGGRO 12013
-#define SOUND_ONDEATH 12019
-#define SOUND_ONSLAY1 12017
-#define SOUND_ONSLAY2 12018
-#define SOUND_ONSUMMON 12014
-#define SOUND_ONENRAGE 12016
-
-#define MOB_SOARING_EAGLE 24858
-#define SE_LOC_X_MAX 400
-#define SE_LOC_X_MIN 335
-#define SE_LOC_Y_MAX 1435
-#define SE_LOC_Y_MIN 1370
-
-#define MOB_TEMP_TRIGGER 23920
-
-struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
-{
- boss_akilzonAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
- ScriptedInstance *pInstance;
-
- uint64 TargetGUID;
- uint64 CycloneGUID;
- uint64 CloudGUID;
-
- uint32 StaticDisruption_Timer;
- uint32 GustOfWind_Timer;
- uint32 CallLighting_Timer;
- uint32 ElectricalStorm_Timer;
- uint32 SDisruptAOEVisual_Timer;
- uint32 SummonEagles_Timer;
- uint32 Enrage_Timer;
-
- uint32 StormCount;
- uint32 StormSequenceTimer;
-
- bool isRaining;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
-
- StaticDisruption_Timer = (10+rand()%10)*1000; //10 to 20 seconds (bosskillers)
- GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
- CallLighting_Timer = (10+rand()%10)*1000; //totaly random timer. can't find any info on this
- ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers)
- Enrage_Timer = 10*60*1000; //10 minutes till enrage(bosskillers)
- SDisruptAOEVisual_Timer = 99999;
- SummonEagles_Timer = 99999;
-
- TargetGUID = 0;
- CloudGUID = 0;
- CycloneGUID = 0;
-
- StormCount = 0;
- StormSequenceTimer = 0;
-
- isRaining = false;
-
- DespawnSummons(MOB_SOARING_EAGLE);
- SetWeather(WEATHER_STATE_FINE, 0.0f);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
- DoZoneInCombat();
- if(pInstance)
- pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
- if(pInstance)
- pInstance->SetData(DATA_AKILZONEVENT, DONE);
- DespawnSummons(MOB_SOARING_EAGLE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
- break;
- case 1:
- DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
- break;
- }
- }
-
- void DespawnSummons(uint32 entry)
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
-
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
- {
- (*i)->SetVisibility(VISIBILITY_OFF);
- (*i)->setDeathState(JUST_DIED);
- }
- }
-
- Player* SelectRandomPlayer(float range = 0.0f, bool alive = true)
- {
- Map *map = m_creature->GetMap();
- if (!map->IsDungeon()) return NULL;
-
- InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
- InstanceMap::PlayerList::iterator i;
- while(PlayerList.size())
- {
- i = PlayerList.begin();
- advance(i, rand()%PlayerList.size());
- if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
- && (!alive || (*i)->isTargetableForAttack()))
- return *i;
- else
- PlayerList.erase(i);
- }
- return NULL;
- }
-
- void SetWeather(uint32 weather, float grade)
- {
- Map *map = m_creature->GetMap();
- if (!map->IsDungeon()) return;
-
- WorldPacket data(SMSG_WEATHER, (4+4+4));
- data << uint32(weather) << (float)grade << uint8(0);
-
- ((InstanceMap*)map)->SendToPlayers(&data);
- }
-
- void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end
- {
- if(StormCount < 10 && StormCount > 1)
- {
- // deal damage
- int32 bp0 = 800;
- for(uint8 i = 2; i < StormCount; ++i)
- bp0 *= 2;
-
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list<Unit *> tempUnitMap;
-
- {
- Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999);
- Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
-
- TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
- TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
- cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
- }
-
- for(std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
- {
- if(!Cloud->IsWithinDistInMap(*i, 15))
- {
- float x, y, z;
- (*i)->GetPosition(x, y, z);
- x = rand()%2 ? x + rand()%5 : x - rand()%5;
- y = rand()%2 ? y + rand()%5 : y - rand()%5;
- z = Cloud->GetPositionZ() + 2 - rand()%4;
- if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
- {
- trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- trigger->StopMoving();
- trigger->CastSpell(trigger, 37248, true);
- trigger->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID());
- }
- }
- }
-
- // visual
- float x, y, z;
- for(uint8 i = 0; i < StormCount; ++i)
- {
- Cloud->GetPosition(x, y, z);
- x = rand()%2 ? x + rand()%10 : x - rand()%10;
- y = rand()%2 ? y + rand()%10 : y - rand()%10;
- z = z + 2 - rand()%4;
- if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
- {
- trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- trigger->StopMoving();
- trigger->CastSpell(trigger, 37248, true);
- }
- Cloud->GetPosition(x, y, z);
- x = rand()%2 ? x + 10 + rand()%10 : x - 10 - rand()%10;
- y = rand()%2 ? y + 10 + rand()%10 : y - 10 - rand()%10;
- if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
- {
- trigger->SetMaxHealth(9999999);
- trigger->SetHealth(9999999);
- trigger->CastSpell(trigger, 43661, true);
- }
- }
- }
-
- StormCount++;
- if(StormCount > 10)
- {
- StormCount = 0; // finish
- SummonEagles_Timer = 5000;
- m_creature->InterruptNonMeleeSpells(false);
- Cloud->RemoveAurasDueToSpell(45213);
- CloudGUID = 0;
- if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))
- Cyclone->RemoveAurasDueToSpell(25160);
- SetWeather(WEATHER_STATE_FINE, 0.0f);
- isRaining = false;
- }
-
- StormSequenceTimer = 1000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(StormCount)
- {
- Unit* target = Unit::GetUnit(*m_creature, CloudGUID);
- if(!target || !target->isAlive())
- {
- EnterEvadeMode();
- return;
- }
- else if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))
- Cyclone->CastSpell(target, 25160, true); // keep casting or...
-
- if(StormSequenceTimer < diff) {
- HandleStormSequence(target);
- }else StormSequenceTimer -= diff;
- return;
- }
-
- if (Enrage_Timer < diff) {
- DoYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONENRAGE);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- Enrage_Timer = 600000;
- }else Enrage_Timer -= diff;
-
- if (StaticDisruption_Timer < diff) {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- TargetGUID = target->GetGUID();
- m_creature->CastSpell(target, SPELL_STATIC_DISRUPTION, false);
- m_creature->SetInFront(m_creature->getVictim());
- StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
-
- float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
- if (dist < 5.0f) dist = 5.0f;
- SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);
- }else StaticDisruption_Timer -= diff;
-
- if (SDisruptAOEVisual_Timer < diff) {
- Unit* SDVictim = Unit::GetUnit((*m_creature), TargetGUID);
- if(SDVictim && SDVictim->isAlive())
- SDVictim->CastSpell(SDVictim, SPELL_STATIC_VISUAL, true);
- SDisruptAOEVisual_Timer = 99999;
- TargetGUID = 0;
- }else SDisruptAOEVisual_Timer -= diff;
-
- if (GustOfWind_Timer < diff) {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- DoCast(target, 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);
- CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
- } else CallLighting_Timer -= diff;
-
- if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000) {
- SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
- isRaining = true;
- }
-
- if (ElectricalStorm_Timer < diff) {
- Unit* target = SelectRandomPlayer(50);
- if(!target) target = m_creature->getVictim();
- float x, y, z;
- target->GetPosition(x, y, z);
- Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ() + 10, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
- if(Cloud)
- {
- CloudGUID = Cloud->GetGUID();
- Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- Cloud->StopMoving();
- Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
- Cloud->setFaction(35);
- Cloud->SetMaxHealth(9999999);
- Cloud->SetHealth(9999999);
- Cloud->CastSpell(Cloud, 45213, true); // cloud visual
- m_creature->StopMoving();
- Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->CastSpell(Cloud, 43501, false); // siphon soul
- }
- Unit *Cyclone = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
- if(Cyclone)
- {
- Cyclone->CastSpell(Cyclone, 25160, true); // wind visual
- CycloneGUID = Cyclone->GetGUID();
- }
- ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
- StormCount = 1;
- StormSequenceTimer = 0;
- } else ElectricalStorm_Timer -= diff;
-
- if (SummonEagles_Timer < diff)
- {
- DoYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ONSUMMON);
-
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- for (uint8 i = 0; i < 6 + rand()%3; i++)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- x = target->GetPositionX() + 10 - rand()%20;
- y = target->GetPositionY() + 10 - rand()%20;
- z = target->GetPositionZ() + 6 + rand()%5 + 10;
- if(z > 95) z = 95 - rand()%5;
- }
-
- Creature *pCreature = m_creature->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());
- }
- }
- SummonEagles_Timer = 999999;
- } else SummonEagles_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL mob_soaring_eagleAI : public ScriptedAI
-{
- mob_soaring_eagleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 EagleSwoop_Timer;
- bool arrived;
- uint32 TargetGUID;
-
- void Reset()
- {
- EagleSwoop_Timer = 5000 + rand()%5000;
- arrived = true;
- TargetGUID = 0;
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- }
-
- void Aggro(Unit *who) {DoZoneInCombat();}
-
- void AttackStart(Unit *who)
- {
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
-
- void MoveInLineOfSight(Unit *) {}
-
- void MovementInform(uint32, uint32)
- {
- arrived = true;
- if(TargetGUID)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, TargetGUID))
- m_creature->CastSpell(target, SPELL_EAGLE_SWOOP, true);
- TargetGUID = 0;
- m_creature->SetSpeed(MOVE_RUN, 1.2f);
- EagleSwoop_Timer = 5000 + rand()%5000;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(EagleSwoop_Timer < diff) EagleSwoop_Timer = 0;
- else EagleSwoop_Timer -= diff;
-
- if(arrived)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- float x, y, z;
- if(EagleSwoop_Timer)
- {
- x = target->GetPositionX() + 10 - rand()%20;
- y = target->GetPositionY() + 10 - rand()%20;
- z = target->GetPositionZ() + 10 + rand()%5;
- if(z > 95) z = 95 - rand()%5;
- }
- else
- {
- target->GetContactPoint(m_creature, x, y, z);
- z += 2;
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- TargetGUID = target->GetGUID();
- }
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- arrived = false;
- }
- }
- }
-};
-
-//Soaring Eagle
-CreatureAI* GetAI_mob_soaring_eagle(Creature *_Creature)
-{
- return new mob_soaring_eagleAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_akilzon(Creature *_Creature)
-{
- return new boss_akilzonAI(_Creature);
-}
-
-void AddSC_boss_akilzon()
-{
- Script *newscript = NULL;
-
- newscript = new Script;
- newscript->Name="boss_akilzon";
- newscript->GetAI = GetAI_boss_akilzon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_akilzon_eagle";
- newscript->GetAI = GetAI_mob_soaring_eagle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright ?2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_Akilzon
+SD%Complete: 75%
+SDComment: Missing timer for Call Lightning and Sound ID's
+SQLUpdate:
+#Temporary fix for Soaring Eagles
+
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+#include "Spell.h"
+#include "Weather.h"
+
+#define SPELL_STATIC_DISRUPTION 43622
+#define SPELL_STATIC_VISUAL 45265
+#define SPELL_CALL_LIGHTNING 43661 //Missing timer
+#define SPELL_GUST_OF_WIND 43621
+#define SPELL_ELECTRICAL_STORM 43648
+#define SPELL_BERSERK 45078
+
+#define SPELL_EAGLE_SWOOP 44732
+
+//"Your death gonna be quick, strangers. You shoulda never have come to this place..."
+#define SAY_ONAGGRO "I be da predator! You da prey..."
+#define SAY_ONDEATH "You can't... kill... me spirit!"
+#define SAY_ONSLAY1 "Ya got nothin'!"
+#define SAY_ONSLAY2 "Stop your cryin'!"
+#define SAY_ONSUMMON "Feed, me bruddahs!"
+#define SAY_ONENRAGE "All you be doing is wasting my time!"
+#define SOUND_ONAGGRO 12013
+#define SOUND_ONDEATH 12019
+#define SOUND_ONSLAY1 12017
+#define SOUND_ONSLAY2 12018
+#define SOUND_ONSUMMON 12014
+#define SOUND_ONENRAGE 12016
+
+#define MOB_SOARING_EAGLE 24858
+#define SE_LOC_X_MAX 400
+#define SE_LOC_X_MIN 335
+#define SE_LOC_Y_MAX 1435
+#define SE_LOC_Y_MIN 1370
+
+#define MOB_TEMP_TRIGGER 23920
+
+struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
+{
+ boss_akilzonAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+ ScriptedInstance *pInstance;
+
+ uint64 TargetGUID;
+ uint64 CycloneGUID;
+ uint64 CloudGUID;
+
+ uint32 StaticDisruption_Timer;
+ uint32 GustOfWind_Timer;
+ uint32 CallLighting_Timer;
+ uint32 ElectricalStorm_Timer;
+ uint32 SDisruptAOEVisual_Timer;
+ uint32 SummonEagles_Timer;
+ uint32 Enrage_Timer;
+
+ uint32 StormCount;
+ uint32 StormSequenceTimer;
+
+ bool isRaining;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
+
+ StaticDisruption_Timer = (10+rand()%10)*1000; //10 to 20 seconds (bosskillers)
+ GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
+ CallLighting_Timer = (10+rand()%10)*1000; //totaly random timer. can't find any info on this
+ ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers)
+ Enrage_Timer = 10*60*1000; //10 minutes till enrage(bosskillers)
+ SDisruptAOEVisual_Timer = 99999;
+ SummonEagles_Timer = 99999;
+
+ TargetGUID = 0;
+ CloudGUID = 0;
+ CycloneGUID = 0;
+
+ StormCount = 0;
+ StormSequenceTimer = 0;
+
+ isRaining = false;
+
+ DespawnSummons(MOB_SOARING_EAGLE);
+ SetWeather(WEATHER_STATE_FINE, 0.0f);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
+ DoZoneInCombat();
+ if(pInstance)
+ pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
+ if(pInstance)
+ pInstance->SetData(DATA_AKILZONEVENT, DONE);
+ DespawnSummons(MOB_SOARING_EAGLE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
+ break;
+ case 1:
+ DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
+ break;
+ }
+ }
+
+ void DespawnSummons(uint32 entry)
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
+ {
+ (*i)->SetVisibility(VISIBILITY_OFF);
+ (*i)->setDeathState(JUST_DIED);
+ }
+ }
+
+ Player* SelectRandomPlayer(float range = 0.0f, bool alive = true)
+ {
+ Map *map = m_creature->GetMap();
+ if (!map->IsDungeon()) return NULL;
+
+ InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
+ InstanceMap::PlayerList::iterator i;
+ while(PlayerList.size())
+ {
+ i = PlayerList.begin();
+ advance(i, rand()%PlayerList.size());
+ if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
+ && (!alive || (*i)->isTargetableForAttack()))
+ return *i;
+ else
+ PlayerList.erase(i);
+ }
+ return NULL;
+ }
+
+ void SetWeather(uint32 weather, float grade)
+ {
+ Map *map = m_creature->GetMap();
+ if (!map->IsDungeon()) return;
+
+ WorldPacket data(SMSG_WEATHER, (4+4+4));
+ data << uint32(weather) << (float)grade << uint8(0);
+
+ ((InstanceMap*)map)->SendToPlayers(&data);
+ }
+
+ void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end
+ {
+ if(StormCount < 10 && StormCount > 1)
+ {
+ // deal damage
+ int32 bp0 = 800;
+ for(uint8 i = 2; i < StormCount; ++i)
+ bp0 *= 2;
+
+ CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list<Unit *> tempUnitMap;
+
+ {
+ Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999);
+ Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
+
+ TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+ TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
+ cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
+ }
+
+ for(std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
+ {
+ if(!Cloud->IsWithinDistInMap(*i, 15))
+ {
+ float x, y, z;
+ (*i)->GetPosition(x, y, z);
+ x = rand()%2 ? x + rand()%5 : x - rand()%5;
+ y = rand()%2 ? y + rand()%5 : y - rand()%5;
+ z = Cloud->GetPositionZ() + 2 - rand()%4;
+ if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
+ {
+ trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ trigger->StopMoving();
+ trigger->CastSpell(trigger, 37248, true);
+ trigger->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID());
+ }
+ }
+ }
+
+ // visual
+ float x, y, z;
+ for(uint8 i = 0; i < StormCount; ++i)
+ {
+ Cloud->GetPosition(x, y, z);
+ x = rand()%2 ? x + rand()%10 : x - rand()%10;
+ y = rand()%2 ? y + rand()%10 : y - rand()%10;
+ z = z + 2 - rand()%4;
+ if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
+ {
+ trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ trigger->StopMoving();
+ trigger->CastSpell(trigger, 37248, true);
+ }
+ Cloud->GetPosition(x, y, z);
+ x = rand()%2 ? x + 10 + rand()%10 : x - 10 - rand()%10;
+ y = rand()%2 ? y + 10 + rand()%10 : y - 10 - rand()%10;
+ if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
+ {
+ trigger->SetMaxHealth(9999999);
+ trigger->SetHealth(9999999);
+ trigger->CastSpell(trigger, 43661, true);
+ }
+ }
+ }
+
+ StormCount++;
+ if(StormCount > 10)
+ {
+ StormCount = 0; // finish
+ SummonEagles_Timer = 5000;
+ m_creature->InterruptNonMeleeSpells(false);
+ Cloud->RemoveAurasDueToSpell(45213);
+ CloudGUID = 0;
+ if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))
+ Cyclone->RemoveAurasDueToSpell(25160);
+ SetWeather(WEATHER_STATE_FINE, 0.0f);
+ isRaining = false;
+ }
+
+ StormSequenceTimer = 1000;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(StormCount)
+ {
+ Unit* target = Unit::GetUnit(*m_creature, CloudGUID);
+ if(!target || !target->isAlive())
+ {
+ EnterEvadeMode();
+ return;
+ }
+ else if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))
+ Cyclone->CastSpell(target, 25160, true); // keep casting or...
+
+ if(StormSequenceTimer < diff) {
+ HandleStormSequence(target);
+ }else StormSequenceTimer -= diff;
+ return;
+ }
+
+ if (Enrage_Timer < diff) {
+ DoYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONENRAGE);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ Enrage_Timer = 600000;
+ }else Enrage_Timer -= diff;
+
+ if (StaticDisruption_Timer < diff) {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ TargetGUID = target->GetGUID();
+ m_creature->CastSpell(target, SPELL_STATIC_DISRUPTION, false);
+ m_creature->SetInFront(m_creature->getVictim());
+ StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
+
+ float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ if (dist < 5.0f) dist = 5.0f;
+ SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);
+ }else StaticDisruption_Timer -= diff;
+
+ if (SDisruptAOEVisual_Timer < diff) {
+ Unit* SDVictim = Unit::GetUnit((*m_creature), TargetGUID);
+ if(SDVictim && SDVictim->isAlive())
+ SDVictim->CastSpell(SDVictim, SPELL_STATIC_VISUAL, true);
+ SDisruptAOEVisual_Timer = 99999;
+ TargetGUID = 0;
+ }else SDisruptAOEVisual_Timer -= diff;
+
+ if (GustOfWind_Timer < diff) {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ DoCast(target, 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);
+ CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
+ } else CallLighting_Timer -= diff;
+
+ if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000) {
+ SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
+ isRaining = true;
+ }
+
+ if (ElectricalStorm_Timer < diff) {
+ Unit* target = SelectRandomPlayer(50);
+ if(!target) target = m_creature->getVictim();
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ() + 10, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
+ if(Cloud)
+ {
+ CloudGUID = Cloud->GetGUID();
+ Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ Cloud->StopMoving();
+ Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
+ Cloud->setFaction(35);
+ Cloud->SetMaxHealth(9999999);
+ Cloud->SetHealth(9999999);
+ Cloud->CastSpell(Cloud, 45213, true); // cloud visual
+ m_creature->StopMoving();
+ Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->CastSpell(Cloud, 43501, false); // siphon soul
+ }
+ Unit *Cyclone = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
+ if(Cyclone)
+ {
+ Cyclone->CastSpell(Cyclone, 25160, true); // wind visual
+ CycloneGUID = Cyclone->GetGUID();
+ }
+ ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
+ StormCount = 1;
+ StormSequenceTimer = 0;
+ } else ElectricalStorm_Timer -= diff;
+
+ if (SummonEagles_Timer < diff)
+ {
+ DoYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ONSUMMON);
+
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ for (uint8 i = 0; i < 6 + rand()%3; i++)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ x = target->GetPositionX() + 10 - rand()%20;
+ y = target->GetPositionY() + 10 - rand()%20;
+ z = target->GetPositionZ() + 6 + rand()%5 + 10;
+ if(z > 95) z = 95 - rand()%5;
+ }
+
+ Creature *pCreature = m_creature->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());
+ }
+ }
+ SummonEagles_Timer = 999999;
+ } else SummonEagles_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_soaring_eagleAI : public ScriptedAI
+{
+ mob_soaring_eagleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 EagleSwoop_Timer;
+ bool arrived;
+ uint32 TargetGUID;
+
+ void Reset()
+ {
+ EagleSwoop_Timer = 5000 + rand()%5000;
+ arrived = true;
+ TargetGUID = 0;
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ }
+
+ void Aggro(Unit *who) {DoZoneInCombat();}
+
+ void AttackStart(Unit *who)
+ {
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *) {}
+
+ void MovementInform(uint32, uint32)
+ {
+ arrived = true;
+ if(TargetGUID)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, TargetGUID))
+ m_creature->CastSpell(target, SPELL_EAGLE_SWOOP, true);
+ TargetGUID = 0;
+ m_creature->SetSpeed(MOVE_RUN, 1.2f);
+ EagleSwoop_Timer = 5000 + rand()%5000;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(EagleSwoop_Timer < diff) EagleSwoop_Timer = 0;
+ else EagleSwoop_Timer -= diff;
+
+ if(arrived)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ float x, y, z;
+ if(EagleSwoop_Timer)
+ {
+ x = target->GetPositionX() + 10 - rand()%20;
+ y = target->GetPositionY() + 10 - rand()%20;
+ z = target->GetPositionZ() + 10 + rand()%5;
+ if(z > 95) z = 95 - rand()%5;
+ }
+ else
+ {
+ target->GetContactPoint(m_creature, x, y, z);
+ z += 2;
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ TargetGUID = target->GetGUID();
+ }
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ arrived = false;
+ }
+ }
+ }
+};
+
+//Soaring Eagle
+CreatureAI* GetAI_mob_soaring_eagle(Creature *_Creature)
+{
+ return new mob_soaring_eagleAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_akilzon(Creature *_Creature)
+{
+ return new boss_akilzonAI(_Creature);
+}
+
+void AddSC_boss_akilzon()
+{
+ Script *newscript = NULL;
+
+ newscript = new Script;
+ newscript->Name="boss_akilzon";
+ newscript->GetAI = GetAI_boss_akilzon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_akilzon_eagle";
+ newscript->GetAI = GetAI_mob_soaring_eagle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
index 24978203861..8abdadc013a 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
@@ -1,402 +1,402 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: boss_Halazzi
-SD%Complete: 80
-SDComment:
-SDCategory: Zul¡äAman
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-//#include "spell.h"
-
-#define YELL_AGGRO "Get on your knees and bow to da fang and claw!"
-#define SOUND_AGGRO 12020
-#define YELL_SABER_ONE "You gonna leave in pieces!"
-#define YELL_SABER_TWO "Me gonna carve ya now!"
-#define YELL_SPLIT "Me gonna carve ya now!"
-#define SOUND_SPLIT 12021
-#define YELL_MERGE "Spirit, come back to me!"
-#define SOUND_MERGE 12022
-#define YELL_KILL_ONE "You cant fight the power!"
-#define SOUND_KILL_ONE 12026
-#define YELL_KILL_TWO "You gonna fail!"
-#define SOUND_KILL_TWO 12027
-#define YELL_DEATH "Chaga... choka'jinn."
-#define SOUND_DEATH 12028
-#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..."
-#define SOUND_BERSERK 12025
-
-#define SPELL_DUAL_WIELD 29651
-#define SPELL_SABER_LASH 43267
-#define SPELL_FRENZY 43139
-#define SPELL_FLAMESHOCK 43303
-#define SPELL_EARTHSHOCK 43305
-#define SPELL_TRANSFORM_SPLIT 43142
-#define SPELL_TRANSFORM_SPLIT2 43573
-#define SPELL_TRANSFORM_MERGE 43271
-#define SPELL_SUMMON_LYNX 43143
-#define SPELL_SUMMON_TOTEM 43302
-#define SPELL_BERSERK 45078
-
-#define MOB_SPIRIT_LYNX 24143
-#define SPELL_LYNX_FRENZY 43290
-#define SPELL_SHRED_ARMOR 43243
-
-#define MOB_TOTEM 24224
-#define SPELL_LIGHTNING 43301
-
-enum PhaseHalazzi
-{
- PHASE_NONE = 0,
- PHASE_LYNX = 1,
- PHASE_SPLIT = 2,
- PHASE_HUMAN = 3,
- PHASE_MERGE = 4,
- PHASE_ENRAGE = 5
-};
-
-struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI
-{
- boss_halazziAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- // wait for core patch be accepted
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SUMMON_TOTEM);
- if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
- TempSpell->EffectImplicitTargetA[0] = 1;
- // need to find out what controls totem's spell cooldown
- TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING);
- if(TempSpell && TempSpell->CastingTimeIndex != 5)
- TempSpell->CastingTimeIndex = 5; // 2000 ms casting time
- }
-
- ScriptedInstance *pInstance;
-
- uint32 FrenzyTimer;
- uint32 SaberlashTimer;
- uint32 ShockTimer;
- uint32 TotemTimer;
- uint32 CheckTimer;
- uint32 BerserkTimer;
-
- uint32 TransformCount;
-
- PhaseHalazzi Phase;
-
- uint64 LynxGUID;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
-
- TransformCount = 0;
- BerserkTimer = 600000;
- CheckTimer = 1000;
-
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
-
- Phase = PHASE_NONE;
- EnterPhase(PHASE_LYNX);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
-
- DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- EnterPhase(PHASE_LYNX);
- }
-
- void JustSummoned(Creature* summon)
- {
- summon->AI()->AttackStart(m_creature->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)
- damage = 0;
- }
-
- void SpellHit(Unit*, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_TRANSFORM_SPLIT2)
- EnterPhase(PHASE_HUMAN);
- }
-
- void AttackStart(Unit *who)
- {
- if(Phase != PHASE_MERGE) ScriptedAI::AttackStart(who);
- }
-
- void EnterPhase(PhaseHalazzi NextPhase)
- {
- switch(NextPhase)
- {
- case PHASE_LYNX:
- case PHASE_ENRAGE:
- if(Phase == PHASE_MERGE)
- {
- m_creature->CastSpell(m_creature, SPELL_TRANSFORM_MERGE, true);
- m_creature->Attack(m_creature->getVictim(), true);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
- if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
- {
- Lynx->SetVisibility(VISIBILITY_OFF);
- Lynx->setDeathState(JUST_DIED);
- }
- m_creature->SetMaxHealth(600000);
- m_creature->SetHealth(600000 - 150000 * TransformCount);
- FrenzyTimer = 16000;
- SaberlashTimer = 20000;
- ShockTimer = 10000;
- TotemTimer = 12000;
- break;
- case PHASE_SPLIT:
- DoYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPLIT);
- m_creature->CastSpell(m_creature, SPELL_TRANSFORM_SPLIT, true);
- break;
- case PHASE_HUMAN:
- //DoCast(m_creature, SPELL_SUMMON_LYNX, true);
- DoSpawnCreature(MOB_SPIRIT_LYNX, 0,0,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- m_creature->SetMaxHealth(400000);
- m_creature->SetHealth(400000);
- ShockTimer = 10000;
- TotemTimer = 12000;
- break;
- case PHASE_MERGE:
- if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
- {
- DoYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_MERGE);
- Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Lynx->GetMotionMaster()->Clear();
- Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
- TransformCount++;
- }break;
- default:
- break;
- }
- Phase = NextPhase;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(BerserkTimer < diff)
- {
- DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- DoCast(m_creature, SPELL_BERSERK, true);
- BerserkTimer = 60000;
- }else BerserkTimer -= diff;
-
- if(Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
- {
- if(SaberlashTimer < diff)
- {
- // A tank with more than 490 defense skills should receive no critical hit
- //m_creature->CastSpell(m_creature, 41296, true);
- m_creature->CastSpell(m_creature->getVictim(), SPELL_SABER_LASH, true);
- //m_creature->RemoveAurasDueToSpell(41296);
- SaberlashTimer = 30000;
- }else SaberlashTimer -= diff;
-
- if(FrenzyTimer < diff)
- {
- DoCast(m_creature, SPELL_FRENZY);
- FrenzyTimer = (10+rand()%5)*1000;
- }else FrenzyTimer -= diff;
-
- if(Phase == PHASE_LYNX)
- if(CheckTimer < diff)
- {
- if(m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount))
- EnterPhase(PHASE_SPLIT);
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-
- if(Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE)
- {
- if(TotemTimer < diff)
- {
- DoCast(m_creature, SPELL_SUMMON_TOTEM);
- TotemTimer = 20000;
- }else TotemTimer -= diff;
-
- if(ShockTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- {
- if(target->IsNonMeleeSpellCasted(false))
- DoCast(target,SPELL_EARTHSHOCK);
- else
- DoCast(target,SPELL_FLAMESHOCK);
- ShockTimer = 10000 + rand()%5000;
- }
- }else ShockTimer -= diff;
-
- if(Phase == PHASE_HUMAN)
- if(CheckTimer < diff)
- {
- if(m_creature->GetHealth() * 10 < m_creature->GetMaxHealth())
- EnterPhase(PHASE_MERGE);
- else
- {
- Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
- if(Lynx && Lynx->GetHealth() * 10 < Lynx->GetMaxHealth())
- EnterPhase(PHASE_MERGE);
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-
- if(Phase == PHASE_MERGE)
- {
- if(CheckTimer < diff)
- {
- Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
- if(Lynx && m_creature->IsWithinDistInMap(Lynx, 6.0f))
- {
- if(TransformCount < 3)
- EnterPhase(PHASE_LYNX);
- else
- EnterPhase(PHASE_ENRAGE);
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
- break;
-
- case 1:
- DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_HALAZZIEVENT, DONE);
-
- DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-};
-
-// Spirits Lynx AI
-
-struct TRINITY_DLL_DECL boss_spiritlynxAI : public ScriptedAI
-{
- boss_spiritlynxAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- uint32 FrenzyTimer;
- uint32 shredder_timer;
-
- void Reset()
- {
- FrenzyTimer = (30+rand()%20)*1000; //frenzy every 30-50 seconds
- shredder_timer = 4000;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth())
- damage = 0;
- }
-
- void AttackStart(Unit *who)
- {
- if(!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- ScriptedAI::AttackStart(who);
- }
-
- void Aggro(Unit *who) {DoZoneInCombat();}
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(FrenzyTimer < diff)
- {
- DoCast(m_creature, SPELL_LYNX_FRENZY);
- FrenzyTimer = (30+rand()%20)*1000;
- }else FrenzyTimer -= diff;
-
- if(shredder_timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHRED_ARMOR);
- shredder_timer = 4000;
- }else shredder_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
-};
-
-CreatureAI* GetAI_boss_halazziAI(Creature *_Creature)
-{
- return new boss_halazziAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_spiritlynxAI(Creature *_Creature)
-{
- return new boss_spiritlynxAI (_Creature);
-}
-
-void AddSC_boss_halazzi()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_halazzi";
- newscript->GetAI = GetAI_boss_halazziAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_halazzi_lynx";
- newscript->GetAI = GetAI_boss_spiritlynxAI;
- m_scripts[nrscripts++] = newscript;
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: boss_Halazzi
+SD%Complete: 80
+SDComment:
+SDCategory: Zul¡äAman
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+//#include "spell.h"
+
+#define YELL_AGGRO "Get on your knees and bow to da fang and claw!"
+#define SOUND_AGGRO 12020
+#define YELL_SABER_ONE "You gonna leave in pieces!"
+#define YELL_SABER_TWO "Me gonna carve ya now!"
+#define YELL_SPLIT "Me gonna carve ya now!"
+#define SOUND_SPLIT 12021
+#define YELL_MERGE "Spirit, come back to me!"
+#define SOUND_MERGE 12022
+#define YELL_KILL_ONE "You cant fight the power!"
+#define SOUND_KILL_ONE 12026
+#define YELL_KILL_TWO "You gonna fail!"
+#define SOUND_KILL_TWO 12027
+#define YELL_DEATH "Chaga... choka'jinn."
+#define SOUND_DEATH 12028
+#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..."
+#define SOUND_BERSERK 12025
+
+#define SPELL_DUAL_WIELD 29651
+#define SPELL_SABER_LASH 43267
+#define SPELL_FRENZY 43139
+#define SPELL_FLAMESHOCK 43303
+#define SPELL_EARTHSHOCK 43305
+#define SPELL_TRANSFORM_SPLIT 43142
+#define SPELL_TRANSFORM_SPLIT2 43573
+#define SPELL_TRANSFORM_MERGE 43271
+#define SPELL_SUMMON_LYNX 43143
+#define SPELL_SUMMON_TOTEM 43302
+#define SPELL_BERSERK 45078
+
+#define MOB_SPIRIT_LYNX 24143
+#define SPELL_LYNX_FRENZY 43290
+#define SPELL_SHRED_ARMOR 43243
+
+#define MOB_TOTEM 24224
+#define SPELL_LIGHTNING 43301
+
+enum PhaseHalazzi
+{
+ PHASE_NONE = 0,
+ PHASE_LYNX = 1,
+ PHASE_SPLIT = 2,
+ PHASE_HUMAN = 3,
+ PHASE_MERGE = 4,
+ PHASE_ENRAGE = 5
+};
+
+struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI
+{
+ boss_halazziAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ // wait for core patch be accepted
+ SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SUMMON_TOTEM);
+ if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
+ TempSpell->EffectImplicitTargetA[0] = 1;
+ // need to find out what controls totem's spell cooldown
+ TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING);
+ if(TempSpell && TempSpell->CastingTimeIndex != 5)
+ TempSpell->CastingTimeIndex = 5; // 2000 ms casting time
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 FrenzyTimer;
+ uint32 SaberlashTimer;
+ uint32 ShockTimer;
+ uint32 TotemTimer;
+ uint32 CheckTimer;
+ uint32 BerserkTimer;
+
+ uint32 TransformCount;
+
+ PhaseHalazzi Phase;
+
+ uint64 LynxGUID;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
+
+ TransformCount = 0;
+ BerserkTimer = 600000;
+ CheckTimer = 1000;
+
+ DoCast(m_creature, SPELL_DUAL_WIELD, true);
+
+ Phase = PHASE_NONE;
+ EnterPhase(PHASE_LYNX);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
+
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ EnterPhase(PHASE_LYNX);
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ summon->AI()->AttackStart(m_creature->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)
+ damage = 0;
+ }
+
+ void SpellHit(Unit*, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_TRANSFORM_SPLIT2)
+ EnterPhase(PHASE_HUMAN);
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(Phase != PHASE_MERGE) ScriptedAI::AttackStart(who);
+ }
+
+ void EnterPhase(PhaseHalazzi NextPhase)
+ {
+ switch(NextPhase)
+ {
+ case PHASE_LYNX:
+ case PHASE_ENRAGE:
+ if(Phase == PHASE_MERGE)
+ {
+ m_creature->CastSpell(m_creature, SPELL_TRANSFORM_MERGE, true);
+ m_creature->Attack(m_creature->getVictim(), true);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }
+ if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
+ {
+ Lynx->SetVisibility(VISIBILITY_OFF);
+ Lynx->setDeathState(JUST_DIED);
+ }
+ m_creature->SetMaxHealth(600000);
+ m_creature->SetHealth(600000 - 150000 * TransformCount);
+ FrenzyTimer = 16000;
+ SaberlashTimer = 20000;
+ ShockTimer = 10000;
+ TotemTimer = 12000;
+ break;
+ case PHASE_SPLIT:
+ DoYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPLIT);
+ m_creature->CastSpell(m_creature, SPELL_TRANSFORM_SPLIT, true);
+ break;
+ case PHASE_HUMAN:
+ //DoCast(m_creature, SPELL_SUMMON_LYNX, true);
+ DoSpawnCreature(MOB_SPIRIT_LYNX, 0,0,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ m_creature->SetMaxHealth(400000);
+ m_creature->SetHealth(400000);
+ ShockTimer = 10000;
+ TotemTimer = 12000;
+ break;
+ case PHASE_MERGE:
+ if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
+ {
+ DoYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MERGE);
+ Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Lynx->GetMotionMaster()->Clear();
+ Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
+ TransformCount++;
+ }break;
+ default:
+ break;
+ }
+ Phase = NextPhase;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(BerserkTimer < diff)
+ {
+ DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ DoCast(m_creature, SPELL_BERSERK, true);
+ BerserkTimer = 60000;
+ }else BerserkTimer -= diff;
+
+ if(Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
+ {
+ if(SaberlashTimer < diff)
+ {
+ // A tank with more than 490 defense skills should receive no critical hit
+ //m_creature->CastSpell(m_creature, 41296, true);
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_SABER_LASH, true);
+ //m_creature->RemoveAurasDueToSpell(41296);
+ SaberlashTimer = 30000;
+ }else SaberlashTimer -= diff;
+
+ if(FrenzyTimer < diff)
+ {
+ DoCast(m_creature, SPELL_FRENZY);
+ FrenzyTimer = (10+rand()%5)*1000;
+ }else FrenzyTimer -= diff;
+
+ if(Phase == PHASE_LYNX)
+ if(CheckTimer < diff)
+ {
+ if(m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount))
+ EnterPhase(PHASE_SPLIT);
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+ }
+
+ if(Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE)
+ {
+ if(TotemTimer < diff)
+ {
+ DoCast(m_creature, SPELL_SUMMON_TOTEM);
+ TotemTimer = 20000;
+ }else TotemTimer -= diff;
+
+ if(ShockTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ if(target->IsNonMeleeSpellCasted(false))
+ DoCast(target,SPELL_EARTHSHOCK);
+ else
+ DoCast(target,SPELL_FLAMESHOCK);
+ ShockTimer = 10000 + rand()%5000;
+ }
+ }else ShockTimer -= diff;
+
+ if(Phase == PHASE_HUMAN)
+ if(CheckTimer < diff)
+ {
+ if(m_creature->GetHealth() * 10 < m_creature->GetMaxHealth())
+ EnterPhase(PHASE_MERGE);
+ else
+ {
+ Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
+ if(Lynx && Lynx->GetHealth() * 10 < Lynx->GetMaxHealth())
+ EnterPhase(PHASE_MERGE);
+ }
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+ }
+
+ if(Phase == PHASE_MERGE)
+ {
+ if(CheckTimer < diff)
+ {
+ Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID);
+ if(Lynx && m_creature->IsWithinDistInMap(Lynx, 6.0f))
+ {
+ if(TransformCount < 3)
+ EnterPhase(PHASE_LYNX);
+ else
+ EnterPhase(PHASE_ENRAGE);
+ }
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
+ break;
+
+ case 1:
+ DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HALAZZIEVENT, DONE);
+
+ DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+};
+
+// Spirits Lynx AI
+
+struct TRINITY_DLL_DECL boss_spiritlynxAI : public ScriptedAI
+{
+ boss_spiritlynxAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ uint32 FrenzyTimer;
+ uint32 shredder_timer;
+
+ void Reset()
+ {
+ FrenzyTimer = (30+rand()%20)*1000; //frenzy every 30-50 seconds
+ shredder_timer = 4000;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth())
+ damage = 0;
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ ScriptedAI::AttackStart(who);
+ }
+
+ void Aggro(Unit *who) {DoZoneInCombat();}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(FrenzyTimer < diff)
+ {
+ DoCast(m_creature, SPELL_LYNX_FRENZY);
+ FrenzyTimer = (30+rand()%20)*1000;
+ }else FrenzyTimer -= diff;
+
+ if(shredder_timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHRED_ARMOR);
+ shredder_timer = 4000;
+ }else shredder_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+
+CreatureAI* GetAI_boss_halazziAI(Creature *_Creature)
+{
+ return new boss_halazziAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_spiritlynxAI(Creature *_Creature)
+{
+ return new boss_spiritlynxAI (_Creature);
+}
+
+void AddSC_boss_halazzi()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_halazzi";
+ newscript->GetAI = GetAI_boss_halazziAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_halazzi_lynx";
+ newscript->GetAI = GetAI_boss_spiritlynxAI;
+ m_scripts[nrscripts++] = newscript;
} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
index d6a651d68a9..89b9154878c 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
@@ -1,932 +1,932 @@
-/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Hex_Lord_Malacrass
-SD%Complete:
-SDComment:
-SDCategory: Zul'Aman
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-
-#define YELL_AGGRO "Da shadow gonna fall on you... "
-#define SOUND_YELL_AGGRO 12041
-#define YELL_SPIRIT_BOLTS "Your soul gonna bleed!"
-#define SOUND_YELL_SPIRIT_BOLTS 12047
-#define YELL_DRAIN_POWER "Darkness comin\' for you"
-#define SOUND_YELL_DRAIN_POWER 12046
-#define YELL_KILL_ONE "Dis a nightmare ya don\' wake up from!"
-#define SOUND_YELL_KILL_ONE 12043
-#define YELL_KILL_TWO "Azzaga choogo zinn!"
-#define SOUND_YELL_KILL_TWO 12044
-#define YELL_DEATH "Dis not... da end of me..."
-#define SOUND_YELL_DEATH 12051
-
-#define SPELL_SPIRIT_BOLTS 43383
-#define SPELL_DRAIN_POWER 44131
-#define SPELL_SIPHON_SOUL 43501
-
-#define MOB_TEMP_TRIGGER 23920
-
-//Defines for various powers he uses after using soul drain
-
-//Druid
-#define SPELL_DR_LIFEBLOOM 43421
-#define SPELL_DR_THORNS 43420
-#define SPELL_DR_MOONFIRE 43545
-
-//Hunter
-#define SPELL_HU_EXPLOSIVE_TRAP 43444
-#define SPELL_HU_FREEZING_TRAP 43447
-#define SPELL_HU_SNAKE_TRAP 43449
-
-//Mage
-#define SPELL_MG_FIREBALL 41383
-#define SPELL_MG_FROSTBOLT 43428
-#define SPELL_MG_FROST_NOVA 43426
-#define SPELL_MG_ICE_LANCE 43427
-
-//Paladin
-#define SPELL_PA_CONSECRATION 43429
-#define SPELL_PA_HOLY_LIGHT 43451
-#define SPELL_PA_AVENGING_WRATH 43430
-
-//Priest
-#define SPELL_PR_HEAL 41372
-#define SPELL_PR_MIND_CONTROL 43550
-#define SPELL_PR_MIND_BLAST 41374
-#define SPELL_PR_SW_DEATH 41375
-#define SPELL_PR_PSYCHIC_SCREAM 43432
-#define SPELL_PR_PAIN_SUPP 44416
-
-//Rogue
-#define SPELL_RO_BLIND 43433
-#define SPELL_RO_SLICE_DICE 43457
-#define SPELL_RO_WOUND_POISON 39665
-
-//Shaman
-#define SPELL_SH_FIRE_NOVA 43436
-#define SPELL_SH_HEALING_WAVE 43548
-#define SPELL_SH_CHAIN_LIGHT 43435
-
-//Warlock
-#define SPELL_WL_CURSE_OF_DOOM 43439
-#define SPELL_WL_RAIN_OF_FIRE 43440
-#define SPELL_WL_UNSTABLE_AFFL 35183
-
-//Warrior
-#define SPELL_WR_SPELL_REFLECT 43443
-#define SPELL_WR_WHIRLWIND 43442
-#define SPELL_WR_MORTAL_STRIKE 43441
-
-#define ORIENT 1.5696
-#define POS_Y 921.2795
-#define POS_Z 33.8883
-
-static float Pos_X[4] = {112.8827, 107.8827, 122.8827, 127.8827};
-
-static uint32 AddEntryList[8]=
-{
- 24240, //Alyson Antille
- 24241, //Thurg
- 24242, //Slither
- 24243, //Lord Raadan
- 24244, //Gazakroth
- 24245, //Fenstalker
- 24246, //Darkheart
- 24247 //Koragg
-};
-
-enum AbilityTarget
-{
- ABILITY_TARGET_SELF = 0,
- ABILITY_TARGET_VICTIM = 1,
- ABILITY_TARGET_ENEMY = 2,
- ABILITY_TARGET_HEAL = 3,
- ABILITY_TARGET_BUFF = 4,
- ABILITY_TARGET_SPECIAL = 5
-};
-
-struct PlayerAbilityStruct
-{
- uint32 spell;
- AbilityTarget target;
- uint32 cooldown;
-};
-
-static PlayerAbilityStruct PlayerAbility[][3] =
-{
- // 1 warrior
- {{SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000},
- {SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000},
- {SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000}},
- // 2 paladin
- {{SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000},
- {SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000},
- {SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000}},
- // 3 hunter
- {{SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000},
- {SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000},
- {SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000}},
- // 4 rogue
- {{SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000},
- {SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000},
- {SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000}},
- // 5 priest
- {{SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000},
- {SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000},
- {SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000}},
- // 5* shadow priest
- {{SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000},
- {SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000},
- {SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000}},
- // 7 shaman
- {{SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000},
- {SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000},
- {SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000}},
- // 8 mage
- {{SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000},
- {SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000},
- {SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000}},
- // 9 warlock
- {{SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000},
- {SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000},
- {SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000}},
- // 11 druid
- {{SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000},
- {SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000},
- {SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000}}
-};
-
-struct TRINITY_DLL_DECL boss_hexlord_addAI : public ScriptedAI
-{
- ScriptedInstance* pInstance;
-
- boss_hexlord_addAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- void Reset() {}
-
- void Aggro(Unit* who) {DoZoneInCombat();}
-
- void UpdateAI(const uint32 diff)
- {
- if(pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
- EnterEvadeMode();
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
-{
- boss_hex_lord_malacrassAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- SelectAddEntry();
- for(uint8 i = 0; i < 4; ++i)
- AddGUID[i] = 0;
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint64 AddGUID[4];
- uint32 AddEntry[4];
-
- uint64 PlayerGUID;
-
- uint32 SpiritBolts_Timer;
- uint32 DrainPower_Timer;
- uint32 SiphonSoul_Timer;
- uint32 PlayerAbility_Timer;
- uint32 CheckAddState_Timer;
-
- uint32 PlayerClass;
-
- Unit* SoulDrainTarget;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
-
- SpiritBolts_Timer = 20000;
- DrainPower_Timer = 60000;
- SiphonSoul_Timer = 100000;
- PlayerAbility_Timer = 99999;
- CheckAddState_Timer = 5000;
-
- SpawnAdds();
-
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 46916);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 50268674);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- }
-
- void Aggro(Unit* who)
- {
- if(pInstance)
- pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
-
- DoZoneInCombat();
- DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
-
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive())
- ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
- else
- {
- EnterEvadeMode();
- break;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
- break;
- case 1:
- DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
- break;
- }
- }
-
- void JustDied(Unit* victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_HEXLORDEVENT, DONE);
-
- DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
-
- for(uint8 i = 0; i < 4 ; ++i)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive())
- Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- void SelectAddEntry()
- {
- std::vector<uint32> AddList;
-
- for(uint8 i = 0; i < 8; ++i)
- AddList.push_back(AddEntryList[i]);
-
- while(AddList.size() > 4)
- AddList.erase(AddList.begin()+rand()%AddList.size());
-
- uint8 i = 0;
- for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr, ++i)
- AddEntry[i] = *itr;
- }
-
- void SpawnAdds()
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- Creature *pCreature = ((Creature*)Unit::GetUnit((*m_creature), 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);
- if(pCreature) AddGUID[i] = pCreature->GetGUID();
- }
- else
- {
- pCreature->AI()->EnterEvadeMode();
- pCreature->Relocate(Pos_X[i], POS_Y, POS_Z, ORIENT);
- pCreature->StopMoving();
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim() )
- return;
-
- if(CheckAddState_Timer < diff)
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
- if(Temp && Temp->isAlive() && !Temp->getVictim())
- ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
- }
- CheckAddState_Timer = 5000;
- }else CheckAddState_Timer -= diff;
-
- if(DrainPower_Timer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_DRAIN_POWER, true);
- DoYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER);
- DrainPower_Timer = 40000 + rand()%15000; // must cast in 60 sec, or buff/debuff will disappear
- }else DrainPower_Timer -= diff;
-
- if(SpiritBolts_Timer < diff)
- {
- if(DrainPower_Timer < 12000) // channel 10 sec
- SpiritBolts_Timer = 13000; // cast drain power first
- else
- {
- m_creature->CastSpell(m_creature, SPELL_SPIRIT_BOLTS, false);
- DoYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_SPIRIT_BOLTS);
- SpiritBolts_Timer = 40000;
- SiphonSoul_Timer = 10000; // ready to drain
- PlayerAbility_Timer = 99999;
- }
- }else SpiritBolts_Timer -= diff;
-
- if(SiphonSoul_Timer < diff)
- {
- Player* target = SelectRandomPlayer(50);
- Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(!target || !trigger) EnterEvadeMode();
- else
- {
- trigger->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
- trigger->GetMotionMaster()->MoveChase(m_creature);
-
- //m_creature->CastSpell(target, SPELL_SIPHON_SOUL, true);
- //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
- //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
-
- PlayerGUID = target->GetGUID();
- PlayerAbility_Timer = 8000 + rand()%2000;
- PlayerClass = target->getClass() - 1;
- if(PlayerClass == 10) PlayerClass = 9; // druid
- if(PlayerClass == 4 && target->HasSpell(15473)) PlayerClass = 5; // shadow priest
- SiphonSoul_Timer = 99999; // buff lasts 30 sec
- }
- }else SiphonSoul_Timer -= diff;
-
- if(PlayerAbility_Timer < diff)
- {
- //Unit* target = Unit::GetUnit(*m_creature, PlayerGUID);
- //if(target && target->isAlive())
- {
- UseAbility();
- PlayerAbility_Timer = 8000 + rand()%2000;
- }
- }else PlayerAbility_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
- void UseAbility()
- {
- uint32 random = rand()%3;
- Unit *target = NULL;
- switch(PlayerAbility[PlayerClass][random].target)
- {
- case ABILITY_TARGET_SELF:
- target = m_creature;
- break;
- case ABILITY_TARGET_VICTIM:
- target = m_creature->getVictim();
- break;
- case ABILITY_TARGET_ENEMY:
- default:
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- break;
- case ABILITY_TARGET_HEAL:
- target = DoSelectLowestHpFriendly(50, 0);
- break;
- case ABILITY_TARGET_BUFF:
- {
- std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell);
- if(!templist.empty()) target = *(templist.begin());
- }
- break;
- }
- m_creature->CastSpell(target, PlayerAbility[PlayerClass][random].spell, false);
- }
-
- Player* SelectRandomPlayer(float range = 0.0f, bool alive = true)
- {
- Map *map = m_creature->GetMap();
- if (!map->IsDungeon()) return NULL;
-
- InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
- InstanceMap::PlayerList::iterator i;
- while(PlayerList.size())
- {
- i = PlayerList.begin();
- advance(i, rand()%PlayerList.size());
- if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
- && (!alive || (*i)->isAlive()))
- return *i;
- else
- PlayerList.erase(i);
- }
- return NULL;
- }
-};
-
-#define SPELL_BLOODLUST 43578
-#define SPELL_CLEAVE 15496
-
-struct TRINITY_DLL_DECL boss_thurgAI : public boss_hexlord_addAI
-{
-
- boss_thurgAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 bloodlust_timer;
- uint32 cleave_timer;
-
- void Reset()
- {
- bloodlust_timer = 15000;
- cleave_timer = 10000;
-
- boss_hexlord_addAI::Reset();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if(bloodlust_timer < diff)
- {
- std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
- if(!templist.empty())
- {
- Unit* target = *(templist.begin());
- m_creature->CastSpell(target, SPELL_BLOODLUST, false);
- }
- bloodlust_timer = 12000;
- }else bloodlust_timer -= diff;
-
- if(cleave_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_CLEAVE, false);
- cleave_timer = 12000; //3 sec cast
- }else cleave_timer -= diff;
- }
-};
-
-#define SPELL_FLASH_HEAL 43575
-#define SPELL_DISPEL_MAGIC 43577
-
-struct TRINITY_DLL_DECL boss_alyson_antilleAI : public boss_hexlord_addAI
-{
- //Holy Priest
- boss_alyson_antilleAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 flashheal_timer;
- uint32 dispelmagic_timer;
-
- void Reset()
- {
- flashheal_timer = 2500;
- dispelmagic_timer = 10000;
-
- //AcquireGUID();
-
- boss_hexlord_addAI::Reset();
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(m_creature->Attack(who, false))
- {
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
-
- if(flashheal_timer < diff)
- {
- Unit* target = DoSelectLowestHpFriendly(99, 30000);
- if(target)
- {
- if(target->IsWithinDistInMap(m_creature, 50))
- m_creature->CastSpell(target,SPELL_FLASH_HEAL, false);
- else
- {
- // bugged
- //m_creature->GetMotionMaster()->Clear();
- //m_creature->GetMotionMaster()->MoveChase(target, 20);
- }
- }
- else
- {
- if(rand()%2)
- {
- Unit* target = DoSelectLowestHpFriendly(50, 0);
- m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
- }
- else
- m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
- }
- flashheal_timer = 2500;
- }else flashheal_timer -= diff;
-
- /*if(dispelmagic_timer < diff)
- {
- if(rand()%2)
- {
- Unit* target = SelectTarget();
-
- m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
- }
- else
- m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
-
- dispelmagic_timer = 12000;
- }else dispelmagic_timer -= diff;*/
- }
-};
-
-#define SPELL_FIREBOLT 43584
-
-struct TRINITY_DLL_DECL boss_gazakrothAI : public boss_hexlord_addAI
-{
- boss_gazakrothAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 firebolt_timer;
-
- void Reset()
- {
- firebolt_timer = 2000;
- boss_hexlord_addAI::Reset();
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(m_creature->Attack(who, false))
- {
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if(firebolt_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_FIREBOLT, false);
- firebolt_timer = 700;
- }else firebolt_timer -= diff;
- }
-};
-
-#define SPELL_FLAME_BREATH 43582
-#define SPELL_THUNDERCLAP 43583
-
-struct TRINITY_DLL_DECL boss_lord_raadanAI : public boss_hexlord_addAI
-{
- boss_lord_raadanAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 flamebreath_timer;
- uint32 thunderclap_timer;
-
- void Reset()
- {
- flamebreath_timer = 8000;
- thunderclap_timer = 13000;
-
- boss_hexlord_addAI::Reset();
-
- }
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if (thunderclap_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_THUNDERCLAP, false);
- thunderclap_timer = 12000;
- }else thunderclap_timer -= diff;
-
- if (flamebreath_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_FLAME_BREATH, false);
- flamebreath_timer = 12000;
- }else flamebreath_timer -= diff;
- }
-};
-
-#define SPELL_PSYCHIC_WAIL 43590
-
-struct TRINITY_DLL_DECL boss_darkheartAI : public boss_hexlord_addAI
-{
- boss_darkheartAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 psychicwail_timer;
-
- void Reset()
- {
- psychicwail_timer = 8000;
-
- boss_hexlord_addAI::Reset();
-
- }
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if (psychicwail_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_PSYCHIC_WAIL, false);
- psychicwail_timer = 12000;
- }else psychicwail_timer -= diff;
- }
-};
-
-#define SPELL_VENOM_SPIT 43579
-
-struct TRINITY_DLL_DECL boss_slitherAI : public boss_hexlord_addAI
-{
- boss_slitherAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 venomspit_timer;
-
-
- void Reset()
- {
- venomspit_timer = 5000;
- boss_hexlord_addAI::Reset();
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(m_creature->Attack(who, false))
- {
- m_creature->GetMotionMaster()->MoveChase(who, 20);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
- boss_hexlord_addAI::UpdateAI(diff);
-
- if (venomspit_timer < diff)
- {
- Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
- m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false);
- venomspit_timer = 2500;
- }else venomspit_timer -= diff;
- }
-};
-
-//Fenstalker
-#define SPELL_VOLATILE_INFECTION 43586
-
-struct TRINITY_DLL_DECL boss_fenstalkerAI : public boss_hexlord_addAI
-{
- boss_fenstalkerAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 volatileinf_timer;
-
-
- void Reset()
- {
- volatileinf_timer = 15000;
- boss_hexlord_addAI::Reset();
-
- }
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if (volatileinf_timer < diff)
- {
- // core bug
- m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_VOLATILE_INFECTION, false);
- volatileinf_timer = 12000;
- }else volatileinf_timer -= diff;
- }
-};
-
-//Koragg
-#define SPELL_COLD_STARE 43593
-#define SPELL_MIGHTY_BLOW 43592
-
-
-struct TRINITY_DLL_DECL boss_koraggAI : public boss_hexlord_addAI
-{
- boss_koraggAI(Creature *c) : boss_hexlord_addAI(c) {}
-
- uint32 coldstare_timer;
- uint32 mightyblow_timer;
-
-
- void Reset()
- {
- coldstare_timer = 15000;
- mightyblow_timer = 10000;
- boss_hexlord_addAI::Reset();
-
- }
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- boss_hexlord_addAI::UpdateAI(diff);
-
- if (mightyblow_timer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_MIGHTY_BLOW, false);
- mightyblow_timer = 12000;
- }
- if (coldstare_timer < diff)
- {
- Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
- m_creature->CastSpell(victim,SPELL_COLD_STARE, false);
- coldstare_timer = 12000;
- }
- }
-};
-
-CreatureAI* GetAI_boss_hex_lord_malacrass(Creature *_Creature)
-{
- return new boss_hex_lord_malacrassAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_thurg(Creature *_Creature)
-{
- return new boss_thurgAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_alyson_antille(Creature *_Creature)
-{
- return new boss_alyson_antilleAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_gazakroth(Creature *_Creature)
-{
- return new boss_gazakrothAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_lord_raadan(Creature *_Creature)
-{
- return new boss_lord_raadanAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_darkheart(Creature *_Creature)
-{
- return new boss_darkheartAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_slither(Creature *_Creature)
-{
- return new boss_slitherAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_fenstalker(Creature *_Creature)
-{
- return new boss_fenstalkerAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_koragg(Creature *_Creature)
-{
- return new boss_koraggAI (_Creature);
-}
-void AddSC_boss_hex_lord_malacrass()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_hexlord_malacrass";
- newscript->GetAI = GetAI_boss_hex_lord_malacrass;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_thurg";
- newscript->GetAI = GetAI_boss_thurg;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_gazakroth";
- newscript->GetAI = GetAI_boss_gazakroth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lord_raadan";
- newscript->GetAI = GetAI_boss_lord_raadan;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_darkheart";
- newscript->GetAI = GetAI_boss_darkheart;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_slither";
- newscript->GetAI = GetAI_boss_slither;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_fenstalker";
- newscript->GetAI = GetAI_boss_fenstalker;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_koragg";
- newscript->GetAI = GetAI_boss_koragg;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_alyson_antille";
- newscript->GetAI = GetAI_boss_alyson_antille;
- m_scripts[nrscripts++] = newscript;
+/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Hex_Lord_Malacrass
+SD%Complete:
+SDComment:
+SDCategory: Zul'Aman
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+
+#define YELL_AGGRO "Da shadow gonna fall on you... "
+#define SOUND_YELL_AGGRO 12041
+#define YELL_SPIRIT_BOLTS "Your soul gonna bleed!"
+#define SOUND_YELL_SPIRIT_BOLTS 12047
+#define YELL_DRAIN_POWER "Darkness comin\' for you"
+#define SOUND_YELL_DRAIN_POWER 12046
+#define YELL_KILL_ONE "Dis a nightmare ya don\' wake up from!"
+#define SOUND_YELL_KILL_ONE 12043
+#define YELL_KILL_TWO "Azzaga choogo zinn!"
+#define SOUND_YELL_KILL_TWO 12044
+#define YELL_DEATH "Dis not... da end of me..."
+#define SOUND_YELL_DEATH 12051
+
+#define SPELL_SPIRIT_BOLTS 43383
+#define SPELL_DRAIN_POWER 44131
+#define SPELL_SIPHON_SOUL 43501
+
+#define MOB_TEMP_TRIGGER 23920
+
+//Defines for various powers he uses after using soul drain
+
+//Druid
+#define SPELL_DR_LIFEBLOOM 43421
+#define SPELL_DR_THORNS 43420
+#define SPELL_DR_MOONFIRE 43545
+
+//Hunter
+#define SPELL_HU_EXPLOSIVE_TRAP 43444
+#define SPELL_HU_FREEZING_TRAP 43447
+#define SPELL_HU_SNAKE_TRAP 43449
+
+//Mage
+#define SPELL_MG_FIREBALL 41383
+#define SPELL_MG_FROSTBOLT 43428
+#define SPELL_MG_FROST_NOVA 43426
+#define SPELL_MG_ICE_LANCE 43427
+
+//Paladin
+#define SPELL_PA_CONSECRATION 43429
+#define SPELL_PA_HOLY_LIGHT 43451
+#define SPELL_PA_AVENGING_WRATH 43430
+
+//Priest
+#define SPELL_PR_HEAL 41372
+#define SPELL_PR_MIND_CONTROL 43550
+#define SPELL_PR_MIND_BLAST 41374
+#define SPELL_PR_SW_DEATH 41375
+#define SPELL_PR_PSYCHIC_SCREAM 43432
+#define SPELL_PR_PAIN_SUPP 44416
+
+//Rogue
+#define SPELL_RO_BLIND 43433
+#define SPELL_RO_SLICE_DICE 43457
+#define SPELL_RO_WOUND_POISON 39665
+
+//Shaman
+#define SPELL_SH_FIRE_NOVA 43436
+#define SPELL_SH_HEALING_WAVE 43548
+#define SPELL_SH_CHAIN_LIGHT 43435
+
+//Warlock
+#define SPELL_WL_CURSE_OF_DOOM 43439
+#define SPELL_WL_RAIN_OF_FIRE 43440
+#define SPELL_WL_UNSTABLE_AFFL 35183
+
+//Warrior
+#define SPELL_WR_SPELL_REFLECT 43443
+#define SPELL_WR_WHIRLWIND 43442
+#define SPELL_WR_MORTAL_STRIKE 43441
+
+#define ORIENT 1.5696
+#define POS_Y 921.2795
+#define POS_Z 33.8883
+
+static float Pos_X[4] = {112.8827, 107.8827, 122.8827, 127.8827};
+
+static uint32 AddEntryList[8]=
+{
+ 24240, //Alyson Antille
+ 24241, //Thurg
+ 24242, //Slither
+ 24243, //Lord Raadan
+ 24244, //Gazakroth
+ 24245, //Fenstalker
+ 24246, //Darkheart
+ 24247 //Koragg
+};
+
+enum AbilityTarget
+{
+ ABILITY_TARGET_SELF = 0,
+ ABILITY_TARGET_VICTIM = 1,
+ ABILITY_TARGET_ENEMY = 2,
+ ABILITY_TARGET_HEAL = 3,
+ ABILITY_TARGET_BUFF = 4,
+ ABILITY_TARGET_SPECIAL = 5
+};
+
+struct PlayerAbilityStruct
+{
+ uint32 spell;
+ AbilityTarget target;
+ uint32 cooldown;
+};
+
+static PlayerAbilityStruct PlayerAbility[][3] =
+{
+ // 1 warrior
+ {{SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000},
+ {SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000},
+ {SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000}},
+ // 2 paladin
+ {{SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000},
+ {SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000},
+ {SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000}},
+ // 3 hunter
+ {{SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000},
+ {SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000},
+ {SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000}},
+ // 4 rogue
+ {{SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000},
+ {SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000},
+ {SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000}},
+ // 5 priest
+ {{SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000},
+ {SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000},
+ {SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000}},
+ // 5* shadow priest
+ {{SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000},
+ {SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000},
+ {SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000}},
+ // 7 shaman
+ {{SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000},
+ {SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000},
+ {SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000}},
+ // 8 mage
+ {{SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000},
+ {SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000},
+ {SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000}},
+ // 9 warlock
+ {{SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000},
+ {SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000},
+ {SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000}},
+ // 11 druid
+ {{SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000},
+ {SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000},
+ {SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000}}
+};
+
+struct TRINITY_DLL_DECL boss_hexlord_addAI : public ScriptedAI
+{
+ ScriptedInstance* pInstance;
+
+ boss_hexlord_addAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ void Reset() {}
+
+ void Aggro(Unit* who) {DoZoneInCombat();}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
+ EnterEvadeMode();
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
+{
+ boss_hex_lord_malacrassAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ SelectAddEntry();
+ for(uint8 i = 0; i < 4; ++i)
+ AddGUID[i] = 0;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint64 AddGUID[4];
+ uint32 AddEntry[4];
+
+ uint64 PlayerGUID;
+
+ uint32 SpiritBolts_Timer;
+ uint32 DrainPower_Timer;
+ uint32 SiphonSoul_Timer;
+ uint32 PlayerAbility_Timer;
+ uint32 CheckAddState_Timer;
+
+ uint32 PlayerClass;
+
+ Unit* SoulDrainTarget;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
+
+ SpiritBolts_Timer = 20000;
+ DrainPower_Timer = 60000;
+ SiphonSoul_Timer = 100000;
+ PlayerAbility_Timer = 99999;
+ CheckAddState_Timer = 5000;
+
+ SpawnAdds();
+
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 46916);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 50268674);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ }
+
+ void Aggro(Unit* who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
+
+ DoZoneInCombat();
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
+
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive())
+ ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
+ else
+ {
+ EnterEvadeMode();
+ break;
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
+ break;
+ case 1:
+ DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
+ break;
+ }
+ }
+
+ void JustDied(Unit* victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HEXLORDEVENT, DONE);
+
+ DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
+
+ for(uint8 i = 0; i < 4 ; ++i)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive())
+ Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ void SelectAddEntry()
+ {
+ std::vector<uint32> AddList;
+
+ for(uint8 i = 0; i < 8; ++i)
+ AddList.push_back(AddEntryList[i]);
+
+ while(AddList.size() > 4)
+ AddList.erase(AddList.begin()+rand()%AddList.size());
+
+ uint8 i = 0;
+ for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr, ++i)
+ AddEntry[i] = *itr;
+ }
+
+ void SpawnAdds()
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Creature *pCreature = ((Creature*)Unit::GetUnit((*m_creature), 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);
+ if(pCreature) AddGUID[i] = pCreature->GetGUID();
+ }
+ else
+ {
+ pCreature->AI()->EnterEvadeMode();
+ pCreature->Relocate(Pos_X[i], POS_Y, POS_Z, ORIENT);
+ pCreature->StopMoving();
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim() )
+ return;
+
+ if(CheckAddState_Timer < diff)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
+ if(Temp && Temp->isAlive() && !Temp->getVictim())
+ ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
+ }
+ CheckAddState_Timer = 5000;
+ }else CheckAddState_Timer -= diff;
+
+ if(DrainPower_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_DRAIN_POWER, true);
+ DoYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER);
+ DrainPower_Timer = 40000 + rand()%15000; // must cast in 60 sec, or buff/debuff will disappear
+ }else DrainPower_Timer -= diff;
+
+ if(SpiritBolts_Timer < diff)
+ {
+ if(DrainPower_Timer < 12000) // channel 10 sec
+ SpiritBolts_Timer = 13000; // cast drain power first
+ else
+ {
+ m_creature->CastSpell(m_creature, SPELL_SPIRIT_BOLTS, false);
+ DoYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_SPIRIT_BOLTS);
+ SpiritBolts_Timer = 40000;
+ SiphonSoul_Timer = 10000; // ready to drain
+ PlayerAbility_Timer = 99999;
+ }
+ }else SpiritBolts_Timer -= diff;
+
+ if(SiphonSoul_Timer < diff)
+ {
+ Player* target = SelectRandomPlayer(50);
+ Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(!target || !trigger) EnterEvadeMode();
+ else
+ {
+ trigger->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
+ trigger->GetMotionMaster()->MoveChase(m_creature);
+
+ //m_creature->CastSpell(target, SPELL_SIPHON_SOUL, true);
+ //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
+ //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
+
+ PlayerGUID = target->GetGUID();
+ PlayerAbility_Timer = 8000 + rand()%2000;
+ PlayerClass = target->getClass() - 1;
+ if(PlayerClass == 10) PlayerClass = 9; // druid
+ if(PlayerClass == 4 && target->HasSpell(15473)) PlayerClass = 5; // shadow priest
+ SiphonSoul_Timer = 99999; // buff lasts 30 sec
+ }
+ }else SiphonSoul_Timer -= diff;
+
+ if(PlayerAbility_Timer < diff)
+ {
+ //Unit* target = Unit::GetUnit(*m_creature, PlayerGUID);
+ //if(target && target->isAlive())
+ {
+ UseAbility();
+ PlayerAbility_Timer = 8000 + rand()%2000;
+ }
+ }else PlayerAbility_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void UseAbility()
+ {
+ uint32 random = rand()%3;
+ Unit *target = NULL;
+ switch(PlayerAbility[PlayerClass][random].target)
+ {
+ case ABILITY_TARGET_SELF:
+ target = m_creature;
+ break;
+ case ABILITY_TARGET_VICTIM:
+ target = m_creature->getVictim();
+ break;
+ case ABILITY_TARGET_ENEMY:
+ default:
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ break;
+ case ABILITY_TARGET_HEAL:
+ target = DoSelectLowestHpFriendly(50, 0);
+ break;
+ case ABILITY_TARGET_BUFF:
+ {
+ std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell);
+ if(!templist.empty()) target = *(templist.begin());
+ }
+ break;
+ }
+ m_creature->CastSpell(target, PlayerAbility[PlayerClass][random].spell, false);
+ }
+
+ Player* SelectRandomPlayer(float range = 0.0f, bool alive = true)
+ {
+ Map *map = m_creature->GetMap();
+ if (!map->IsDungeon()) return NULL;
+
+ InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers();
+ InstanceMap::PlayerList::iterator i;
+ while(PlayerList.size())
+ {
+ i = PlayerList.begin();
+ advance(i, rand()%PlayerList.size());
+ if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range))
+ && (!alive || (*i)->isAlive()))
+ return *i;
+ else
+ PlayerList.erase(i);
+ }
+ return NULL;
+ }
+};
+
+#define SPELL_BLOODLUST 43578
+#define SPELL_CLEAVE 15496
+
+struct TRINITY_DLL_DECL boss_thurgAI : public boss_hexlord_addAI
+{
+
+ boss_thurgAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 bloodlust_timer;
+ uint32 cleave_timer;
+
+ void Reset()
+ {
+ bloodlust_timer = 15000;
+ cleave_timer = 10000;
+
+ boss_hexlord_addAI::Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if(bloodlust_timer < diff)
+ {
+ std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
+ if(!templist.empty())
+ {
+ Unit* target = *(templist.begin());
+ m_creature->CastSpell(target, SPELL_BLOODLUST, false);
+ }
+ bloodlust_timer = 12000;
+ }else bloodlust_timer -= diff;
+
+ if(cleave_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_CLEAVE, false);
+ cleave_timer = 12000; //3 sec cast
+ }else cleave_timer -= diff;
+ }
+};
+
+#define SPELL_FLASH_HEAL 43575
+#define SPELL_DISPEL_MAGIC 43577
+
+struct TRINITY_DLL_DECL boss_alyson_antilleAI : public boss_hexlord_addAI
+{
+ //Holy Priest
+ boss_alyson_antilleAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 flashheal_timer;
+ uint32 dispelmagic_timer;
+
+ void Reset()
+ {
+ flashheal_timer = 2500;
+ dispelmagic_timer = 10000;
+
+ //AcquireGUID();
+
+ boss_hexlord_addAI::Reset();
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(m_creature->Attack(who, false))
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, 20);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+
+ if(flashheal_timer < diff)
+ {
+ Unit* target = DoSelectLowestHpFriendly(99, 30000);
+ if(target)
+ {
+ if(target->IsWithinDistInMap(m_creature, 50))
+ m_creature->CastSpell(target,SPELL_FLASH_HEAL, false);
+ else
+ {
+ // bugged
+ //m_creature->GetMotionMaster()->Clear();
+ //m_creature->GetMotionMaster()->MoveChase(target, 20);
+ }
+ }
+ else
+ {
+ if(rand()%2)
+ {
+ Unit* target = DoSelectLowestHpFriendly(50, 0);
+ m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
+ }
+ else
+ m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
+ }
+ flashheal_timer = 2500;
+ }else flashheal_timer -= diff;
+
+ /*if(dispelmagic_timer < diff)
+ {
+ if(rand()%2)
+ {
+ Unit* target = SelectTarget();
+
+ m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
+ }
+ else
+ m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
+
+ dispelmagic_timer = 12000;
+ }else dispelmagic_timer -= diff;*/
+ }
+};
+
+#define SPELL_FIREBOLT 43584
+
+struct TRINITY_DLL_DECL boss_gazakrothAI : public boss_hexlord_addAI
+{
+ boss_gazakrothAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 firebolt_timer;
+
+ void Reset()
+ {
+ firebolt_timer = 2000;
+ boss_hexlord_addAI::Reset();
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(m_creature->Attack(who, false))
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, 20);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if(firebolt_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_FIREBOLT, false);
+ firebolt_timer = 700;
+ }else firebolt_timer -= diff;
+ }
+};
+
+#define SPELL_FLAME_BREATH 43582
+#define SPELL_THUNDERCLAP 43583
+
+struct TRINITY_DLL_DECL boss_lord_raadanAI : public boss_hexlord_addAI
+{
+ boss_lord_raadanAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 flamebreath_timer;
+ uint32 thunderclap_timer;
+
+ void Reset()
+ {
+ flamebreath_timer = 8000;
+ thunderclap_timer = 13000;
+
+ boss_hexlord_addAI::Reset();
+
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if (thunderclap_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_THUNDERCLAP, false);
+ thunderclap_timer = 12000;
+ }else thunderclap_timer -= diff;
+
+ if (flamebreath_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_FLAME_BREATH, false);
+ flamebreath_timer = 12000;
+ }else flamebreath_timer -= diff;
+ }
+};
+
+#define SPELL_PSYCHIC_WAIL 43590
+
+struct TRINITY_DLL_DECL boss_darkheartAI : public boss_hexlord_addAI
+{
+ boss_darkheartAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 psychicwail_timer;
+
+ void Reset()
+ {
+ psychicwail_timer = 8000;
+
+ boss_hexlord_addAI::Reset();
+
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if (psychicwail_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_PSYCHIC_WAIL, false);
+ psychicwail_timer = 12000;
+ }else psychicwail_timer -= diff;
+ }
+};
+
+#define SPELL_VENOM_SPIT 43579
+
+struct TRINITY_DLL_DECL boss_slitherAI : public boss_hexlord_addAI
+{
+ boss_slitherAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 venomspit_timer;
+
+
+ void Reset()
+ {
+ venomspit_timer = 5000;
+ boss_hexlord_addAI::Reset();
+ }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(m_creature->Attack(who, false))
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, 20);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if (venomspit_timer < diff)
+ {
+ Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false);
+ venomspit_timer = 2500;
+ }else venomspit_timer -= diff;
+ }
+};
+
+//Fenstalker
+#define SPELL_VOLATILE_INFECTION 43586
+
+struct TRINITY_DLL_DECL boss_fenstalkerAI : public boss_hexlord_addAI
+{
+ boss_fenstalkerAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 volatileinf_timer;
+
+
+ void Reset()
+ {
+ volatileinf_timer = 15000;
+ boss_hexlord_addAI::Reset();
+
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if (volatileinf_timer < diff)
+ {
+ // core bug
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_VOLATILE_INFECTION, false);
+ volatileinf_timer = 12000;
+ }else volatileinf_timer -= diff;
+ }
+};
+
+//Koragg
+#define SPELL_COLD_STARE 43593
+#define SPELL_MIGHTY_BLOW 43592
+
+
+struct TRINITY_DLL_DECL boss_koraggAI : public boss_hexlord_addAI
+{
+ boss_koraggAI(Creature *c) : boss_hexlord_addAI(c) {}
+
+ uint32 coldstare_timer;
+ uint32 mightyblow_timer;
+
+
+ void Reset()
+ {
+ coldstare_timer = 15000;
+ mightyblow_timer = 10000;
+ boss_hexlord_addAI::Reset();
+
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ boss_hexlord_addAI::UpdateAI(diff);
+
+ if (mightyblow_timer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_MIGHTY_BLOW, false);
+ mightyblow_timer = 12000;
+ }
+ if (coldstare_timer < diff)
+ {
+ Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ m_creature->CastSpell(victim,SPELL_COLD_STARE, false);
+ coldstare_timer = 12000;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_hex_lord_malacrass(Creature *_Creature)
+{
+ return new boss_hex_lord_malacrassAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_thurg(Creature *_Creature)
+{
+ return new boss_thurgAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_alyson_antille(Creature *_Creature)
+{
+ return new boss_alyson_antilleAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_gazakroth(Creature *_Creature)
+{
+ return new boss_gazakrothAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_lord_raadan(Creature *_Creature)
+{
+ return new boss_lord_raadanAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_darkheart(Creature *_Creature)
+{
+ return new boss_darkheartAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_slither(Creature *_Creature)
+{
+ return new boss_slitherAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_fenstalker(Creature *_Creature)
+{
+ return new boss_fenstalkerAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_koragg(Creature *_Creature)
+{
+ return new boss_koraggAI (_Creature);
+}
+void AddSC_boss_hex_lord_malacrass()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_hexlord_malacrass";
+ newscript->GetAI = GetAI_boss_hex_lord_malacrass;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_thurg";
+ newscript->GetAI = GetAI_boss_thurg;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_gazakroth";
+ newscript->GetAI = GetAI_boss_gazakroth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lord_raadan";
+ newscript->GetAI = GetAI_boss_lord_raadan;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_darkheart";
+ newscript->GetAI = GetAI_boss_darkheart;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_slither";
+ newscript->GetAI = GetAI_boss_slither;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_fenstalker";
+ newscript->GetAI = GetAI_boss_fenstalker;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_koragg";
+ newscript->GetAI = GetAI_boss_koragg;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_alyson_antille";
+ newscript->GetAI = GetAI_boss_alyson_antille;
+ m_scripts[nrscripts++] = newscript;
} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
index 9aacaded028..0b460404f92 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
@@ -1,729 +1,729 @@
-/* Copyright(C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-*(at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Janalai
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Aman
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-#include "GridNotifiers.h"
-
-// Jan'alai
-// --Spell
-#define SPELL_FLAME_BREATH 43140
-#define SPELL_FIRE_WALL 43113
-#define SPELL_ENRAGE 44779
-#define SPELL_SUMMON_PLAYERS 43097
-#define SPELL_TELE_TO_CENTER 43098 // coord
-#define SPELL_HATCH_ALL 43144
-#define SPELL_BERSERK 45078
-// -- Fire Bob Spells
-#define SPELL_FIRE_BOMB_CHANNEL 42621 // last forever
-#define SPELL_FIRE_BOMB_THROW 42628 // throw visual
-#define SPELL_FIRE_BOMB_DUMMY 42629 // bomb visual
-#define SPELL_FIRE_BOMB_DAMAGE 42630
-
-// -- SAYs
-#define SOUND_AGGRO 12031
-#define SAY_AGGRO "Spirits of da wind be your doom!"
-#define SOUND_FIRE_BOMBS 12032
-#define SAY_FIRE_BOMBS "I burn ya now!"
-#define SOUND_SUMMON_HATCHER 12033
-#define SAY_SUMMON_HATCHER "Where ma hatcha? Get to work on dem templist!"
-#define SOUND_ALL_EGGS 12034
-#define SAY_ALL_EGGS "I show you strength... in numbers."
-#define SOUND_BERSERK 12035
-#define SAY_BERSERK "You done run outta time!"
-
-#define SOUND_SLAY_1 12036
-#define SAY_SLAY_1 "It all be over now, mon!"
-#define SOUND_SLAY_2 12037
-#define SAY_SLAY_2 "Tazaga-choo!"
-
-#define SOUND_DEATH 12038
-#define SAY_DEATH "Zul'jin... got a surprise for you..."
-
-#define SOUND_AGGRO_1 12039 //NOT USED need more information
-#define SAY_AGGRO_1 "Come, strangers. The spirit of the dragonhawk hot be hungry for worthy souls." //NOT USED need more information(random say before aggro?)
-#define SOUND_AGGRO_2 12040 //NOT USED need more information
-#define SAY_AGGRO_2 "Come, friends. Your bodies gonna feed ma HatchNum, and your souls are going to feed me with power!" //NOT USED need more information(random say before aggro?)
-
-// --Summons
-#define MOB_AMANI_HATCHER 23818
-#define MOB_HATCHLING 23598 // 42493
-#define MOB_EGG 23817
-#define MOB_FIRE_BOMB 23920
-
-// -- Hatcher Spells
-#define SPELL_HATCH_EGG 43734 // 42471
-
-// -- Hatchling Spells
-#define SPELL_FLAMEBUFFET 43299
-
-const int area_dx = 44;
-const int area_dy = 51;
-
-float JanalainPos[1][3] =
-{
- {-33.93, 1149.27, 19}
-};
-
-float FireWallCoords[4][4] =
-{
- {-10.13, 1149.27, 19, 3.1415},
- {-33.93, 1123.90, 19, 0.5*3.1415},
- {-54.80, 1150.08, 19, 0},
- {-33.93, 1175.68, 19, 1.5*3.1415}
-};
-
-float hatcherway[2][5][3] =
-{
- {
- {-87.46,1170.09,6},
- {-74.41,1154.75,6},
- {-52.74,1153.32,19},
- {-33.37,1172.46,19},
- {-33.09,1203.87,19}
- },
- {
- {-86.57,1132.85,6},
- {-73.94,1146.00,6},
- {-52.29,1146.51,19},
- {-33.57,1125.72,19},
- {-34.29,1095.22,19}
- }
-};
-
-struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
-{
- boss_janalaiAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 FireBreathTimer;
- uint32 BombTimer;
- uint32 BombSequenceTimer;
- uint32 BombCount;
- uint32 HatcherTimer;
- uint32 EnrageTimer;
- uint32 ResetTimer;
-
- bool noeggs;
- bool enraged;
- bool isBombing;
-
- bool isFlameBreathing;
-
- uint64 FireBombGUIDs[40];
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
-
- FireBreathTimer = 8000;
- BombTimer = 30000;
- BombSequenceTimer = 1000;
- BombCount = 0;
- HatcherTimer = 10000;
- EnrageTimer = 300000;
- ResetTimer = 5000;
-
- noeggs = false;
- isBombing =false;
- enraged = false;
-
- isFlameBreathing = false;
-
- for(uint8 i = 0; i < 40; i++)
- FireBombGUIDs[i] = 0;
-
- HatchAllEggs(1);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_JANALAIEVENT, DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
-
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
-// DoZoneInCombat();
- }
-
- void DamageDeal(Unit* target, uint32 &damage)
- {
- if(isFlameBreathing)
- {
- if(!m_creature->HasInArc(M_PI/6, target))
- damage = 0;
- }
- }
-
- void FireWall()
- {
- uint8 WallNum;
- Creature* wall = NULL;
- for(uint8 i = 0; i < 4; i++)
- {
- if(i == 0 || i == 2)
- WallNum = 3;
- else
- WallNum = 2;
-
- 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);
- 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);
- if(wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true);
- }
- }
- }
-
- void SpawnBombs()
- {
- float dx, dy;
- for( int i(0); i < 40; i++)
- {
- dx =(rand()%(area_dx))-(area_dx/2);
- dy =(rand()%(area_dy))-(area_dy/2);
-
- Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
- if(bomb) FireBombGUIDs[i] = bomb->GetGUID();
- }
- BombCount = 0;
- }
-
- bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
-
- //error_log("Eggs %d at middle", templist.size());
- if(!templist.size())
- return false;
-
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
- {
- if(action == 1)
- (*i)->SetDisplayId(10056);
- else if(action == 2 &&(*i)->GetDisplayId() != 11686)
- (*i)->CastSpell(*i, SPELL_HATCH_EGG, false);
- }
- return true;
- }
-
- void Boom()
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
- {
- (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true);
- (*i)->RemoveAllAuras();
- }
- }
-
- void HandleBombSequence()
- {
- if(BombCount < 40)
- {
- if(Unit *FireBomb = Unit::GetUnit((*m_creature), FireBombGUIDs[BombCount]))
- {
- FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true);
- FireBomb->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- BombCount++;
- if(BombCount == 40)
- {
- BombSequenceTimer = 5000;
- }else BombSequenceTimer = 100;
- }
- else
- {
- Boom();
- isBombing = false;
- BombTimer = 20000+rand()%20000;
- m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL);
- if(EnrageTimer <= 10000)
- EnrageTimer = 0;
- else
- EnrageTimer -= 10000;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(isFlameBreathing)
- {
- if(!m_creature->IsNonMeleeSpellCasted(false))
- {
- isFlameBreathing = false;
- }else return;
- }
-
- if(isBombing)
- {
- if(BombSequenceTimer < diff)
- {
- HandleBombSequence();
- }else BombSequenceTimer -= diff;
- return;
- }
-
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- //enrage if under 25% hp before 5 min.
- if(!enraged && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth())
- EnrageTimer = 0;
-
- if(EnrageTimer < diff)
- {
- if(!enraged)
- {
- m_creature->CastSpell(m_creature, SPELL_ENRAGE, true);
- enraged = true;
- EnrageTimer = 300000;
- }
- else
- {
- DoYell(SAY_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_BERSERK);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- EnrageTimer = 300000;
- }
- }else EnrageTimer -= diff;
-
- if(BombTimer < diff)
- {
- DoYell(SAY_FIRE_BOMBS, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_FIRE_BOMBS);
-
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
- m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0);
- m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0);
- m_creature->StopMoving();
- m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_CHANNEL, false);
- //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0);
- //m_creature->CastSpell(m_creature, SPELL_TELE_TO_CENTER, true);
-
- FireWall();
- SpawnBombs();
- isBombing = true;
- BombSequenceTimer = 100;
-
- //Teleport every Player into the middle
- Map *map = m_creature->GetMap();
- if(!map->IsDungeon()) return;
- InstanceMap::PlayerList const &PlayerList =((InstanceMap*)map)->GetPlayers();
- for(InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if((*i)->isAlive())
- DoTeleportPlayer(*i, JanalainPos[0][0]-5+rand()%10, JanalainPos[0][1]-5+rand()%10, JanalainPos[0][2], 0);
- }
- //m_creature->CastSpell(Temp, SPELL_SUMMON_PLAYERS, true); // core bug, spell does not work if too far
- return;
- }else BombTimer -= diff;
-
- if(!noeggs)
- {
- if(100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth())
- {
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
- m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0);
- m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0);
- m_creature->StopMoving();
- m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false);
- HatchAllEggs(2);
- noeggs = true;
- }
- else if(HatcherTimer < diff)
- {
- if(HatchAllEggs(0))
- {
- DoYell(SAY_SUMMON_HATCHER, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON_HATCHER);
- 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);
- HatcherTimer = 90000;
- }
- else
- noeggs = true;
- }else HatcherTimer -= diff;
- }
-
- if(ResetTimer < diff)
- {
- /*float x, y, z;
- m_creature->GetPosition(x, y, z);
- if(x < -70 || x > 0 || y > 1176 || y < 1121 || z < 18)
- EnterEvadeMode();*/
- ResetTimer = 5000;
- }else ResetTimer -= diff;
-
- DoMeleeAttackIfReady();
-
- if(FireBreathTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- {
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear();
- m_creature->CastSpell(target, SPELL_FLAME_BREATH, false);
- m_creature->StopMoving();
- isFlameBreathing = true;
- }
- FireBreathTimer = 8000;
- }else FireBreathTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_boss_janalaiAI(Creature *_Creature)
-{
- return new boss_janalaiAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_jandalai_firebombAI : public ScriptedAI
-{
- mob_jandalai_firebombAI(Creature *c) : ScriptedAI(c){Reset();}
-
- void Reset() {}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_FIRE_BOMB_THROW)
- m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_DUMMY, true);
- }
-
- void Aggro(Unit* who) {}
-
- void AttackStart(Unit* who) {}
-
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff) {}
-};
-
-CreatureAI* GetAI_mob_jandalai_firebombAI(Creature *_Creature)
-{
- return new mob_jandalai_firebombAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI
-{
- mob_amanishi_hatcherAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 waypoint;
- uint32 HatchNum;
- uint32 WaitTimer;
-
- bool side;
- bool hasChangedSide;
- bool isHatching;
-
- void Reset()
- {
- side =(m_creature->GetPositionY() < 1150);
- waypoint = 0;
- isHatching = false;
- hasChangedSide = false;
- WaitTimer = 1;
- HatchNum = 0;
- }
-
- bool HatchEggs(uint32 num)
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
-
- //error_log("Eggs %d at %d", templist.size(), side);
-
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end() && num > 0; ++i)
- {
- if((*i)->GetDisplayId() != 11686)
- {
- (*i)->CastSpell(*i, SPELL_HATCH_EGG, false);
- num--;
- }
- }
-
- if(num)
- return false; // no more templist
- else
- return true;
- }
-
- void Aggro(Unit* who) {}
- void AttackStart(Unit*) {}
- void MoveInLineOfSight(Unit*) {}
- void MovementInform(uint32, uint32)
- {
- if(waypoint == 5)
- {
- isHatching = true;
- HatchNum = 1;
- WaitTimer = 5000;
- }
- else
- WaitTimer = 1;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }
-
- if(!isHatching)
- {
- if(WaitTimer)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]);
- waypoint++;
- WaitTimer = 0;
- }
- }
- else
- {
- if(WaitTimer < diff)
- {
- if(HatchEggs(HatchNum))
- {
- HatchNum++;
- WaitTimer = 10000;
- }
- else if(!hasChangedSide)
- {
- side = side ? 0 : 1;
- isHatching = false;
- waypoint = 3;
- WaitTimer = 1;
- hasChangedSide = true;
- }
- else
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }
- }else WaitTimer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature *_Creature)
-{
- return new mob_amanishi_hatcherAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI
-{
- mob_hatchlingAI(Creature *c) : ScriptedAI(c)
- {
- pInstance =((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
- uint32 BuffetTimer;
-
- 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]);
- else
- m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]);
-
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- }
-
- void Aggro(Unit *who) {/*DoZoneInCombat();*/}
-
- void UpdateAI(const uint32 diff)
- {
- if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(BuffetTimer < diff)
- {
- m_creature->CastSpell(m_creature->getVictim(), SPELL_FLAMEBUFFET, false);
- BuffetTimer = 10000;
- }else BuffetTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_hatchlingAI(Creature *_Creature)
-{
- return new mob_hatchlingAI(_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_eggAI : public ScriptedAI
-{
- mob_eggAI(Creature *c) : ScriptedAI(c){}
- void Reset() {}
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_HATCH_EGG)
- {
- DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- m_creature->SetDisplayId(11686);
- }
- }
-};
-
-CreatureAI* GetAI_mob_eggAI(Creature *_Creature)
-{
- return new mob_eggAI(_Creature);
-}
-
-void AddSC_boss_janalai()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_janalai";
- newscript->GetAI = GetAI_boss_janalaiAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_janalai_firebomb";
- newscript->GetAI = GetAI_mob_jandalai_firebombAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_janalai_hatcher";
- newscript->GetAI = GetAI_mob_amanishi_hatcherAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_janalai_hatchling";
- newscript->GetAI = GetAI_mob_hatchlingAI;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_janalai_egg";
- newscript->GetAI = GetAI_mob_eggAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright(C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+*(at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Janalai
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Aman
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+#include "GridNotifiers.h"
+
+// Jan'alai
+// --Spell
+#define SPELL_FLAME_BREATH 43140
+#define SPELL_FIRE_WALL 43113
+#define SPELL_ENRAGE 44779
+#define SPELL_SUMMON_PLAYERS 43097
+#define SPELL_TELE_TO_CENTER 43098 // coord
+#define SPELL_HATCH_ALL 43144
+#define SPELL_BERSERK 45078
+// -- Fire Bob Spells
+#define SPELL_FIRE_BOMB_CHANNEL 42621 // last forever
+#define SPELL_FIRE_BOMB_THROW 42628 // throw visual
+#define SPELL_FIRE_BOMB_DUMMY 42629 // bomb visual
+#define SPELL_FIRE_BOMB_DAMAGE 42630
+
+// -- SAYs
+#define SOUND_AGGRO 12031
+#define SAY_AGGRO "Spirits of da wind be your doom!"
+#define SOUND_FIRE_BOMBS 12032
+#define SAY_FIRE_BOMBS "I burn ya now!"
+#define SOUND_SUMMON_HATCHER 12033
+#define SAY_SUMMON_HATCHER "Where ma hatcha? Get to work on dem templist!"
+#define SOUND_ALL_EGGS 12034
+#define SAY_ALL_EGGS "I show you strength... in numbers."
+#define SOUND_BERSERK 12035
+#define SAY_BERSERK "You done run outta time!"
+
+#define SOUND_SLAY_1 12036
+#define SAY_SLAY_1 "It all be over now, mon!"
+#define SOUND_SLAY_2 12037
+#define SAY_SLAY_2 "Tazaga-choo!"
+
+#define SOUND_DEATH 12038
+#define SAY_DEATH "Zul'jin... got a surprise for you..."
+
+#define SOUND_AGGRO_1 12039 //NOT USED need more information
+#define SAY_AGGRO_1 "Come, strangers. The spirit of the dragonhawk hot be hungry for worthy souls." //NOT USED need more information(random say before aggro?)
+#define SOUND_AGGRO_2 12040 //NOT USED need more information
+#define SAY_AGGRO_2 "Come, friends. Your bodies gonna feed ma HatchNum, and your souls are going to feed me with power!" //NOT USED need more information(random say before aggro?)
+
+// --Summons
+#define MOB_AMANI_HATCHER 23818
+#define MOB_HATCHLING 23598 // 42493
+#define MOB_EGG 23817
+#define MOB_FIRE_BOMB 23920
+
+// -- Hatcher Spells
+#define SPELL_HATCH_EGG 43734 // 42471
+
+// -- Hatchling Spells
+#define SPELL_FLAMEBUFFET 43299
+
+const int area_dx = 44;
+const int area_dy = 51;
+
+float JanalainPos[1][3] =
+{
+ {-33.93, 1149.27, 19}
+};
+
+float FireWallCoords[4][4] =
+{
+ {-10.13, 1149.27, 19, 3.1415},
+ {-33.93, 1123.90, 19, 0.5*3.1415},
+ {-54.80, 1150.08, 19, 0},
+ {-33.93, 1175.68, 19, 1.5*3.1415}
+};
+
+float hatcherway[2][5][3] =
+{
+ {
+ {-87.46,1170.09,6},
+ {-74.41,1154.75,6},
+ {-52.74,1153.32,19},
+ {-33.37,1172.46,19},
+ {-33.09,1203.87,19}
+ },
+ {
+ {-86.57,1132.85,6},
+ {-73.94,1146.00,6},
+ {-52.29,1146.51,19},
+ {-33.57,1125.72,19},
+ {-34.29,1095.22,19}
+ }
+};
+
+struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
+{
+ boss_janalaiAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 FireBreathTimer;
+ uint32 BombTimer;
+ uint32 BombSequenceTimer;
+ uint32 BombCount;
+ uint32 HatcherTimer;
+ uint32 EnrageTimer;
+ uint32 ResetTimer;
+
+ bool noeggs;
+ bool enraged;
+ bool isBombing;
+
+ bool isFlameBreathing;
+
+ uint64 FireBombGUIDs[40];
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
+
+ FireBreathTimer = 8000;
+ BombTimer = 30000;
+ BombSequenceTimer = 1000;
+ BombCount = 0;
+ HatcherTimer = 10000;
+ EnrageTimer = 300000;
+ ResetTimer = 5000;
+
+ noeggs = false;
+ isBombing =false;
+ enraged = false;
+
+ isFlameBreathing = false;
+
+ for(uint8 i = 0; i < 40; i++)
+ FireBombGUIDs[i] = 0;
+
+ HatchAllEggs(1);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_JANALAIEVENT, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
+
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+// DoZoneInCombat();
+ }
+
+ void DamageDeal(Unit* target, uint32 &damage)
+ {
+ if(isFlameBreathing)
+ {
+ if(!m_creature->HasInArc(M_PI/6, target))
+ damage = 0;
+ }
+ }
+
+ void FireWall()
+ {
+ uint8 WallNum;
+ Creature* wall = NULL;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ if(i == 0 || i == 2)
+ WallNum = 3;
+ else
+ WallNum = 2;
+
+ 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);
+ 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);
+ if(wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true);
+ }
+ }
+ }
+
+ void SpawnBombs()
+ {
+ float dx, dy;
+ for( int i(0); i < 40; i++)
+ {
+ dx =(rand()%(area_dx))-(area_dx/2);
+ dy =(rand()%(area_dy))-(area_dy/2);
+
+ Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
+ if(bomb) FireBombGUIDs[i] = bomb->GetGUID();
+ }
+ BombCount = 0;
+ }
+
+ bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+
+ //error_log("Eggs %d at middle", templist.size());
+ if(!templist.size())
+ return false;
+
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
+ {
+ if(action == 1)
+ (*i)->SetDisplayId(10056);
+ else if(action == 2 &&(*i)->GetDisplayId() != 11686)
+ (*i)->CastSpell(*i, SPELL_HATCH_EGG, false);
+ }
+ return true;
+ }
+
+ void Boom()
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
+ {
+ (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true);
+ (*i)->RemoveAllAuras();
+ }
+ }
+
+ void HandleBombSequence()
+ {
+ if(BombCount < 40)
+ {
+ if(Unit *FireBomb = Unit::GetUnit((*m_creature), FireBombGUIDs[BombCount]))
+ {
+ FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true);
+ FireBomb->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ BombCount++;
+ if(BombCount == 40)
+ {
+ BombSequenceTimer = 5000;
+ }else BombSequenceTimer = 100;
+ }
+ else
+ {
+ Boom();
+ isBombing = false;
+ BombTimer = 20000+rand()%20000;
+ m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL);
+ if(EnrageTimer <= 10000)
+ EnrageTimer = 0;
+ else
+ EnrageTimer -= 10000;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(isFlameBreathing)
+ {
+ if(!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ isFlameBreathing = false;
+ }else return;
+ }
+
+ if(isBombing)
+ {
+ if(BombSequenceTimer < diff)
+ {
+ HandleBombSequence();
+ }else BombSequenceTimer -= diff;
+ return;
+ }
+
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ //enrage if under 25% hp before 5 min.
+ if(!enraged && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth())
+ EnrageTimer = 0;
+
+ if(EnrageTimer < diff)
+ {
+ if(!enraged)
+ {
+ m_creature->CastSpell(m_creature, SPELL_ENRAGE, true);
+ enraged = true;
+ EnrageTimer = 300000;
+ }
+ else
+ {
+ DoYell(SAY_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_BERSERK);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ EnrageTimer = 300000;
+ }
+ }else EnrageTimer -= diff;
+
+ if(BombTimer < diff)
+ {
+ DoYell(SAY_FIRE_BOMBS, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_FIRE_BOMBS);
+
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0);
+ m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0);
+ m_creature->StopMoving();
+ m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_CHANNEL, false);
+ //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0);
+ //m_creature->CastSpell(m_creature, SPELL_TELE_TO_CENTER, true);
+
+ FireWall();
+ SpawnBombs();
+ isBombing = true;
+ BombSequenceTimer = 100;
+
+ //Teleport every Player into the middle
+ Map *map = m_creature->GetMap();
+ if(!map->IsDungeon()) return;
+ InstanceMap::PlayerList const &PlayerList =((InstanceMap*)map)->GetPlayers();
+ for(InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if((*i)->isAlive())
+ DoTeleportPlayer(*i, JanalainPos[0][0]-5+rand()%10, JanalainPos[0][1]-5+rand()%10, JanalainPos[0][2], 0);
+ }
+ //m_creature->CastSpell(Temp, SPELL_SUMMON_PLAYERS, true); // core bug, spell does not work if too far
+ return;
+ }else BombTimer -= diff;
+
+ if(!noeggs)
+ {
+ if(100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth())
+ {
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0);
+ m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0);
+ m_creature->StopMoving();
+ m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false);
+ HatchAllEggs(2);
+ noeggs = true;
+ }
+ else if(HatcherTimer < diff)
+ {
+ if(HatchAllEggs(0))
+ {
+ DoYell(SAY_SUMMON_HATCHER, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON_HATCHER);
+ 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);
+ HatcherTimer = 90000;
+ }
+ else
+ noeggs = true;
+ }else HatcherTimer -= diff;
+ }
+
+ if(ResetTimer < diff)
+ {
+ /*float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ if(x < -70 || x > 0 || y > 1176 || y < 1121 || z < 18)
+ EnterEvadeMode();*/
+ ResetTimer = 5000;
+ }else ResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ if(FireBreathTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->CastSpell(target, SPELL_FLAME_BREATH, false);
+ m_creature->StopMoving();
+ isFlameBreathing = true;
+ }
+ FireBreathTimer = 8000;
+ }else FireBreathTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_janalaiAI(Creature *_Creature)
+{
+ return new boss_janalaiAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_jandalai_firebombAI : public ScriptedAI
+{
+ mob_jandalai_firebombAI(Creature *c) : ScriptedAI(c){Reset();}
+
+ void Reset() {}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_FIRE_BOMB_THROW)
+ m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_DUMMY, true);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void AttackStart(Unit* who) {}
+
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_mob_jandalai_firebombAI(Creature *_Creature)
+{
+ return new mob_jandalai_firebombAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI
+{
+ mob_amanishi_hatcherAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 waypoint;
+ uint32 HatchNum;
+ uint32 WaitTimer;
+
+ bool side;
+ bool hasChangedSide;
+ bool isHatching;
+
+ void Reset()
+ {
+ side =(m_creature->GetPositionY() < 1150);
+ waypoint = 0;
+ isHatching = false;
+ hasChangedSide = false;
+ WaitTimer = 1;
+ HatchNum = 0;
+ }
+
+ bool HatchEggs(uint32 num)
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+
+ //error_log("Eggs %d at %d", templist.size(), side);
+
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end() && num > 0; ++i)
+ {
+ if((*i)->GetDisplayId() != 11686)
+ {
+ (*i)->CastSpell(*i, SPELL_HATCH_EGG, false);
+ num--;
+ }
+ }
+
+ if(num)
+ return false; // no more templist
+ else
+ return true;
+ }
+
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit*) {}
+ void MoveInLineOfSight(Unit*) {}
+ void MovementInform(uint32, uint32)
+ {
+ if(waypoint == 5)
+ {
+ isHatching = true;
+ HatchNum = 1;
+ WaitTimer = 5000;
+ }
+ else
+ WaitTimer = 1;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }
+
+ if(!isHatching)
+ {
+ if(WaitTimer)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]);
+ waypoint++;
+ WaitTimer = 0;
+ }
+ }
+ else
+ {
+ if(WaitTimer < diff)
+ {
+ if(HatchEggs(HatchNum))
+ {
+ HatchNum++;
+ WaitTimer = 10000;
+ }
+ else if(!hasChangedSide)
+ {
+ side = side ? 0 : 1;
+ isHatching = false;
+ waypoint = 3;
+ WaitTimer = 1;
+ hasChangedSide = true;
+ }
+ else
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }
+ }else WaitTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature *_Creature)
+{
+ return new mob_amanishi_hatcherAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI
+{
+ mob_hatchlingAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance =((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ uint32 BuffetTimer;
+
+ 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]);
+ else
+ m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]);
+
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ }
+
+ void Aggro(Unit *who) {/*DoZoneInCombat();*/}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(BuffetTimer < diff)
+ {
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_FLAMEBUFFET, false);
+ BuffetTimer = 10000;
+ }else BuffetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_hatchlingAI(Creature *_Creature)
+{
+ return new mob_hatchlingAI(_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_eggAI : public ScriptedAI
+{
+ mob_eggAI(Creature *c) : ScriptedAI(c){}
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_HATCH_EGG)
+ {
+ DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ m_creature->SetDisplayId(11686);
+ }
+ }
+};
+
+CreatureAI* GetAI_mob_eggAI(Creature *_Creature)
+{
+ return new mob_eggAI(_Creature);
+}
+
+void AddSC_boss_janalai()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_janalai";
+ newscript->GetAI = GetAI_boss_janalaiAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_janalai_firebomb";
+ newscript->GetAI = GetAI_mob_jandalai_firebombAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_janalai_hatcher";
+ newscript->GetAI = GetAI_mob_amanishi_hatcherAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_janalai_hatchling";
+ newscript->GetAI = GetAI_mob_hatchlingAI;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_janalai_egg";
+ newscript->GetAI = GetAI_mob_eggAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
index 3a99a6ed97c..d51e1cdfa00 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
@@ -1,304 +1,304 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Nalorakk
-SD%Complete: 80
-SDComment: Todo: Trash Waves
-SDCategory: Zul'Aman
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-
-//TODO: Trash Waves
-
-//Unimplemented SoundIDs
-/*
-#define SOUND_NALORAKK_WAVE1 12066
-#define SOUND_NALORAKK_WAVE2 12067
-#define SOUND_NALORAKK_WAVE3 12068
-#define SOUND_NALORAKK_WAVE4 12069
-
-#define SOUND_NALORAKK_EVENT1 12078
-#define SOUND_NALORAKK_EVENT2 12079
-*/
-
-
-//General defines
-#define YELL_AGGRO "You be dead soon enough!"
-#define SOUND_YELL_AGGRO 12070
-#define YELL_KILL_ONE "Mua-ha-ha! Now whatchoo got to say?"
-#define SOUND_YELL_KILL_ONE 12075
-#define YELL_KILL_TWO "Da Amani gonna rule again!"
-#define SOUND_YELL_KILL_TWO 12076
-#define YELL_DEATH "I... be waitin' on da udda side...."
-#define SOUND_YELL_DEATH 12077
-#define YELL_BERSERK "You had your chance, now it be too late!" //Never seen this being used, so just guessing from what I hear.
-#define SOUND_YELL_BERSERK 12074
-
-#define SPELL_BERSERK 45078
-
-//Defines for Troll form
-#define SPELL_BRUTALSWIPE 42384
-#define SPELL_MANGLE 42389
-#define SPELL_MANGLEEFFECT 44955
-#define SPELL_SURGE 42402
-#define SPELL_BEARFORM 42377
-
-#define YELL_SURGE "I bring da pain!"
-#define SOUND_YELL_SURGE 12071
-
-#define YELL_SHIFTEDTOTROLL "Make way for Nalorakk!"
-#define SOUND_YELL_TOTROLL 12073
-
-//Defines for Bear form
-#define SPELL_LACERATINGSLASH 42395
-#define SPELL_RENDFLESH 42397
-#define SPELL_DEAFENINGROAR 42398
-
-#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!"
-#define SOUND_YELL_TOBEAR 12072
-
-
-struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
-{
- boss_nalorakkAI(Creature *c) : ScriptedAI(c) {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 BrutalSwipe_Timer;
- uint32 Mangle_Timer;
- uint32 Surge_Timer;
-
- uint32 LaceratingSlash_Timer;
- uint32 RendFlesh_Timer;
- uint32 DeafeningRoar_Timer;
-
- uint32 ShapeShift_Timer;
- uint32 Berserk_Timer;
-
- uint64 ChargeTargetGUID;
- uint64 TankGUID;
-
- bool inBearForm;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
-
- Surge_Timer = 15000 + rand()%5000;
- BrutalSwipe_Timer = 7000 + rand()%5000;
- Mangle_Timer = 10000 + rand()%5000;
- ShapeShift_Timer = 45000 + rand()%5000;
- Berserk_Timer = 600000;
-
- ChargeTargetGUID = 0;
- TankGUID = 0;
-
- inBearForm = false;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
-
- DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
-// DoZoneInCombat();
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_NALORAKKEVENT, DONE);
-
- DoYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
- break;
- case 1:
- DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
- break;
- }
- }
-
- void MovementInform(uint32, uint32)
- {
- if(ChargeTargetGUID)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, ChargeTargetGUID))
- m_creature->CastSpell(target, SPELL_SURGE, true);
- ChargeTargetGUID = 0;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(TankGUID)
- {
- if(!ChargeTargetGUID)
- {
- m_creature->SetSpeed(MOVE_RUN, 1.2f);
- m_creature->GetMotionMaster()->Clear();
- if(Unit* target = Unit::GetUnit(*m_creature, TankGUID))
- m_creature->GetMotionMaster()->MoveChase(target);
- TankGUID = 0;
- }
- return;
- }
-
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(Berserk_Timer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK, true);
- DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK);
- Berserk_Timer = 600000;
- }else Berserk_Timer -= diff;
-
- if(ShapeShift_Timer < diff)
- {
- if(inBearForm)
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
- DoYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL);
- m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM);
- Surge_Timer = 15000 + rand()%5000;
- BrutalSwipe_Timer = 7000 + rand()%5000;
- Mangle_Timer = 10000 + rand()%5000;
- ShapeShift_Timer = 45000 + rand()%5000;
- inBearForm = false;
- }
- else
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
- DoYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR);
- DoCast(m_creature, SPELL_BEARFORM, true);
- LaceratingSlash_Timer = 2000; // dur 18s
- RendFlesh_Timer = 3000; // dur 5s
- DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
- ShapeShift_Timer = 20000 + rand()%5000; // dur 30s
- inBearForm = true;
- }
- }else ShapeShift_Timer -= diff;
-
- if(!inBearForm)
- {
- if(BrutalSwipe_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BRUTALSWIPE);
- BrutalSwipe_Timer = 7000 + rand()%5000;
- }else BrutalSwipe_Timer -= diff;
-
- if(Mangle_Timer < diff)
- {
- if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
- {
- DoCast(m_creature->getVictim(), SPELL_MANGLE);
- Mangle_Timer = 1000;
- }
- else Mangle_Timer = 10000 + rand()%5000;
- }else Mangle_Timer -= diff;
-
- if(Surge_Timer < diff)
- {
- DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
-
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- TankGUID = m_creature->getVictim()->GetGUID();
- ChargeTargetGUID = target->GetGUID();
-
- float x, y, z;
- target->GetContactPoint(m_creature, x, y, z);
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
-
- Surge_Timer = 15000 + rand()%5000;
- return;
- }else Surge_Timer -= diff;
- }
- else {
- if(LaceratingSlash_Timer < diff)
- {
- if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
- DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH);
- else
- {
- int32 bp0 = 3470;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_LACERATINGSLASH, &bp0, NULL, NULL, false);
- }
- LaceratingSlash_Timer = 18000 + rand()%5000;
- }else LaceratingSlash_Timer -= diff;
-
- if(RendFlesh_Timer < diff)
- {
- if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
- DoCast(m_creature->getVictim(), SPELL_RENDFLESH);
- else
- {
- int32 bp1 = 4670;
- m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_RENDFLESH, NULL, &bp1, NULL, false);
- }
- RendFlesh_Timer = 5000 + rand()%5000;
- }else RendFlesh_Timer -= diff;
-
- if(DeafeningRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DEAFENINGROAR);
- DeafeningRoar_Timer = 15000 + rand()%5000;
- }else DeafeningRoar_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_nalorakk(Creature *_Creature)
-{
- return new boss_nalorakkAI (_Creature);
-}
-
-void AddSC_boss_nalorakk()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_nalorakk";
- newscript->GetAI = GetAI_boss_nalorakk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Nalorakk
+SD%Complete: 80
+SDComment: Todo: Trash Waves
+SDCategory: Zul'Aman
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+
+//TODO: Trash Waves
+
+//Unimplemented SoundIDs
+/*
+#define SOUND_NALORAKK_WAVE1 12066
+#define SOUND_NALORAKK_WAVE2 12067
+#define SOUND_NALORAKK_WAVE3 12068
+#define SOUND_NALORAKK_WAVE4 12069
+
+#define SOUND_NALORAKK_EVENT1 12078
+#define SOUND_NALORAKK_EVENT2 12079
+*/
+
+
+//General defines
+#define YELL_AGGRO "You be dead soon enough!"
+#define SOUND_YELL_AGGRO 12070
+#define YELL_KILL_ONE "Mua-ha-ha! Now whatchoo got to say?"
+#define SOUND_YELL_KILL_ONE 12075
+#define YELL_KILL_TWO "Da Amani gonna rule again!"
+#define SOUND_YELL_KILL_TWO 12076
+#define YELL_DEATH "I... be waitin' on da udda side...."
+#define SOUND_YELL_DEATH 12077
+#define YELL_BERSERK "You had your chance, now it be too late!" //Never seen this being used, so just guessing from what I hear.
+#define SOUND_YELL_BERSERK 12074
+
+#define SPELL_BERSERK 45078
+
+//Defines for Troll form
+#define SPELL_BRUTALSWIPE 42384
+#define SPELL_MANGLE 42389
+#define SPELL_MANGLEEFFECT 44955
+#define SPELL_SURGE 42402
+#define SPELL_BEARFORM 42377
+
+#define YELL_SURGE "I bring da pain!"
+#define SOUND_YELL_SURGE 12071
+
+#define YELL_SHIFTEDTOTROLL "Make way for Nalorakk!"
+#define SOUND_YELL_TOTROLL 12073
+
+//Defines for Bear form
+#define SPELL_LACERATINGSLASH 42395
+#define SPELL_RENDFLESH 42397
+#define SPELL_DEAFENINGROAR 42398
+
+#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!"
+#define SOUND_YELL_TOBEAR 12072
+
+
+struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
+{
+ boss_nalorakkAI(Creature *c) : ScriptedAI(c) {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 BrutalSwipe_Timer;
+ uint32 Mangle_Timer;
+ uint32 Surge_Timer;
+
+ uint32 LaceratingSlash_Timer;
+ uint32 RendFlesh_Timer;
+ uint32 DeafeningRoar_Timer;
+
+ uint32 ShapeShift_Timer;
+ uint32 Berserk_Timer;
+
+ uint64 ChargeTargetGUID;
+ uint64 TankGUID;
+
+ bool inBearForm;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
+
+ Surge_Timer = 15000 + rand()%5000;
+ BrutalSwipe_Timer = 7000 + rand()%5000;
+ Mangle_Timer = 10000 + rand()%5000;
+ ShapeShift_Timer = 45000 + rand()%5000;
+ Berserk_Timer = 600000;
+
+ ChargeTargetGUID = 0;
+ TankGUID = 0;
+
+ inBearForm = false;
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
+
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO);
+// DoZoneInCombat();
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_NALORAKKEVENT, DONE);
+
+ DoYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE);
+ break;
+ case 1:
+ DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO);
+ break;
+ }
+ }
+
+ void MovementInform(uint32, uint32)
+ {
+ if(ChargeTargetGUID)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, ChargeTargetGUID))
+ m_creature->CastSpell(target, SPELL_SURGE, true);
+ ChargeTargetGUID = 0;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(TankGUID)
+ {
+ if(!ChargeTargetGUID)
+ {
+ m_creature->SetSpeed(MOVE_RUN, 1.2f);
+ m_creature->GetMotionMaster()->Clear();
+ if(Unit* target = Unit::GetUnit(*m_creature, TankGUID))
+ m_creature->GetMotionMaster()->MoveChase(target);
+ TankGUID = 0;
+ }
+ return;
+ }
+
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(Berserk_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK, true);
+ DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK);
+ Berserk_Timer = 600000;
+ }else Berserk_Timer -= diff;
+
+ if(ShapeShift_Timer < diff)
+ {
+ if(inBearForm)
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
+ DoYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL);
+ m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM);
+ Surge_Timer = 15000 + rand()%5000;
+ BrutalSwipe_Timer = 7000 + rand()%5000;
+ Mangle_Timer = 10000 + rand()%5000;
+ ShapeShift_Timer = 45000 + rand()%5000;
+ inBearForm = false;
+ }
+ else
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
+ DoYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR);
+ DoCast(m_creature, SPELL_BEARFORM, true);
+ LaceratingSlash_Timer = 2000; // dur 18s
+ RendFlesh_Timer = 3000; // dur 5s
+ DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
+ ShapeShift_Timer = 20000 + rand()%5000; // dur 30s
+ inBearForm = true;
+ }
+ }else ShapeShift_Timer -= diff;
+
+ if(!inBearForm)
+ {
+ if(BrutalSwipe_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BRUTALSWIPE);
+ BrutalSwipe_Timer = 7000 + rand()%5000;
+ }else BrutalSwipe_Timer -= diff;
+
+ if(Mangle_Timer < diff)
+ {
+ if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
+ {
+ DoCast(m_creature->getVictim(), SPELL_MANGLE);
+ Mangle_Timer = 1000;
+ }
+ else Mangle_Timer = 10000 + rand()%5000;
+ }else Mangle_Timer -= diff;
+
+ if(Surge_Timer < diff)
+ {
+ DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
+
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ TankGUID = m_creature->getVictim()->GetGUID();
+ ChargeTargetGUID = target->GetGUID();
+
+ float x, y, z;
+ target->GetContactPoint(m_creature, x, y, z);
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+
+ Surge_Timer = 15000 + rand()%5000;
+ return;
+ }else Surge_Timer -= diff;
+ }
+ else {
+ if(LaceratingSlash_Timer < diff)
+ {
+ if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
+ DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH);
+ else
+ {
+ int32 bp0 = 3470;
+ m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_LACERATINGSLASH, &bp0, NULL, NULL, false);
+ }
+ LaceratingSlash_Timer = 18000 + rand()%5000;
+ }else LaceratingSlash_Timer -= diff;
+
+ if(RendFlesh_Timer < diff)
+ {
+ if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
+ DoCast(m_creature->getVictim(), SPELL_RENDFLESH);
+ else
+ {
+ int32 bp1 = 4670;
+ m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_RENDFLESH, NULL, &bp1, NULL, false);
+ }
+ RendFlesh_Timer = 5000 + rand()%5000;
+ }else RendFlesh_Timer -= diff;
+
+ if(DeafeningRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DEAFENINGROAR);
+ DeafeningRoar_Timer = 15000 + rand()%5000;
+ }else DeafeningRoar_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_nalorakk(Creature *_Creature)
+{
+ return new boss_nalorakkAI (_Creature);
+}
+
+void AddSC_boss_nalorakk()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_nalorakk";
+ newscript->GetAI = GetAI_boss_nalorakk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
index a73ced22de6..c97f8284acb 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
@@ -1,683 +1,683 @@
-/* Copyright (C) 2006,2007,2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_ZulJin
-SD%Complete: 85%
-SDComment:
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-//#include "spell.h"
-
-//Speech
-#define YELL_TRANSFORM_TO_LYNX "Let me introduce to you my new bruddahs: fang and claw!"
-#define SOUND_TRANSFORM_TO_LYNX 12094
-
-#define YELL_TRANSFORM_TO_BEAR "Got me some new tricks...like me bruddah bear!"
-#define SOUND_TRANSFORM_TO_BEAR 12092
-
-#define YELL_TRANSFORM_TO_DRAGONHAWK "Ya don' have to look to da sky to see da dragonhawk!"
-#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095
-
-#define YELL_TRANSFORM_TO_EAGLE "Dere be no hidin' from da eagle!"
-#define SOUND_TRANSFORM_TO_EAGLE 12093
-
-#define YELL_KILL_ONE "Da Amani de chuka!"
-#define SOUND_KILL_ONE 12098
-
-#define YELL_KILL_TWO "Lot more gonna fall like you!"
-#define SOUND_KILL_TWO 12099
-
-#define YELL_FIRE_BREATH "Fire kill you just as quick!"
-#define SOUND_FIRE_BRETH 12096
-
-#define YELL_AGGRO "Nobody badduh dan me!"
-#define SOUND_AGGRO 12091
-
-#define YELL_BERSERK "You too slow! Me too strong!"
-#define SOUND_BERSERK 12097
-
-#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..."
-#define SOUND_DEATH 12100
-
-//Still not used, need more info
-#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!"
-#define SOUND_INTRO 12090
-
-//Spells:
-// ====== Troll Form
-#define SPELL_WHIRLWIND 17207
-#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed
-// ====== Bear Form
-#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid
-#define SPELL_OVERPOWER 43456 // use after melee attack dodged
-// ====== Eagle Form
-#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577
-#define SPELL_ZAP_INFORM 42577
-#define SPELL_ZAP_DAMAGE 43137 // 1250 damage
-#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex
-#define CREATURE_FEATHER_VORTEX 24136
-#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual
-#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second
-//Lynx Form
-#define SPELL_CLAW_RAGE_HASTE 42583
-#define SPELL_CLAW_RAGE_TRIGGER 43149
-#define SPELL_CLAW_RAGE_DAMAGE 43150
-#define SPELL_LYNX_RUSH_HASTE 43152
-#define SPELL_LYNX_RUSH_DAMAGE 43153
-//Dragonhawk Form
-#define SPELL_FLAME_WHIRL 43213 // trigger two spells
-#define SPELL_FLAME_BREATH 43215
-#define SPELL_SUMMON_PILLAR 43216 // summon 24187
-#define CREATURE_COLUMN_OF_FIRE 24187
-#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217
-
-//cosmetic
-#define SPELL_SPIRIT_AURA 42466
-#define SPELL_SIPHON_SOUL 43501
-
-//Transforms:
-#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg
-#define SPELL_SHAPE_OF_THE_EAGLE 42606
-#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30%
-#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608
-
-#define SPELL_BERSERK 45078
-
-
-#define PHASE_BEAR 0
-#define PHASE_EAGLE 1
-#define PHASE_LYNX 2
-#define PHASE_DRAGONHAWK 3
-#define PHASE_TROLL 4
-
-//coords for going for changing form
-#define CENTER_X 120.148811
-#define CENTER_Y 703.713684
-#define CENTER_Z 45.111477
-
-struct SpiritInfoStruct
-{
- uint32 entry;
- float x, y, z, orient;
-};
-
-static SpiritInfoStruct SpiritInfo[] =
-{
- {23878, 147.87, 706.51, 45.11, 3.04},
- {23880, 88.95, 705.49, 45.11, 6.11},
- {23877, 137.23, 725.98, 45.11, 3.71},
- {23879, 104.29, 726.43, 45.11, 5.43}
-};
-
-struct TransformStruct
-{
- uint32 sound;
- char* text;
- uint32 spell, unaura;
-};
-
-static TransformStruct Transform[] =
-{
- {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND},
- {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR},
- {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE},
- {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX}
-};
-
-struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
-{
- boss_zuljinAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- // wait for core patch be accepted
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CLAW_RAGE_DAMAGE);
- if(TempSpell)
- {
- //if(TempSpell->DmgClass != SPELL_DAMAGE_CLASS_MELEE)
- // TempSpell->DmgClass = SPELL_DAMAGE_CLASS_MELEE;
- if(TempSpell->EffectApplyAuraName[2] != SPELL_AURA_MOD_STUN)
- TempSpell->EffectApplyAuraName[2] = SPELL_AURA_MOD_STUN;
- }
- Reset();
- }
- ScriptedInstance *pInstance;
-
- uint64 SpiritGUID[4];
- uint64 ClawTargetGUID;
- uint64 TankGUID;
-
- uint32 Phase;
- uint32 health_20;
-
- uint32 Intro_Timer;
- uint32 Berserk_Timer;
-
- uint32 Whirlwind_Timer;
- uint32 Grievous_Throw_Timer;
-
- uint32 Creeping_Paralysis_Timer;
- uint32 Overpower_Timer;
-
- uint32 Claw_Rage_Timer;
- uint32 Lynx_Rush_Timer;
- uint32 Claw_Counter;
- uint32 Claw_Loop_Timer;
-
- uint32 Flame_Whirl_Timer;
- uint32 Flame_Breath_Timer;
- uint32 Pillar_Of_Fire_Timer;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
-
- Phase = 0;
-
- health_20 = m_creature->GetMaxHealth()*0.2;
-
- Intro_Timer = 37000;
- Berserk_Timer = 600000;
-
- Whirlwind_Timer = 7000;
- Grievous_Throw_Timer = 8000;
-
- Creeping_Paralysis_Timer = 7000;
- Overpower_Timer = 0;
-
- Claw_Rage_Timer = 5000;
- Lynx_Rush_Timer = 14000;
- Claw_Loop_Timer = 0;
- Claw_Counter = 0;
-
- Flame_Whirl_Timer = 5000;
- Flame_Breath_Timer = 6000;
- Pillar_Of_Fire_Timer = 7000;
-
- ClawTargetGUID = 0;
- TankGUID = 0;
-
- DespawnAdds();
- DespawnSummons(CREATURE_FEATHER_VORTEX);
- DespawnSummons(CREATURE_COLUMN_OF_FIRE);
-
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 47174);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
-
- DoZoneInCombat();
-
- DoYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- SpawnAdds();
- EnterPhase(0);
- }
-
- void KilledUnit(Unit* victim)
- {
- if(Intro_Timer)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
- break;
- case 1:
- DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_ZULJINEVENT, DONE);
-
- DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- DespawnSummons(CREATURE_COLUMN_OF_FIRE);
-
- if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
- }
-
- void AttackStart(Unit *who)
- {
- if(!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(Phase == 2)
- m_creature->Attack(who, false);
- else
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void DoMeleeAttackIfReady()
- {
- if( !m_creature->IsNonMeleeSpellCasted(false))
- {
- if(m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- 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())
- {
- m_creature->CastSpell(m_creature->getVictim(), SPELL_OVERPOWER, false);
- Overpower_Timer = 5000;
- }
- }else m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
- }
-
- void SpawnAdds()
- {
- 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);
- if(pCreature)
- {
- pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- SpiritGUID[i] = pCreature->GetGUID();
- }
- }
- }
-
- void DespawnAdds()
- {
- for(uint8 i = 0; i < 4; i++)
- {
- Unit* Temp = NULL;
- if(SpiritGUID[i])
- {
- if(Temp = Unit::GetUnit(*m_creature, SpiritGUID[i]))
- {
- Temp->SetVisibility(VISIBILITY_OFF);
- Temp->setDeathState(DEAD);
- }
- }
- SpiritGUID[i] = 0;
- }
- }
-
- void DespawnSummons(uint32 entry)
- {
- std::list<Creature*> templist;
- float x, y, z;
- m_creature->GetPosition(x, y, z);
-
- {
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
-
- TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
- }
-
- for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
- {
- (*i)->SetVisibility(VISIBILITY_OFF);
- (*i)->setDeathState(JUST_DIED);
- }
- }
-
- void EnterPhase(uint32 NextPhase)
- {
- switch(NextPhase)
- {
- case 0:
- break;
- case 1:
- case 2:
- case 3:
- case 4:
- m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z,0);
- m_creature->SendMonsterMove(CENTER_X, CENTER_Y, CENTER_Z,0,0,100);
- DoResetThreat();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura);
- DoCast(m_creature, Transform[Phase].spell);
- DoYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, Transform[Phase].sound);
- if(Phase > 0)
- {
- if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_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(NextPhase == 2)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->CastSpell(m_creature, 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);
- if(Vortex)
- {
- Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
- Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
- Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Vortex->SetSpeed(MOVE_RUN, 1.0f);
- Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- DoZoneInCombat(Vortex);
- }
- }
- }
- else
- m_creature->AI()->AttackStart(m_creature->getVictim());
- if(NextPhase == 3)
- {
- m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
- DespawnSummons(CREATURE_FEATHER_VORTEX);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
- break;
- default:
- break;
- }
- Phase = NextPhase;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!TankGUID)
- {
- if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(m_creature->GetHealth() < health_20 * (4 - Phase))
- EnterPhase(Phase + 1);
- }
-
- if(Berserk_Timer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BERSERK);
- Berserk_Timer = 60000;
- }else Berserk_Timer -= diff;
-
- switch (Phase)
- {
- case 0:
- if(Intro_Timer)
- {
- if(Intro_Timer <= diff)
- {
- DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- Intro_Timer = 0;
- }else Intro_Timer -= diff;
- }
-
- if(Whirlwind_Timer < diff)
- {
- DoCast(m_creature, SPELL_WHIRLWIND);
- Whirlwind_Timer = 15000 + rand()%5000;
- }else Whirlwind_Timer -= diff;
-
- if(Grievous_Throw_Timer < diff)
- {
- if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->CastSpell(target, SPELL_GRIEVOUS_THROW, false);
- Grievous_Throw_Timer = 10000;
- }else Grievous_Throw_Timer -= diff;
- break;
-
- case 1:
- if(Creeping_Paralysis_Timer < diff)
- {
- DoCast(m_creature, SPELL_CREEPING_PARALYSIS);
- Creeping_Paralysis_Timer = 20000;
- }else Creeping_Paralysis_Timer -= diff;
-
- if(Overpower_Timer < diff)
- {
- // implemented in DoMeleeAttackIfReady()
- Overpower_Timer = 0;
- }else Overpower_Timer -= diff;
- break;
-
- case 2:
- return;
-
- case 3:
- if(Claw_Rage_Timer <= diff)
- {
- if(!TankGUID)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- TankGUID = m_creature->getVictim()->GetGUID();
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- AttackStart(target); // change victim
- Claw_Rage_Timer = 0;
- Claw_Loop_Timer = 500;
- Claw_Counter = 0;
- }
- }
- else if(!Claw_Rage_Timer) // do not do this when Lynx_Rush
- {
- if(Claw_Loop_Timer < diff)
- {
- Unit* target = m_creature->getVictim();
- if(!target || !target->isTargetableForAttack()) target = Unit::GetUnit(*m_creature, TankGUID);
- if(!target || !target->isTargetableForAttack()) target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- AttackStart(target);
- if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
- {
- m_creature->CastSpell(target, 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));
- TankGUID = 0;
- return;
- }
- else
- Claw_Loop_Timer = 500;
- }
- }else EnterEvadeMode(); // if(target)
- }else Claw_Loop_Timer -= diff;
- } //if(TankGUID)
- }else Claw_Rage_Timer -= diff;
-
- if(Lynx_Rush_Timer <= diff)
- {
- if(!TankGUID)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- TankGUID = m_creature->getVictim()->GetGUID();
- m_creature->SetSpeed(MOVE_RUN, 5.0f);
- AttackStart(target); // change victim
- Lynx_Rush_Timer = 0;
- Claw_Counter = 0;
- }
- }
- else if(!Lynx_Rush_Timer)
- {
- Unit* target = m_creature->getVictim();
- if(!target || !target->isTargetableForAttack())
- {
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- AttackStart(target);
- }
- if(target)
- {
- if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
- {
- m_creature->CastSpell(target, 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));
- TankGUID = 0;
- }
- else
- AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- }
- }else EnterEvadeMode(); // if(target)
- } //if(TankGUID)
- }else Lynx_Rush_Timer -= diff;
-
- break;
- case 4:
- if(Flame_Whirl_Timer < diff)
- {
- DoCast(m_creature, SPELL_FLAME_WHIRL);
- Flame_Whirl_Timer = 12000;
- }Flame_Whirl_Timer -= diff;
-
- if(Pillar_Of_Fire_Timer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- float x, y, z;
- target->GetPosition(x, y, z);
- Creature* Pillar = m_creature->SummonCreature(CREATURE_COLUMN_OF_FIRE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Pillar)
- {
- Pillar->CastSpell(Pillar, SPELL_PILLAR_TRIGGER, true);
- Pillar->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- Pillar_Of_Fire_Timer = 10000;
- }else Pillar_Of_Fire_Timer -= diff;
-
- if(Flame_Breath_Timer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->CastSpell(m_creature, SPELL_FLAME_BREATH, false);
- Flame_Breath_Timer = 10000;
- }else Flame_Breath_Timer -= diff;
- break;
-
- default:
- break;
- }
-
- if(!TankGUID)
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_zuljin(Creature *_Creature)
-{
- return new boss_zuljinAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL do_nothingAI : public ScriptedAI
-{
- do_nothingAI(Creature *c) : ScriptedAI(c) {}
- void Reset() {}
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-};
-
-CreatureAI* GetAI_do_nothing(Creature *_Creature)
-{
- return new do_nothingAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI
-{
- feather_vortexAI(Creature *c) : ScriptedAI(c) {}
-
- void Reset() {}
-
- void Aggro(Unit* target) {}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_ZAP_INFORM)
- m_creature->CastSpell(caster, SPELL_ZAP_DAMAGE, true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //if the vortex reach the target, it change his target to another player
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- }
-};
-
-CreatureAI* GetAI_feather_vortexAI(Creature *_Creature)
-{
- return new feather_vortexAI (_Creature);
-}
-
-void AddSC_boss_zuljin()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_zuljin";
- newscript->GetAI = GetAI_boss_zuljin;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="do_nothing";
- newscript->GetAI = GetAI_do_nothing;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_zuljin_vortex";
- newscript->GetAI = GetAI_feather_vortexAI;
- m_scripts[nrscripts++] = newscript;
+/* Copyright (C) 2006,2007,2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_ZulJin
+SD%Complete: 85%
+SDComment:
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+//#include "spell.h"
+
+//Speech
+#define YELL_TRANSFORM_TO_LYNX "Let me introduce to you my new bruddahs: fang and claw!"
+#define SOUND_TRANSFORM_TO_LYNX 12094
+
+#define YELL_TRANSFORM_TO_BEAR "Got me some new tricks...like me bruddah bear!"
+#define SOUND_TRANSFORM_TO_BEAR 12092
+
+#define YELL_TRANSFORM_TO_DRAGONHAWK "Ya don' have to look to da sky to see da dragonhawk!"
+#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095
+
+#define YELL_TRANSFORM_TO_EAGLE "Dere be no hidin' from da eagle!"
+#define SOUND_TRANSFORM_TO_EAGLE 12093
+
+#define YELL_KILL_ONE "Da Amani de chuka!"
+#define SOUND_KILL_ONE 12098
+
+#define YELL_KILL_TWO "Lot more gonna fall like you!"
+#define SOUND_KILL_TWO 12099
+
+#define YELL_FIRE_BREATH "Fire kill you just as quick!"
+#define SOUND_FIRE_BRETH 12096
+
+#define YELL_AGGRO "Nobody badduh dan me!"
+#define SOUND_AGGRO 12091
+
+#define YELL_BERSERK "You too slow! Me too strong!"
+#define SOUND_BERSERK 12097
+
+#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..."
+#define SOUND_DEATH 12100
+
+//Still not used, need more info
+#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!"
+#define SOUND_INTRO 12090
+
+//Spells:
+// ====== Troll Form
+#define SPELL_WHIRLWIND 17207
+#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed
+// ====== Bear Form
+#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid
+#define SPELL_OVERPOWER 43456 // use after melee attack dodged
+// ====== Eagle Form
+#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577
+#define SPELL_ZAP_INFORM 42577
+#define SPELL_ZAP_DAMAGE 43137 // 1250 damage
+#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex
+#define CREATURE_FEATHER_VORTEX 24136
+#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual
+#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second
+//Lynx Form
+#define SPELL_CLAW_RAGE_HASTE 42583
+#define SPELL_CLAW_RAGE_TRIGGER 43149
+#define SPELL_CLAW_RAGE_DAMAGE 43150
+#define SPELL_LYNX_RUSH_HASTE 43152
+#define SPELL_LYNX_RUSH_DAMAGE 43153
+//Dragonhawk Form
+#define SPELL_FLAME_WHIRL 43213 // trigger two spells
+#define SPELL_FLAME_BREATH 43215
+#define SPELL_SUMMON_PILLAR 43216 // summon 24187
+#define CREATURE_COLUMN_OF_FIRE 24187
+#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217
+
+//cosmetic
+#define SPELL_SPIRIT_AURA 42466
+#define SPELL_SIPHON_SOUL 43501
+
+//Transforms:
+#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg
+#define SPELL_SHAPE_OF_THE_EAGLE 42606
+#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30%
+#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608
+
+#define SPELL_BERSERK 45078
+
+
+#define PHASE_BEAR 0
+#define PHASE_EAGLE 1
+#define PHASE_LYNX 2
+#define PHASE_DRAGONHAWK 3
+#define PHASE_TROLL 4
+
+//coords for going for changing form
+#define CENTER_X 120.148811
+#define CENTER_Y 703.713684
+#define CENTER_Z 45.111477
+
+struct SpiritInfoStruct
+{
+ uint32 entry;
+ float x, y, z, orient;
+};
+
+static SpiritInfoStruct SpiritInfo[] =
+{
+ {23878, 147.87, 706.51, 45.11, 3.04},
+ {23880, 88.95, 705.49, 45.11, 6.11},
+ {23877, 137.23, 725.98, 45.11, 3.71},
+ {23879, 104.29, 726.43, 45.11, 5.43}
+};
+
+struct TransformStruct
+{
+ uint32 sound;
+ char* text;
+ uint32 spell, unaura;
+};
+
+static TransformStruct Transform[] =
+{
+ {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND},
+ {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR},
+ {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE},
+ {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX}
+};
+
+struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
+{
+ boss_zuljinAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ // wait for core patch be accepted
+ SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CLAW_RAGE_DAMAGE);
+ if(TempSpell)
+ {
+ //if(TempSpell->DmgClass != SPELL_DAMAGE_CLASS_MELEE)
+ // TempSpell->DmgClass = SPELL_DAMAGE_CLASS_MELEE;
+ if(TempSpell->EffectApplyAuraName[2] != SPELL_AURA_MOD_STUN)
+ TempSpell->EffectApplyAuraName[2] = SPELL_AURA_MOD_STUN;
+ }
+ Reset();
+ }
+ ScriptedInstance *pInstance;
+
+ uint64 SpiritGUID[4];
+ uint64 ClawTargetGUID;
+ uint64 TankGUID;
+
+ uint32 Phase;
+ uint32 health_20;
+
+ uint32 Intro_Timer;
+ uint32 Berserk_Timer;
+
+ uint32 Whirlwind_Timer;
+ uint32 Grievous_Throw_Timer;
+
+ uint32 Creeping_Paralysis_Timer;
+ uint32 Overpower_Timer;
+
+ uint32 Claw_Rage_Timer;
+ uint32 Lynx_Rush_Timer;
+ uint32 Claw_Counter;
+ uint32 Claw_Loop_Timer;
+
+ uint32 Flame_Whirl_Timer;
+ uint32 Flame_Breath_Timer;
+ uint32 Pillar_Of_Fire_Timer;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
+
+ Phase = 0;
+
+ health_20 = m_creature->GetMaxHealth()*0.2;
+
+ Intro_Timer = 37000;
+ Berserk_Timer = 600000;
+
+ Whirlwind_Timer = 7000;
+ Grievous_Throw_Timer = 8000;
+
+ Creeping_Paralysis_Timer = 7000;
+ Overpower_Timer = 0;
+
+ Claw_Rage_Timer = 5000;
+ Lynx_Rush_Timer = 14000;
+ Claw_Loop_Timer = 0;
+ Claw_Counter = 0;
+
+ Flame_Whirl_Timer = 5000;
+ Flame_Breath_Timer = 6000;
+ Pillar_Of_Fire_Timer = 7000;
+
+ ClawTargetGUID = 0;
+ TankGUID = 0;
+
+ DespawnAdds();
+ DespawnSummons(CREATURE_FEATHER_VORTEX);
+ DespawnSummons(CREATURE_COLUMN_OF_FIRE);
+
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 47174);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
+
+ DoZoneInCombat();
+
+ DoYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ SpawnAdds();
+ EnterPhase(0);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if(Intro_Timer)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_ONE);
+ break;
+ case 1:
+ DoYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_KILL_TWO);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ZULJINEVENT, DONE);
+
+ DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ DespawnSummons(CREATURE_COLUMN_OF_FIRE);
+
+ if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3]))
+ Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(Phase == 2)
+ m_creature->Attack(who, false);
+ else
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void DoMeleeAttackIfReady()
+ {
+ if( !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ if(m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ 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())
+ {
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_OVERPOWER, false);
+ Overpower_Timer = 5000;
+ }
+ }else m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+ }
+
+ void SpawnAdds()
+ {
+ 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);
+ if(pCreature)
+ {
+ pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ SpiritGUID[i] = pCreature->GetGUID();
+ }
+ }
+ }
+
+ void DespawnAdds()
+ {
+ for(uint8 i = 0; i < 4; i++)
+ {
+ Unit* Temp = NULL;
+ if(SpiritGUID[i])
+ {
+ if(Temp = Unit::GetUnit(*m_creature, SpiritGUID[i]))
+ {
+ Temp->SetVisibility(VISIBILITY_OFF);
+ Temp->setDeathState(DEAD);
+ }
+ }
+ SpiritGUID[i] = 0;
+ }
+ }
+
+ void DespawnSummons(uint32 entry)
+ {
+ std::list<Creature*> templist;
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+
+ {
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+
+ TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ }
+
+ for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
+ {
+ (*i)->SetVisibility(VISIBILITY_OFF);
+ (*i)->setDeathState(JUST_DIED);
+ }
+ }
+
+ void EnterPhase(uint32 NextPhase)
+ {
+ switch(NextPhase)
+ {
+ case 0:
+ break;
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z,0);
+ m_creature->SendMonsterMove(CENTER_X, CENTER_Y, CENTER_Z,0,0,100);
+ DoResetThreat();
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura);
+ DoCast(m_creature, Transform[Phase].spell);
+ DoYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, Transform[Phase].sound);
+ if(Phase > 0)
+ {
+ if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1]))
+ Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_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(NextPhase == 2)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->CastSpell(m_creature, 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);
+ if(Vortex)
+ {
+ Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
+ Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
+ Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Vortex->SetSpeed(MOVE_RUN, 1.0f);
+ Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ DoZoneInCombat(Vortex);
+ }
+ }
+ }
+ else
+ m_creature->AI()->AttackStart(m_creature->getVictim());
+ if(NextPhase == 3)
+ {
+ m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
+ DespawnSummons(CREATURE_FEATHER_VORTEX);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }
+ break;
+ default:
+ break;
+ }
+ Phase = NextPhase;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!TankGUID)
+ {
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(m_creature->GetHealth() < health_20 * (4 - Phase))
+ EnterPhase(Phase + 1);
+ }
+
+ if(Berserk_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BERSERK);
+ Berserk_Timer = 60000;
+ }else Berserk_Timer -= diff;
+
+ switch (Phase)
+ {
+ case 0:
+ if(Intro_Timer)
+ {
+ if(Intro_Timer <= diff)
+ {
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ Intro_Timer = 0;
+ }else Intro_Timer -= diff;
+ }
+
+ if(Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_WHIRLWIND);
+ Whirlwind_Timer = 15000 + rand()%5000;
+ }else Whirlwind_Timer -= diff;
+
+ if(Grievous_Throw_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ m_creature->CastSpell(target, SPELL_GRIEVOUS_THROW, false);
+ Grievous_Throw_Timer = 10000;
+ }else Grievous_Throw_Timer -= diff;
+ break;
+
+ case 1:
+ if(Creeping_Paralysis_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_CREEPING_PARALYSIS);
+ Creeping_Paralysis_Timer = 20000;
+ }else Creeping_Paralysis_Timer -= diff;
+
+ if(Overpower_Timer < diff)
+ {
+ // implemented in DoMeleeAttackIfReady()
+ Overpower_Timer = 0;
+ }else Overpower_Timer -= diff;
+ break;
+
+ case 2:
+ return;
+
+ case 3:
+ if(Claw_Rage_Timer <= diff)
+ {
+ if(!TankGUID)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ TankGUID = m_creature->getVictim()->GetGUID();
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ AttackStart(target); // change victim
+ Claw_Rage_Timer = 0;
+ Claw_Loop_Timer = 500;
+ Claw_Counter = 0;
+ }
+ }
+ else if(!Claw_Rage_Timer) // do not do this when Lynx_Rush
+ {
+ if(Claw_Loop_Timer < diff)
+ {
+ Unit* target = m_creature->getVictim();
+ if(!target || !target->isTargetableForAttack()) target = Unit::GetUnit(*m_creature, TankGUID);
+ if(!target || !target->isTargetableForAttack()) target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ AttackStart(target);
+ if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
+ {
+ m_creature->CastSpell(target, 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));
+ TankGUID = 0;
+ return;
+ }
+ else
+ Claw_Loop_Timer = 500;
+ }
+ }else EnterEvadeMode(); // if(target)
+ }else Claw_Loop_Timer -= diff;
+ } //if(TankGUID)
+ }else Claw_Rage_Timer -= diff;
+
+ if(Lynx_Rush_Timer <= diff)
+ {
+ if(!TankGUID)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ TankGUID = m_creature->getVictim()->GetGUID();
+ m_creature->SetSpeed(MOVE_RUN, 5.0f);
+ AttackStart(target); // change victim
+ Lynx_Rush_Timer = 0;
+ Claw_Counter = 0;
+ }
+ }
+ else if(!Lynx_Rush_Timer)
+ {
+ Unit* target = m_creature->getVictim();
+ if(!target || !target->isTargetableForAttack())
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ AttackStart(target);
+ }
+ if(target)
+ {
+ if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
+ {
+ m_creature->CastSpell(target, 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));
+ TankGUID = 0;
+ }
+ else
+ AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ }
+ }else EnterEvadeMode(); // if(target)
+ } //if(TankGUID)
+ }else Lynx_Rush_Timer -= diff;
+
+ break;
+ case 4:
+ if(Flame_Whirl_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_FLAME_WHIRL);
+ Flame_Whirl_Timer = 12000;
+ }Flame_Whirl_Timer -= diff;
+
+ if(Pillar_Of_Fire_Timer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ Creature* Pillar = m_creature->SummonCreature(CREATURE_COLUMN_OF_FIRE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(Pillar)
+ {
+ Pillar->CastSpell(Pillar, SPELL_PILLAR_TRIGGER, true);
+ Pillar->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ Pillar_Of_Fire_Timer = 10000;
+ }else Pillar_Of_Fire_Timer -= diff;
+
+ if(Flame_Breath_Timer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ m_creature->CastSpell(m_creature, SPELL_FLAME_BREATH, false);
+ Flame_Breath_Timer = 10000;
+ }else Flame_Breath_Timer -= diff;
+ break;
+
+ default:
+ break;
+ }
+
+ if(!TankGUID)
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_zuljin(Creature *_Creature)
+{
+ return new boss_zuljinAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL do_nothingAI : public ScriptedAI
+{
+ do_nothingAI(Creature *c) : ScriptedAI(c) {}
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_do_nothing(Creature *_Creature)
+{
+ return new do_nothingAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI
+{
+ feather_vortexAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+
+ void Aggro(Unit* target) {}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_ZAP_INFORM)
+ m_creature->CastSpell(caster, SPELL_ZAP_DAMAGE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //if the vortex reach the target, it change his target to another player
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ }
+};
+
+CreatureAI* GetAI_feather_vortexAI(Creature *_Creature)
+{
+ return new feather_vortexAI (_Creature);
+}
+
+void AddSC_boss_zuljin()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_zuljin";
+ newscript->GetAI = GetAI_boss_zuljin;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="do_nothing";
+ newscript->GetAI = GetAI_do_nothing;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_zuljin_vortex";
+ newscript->GetAI = GetAI_feather_vortexAI;
+ m_scripts[nrscripts++] = newscript;
} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
index d01da90b9d1..b5e4cee2519 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
+++ b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
@@ -1,18 +1,18 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_ZULAMAN_H
-#define DEF_ZULAMAN_H
-
-#define DATA_NALORAKKEVENT 1
-#define DATA_AKILZONEVENT 2
-#define DATA_JANALAIEVENT 3
-#define DATA_HALAZZIEVENT 4
-#define DATA_HEXLORDEVENT 5
-#define DATA_ZULJINEVENT 6
-#define DATA_CHESTLOOTED 7
-#define TYPE_RAND_VENDOR_1 8
-#define TYPE_RAND_VENDOR_2 9
-
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_ZULAMAN_H
+#define DEF_ZULAMAN_H
+
+#define DATA_NALORAKKEVENT 1
+#define DATA_AKILZONEVENT 2
+#define DATA_JANALAIEVENT 3
+#define DATA_HALAZZIEVENT 4
+#define DATA_HEXLORDEVENT 5
+#define DATA_ZULJINEVENT 6
+#define DATA_CHESTLOOTED 7
+#define TYPE_RAND_VENDOR_1 8
+#define TYPE_RAND_VENDOR_2 9
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
index 109e01e5189..2e9e481236f 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
@@ -1,325 +1,325 @@
-/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: instance_zulaman
-SD%Complete: 80
-SDComment:
-SDCategory: Zul'Aman
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-
-#define ENCOUNTERS 6
-#define RAND_VENDOR 2
-
-//187021 //Harkor's Satchel
-//186648 //Tanzar's Trunk
-//186672 //Ashli's Bag
-//186667 //Kraz's Package
-// Chests spawn at bear/eagle/dragonhawk/lynx bosses
-// The loots depend on how many bosses have been killed, but not the entries of the chests
-// But we cannot add loots to gameobject, so we have to use the fixed loot_template
-struct SHostageInfo
-{
- uint32 npc, go;
- float x, y, z, o;
-};
-
-static SHostageInfo HostageInfo[] =
-{
- {23790, 186648, -57, 1343, 40.77, 3.2}, // bear
- {23999, 187021, 400, 1414, 74.36, 3.3}, // eagle
- {24001, 186672, -35, 1134, 18.71, 1.9}, // dragonhawk
- {24024, 186667, 413, 1117, 6.32, 3.1} // lynx
-
-};
-
-struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
-{
- instance_zulaman(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint64 HarkorsSatchelGUID;
- uint64 TanzarsTrunkGUID;
- uint64 AshlisBagGUID;
- uint64 KrazsPackageGUID;
-
- uint64 HexLordGateGUID;
- uint64 ZulJinGateGUID;
- uint64 AkilzonDoorGUID;
- uint64 ZulJinDoorGUID;
- uint64 HalazziDoorGUID;
-
- uint32 QuestTimer;
- uint16 BossKilled;
- uint16 QuestMinute;
- uint16 ChestLooted;
-
- uint32 Encounters[ENCOUNTERS];
- uint32 RandVendor[RAND_VENDOR];
-
- void Initialize()
- {
- HarkorsSatchelGUID = 0;
- TanzarsTrunkGUID = 0;
- AshlisBagGUID = 0;
- KrazsPackageGUID = 0;
-
- uint64 HexLordGateGUID = 0;
- uint64 ZulJinGateGUID = 0;
- uint64 AkilzonDoorGUID = 0;
- uint64 HalazziDoorGUID = 0;
- uint64 ZulJinDoorGUID = 0;
-
- QuestTimer = 0;
- QuestMinute = 21;
- BossKilled = 0;
- ChestLooted = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = NOT_STARTED;
- for(uint8 i = 0; i < RAND_VENDOR; i++)
- RandVendor[i] = NOT_STARTED;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i] == IN_PROGRESS) return true;
-
- return false;
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 23578://janalai
- case 23863://zuljin
- case 24239://hexlord
- case 23577://halazzi
- case 23576://nalorakk
- default: break;
- }
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case 186303: HalazziDoorGUID = go->GetGUID(); break;
- case 186304: ZulJinGateGUID = go->GetGUID(); break;
- case 186305: HexLordGateGUID = go->GetGUID(); break;
- case 186858: AkilzonDoorGUID = go->GetGUID(); break;
- case 186859: ZulJinDoorGUID = go->GetGUID(); break;
-
- case 187021: HarkorsSatchelGUID = go->GetGUID(); break;
- case 186648: TanzarsTrunkGUID = go->GetGUID(); break;
- case 186672: AshlisBagGUID = go->GetGUID(); break;
- case 186667: KrazsPackageGUID = go->GetGUID(); break;
- default: break;
-
- }
- CheckInstanceStatus();
- }
-
- void OpenDoor(uint64 DoorGUID, bool open)
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
- }
-
- void SummonHostage(uint8 num)
- {
- if(QuestMinute && ((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(Unit* Hostage = first->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
- {
- Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
- }
-
- void CheckInstanceStatus()
- {
- if(BossKilled >= 4)
- OpenDoor(HexLordGateGUID, true);
-
- if(BossKilled >= 5)
- OpenDoor(ZulJinGateGUID, true);
- }
-
- void UpdateWorldState(uint32 field, uint32 value)
- {
- WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
- data << field << value;
- ((InstanceMap*)instance)->SendToPlayers(&data);
- }
-
- const char* Save()
- {
- std::ostringstream ss;
- ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute;
- char* data = new char[ss.str().length()+1];
- strcpy(data, ss.str().c_str());
- //error_log("SD2: Zul'aman saved, %s.", data);
- return data;
- }
-
- void Load(const char* load)
- {
- if(!load) return;
- std::istringstream ss(load);
- //error_log("SD2: Zul'aman loaded, %s.", ss.str().c_str());
- char dataHead; // S
- uint16 data1, data2, data3;
- ss >> dataHead >> data1 >> data2 >> data3;
- //error_log("SD2: Zul'aman loaded, %d %d %d.", data1, data2, data3);
- if(dataHead == 'S')
- {
- BossKilled = data1;
- ChestLooted = data2;
- QuestMinute = data3;
- }else error_log("SD2: Zul'aman: corrupted save data.");
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_NALORAKKEVENT:
- Encounters[0] = data;
- if(data == DONE)
- {
- if(QuestMinute)
- {
- QuestMinute += 15;
- UpdateWorldState(3106, QuestMinute);
- }
- SummonHostage(0);
- }
- break;
- case DATA_AKILZONEVENT:
- Encounters[1] = data;
- OpenDoor(AkilzonDoorGUID, data != IN_PROGRESS);
- if(data == DONE)
- {
- if(QuestMinute)
- {
- QuestMinute += 10;
- UpdateWorldState(3106, QuestMinute);
- }
- SummonHostage(1);
- }
- break;
- case DATA_JANALAIEVENT:
- Encounters[2] = data;
- if(data == DONE) SummonHostage(2);
- break;
- case DATA_HALAZZIEVENT:
- Encounters[3] = data;
- OpenDoor(HalazziDoorGUID, data != IN_PROGRESS);
- if(data == DONE) SummonHostage(3);
- break;
- case DATA_HEXLORDEVENT:
- Encounters[4] = data;
- if(data == IN_PROGRESS)
- OpenDoor(HexLordGateGUID, false);
- else if(data == NOT_STARTED)
- CheckInstanceStatus();
- break;
- case DATA_ZULJINEVENT:
- Encounters[5] = data;
- OpenDoor(ZulJinDoorGUID, data != IN_PROGRESS);
- break;
- case DATA_CHESTLOOTED:
- ChestLooted++;
- SaveToDB();
- break;
- case TYPE_RAND_VENDOR_1:
- RandVendor[0] = data;
- break;
- case TYPE_RAND_VENDOR_2:
- RandVendor[1] = data;
- break;
- }
-
- if(data == DONE)
- {
- BossKilled++;
- if(QuestMinute && BossKilled >= 4)
- {
- QuestMinute = 0;
- UpdateWorldState(3104, 0);
- }
- CheckInstanceStatus();
- SaveToDB();
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_NALORAKKEVENT: return Encounters[0];
- case DATA_AKILZONEVENT: return Encounters[1];
- case DATA_JANALAIEVENT: return Encounters[2];
- case DATA_HALAZZIEVENT: return Encounters[3];
- case DATA_HEXLORDEVENT: return Encounters[4];
- case DATA_ZULJINEVENT: return Encounters[5];
- case DATA_CHESTLOOTED: return ChestLooted;
- case TYPE_RAND_VENDOR_1: return RandVendor[0];
- case TYPE_RAND_VENDOR_2: return RandVendor[1];
- default: return 0;
- }
- }
-
- void Update(uint32 diff)
- {
- if(QuestMinute)
- {
- if(QuestTimer < diff)
- {
- QuestMinute--;
- SaveToDB();
- QuestTimer += 60000;
- if(QuestMinute)
- {
- UpdateWorldState(3104, 1);
- UpdateWorldState(3106, QuestMinute);
- }else UpdateWorldState(3104, 0);
- }
- QuestTimer -= diff;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_zulaman(Map* map)
-{
- return new instance_zulaman(map);
-}
-
-void AddSC_instance_zulaman()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_zulaman";
- newscript->GetInstanceData = GetInstanceData_instance_zulaman;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: instance_zulaman
+SD%Complete: 80
+SDComment:
+SDCategory: Zul'Aman
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+
+#define ENCOUNTERS 6
+#define RAND_VENDOR 2
+
+//187021 //Harkor's Satchel
+//186648 //Tanzar's Trunk
+//186672 //Ashli's Bag
+//186667 //Kraz's Package
+// Chests spawn at bear/eagle/dragonhawk/lynx bosses
+// The loots depend on how many bosses have been killed, but not the entries of the chests
+// But we cannot add loots to gameobject, so we have to use the fixed loot_template
+struct SHostageInfo
+{
+ uint32 npc, go;
+ float x, y, z, o;
+};
+
+static SHostageInfo HostageInfo[] =
+{
+ {23790, 186648, -57, 1343, 40.77, 3.2}, // bear
+ {23999, 187021, 400, 1414, 74.36, 3.3}, // eagle
+ {24001, 186672, -35, 1134, 18.71, 1.9}, // dragonhawk
+ {24024, 186667, 413, 1117, 6.32, 3.1} // lynx
+
+};
+
+struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
+{
+ instance_zulaman(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 HarkorsSatchelGUID;
+ uint64 TanzarsTrunkGUID;
+ uint64 AshlisBagGUID;
+ uint64 KrazsPackageGUID;
+
+ uint64 HexLordGateGUID;
+ uint64 ZulJinGateGUID;
+ uint64 AkilzonDoorGUID;
+ uint64 ZulJinDoorGUID;
+ uint64 HalazziDoorGUID;
+
+ uint32 QuestTimer;
+ uint16 BossKilled;
+ uint16 QuestMinute;
+ uint16 ChestLooted;
+
+ uint32 Encounters[ENCOUNTERS];
+ uint32 RandVendor[RAND_VENDOR];
+
+ void Initialize()
+ {
+ HarkorsSatchelGUID = 0;
+ TanzarsTrunkGUID = 0;
+ AshlisBagGUID = 0;
+ KrazsPackageGUID = 0;
+
+ uint64 HexLordGateGUID = 0;
+ uint64 ZulJinGateGUID = 0;
+ uint64 AkilzonDoorGUID = 0;
+ uint64 HalazziDoorGUID = 0;
+ uint64 ZulJinDoorGUID = 0;
+
+ QuestTimer = 0;
+ QuestMinute = 21;
+ BossKilled = 0;
+ ChestLooted = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = NOT_STARTED;
+ for(uint8 i = 0; i < RAND_VENDOR; i++)
+ RandVendor[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 23578://janalai
+ case 23863://zuljin
+ case 24239://hexlord
+ case 23577://halazzi
+ case 23576://nalorakk
+ default: break;
+ }
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case 186303: HalazziDoorGUID = go->GetGUID(); break;
+ case 186304: ZulJinGateGUID = go->GetGUID(); break;
+ case 186305: HexLordGateGUID = go->GetGUID(); break;
+ case 186858: AkilzonDoorGUID = go->GetGUID(); break;
+ case 186859: ZulJinDoorGUID = go->GetGUID(); break;
+
+ case 187021: HarkorsSatchelGUID = go->GetGUID(); break;
+ case 186648: TanzarsTrunkGUID = go->GetGUID(); break;
+ case 186672: AshlisBagGUID = go->GetGUID(); break;
+ case 186667: KrazsPackageGUID = go->GetGUID(); break;
+ default: break;
+
+ }
+ CheckInstanceStatus();
+ }
+
+ void OpenDoor(uint64 DoorGUID, bool open)
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ }
+
+ void SummonHostage(uint8 num)
+ {
+ if(QuestMinute && ((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(Unit* Hostage = first->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
+ {
+ Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+ }
+
+ void CheckInstanceStatus()
+ {
+ if(BossKilled >= 4)
+ OpenDoor(HexLordGateGUID, true);
+
+ if(BossKilled >= 5)
+ OpenDoor(ZulJinGateGUID, true);
+ }
+
+ void UpdateWorldState(uint32 field, uint32 value)
+ {
+ WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
+ data << field << value;
+ ((InstanceMap*)instance)->SendToPlayers(&data);
+ }
+
+ const char* Save()
+ {
+ std::ostringstream ss;
+ ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute;
+ char* data = new char[ss.str().length()+1];
+ strcpy(data, ss.str().c_str());
+ //error_log("SD2: Zul'aman saved, %s.", data);
+ return data;
+ }
+
+ void Load(const char* load)
+ {
+ if(!load) return;
+ std::istringstream ss(load);
+ //error_log("SD2: Zul'aman loaded, %s.", ss.str().c_str());
+ char dataHead; // S
+ uint16 data1, data2, data3;
+ ss >> dataHead >> data1 >> data2 >> data3;
+ //error_log("SD2: Zul'aman loaded, %d %d %d.", data1, data2, data3);
+ if(dataHead == 'S')
+ {
+ BossKilled = data1;
+ ChestLooted = data2;
+ QuestMinute = data3;
+ }else error_log("SD2: Zul'aman: corrupted save data.");
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_NALORAKKEVENT:
+ Encounters[0] = data;
+ if(data == DONE)
+ {
+ if(QuestMinute)
+ {
+ QuestMinute += 15;
+ UpdateWorldState(3106, QuestMinute);
+ }
+ SummonHostage(0);
+ }
+ break;
+ case DATA_AKILZONEVENT:
+ Encounters[1] = data;
+ OpenDoor(AkilzonDoorGUID, data != IN_PROGRESS);
+ if(data == DONE)
+ {
+ if(QuestMinute)
+ {
+ QuestMinute += 10;
+ UpdateWorldState(3106, QuestMinute);
+ }
+ SummonHostage(1);
+ }
+ break;
+ case DATA_JANALAIEVENT:
+ Encounters[2] = data;
+ if(data == DONE) SummonHostage(2);
+ break;
+ case DATA_HALAZZIEVENT:
+ Encounters[3] = data;
+ OpenDoor(HalazziDoorGUID, data != IN_PROGRESS);
+ if(data == DONE) SummonHostage(3);
+ break;
+ case DATA_HEXLORDEVENT:
+ Encounters[4] = data;
+ if(data == IN_PROGRESS)
+ OpenDoor(HexLordGateGUID, false);
+ else if(data == NOT_STARTED)
+ CheckInstanceStatus();
+ break;
+ case DATA_ZULJINEVENT:
+ Encounters[5] = data;
+ OpenDoor(ZulJinDoorGUID, data != IN_PROGRESS);
+ break;
+ case DATA_CHESTLOOTED:
+ ChestLooted++;
+ SaveToDB();
+ break;
+ case TYPE_RAND_VENDOR_1:
+ RandVendor[0] = data;
+ break;
+ case TYPE_RAND_VENDOR_2:
+ RandVendor[1] = data;
+ break;
+ }
+
+ if(data == DONE)
+ {
+ BossKilled++;
+ if(QuestMinute && BossKilled >= 4)
+ {
+ QuestMinute = 0;
+ UpdateWorldState(3104, 0);
+ }
+ CheckInstanceStatus();
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_NALORAKKEVENT: return Encounters[0];
+ case DATA_AKILZONEVENT: return Encounters[1];
+ case DATA_JANALAIEVENT: return Encounters[2];
+ case DATA_HALAZZIEVENT: return Encounters[3];
+ case DATA_HEXLORDEVENT: return Encounters[4];
+ case DATA_ZULJINEVENT: return Encounters[5];
+ case DATA_CHESTLOOTED: return ChestLooted;
+ case TYPE_RAND_VENDOR_1: return RandVendor[0];
+ case TYPE_RAND_VENDOR_2: return RandVendor[1];
+ default: return 0;
+ }
+ }
+
+ void Update(uint32 diff)
+ {
+ if(QuestMinute)
+ {
+ if(QuestTimer < diff)
+ {
+ QuestMinute--;
+ SaveToDB();
+ QuestTimer += 60000;
+ if(QuestMinute)
+ {
+ UpdateWorldState(3104, 1);
+ UpdateWorldState(3106, QuestMinute);
+ }else UpdateWorldState(3104, 0);
+ }
+ QuestTimer -= diff;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_zulaman(Map* map)
+{
+ return new instance_zulaman(map);
+}
+
+void AddSC_instance_zulaman()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_zulaman";
+ newscript->GetInstanceData = GetInstanceData_instance_zulaman;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
index 316081b9dc0..4927ff4869a 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
@@ -1,182 +1,182 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Zulaman
-SD%Complete: 90
-SDComment: Forest Frog will turn into different NPC's. Workaround to prevent new entry from running this script
-SDCategory: Zul'Aman
-EndScriptData */
-
-/* ContentData
-npc_forest_frog
-EndContentData */
-
-#include "precompiled.h"
-#include "def_zulaman.h"
-
-/*######
-## npc_forest_frog
-######*/
-
-#define SPELL_REMOVE_AMANI_CURSE 43732
-#define SPELL_PUSH_MOJO 43923
-#define ENTRY_FOREST_FROG 24396
-
-struct TRINITY_DLL_DECL npc_forest_frogAI : public ScriptedAI
-{
- npc_forest_frogAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- void Reset() { }
-
- void Aggro(Unit *who) { }
-
- void DoSpawnRandom()
- {
- if( pInstance )
- {
- uint32 cEntry = 0;
- switch(rand()%11)
- {
- case 0: cEntry = 24024; break; //Kraz
- case 1: cEntry = 24397; break; //Mannuth
- case 2: cEntry = 24403; break; //Deez
- case 3: cEntry = 24404; break; //Galathryn
- case 4: cEntry = 24405; break; //Adarrah
- case 5: cEntry = 24406; break; //Fudgerick
- case 6: cEntry = 24407; break; //Darwen
- case 7: cEntry = 24445; break; //Mitzi
- case 8: cEntry = 24448; break; //Christian
- case 9: cEntry = 24453; break; //Brennan
- case 10: cEntry = 24455; break; //Hollee
- }
-
- if( !pInstance->GetData(TYPE_RAND_VENDOR_1) )
- if(rand()%10 == 1) cEntry = 24408; //Gunter
- if( !pInstance->GetData(TYPE_RAND_VENDOR_2) )
- if(rand()%10 == 1) cEntry = 24409; //Kyren
-
- if( cEntry ) m_creature->UpdateEntry(cEntry);
-
- if( cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE);
- if( cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE);
- }
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == ENTRY_FOREST_FROG )
- {
- //increase or decrease chance of mojo?
- if( rand()%99 == 50 ) DoCast(caster,SPELL_PUSH_MOJO,true);
- else DoSpawnRandom();
- }
- }
-};
-CreatureAI* GetAI_npc_forest_frog(Creature *_Creature)
-{
- return new npc_forest_frogAI (_Creature);
-}
-
-/*######
-## npc_zulaman_hostage
-######*/
-
-#define GOSSIP_HOSTAGE1 "I am glad to help you."
-
-static uint32 HostageInfo[] = {23790, 23999, 24024, 24001};
-
-struct TRINITY_DLL_DECL npc_zulaman_hostageAI : public ScriptedAI
-{
- npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;}
- bool IsLoot;
- uint64 PlayerGUID;
- void Reset() {}
- void Aggro(Unit *who) {}
- void JustDied(Unit *)
- {
- Player* player = (Player*)Unit::GetUnit(*m_creature, PlayerGUID);
- if(player) player->SendLoot(m_creature->GetGUID(), LOOT_CORPSE);
- }
- void UpdateAI(const uint32 diff)
- {
- if(IsLoot) m_creature->CastSpell(m_creature, 7, false);
- }
-};
-
-bool GossipHello_npc_zulaman_hostage(Player* player, Creature* _Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_zulaman_hostage(Player* player, Creature* _Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF + 1)
- player->CLOSE_GOSSIP_MENU();
-
- if(!_Creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- return true;
- _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
- if(pInstance)
- {
- uint8 progress = pInstance->GetData(DATA_CHESTLOOTED);
- pInstance->SetData(DATA_CHESTLOOTED, 0);
- float x, y, z;
- _Creature->GetPosition(x, y, z);
- Creature* summon = _Creature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(summon)
- {
- ((npc_zulaman_hostageAI*)summon->AI())->PlayerGUID = player->GetGUID();
- ((npc_zulaman_hostageAI*)summon->AI())->IsLoot = true;
- summon->SetDisplayId(10056);
- summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
- }
- return true;
-}
-
-CreatureAI* GetAI_npc_zulaman_hostage(Creature *_Creature)
-{
- return new npc_zulaman_hostageAI(_Creature);
-}
-
-void AddSC_zulaman()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_forest_frog";
- newscript->GetAI = GetAI_npc_forest_frog;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_zulaman_hostage";
- newscript->GetAI = GetAI_npc_zulaman_hostage;
- newscript->pGossipHello = GossipHello_npc_zulaman_hostage;
- newscript->pGossipSelect = GossipSelect_npc_zulaman_hostage;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Zulaman
+SD%Complete: 90
+SDComment: Forest Frog will turn into different NPC's. Workaround to prevent new entry from running this script
+SDCategory: Zul'Aman
+EndScriptData */
+
+/* ContentData
+npc_forest_frog
+EndContentData */
+
+#include "precompiled.h"
+#include "def_zulaman.h"
+
+/*######
+## npc_forest_frog
+######*/
+
+#define SPELL_REMOVE_AMANI_CURSE 43732
+#define SPELL_PUSH_MOJO 43923
+#define ENTRY_FOREST_FROG 24396
+
+struct TRINITY_DLL_DECL npc_forest_frogAI : public ScriptedAI
+{
+ npc_forest_frogAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ void Reset() { }
+
+ void Aggro(Unit *who) { }
+
+ void DoSpawnRandom()
+ {
+ if( pInstance )
+ {
+ uint32 cEntry = 0;
+ switch(rand()%11)
+ {
+ case 0: cEntry = 24024; break; //Kraz
+ case 1: cEntry = 24397; break; //Mannuth
+ case 2: cEntry = 24403; break; //Deez
+ case 3: cEntry = 24404; break; //Galathryn
+ case 4: cEntry = 24405; break; //Adarrah
+ case 5: cEntry = 24406; break; //Fudgerick
+ case 6: cEntry = 24407; break; //Darwen
+ case 7: cEntry = 24445; break; //Mitzi
+ case 8: cEntry = 24448; break; //Christian
+ case 9: cEntry = 24453; break; //Brennan
+ case 10: cEntry = 24455; break; //Hollee
+ }
+
+ if( !pInstance->GetData(TYPE_RAND_VENDOR_1) )
+ if(rand()%10 == 1) cEntry = 24408; //Gunter
+ if( !pInstance->GetData(TYPE_RAND_VENDOR_2) )
+ if(rand()%10 == 1) cEntry = 24409; //Kyren
+
+ if( cEntry ) m_creature->UpdateEntry(cEntry);
+
+ if( cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE);
+ if( cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE);
+ }
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == ENTRY_FOREST_FROG )
+ {
+ //increase or decrease chance of mojo?
+ if( rand()%99 == 50 ) DoCast(caster,SPELL_PUSH_MOJO,true);
+ else DoSpawnRandom();
+ }
+ }
+};
+CreatureAI* GetAI_npc_forest_frog(Creature *_Creature)
+{
+ return new npc_forest_frogAI (_Creature);
+}
+
+/*######
+## npc_zulaman_hostage
+######*/
+
+#define GOSSIP_HOSTAGE1 "I am glad to help you."
+
+static uint32 HostageInfo[] = {23790, 23999, 24024, 24001};
+
+struct TRINITY_DLL_DECL npc_zulaman_hostageAI : public ScriptedAI
+{
+ npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;}
+ bool IsLoot;
+ uint64 PlayerGUID;
+ void Reset() {}
+ void Aggro(Unit *who) {}
+ void JustDied(Unit *)
+ {
+ Player* player = (Player*)Unit::GetUnit(*m_creature, PlayerGUID);
+ if(player) player->SendLoot(m_creature->GetGUID(), LOOT_CORPSE);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(IsLoot) m_creature->CastSpell(m_creature, 7, false);
+ }
+};
+
+bool GossipHello_npc_zulaman_hostage(Player* player, Creature* _Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_zulaman_hostage(Player* player, Creature* _Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF + 1)
+ player->CLOSE_GOSSIP_MENU();
+
+ if(!_Creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ return true;
+ _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ if(pInstance)
+ {
+ uint8 progress = pInstance->GetData(DATA_CHESTLOOTED);
+ pInstance->SetData(DATA_CHESTLOOTED, 0);
+ float x, y, z;
+ _Creature->GetPosition(x, y, z);
+ Creature* summon = _Creature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ if(summon)
+ {
+ ((npc_zulaman_hostageAI*)summon->AI())->PlayerGUID = player->GetGUID();
+ ((npc_zulaman_hostageAI*)summon->AI())->IsLoot = true;
+ summon->SetDisplayId(10056);
+ summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+ }
+ return true;
+}
+
+CreatureAI* GetAI_npc_zulaman_hostage(Creature *_Creature)
+{
+ return new npc_zulaman_hostageAI(_Creature);
+}
+
+void AddSC_zulaman()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_forest_frog";
+ newscript->GetAI = GetAI_npc_forest_frog;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_zulaman_hostage";
+ newscript->GetAI = GetAI_npc_zulaman_hostage;
+ newscript->pGossipHello = GossipHello_npc_zulaman_hostage;
+ newscript->pGossipSelect = GossipSelect_npc_zulaman_hostage;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
index 263ca6a33bd..6145f640634 100644
--- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
+++ b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
@@ -1,224 +1,224 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Zulfarrak
-SD%Complete: 50
-SDComment: Consider it temporary, no instance script made for this instance yet.
-SDCategory: Zul'Farrak
-EndScriptData */
-
-/* ContentData
-npc_sergeant_bly
-npc_weegli_blastfuse
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_sergeant_bly
-######*/
-
-#define FACTION_HOSTILE 14
-#define FACTION_FRIENDLY 35
-
-#define SPELL_SHIELD_BASH 11972
-#define SPELL_REVENGE 12170
-
-#define GOSSIP_BLY "[PH] In that case, i will take my reward!"
-
-struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI
-{
- npc_sergeant_blyAI(Creature *c) : ScriptedAI(c)
- {
- //pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- //ScriptedInstance* pInstance;
-
- uint32 ShieldBash_Timer;
- uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required.
-
- void Reset()
- {
- ShieldBash_Timer = 5000;
- Revenge_Timer = 8000;
-
- m_creature->setFaction(FACTION_FRIENDLY);
-
- /*if( pInstance )
- pInstance->SetData(0, NOT_STARTED);*/
- }
-
- void Aggro(Unit *who)
- {
- /*if( pInstance )
- pInstance->SetData(0, IN_PROGRESS);*/
- }
-
- void JustDied(Unit *victim)
- {
- /*if( pInstance )
- pInstance->SetData(0, DONE);*/
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( ShieldBash_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH);
- ShieldBash_Timer = 15000;
- }else ShieldBash_Timer -= diff;
-
- if( Revenge_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_REVENGE);
- Revenge_Timer = 10000;
- }else Revenge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_sergeant_bly(Creature *_Creature)
-{
- return new npc_sergeant_blyAI (_Creature);
-}
-
-bool GossipHello_npc_sergeant_bly(Player *player, Creature *_Creature )
-{
- /*if( pInstance->GetData(0) == DONE )
- {*/
- player->ADD_GOSSIP_ITEM(1, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(1517, _Creature->GetGUID());
- /*}
- else if( pInstance->GetData(0) == IN_PROGRESS )
- player->SEND_GOSSIP_MENU(1516, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(1515, _Creature->GetGUID());*/
-
- return true;
-}
-
-bool GossipSelect_npc_sergeant_bly(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(FACTION_HOSTILE);
- ((npc_sergeant_blyAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-## npc_weegli_blastfuse
-######*/
-
-#define SPELL_BOMB 8858
-#define SPELL_GOBLIN_LAND_MINE 21688
-#define SPELL_SHOOT 6660
-#define SPELL_WEEGLIS_BARREL 10772
-
-#define GOSSIP_WEEGLI "[PH] Please blow up the door."
-
-struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI
-{
- npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c)
- {
- //pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- //ScriptedInstance* pInstance;
-
- void Reset()
- {
- /*if( pInstance )
- pInstance->SetData(0, NOT_STARTED);*/
- }
-
- void Aggro(Unit *who)
- {
- /*if( pInstance )
- pInstance->SetData(0, IN_PROGRESS);*/
- }
-
- void JustDied(Unit *victim)
- {
- /*if( pInstance )
- pInstance->SetData(0, DONE);*/
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_weegli_blastfuse(Creature *_Creature)
-{
- return new npc_weegli_blastfuseAI (_Creature);
-}
-
-bool GossipHello_npc_weegli_blastfuse(Player *player, Creature *_Creature )
-{
- //event not implemented yet, this is only placeholder for future developement
- /*if( pInstance->GetData(0) == DONE )
- {
- player->ADD_GOSSIP_ITEM(1, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(1514, _Creature->GetGUID());//if event can proceed to end
- }
- else if( pInstance->GetData(0) == IN_PROGRESS )
- player->SEND_GOSSIP_MENU(1513, _Creature->GetGUID());//if event are in progress
- else*/
- player->SEND_GOSSIP_MENU(1511, _Creature->GetGUID()); //if event not started
- return true;
-}
-
-bool GossipSelect_npc_weegli_blastfuse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF+1 )
- {
- player->CLOSE_GOSSIP_MENU();
- //here we make him run to door, set the charge and run away off to nowhere
- }
- return true;
-}
-
-void AddSC_zulfarrak()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_sergeant_bly";
- newscript->GetAI = GetAI_npc_sergeant_bly;
- newscript->pGossipHello = &GossipHello_npc_sergeant_bly;
- newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_weegli_blastfuse";
- newscript->GetAI = GetAI_npc_weegli_blastfuse;
- newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse;
- newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Zulfarrak
+SD%Complete: 50
+SDComment: Consider it temporary, no instance script made for this instance yet.
+SDCategory: Zul'Farrak
+EndScriptData */
+
+/* ContentData
+npc_sergeant_bly
+npc_weegli_blastfuse
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_sergeant_bly
+######*/
+
+#define FACTION_HOSTILE 14
+#define FACTION_FRIENDLY 35
+
+#define SPELL_SHIELD_BASH 11972
+#define SPELL_REVENGE 12170
+
+#define GOSSIP_BLY "[PH] In that case, i will take my reward!"
+
+struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI
+{
+ npc_sergeant_blyAI(Creature *c) : ScriptedAI(c)
+ {
+ //pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ //ScriptedInstance* pInstance;
+
+ uint32 ShieldBash_Timer;
+ uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required.
+
+ void Reset()
+ {
+ ShieldBash_Timer = 5000;
+ Revenge_Timer = 8000;
+
+ m_creature->setFaction(FACTION_FRIENDLY);
+
+ /*if( pInstance )
+ pInstance->SetData(0, NOT_STARTED);*/
+ }
+
+ void Aggro(Unit *who)
+ {
+ /*if( pInstance )
+ pInstance->SetData(0, IN_PROGRESS);*/
+ }
+
+ void JustDied(Unit *victim)
+ {
+ /*if( pInstance )
+ pInstance->SetData(0, DONE);*/
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( ShieldBash_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH);
+ ShieldBash_Timer = 15000;
+ }else ShieldBash_Timer -= diff;
+
+ if( Revenge_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_REVENGE);
+ Revenge_Timer = 10000;
+ }else Revenge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_sergeant_bly(Creature *_Creature)
+{
+ return new npc_sergeant_blyAI (_Creature);
+}
+
+bool GossipHello_npc_sergeant_bly(Player *player, Creature *_Creature )
+{
+ /*if( pInstance->GetData(0) == DONE )
+ {*/
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(1517, _Creature->GetGUID());
+ /*}
+ else if( pInstance->GetData(0) == IN_PROGRESS )
+ player->SEND_GOSSIP_MENU(1516, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(1515, _Creature->GetGUID());*/
+
+ return true;
+}
+
+bool GossipSelect_npc_sergeant_bly(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(FACTION_HOSTILE);
+ ((npc_sergeant_blyAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+## npc_weegli_blastfuse
+######*/
+
+#define SPELL_BOMB 8858
+#define SPELL_GOBLIN_LAND_MINE 21688
+#define SPELL_SHOOT 6660
+#define SPELL_WEEGLIS_BARREL 10772
+
+#define GOSSIP_WEEGLI "[PH] Please blow up the door."
+
+struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI
+{
+ npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c)
+ {
+ //pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ //ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ /*if( pInstance )
+ pInstance->SetData(0, NOT_STARTED);*/
+ }
+
+ void Aggro(Unit *who)
+ {
+ /*if( pInstance )
+ pInstance->SetData(0, IN_PROGRESS);*/
+ }
+
+ void JustDied(Unit *victim)
+ {
+ /*if( pInstance )
+ pInstance->SetData(0, DONE);*/
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_weegli_blastfuse(Creature *_Creature)
+{
+ return new npc_weegli_blastfuseAI (_Creature);
+}
+
+bool GossipHello_npc_weegli_blastfuse(Player *player, Creature *_Creature )
+{
+ //event not implemented yet, this is only placeholder for future developement
+ /*if( pInstance->GetData(0) == DONE )
+ {
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(1514, _Creature->GetGUID());//if event can proceed to end
+ }
+ else if( pInstance->GetData(0) == IN_PROGRESS )
+ player->SEND_GOSSIP_MENU(1513, _Creature->GetGUID());//if event are in progress
+ else*/
+ player->SEND_GOSSIP_MENU(1511, _Creature->GetGUID()); //if event not started
+ return true;
+}
+
+bool GossipSelect_npc_weegli_blastfuse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF+1 )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ //here we make him run to door, set the charge and run away off to nowhere
+ }
+ return true;
+}
+
+void AddSC_zulfarrak()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_sergeant_bly";
+ newscript->GetAI = GetAI_npc_sergeant_bly;
+ newscript->pGossipHello = &GossipHello_npc_sergeant_bly;
+ newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_weegli_blastfuse";
+ newscript->GetAI = GetAI_npc_weegli_blastfuse;
+ newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse;
+ newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
index b167d6057b3..a82ecb0453a 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
@@ -1,211 +1,211 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Arlokk
-SD%Complete: 95
-SDComment: Wrong cleave and red aura is missing.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_SHADOWWORDPAIN 23952
-#define SPELL_GOUGE 24698
-#define SPELL_MARK 24210
-#define SPELL_CLEAVE 26350 //Perhaps not right. Not a red aura...
-#define SPELL_PANTHER_TRANSFORM 24190
-
-#define SAY_TRANSFORM "Bethekk, your priestess calls upon your might!"
-#define SAY_DEATH "At last I am free of the soul flayer..."
-
-#define SOUND_TRANSFORM 8416
-#define SOUND_DEATH 8412
-
-struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
-{
- boss_arlokkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowWordPain_Timer;
- uint32 Gouge_Timer;
- uint32 Mark_Timer;
- uint32 Cleave_Timer;
- uint32 Vanish_Timer;
- uint32 Summon_Timer;
- uint32 Visible_Timer;
-
- Unit* markedTarget;
- Creature *Panther;
- uint32 Counter;
-
- bool PhaseTwo;
- bool VanishedOnce;
-
- void Reset()
- {
- ShadowWordPain_Timer = 8000;
- Gouge_Timer = 14000;
- Mark_Timer = 35000;
- Cleave_Timer = 4000;
- Vanish_Timer = 60000;
- Summon_Timer = 5000;
- Visible_Timer = 6000;
-
- Counter = 0;
-
- markedTarget = NULL;
- PhaseTwo = false;
- VanishedOnce = false;
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15218);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15218);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
-
- if(pInstance)
- pInstance->SetData(DATA_ARLOKK_DEATH, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
- if (!PhaseTwo && ShadowWordPain_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 15000;
- }else ShadowWordPain_Timer -= diff;
-
- if (!PhaseTwo && Mark_Timer < diff)
- {
- markedTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(markedTarget,SPELL_MARK);
- Mark_Timer = 15000;
- }else Mark_Timer -= diff;
-
- if (Summon_Timer < diff && Counter < 31)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- Panther = m_creature->SummonCreature(15101,-11532.79980,-1649.6734,41.4800,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
-
- if(markedTarget && Panther )
- { Panther ->AI()->AttackStart(markedTarget); }
- else
- { Panther ->AI()->AttackStart(target); }
-
- Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
-
- if(markedTarget && Panther )
- { Panther ->AI()->AttackStart(markedTarget); }
- else
- { Panther ->AI()->AttackStart(target); }
-
- Counter++;
- Summon_Timer = 5000;
- }else Summon_Timer -= diff;
-
- if (Vanish_Timer < diff)
- {
- //Invisble Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->CombatStop();
- DoResetThreat();
- VanishedOnce = true;
- Vanish_Timer = 45000;
- Visible_Timer = 6000;
- }else Vanish_Timer -= diff;
-
- if (VanishedOnce)
- {
- if(Visible_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- //The Panther Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- if (!PhaseTwo)
- {
- DoYell(SAY_TRANSFORM,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_TRANSFORM);
- }
-
- 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);
- DoStartAttackAndMovement(target);
- //The Panther Model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- PhaseTwo = true;
- }else Visible_Timer -= diff;
- }
-
- //Cleave_Timer
- if(PhaseTwo && Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CLEAVE);
- Cleave_Timer = 16000;
- }Cleave_Timer -=diff;
-
- //Gouge_Timer
- if(PhaseTwo && Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_GOUGE);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
-
- Gouge_Timer = 17000+rand()%10000;
- }else Gouge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-CreatureAI* GetAI_boss_arlokk(Creature *_Creature)
-{
- return new boss_arlokkAI (_Creature);
-}
-
-void AddSC_boss_arlokk()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_arlokk";
- newscript->GetAI = GetAI_boss_arlokk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Arlokk
+SD%Complete: 95
+SDComment: Wrong cleave and red aura is missing.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_SHADOWWORDPAIN 23952
+#define SPELL_GOUGE 24698
+#define SPELL_MARK 24210
+#define SPELL_CLEAVE 26350 //Perhaps not right. Not a red aura...
+#define SPELL_PANTHER_TRANSFORM 24190
+
+#define SAY_TRANSFORM "Bethekk, your priestess calls upon your might!"
+#define SAY_DEATH "At last I am free of the soul flayer..."
+
+#define SOUND_TRANSFORM 8416
+#define SOUND_DEATH 8412
+
+struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
+{
+ boss_arlokkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowWordPain_Timer;
+ uint32 Gouge_Timer;
+ uint32 Mark_Timer;
+ uint32 Cleave_Timer;
+ uint32 Vanish_Timer;
+ uint32 Summon_Timer;
+ uint32 Visible_Timer;
+
+ Unit* markedTarget;
+ Creature *Panther;
+ uint32 Counter;
+
+ bool PhaseTwo;
+ bool VanishedOnce;
+
+ void Reset()
+ {
+ ShadowWordPain_Timer = 8000;
+ Gouge_Timer = 14000;
+ Mark_Timer = 35000;
+ Cleave_Timer = 4000;
+ Vanish_Timer = 60000;
+ Summon_Timer = 5000;
+ Visible_Timer = 6000;
+
+ Counter = 0;
+
+ markedTarget = NULL;
+ PhaseTwo = false;
+ VanishedOnce = false;
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15218);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15218);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+
+ if(pInstance)
+ pInstance->SetData(DATA_ARLOKK_DEATH, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+ if (!PhaseTwo && ShadowWordPain_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 15000;
+ }else ShadowWordPain_Timer -= diff;
+
+ if (!PhaseTwo && Mark_Timer < diff)
+ {
+ markedTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(markedTarget,SPELL_MARK);
+ Mark_Timer = 15000;
+ }else Mark_Timer -= diff;
+
+ if (Summon_Timer < diff && Counter < 31)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ Panther = m_creature->SummonCreature(15101,-11532.79980,-1649.6734,41.4800,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+
+ if(markedTarget && Panther )
+ { Panther ->AI()->AttackStart(markedTarget); }
+ else
+ { Panther ->AI()->AttackStart(target); }
+
+ Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+
+ if(markedTarget && Panther )
+ { Panther ->AI()->AttackStart(markedTarget); }
+ else
+ { Panther ->AI()->AttackStart(target); }
+
+ Counter++;
+ Summon_Timer = 5000;
+ }else Summon_Timer -= diff;
+
+ if (Vanish_Timer < diff)
+ {
+ //Invisble Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->CombatStop();
+ DoResetThreat();
+ VanishedOnce = true;
+ Vanish_Timer = 45000;
+ Visible_Timer = 6000;
+ }else Vanish_Timer -= diff;
+
+ if (VanishedOnce)
+ {
+ if(Visible_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ //The Panther Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (!PhaseTwo)
+ {
+ DoYell(SAY_TRANSFORM,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_TRANSFORM);
+ }
+
+ 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);
+ DoStartAttackAndMovement(target);
+ //The Panther Model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ PhaseTwo = true;
+ }else Visible_Timer -= diff;
+ }
+
+ //Cleave_Timer
+ if(PhaseTwo && Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ Cleave_Timer = 16000;
+ }Cleave_Timer -=diff;
+
+ //Gouge_Timer
+ if(PhaseTwo && Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_GOUGE);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
+
+ Gouge_Timer = 17000+rand()%10000;
+ }else Gouge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+CreatureAI* GetAI_boss_arlokk(Creature *_Creature)
+{
+ return new boss_arlokkAI (_Creature);
+}
+
+void AddSC_boss_arlokk()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_arlokk";
+ newscript->GetAI = GetAI_boss_arlokk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
index 6b3c53e19d1..7168d647d49 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
@@ -1,92 +1,92 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gahz'ranka
-SD%Complete: 85
-SDComment: Massive Geyser with knockback not working. Spell buggy.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTBREATH 21099
-#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
-#define SPELL_SLAM 24326
-
-struct TRINITY_DLL_DECL boss_gahzrankaAI : public ScriptedAI
-{
- boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {Reset();}
- uint32 Frostbreath_Timer;
- uint32 MassiveGeyser_Timer;
- uint32 Slam_Timer;
-
- void Reset()
- {
- Frostbreath_Timer = 8000;
- MassiveGeyser_Timer = 25000;
- Slam_Timer = 17000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Frostbreath_Timer
- if (Frostbreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
- Frostbreath_Timer = 7000 + rand()%4000;
- }else Frostbreath_Timer -= diff;
-
- //MassiveGeyser_Timer
- if (MassiveGeyser_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MASSIVEGEYSER);
- DoResetThreat();
-
- MassiveGeyser_Timer = 22000 + rand()%10000;
- }else MassiveGeyser_Timer -= diff;
-
- //Slam_Timer
- if (Slam_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLAM);
- Slam_Timer = 12000 + rand()%8000;
- }else Slam_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gahzranka(Creature *_Creature)
-{
- return new boss_gahzrankaAI (_Creature);
-}
-
-void AddSC_boss_gahzranka()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gahzranka";
- newscript->GetAI = GetAI_boss_gahzranka;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gahz'ranka
+SD%Complete: 85
+SDComment: Massive Geyser with knockback not working. Spell buggy.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTBREATH 21099
+#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
+#define SPELL_SLAM 24326
+
+struct TRINITY_DLL_DECL boss_gahzrankaAI : public ScriptedAI
+{
+ boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {Reset();}
+ uint32 Frostbreath_Timer;
+ uint32 MassiveGeyser_Timer;
+ uint32 Slam_Timer;
+
+ void Reset()
+ {
+ Frostbreath_Timer = 8000;
+ MassiveGeyser_Timer = 25000;
+ Slam_Timer = 17000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Frostbreath_Timer
+ if (Frostbreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
+ Frostbreath_Timer = 7000 + rand()%4000;
+ }else Frostbreath_Timer -= diff;
+
+ //MassiveGeyser_Timer
+ if (MassiveGeyser_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MASSIVEGEYSER);
+ DoResetThreat();
+
+ MassiveGeyser_Timer = 22000 + rand()%10000;
+ }else MassiveGeyser_Timer -= diff;
+
+ //Slam_Timer
+ if (Slam_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLAM);
+ Slam_Timer = 12000 + rand()%8000;
+ }else Slam_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gahzranka(Creature *_Creature)
+{
+ return new boss_gahzrankaAI (_Creature);
+}
+
+void AddSC_boss_gahzranka()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gahzranka";
+ newscript->GetAI = GetAI_boss_gahzranka;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
index c6013cd00a3..c2e9b616620 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
@@ -1,92 +1,92 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grilek
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_AVARTAR 24646 //The Enrage Spell
-#define SPELL_GROUNDTREMOR 6524
-
-struct TRINITY_DLL_DECL boss_grilekAI : public ScriptedAI
-{
- boss_grilekAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Avartar_Timer;
- uint32 GroundTremor_Timer;
-
- void Reset()
- {
- Avartar_Timer = 15000 + rand()%10000;
- GroundTremor_Timer = 8000 + rand()%8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Avartar_Timer
- if (Avartar_Timer < diff)
- {
-
- DoCast(m_creature, SPELL_AVARTAR);
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
- if (target)
- DoStartAttackAndMovement(target);
-
- Avartar_Timer = 25000 + rand()%10000;
- }else Avartar_Timer -= diff;
-
- //GroundTremor_Timer
- if (GroundTremor_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR);
- GroundTremor_Timer = 12000 + rand()%4000;
- }else GroundTremor_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_grilek(Creature *_Creature)
-{
- return new boss_grilekAI (_Creature);
-}
-
-void AddSC_boss_grilek()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_grilek";
- newscript->GetAI = GetAI_boss_grilek;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grilek
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_AVARTAR 24646 //The Enrage Spell
+#define SPELL_GROUNDTREMOR 6524
+
+struct TRINITY_DLL_DECL boss_grilekAI : public ScriptedAI
+{
+ boss_grilekAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Avartar_Timer;
+ uint32 GroundTremor_Timer;
+
+ void Reset()
+ {
+ Avartar_Timer = 15000 + rand()%10000;
+ GroundTremor_Timer = 8000 + rand()%8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Avartar_Timer
+ if (Avartar_Timer < diff)
+ {
+
+ DoCast(m_creature, SPELL_AVARTAR);
+ Unit* target = NULL;
+
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+ if (target)
+ DoStartAttackAndMovement(target);
+
+ Avartar_Timer = 25000 + rand()%10000;
+ }else Avartar_Timer -= diff;
+
+ //GroundTremor_Timer
+ if (GroundTremor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR);
+ GroundTremor_Timer = 12000 + rand()%4000;
+ }else GroundTremor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_grilek(Creature *_Creature)
+{
+ return new boss_grilekAI (_Creature);
+}
+
+void AddSC_boss_grilek()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_grilek";
+ newscript->GetAI = GetAI_boss_grilek;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
index 3482f287116..cdd4c42128b 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
@@ -1,256 +1,256 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Hakkar
-SD%Complete: 95
-SDComment: Blood siphon spell buggy cause of Core Issue.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_BLOODSIPHON 24322
-#define SPELL_CORRUPTEDBLOOD 24328
-#define SPELL_CAUSEINSANITY 24327 //Not working disabled.
-#define SPELL_WILLOFHAKKAR 24178
-#define SPELL_ENRAGE 24318
-
-// The Aspects of all High Priests
-#define SPELL_ASPECT_OF_JEKLIK 24687
-#define SPELL_ASPECT_OF_VENOXIS 24688
-#define SPELL_ASPECT_OF_MARLI 24686
-#define SPELL_ASPECT_OF_THEKAL 24689
-#define SPELL_ASPECT_OF_ARLOKK 24690
-
-#define SAY_AGGRO "PRIDE HERALDS THE END OF YOUR WORLD. COME, MORTALS! FACE THE WRATH OF THE SOULFLAYER!"
-#define SOUND_AGGRO 8414
-
-#define SAY_SLAY "Fleeing will do you no good, mortals!"
-
-struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI
-{
- boss_hakkarAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 BloodSiphon_Timer;
- uint32 CorruptedBlood_Timer;
- uint32 CauseInsanity_Timer;
- uint32 WillOfHakkar_Timer;
- uint32 Enrage_Timer;
-
- uint32 CheckJeklik_Timer;
- uint32 CheckVenoxis_Timer;
- uint32 CheckMarli_Timer;
- uint32 CheckThekal_Timer;
- uint32 CheckArlokk_Timer;
-
- uint32 AspectOfJeklik_Timer;
- uint32 AspectOfVenoxis_Timer;
- uint32 AspectOfMarli_Timer;
- uint32 AspectOfThekal_Timer;
- uint32 AspectOfArlokk_Timer;
-
- ScriptedInstance *pInstance;
-
- bool Enraged;
-
- void Reset()
- {
- BloodSiphon_Timer = 90000;
- CorruptedBlood_Timer = 25000;
- CauseInsanity_Timer = 17000;
- WillOfHakkar_Timer = 17000;
- Enrage_Timer = 600000;
-
- CheckJeklik_Timer = 1000;
- CheckVenoxis_Timer = 2000;
- CheckMarli_Timer = 3000;
- CheckThekal_Timer = 4000;
- CheckArlokk_Timer = 5000;
-
- AspectOfJeklik_Timer = 4000;
- AspectOfVenoxis_Timer = 7000;
- AspectOfMarli_Timer = 12000;
- AspectOfThekal_Timer = 8000;
- AspectOfArlokk_Timer = 18000;
-
- Enraged = false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //BloodSiphon_Timer
- if (BloodSiphon_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLOODSIPHON);
- BloodSiphon_Timer = 90000;
- }else BloodSiphon_Timer -= diff;
-
- //CorruptedBlood_Timer
- if (CorruptedBlood_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD);
- CorruptedBlood_Timer = 30000 + rand()%15000;
- }else CorruptedBlood_Timer -= diff;
-
- //CauseInsanity_Timer
- // if (CauseInsanity_Timer < diff)
- // {
- //
- // Unit* target = NULL;
- // target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- // DoCast(target,SPELL_CAUSEINSANITY);
-
- // CauseInsanity_Timer = 35000 + rand()%8000;
- // }else CauseInsanity_Timer -= diff;
-
- //WillOfHakkar_Timer
- if (WillOfHakkar_Timer < diff)
- {
-
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_WILLOFHAKKAR);
- WillOfHakkar_Timer = 25000 + rand()%10000;
- }else WillOfHakkar_Timer -= diff;
-
- if (!Enraged && Enrage_Timer < diff)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }else Enrage_Timer -= diff;
-
- //Checking if Jeklik is dead. If not we cast her Aspect
- if(CheckJeklik_Timer < diff)
- {
- if(pInstance)
- {
- if(!pInstance->GetData(DATA_JEKLIKISDEAD))
- {
- if (AspectOfJeklik_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_JEKLIK);
- AspectOfJeklik_Timer = 10000 + rand()%4000;
- }else AspectOfJeklik_Timer -= diff;
- }
- }
- CheckJeklik_Timer = 1000;
- }else CheckJeklik_Timer -= diff;
-
- //Checking if Venoxis is dead. If not we cast his Aspect
- if(CheckVenoxis_Timer < diff)
- {
- if(pInstance)
- {
- if(!pInstance->GetData(DATA_VENOXISISDEAD))
- {
- if (AspectOfVenoxis_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_VENOXIS);
- AspectOfVenoxis_Timer = 8000;
- }else AspectOfVenoxis_Timer -= diff;
- }
- }
- CheckVenoxis_Timer = 1000;
- }else CheckVenoxis_Timer -= diff;
-
- //Checking if Marli is dead. If not we cast her Aspect
- if(CheckMarli_Timer < diff)
- {
- if(pInstance)
- {
- if(!pInstance->GetData(DATA_MARLIISDEAD))
- {
- if (AspectOfMarli_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI);
- AspectOfMarli_Timer = 10000;
- }else AspectOfMarli_Timer -= diff;
-
- }
- }
- CheckMarli_Timer = 1000;
- }else CheckMarli_Timer -= diff;
-
- //Checking if Thekal is dead. If not we cast his Aspect
- if(CheckThekal_Timer < diff)
- {
- if(pInstance)
- {
- if(!pInstance->GetData(DATA_THEKALISDEAD))
- {
- if (AspectOfThekal_Timer < diff)
- {
- DoCast(m_creature,SPELL_ASPECT_OF_THEKAL);
- AspectOfThekal_Timer = 15000;
- }else AspectOfThekal_Timer -= diff;
- }
- }
- CheckThekal_Timer = 1000;
- }else CheckThekal_Timer -= diff;
-
- //Checking if Arlokk is dead. If yes we cast her Aspect
- if(CheckArlokk_Timer < diff)
- {
- if(pInstance)
- {
- if(!pInstance->GetData(DATA_ARLOKKISDEAD))
- {
- if (AspectOfArlokk_Timer < diff)
- {
- DoCast(m_creature,SPELL_ASPECT_OF_ARLOKK);
- DoResetThreat();
-
- AspectOfArlokk_Timer = 10000 + rand()%5000;
- }else AspectOfArlokk_Timer -= diff;
- }
- }
- CheckArlokk_Timer = 1000;
- }else CheckArlokk_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_hakkar(Creature *_Creature)
-{
- return new boss_hakkarAI (_Creature);
-}
-
-void AddSC_boss_hakkar()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_hakkar";
- newscript->GetAI = GetAI_boss_hakkar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Hakkar
+SD%Complete: 95
+SDComment: Blood siphon spell buggy cause of Core Issue.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_BLOODSIPHON 24322
+#define SPELL_CORRUPTEDBLOOD 24328
+#define SPELL_CAUSEINSANITY 24327 //Not working disabled.
+#define SPELL_WILLOFHAKKAR 24178
+#define SPELL_ENRAGE 24318
+
+// The Aspects of all High Priests
+#define SPELL_ASPECT_OF_JEKLIK 24687
+#define SPELL_ASPECT_OF_VENOXIS 24688
+#define SPELL_ASPECT_OF_MARLI 24686
+#define SPELL_ASPECT_OF_THEKAL 24689
+#define SPELL_ASPECT_OF_ARLOKK 24690
+
+#define SAY_AGGRO "PRIDE HERALDS THE END OF YOUR WORLD. COME, MORTALS! FACE THE WRATH OF THE SOULFLAYER!"
+#define SOUND_AGGRO 8414
+
+#define SAY_SLAY "Fleeing will do you no good, mortals!"
+
+struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI
+{
+ boss_hakkarAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 BloodSiphon_Timer;
+ uint32 CorruptedBlood_Timer;
+ uint32 CauseInsanity_Timer;
+ uint32 WillOfHakkar_Timer;
+ uint32 Enrage_Timer;
+
+ uint32 CheckJeklik_Timer;
+ uint32 CheckVenoxis_Timer;
+ uint32 CheckMarli_Timer;
+ uint32 CheckThekal_Timer;
+ uint32 CheckArlokk_Timer;
+
+ uint32 AspectOfJeklik_Timer;
+ uint32 AspectOfVenoxis_Timer;
+ uint32 AspectOfMarli_Timer;
+ uint32 AspectOfThekal_Timer;
+ uint32 AspectOfArlokk_Timer;
+
+ ScriptedInstance *pInstance;
+
+ bool Enraged;
+
+ void Reset()
+ {
+ BloodSiphon_Timer = 90000;
+ CorruptedBlood_Timer = 25000;
+ CauseInsanity_Timer = 17000;
+ WillOfHakkar_Timer = 17000;
+ Enrage_Timer = 600000;
+
+ CheckJeklik_Timer = 1000;
+ CheckVenoxis_Timer = 2000;
+ CheckMarli_Timer = 3000;
+ CheckThekal_Timer = 4000;
+ CheckArlokk_Timer = 5000;
+
+ AspectOfJeklik_Timer = 4000;
+ AspectOfVenoxis_Timer = 7000;
+ AspectOfMarli_Timer = 12000;
+ AspectOfThekal_Timer = 8000;
+ AspectOfArlokk_Timer = 18000;
+
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //BloodSiphon_Timer
+ if (BloodSiphon_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLOODSIPHON);
+ BloodSiphon_Timer = 90000;
+ }else BloodSiphon_Timer -= diff;
+
+ //CorruptedBlood_Timer
+ if (CorruptedBlood_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD);
+ CorruptedBlood_Timer = 30000 + rand()%15000;
+ }else CorruptedBlood_Timer -= diff;
+
+ //CauseInsanity_Timer
+ // if (CauseInsanity_Timer < diff)
+ // {
+ //
+ // Unit* target = NULL;
+ // target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ // DoCast(target,SPELL_CAUSEINSANITY);
+
+ // CauseInsanity_Timer = 35000 + rand()%8000;
+ // }else CauseInsanity_Timer -= diff;
+
+ //WillOfHakkar_Timer
+ if (WillOfHakkar_Timer < diff)
+ {
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_WILLOFHAKKAR);
+ WillOfHakkar_Timer = 25000 + rand()%10000;
+ }else WillOfHakkar_Timer -= diff;
+
+ if (!Enraged && Enrage_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enraged = true;
+ }else Enrage_Timer -= diff;
+
+ //Checking if Jeklik is dead. If not we cast her Aspect
+ if(CheckJeklik_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(!pInstance->GetData(DATA_JEKLIKISDEAD))
+ {
+ if (AspectOfJeklik_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_JEKLIK);
+ AspectOfJeklik_Timer = 10000 + rand()%4000;
+ }else AspectOfJeklik_Timer -= diff;
+ }
+ }
+ CheckJeklik_Timer = 1000;
+ }else CheckJeklik_Timer -= diff;
+
+ //Checking if Venoxis is dead. If not we cast his Aspect
+ if(CheckVenoxis_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(!pInstance->GetData(DATA_VENOXISISDEAD))
+ {
+ if (AspectOfVenoxis_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_VENOXIS);
+ AspectOfVenoxis_Timer = 8000;
+ }else AspectOfVenoxis_Timer -= diff;
+ }
+ }
+ CheckVenoxis_Timer = 1000;
+ }else CheckVenoxis_Timer -= diff;
+
+ //Checking if Marli is dead. If not we cast her Aspect
+ if(CheckMarli_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(!pInstance->GetData(DATA_MARLIISDEAD))
+ {
+ if (AspectOfMarli_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI);
+ AspectOfMarli_Timer = 10000;
+ }else AspectOfMarli_Timer -= diff;
+
+ }
+ }
+ CheckMarli_Timer = 1000;
+ }else CheckMarli_Timer -= diff;
+
+ //Checking if Thekal is dead. If not we cast his Aspect
+ if(CheckThekal_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(!pInstance->GetData(DATA_THEKALISDEAD))
+ {
+ if (AspectOfThekal_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ASPECT_OF_THEKAL);
+ AspectOfThekal_Timer = 15000;
+ }else AspectOfThekal_Timer -= diff;
+ }
+ }
+ CheckThekal_Timer = 1000;
+ }else CheckThekal_Timer -= diff;
+
+ //Checking if Arlokk is dead. If yes we cast her Aspect
+ if(CheckArlokk_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(!pInstance->GetData(DATA_ARLOKKISDEAD))
+ {
+ if (AspectOfArlokk_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ASPECT_OF_ARLOKK);
+ DoResetThreat();
+
+ AspectOfArlokk_Timer = 10000 + rand()%5000;
+ }else AspectOfArlokk_Timer -= diff;
+ }
+ }
+ CheckArlokk_Timer = 1000;
+ }else CheckArlokk_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_hakkar(Creature *_Creature)
+{
+ return new boss_hakkarAI (_Creature);
+}
+
+void AddSC_boss_hakkar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_hakkar";
+ newscript->GetAI = GetAI_boss_hakkar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
index 77ace8a4880..62140f5303d 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
@@ -1,100 +1,100 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Hazzarah
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_MANABURN 26046
-#define SPELL_SLEEP 24664
-
-struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI
-{
- boss_hazzarahAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ManaBurn_Timer;
- uint32 Sleep_Timer;
- uint32 Illusions_Timer;
- Creature* Illusion;
-
- void Reset()
- {
- ManaBurn_Timer = 4000 + rand()%6000;
- Sleep_Timer = 10000 + rand()%8000;
- Illusions_Timer = 10000 + rand()%8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //ManaBurn_Timer
- if (ManaBurn_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MANABURN);
- ManaBurn_Timer = 8000 + rand()%8000;
- }else ManaBurn_Timer -= diff;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLEEP);
- Sleep_Timer = 12000 + rand()%8000;
- }else Sleep_Timer -= diff;
-
- //Illusions_Timer
- if (Illusions_Timer < diff)
- {
- //We will summon 3 illusions that will spawn on a random gamer and attack this gamer
- //We will just use one model for the beginning
- Unit* target = NULL;
- for(int i = 0; i < 3;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
- ((CreatureAI*)Illusion->AI())->AttackStart(target);
- }
-
- Illusions_Timer = 15000 + rand()%10000;
- }else Illusions_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_hazzarah(Creature *_Creature)
-{
- return new boss_hazzarahAI (_Creature);
-}
-
-void AddSC_boss_hazzarah()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_hazzarah";
- newscript->GetAI = GetAI_boss_hazzarah;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Hazzarah
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_MANABURN 26046
+#define SPELL_SLEEP 24664
+
+struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI
+{
+ boss_hazzarahAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ManaBurn_Timer;
+ uint32 Sleep_Timer;
+ uint32 Illusions_Timer;
+ Creature* Illusion;
+
+ void Reset()
+ {
+ ManaBurn_Timer = 4000 + rand()%6000;
+ Sleep_Timer = 10000 + rand()%8000;
+ Illusions_Timer = 10000 + rand()%8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //ManaBurn_Timer
+ if (ManaBurn_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MANABURN);
+ ManaBurn_Timer = 8000 + rand()%8000;
+ }else ManaBurn_Timer -= diff;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLEEP);
+ Sleep_Timer = 12000 + rand()%8000;
+ }else Sleep_Timer -= diff;
+
+ //Illusions_Timer
+ if (Illusions_Timer < diff)
+ {
+ //We will summon 3 illusions that will spawn on a random gamer and attack this gamer
+ //We will just use one model for the beginning
+ Unit* target = NULL;
+ for(int i = 0; i < 3;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
+ ((CreatureAI*)Illusion->AI())->AttackStart(target);
+ }
+
+ Illusions_Timer = 15000 + rand()%10000;
+ }else Illusions_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_hazzarah(Creature *_Creature)
+{
+ return new boss_hazzarahAI (_Creature);
+}
+
+void AddSC_boss_hazzarah()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_hazzarah";
+ newscript->GetAI = GetAI_boss_hazzarah;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
index 092d6da39c2..2f62ef41856 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
@@ -1,297 +1,297 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Jeklik
-SD%Complete: 85
-SDComment: Problem in finding the right flying batriders for spawning and making them fly.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_CHARGE 22911
-#define SPELL_SONICBURST 23918
-#define SPELL_SCREECH 6605
-#define SPELL_SHADOW_WORD_PAIN 23952
-#define SPELL_MIND_FLAY 23953
-#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled
-#define SPELL_GREATERHEAL 23954
-#define SPELL_BAT_FORM 23966
-
-// Batriders Spell
-
-#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working...
-
-#define SAY_AGGRO "Lord Hireek grant me wings of vengance!"
-#define SAY_DEATH "Hireek - Finnaly death. Curse you Hakkar! Curse you!"
-
-#define SOUND_AGGRO 8417
-#define SOUND_DEATH 8422
-
-struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI
-{
- boss_jeklikAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Charge_Timer;
- uint32 SonicBurst_Timer;
- uint32 Screech_Timer;
- uint32 SpawnBats_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 MindFlay_Timer;
- uint32 ChainMindFlay_Timer;
- uint32 GreaterHeal_Timer;
- uint32 SpawnFlyingBats_Timer;
-
- bool PhaseTwo;
-
- void Reset()
- {
- Charge_Timer = 20000;
- SonicBurst_Timer = 8000;
- Screech_Timer = 13000;
- SpawnBats_Timer = 60000;
- ShadowWordPain_Timer = 6000;
- MindFlay_Timer = 11000;
- ChainMindFlay_Timer = 26000;
- GreaterHeal_Timer = 50000;
- SpawnFlyingBats_Timer = 10000;
-
- PhaseTwo = false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- DoCast(m_creature,SPELL_BAT_FORM);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- ScriptedInstance *pInstance = ((ScriptedInstance*)m_creature->GetInstanceData());
- if(pInstance)
- pInstance->SetData(DATA_JEKLIK_DEATH, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
- {
- if (Charge_Timer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(target)
- {
- DoCast(target,SPELL_CHARGE);
-
- m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
- DoStartAttackAndMovement(target);
- }
-
- Charge_Timer = 15000 + rand()%15000;
- }else Charge_Timer -= diff;
-
- if (SonicBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SONICBURST);
- SonicBurst_Timer = 8000 + rand()%5000;
- }else SonicBurst_Timer -= diff;
-
- if (Screech_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SCREECH);
- Screech_Timer = 18000 + rand()%8000;
- }else Screech_Timer -= diff;
-
- if (SpawnBats_Timer < diff)
- {
- Unit* target = 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);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
-
- Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
-
- Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
-
- Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
-
- Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
- Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Bat ) { Bat ->AI()->AttackStart(target); }
-
- SpawnBats_Timer = 60000;
- }else SpawnBats_Timer -= diff;
- }
- else
- {
- if(PhaseTwo)
- {
- if(PhaseTwo && ShadowWordPain_Timer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(target)
- {
- DoCast(target, SPELL_SHADOW_WORD_PAIN);
- ShadowWordPain_Timer = 12000 + rand()%6000;
- }
- }ShadowWordPain_Timer -=diff;
-
- if(MindFlay_Timer < diff)
- {
- DoCast(m_creature->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);
- ChainMindFlay_Timer = 15000 + rand()%15000;
- }ChainMindFlay_Timer -=diff;
-
- if(GreaterHeal_Timer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature,SPELL_GREATERHEAL);
- GreaterHeal_Timer = 25000 + rand()%10000;
- }GreaterHeal_Timer -=diff;
-
- if(SpawnFlyingBats_Timer < diff)
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(FlyingBat)
- {
- if(target)
- FlyingBat->AI()->AttackStart(target);
- }
-
- SpawnFlyingBats_Timer = 10000 + rand()%5000;
- }SpawnFlyingBats_Timer -=diff;
- }
- else
- {
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15219);
- DoResetThreat();
- PhaseTwo = true;
- }
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-//Flying Bat
-struct TRINITY_DLL_DECL mob_batriderAI : public ScriptedAI
-{
- mob_batriderAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 Bomb_Timer;
- uint32 Check_Timer;
-
- void Reset()
- {
- Bomb_Timer = 2000;
- Check_Timer = 1000;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI (const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Bomb_Timer
- if(Bomb_Timer < diff)
- {
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoCast(target, SPELL_BOMB);
- Bomb_Timer = 5000;
- }
- }else Bomb_Timer -= diff;
-
- //Check_Timer
- if(Check_Timer < diff)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_JEKLIKISDEAD))
- {
- m_creature->setDeathState(JUST_DIED);
- m_creature->RemoveCorpse();
- }
- }
-
- Check_Timer = 1000;
- }else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_jeklik(Creature *_Creature)
-{
- return new boss_jeklikAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_batrider(Creature *_Creature)
-{
- return new mob_batriderAI (_Creature);
-}
-
-void AddSC_boss_jeklik()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_jeklik";
- newscript->GetAI = GetAI_boss_jeklik;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_batrider";
- newscript->GetAI = GetAI_mob_batrider;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Jeklik
+SD%Complete: 85
+SDComment: Problem in finding the right flying batriders for spawning and making them fly.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_CHARGE 22911
+#define SPELL_SONICBURST 23918
+#define SPELL_SCREECH 6605
+#define SPELL_SHADOW_WORD_PAIN 23952
+#define SPELL_MIND_FLAY 23953
+#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled
+#define SPELL_GREATERHEAL 23954
+#define SPELL_BAT_FORM 23966
+
+// Batriders Spell
+
+#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working...
+
+#define SAY_AGGRO "Lord Hireek grant me wings of vengance!"
+#define SAY_DEATH "Hireek - Finnaly death. Curse you Hakkar! Curse you!"
+
+#define SOUND_AGGRO 8417
+#define SOUND_DEATH 8422
+
+struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI
+{
+ boss_jeklikAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Charge_Timer;
+ uint32 SonicBurst_Timer;
+ uint32 Screech_Timer;
+ uint32 SpawnBats_Timer;
+ uint32 ShadowWordPain_Timer;
+ uint32 MindFlay_Timer;
+ uint32 ChainMindFlay_Timer;
+ uint32 GreaterHeal_Timer;
+ uint32 SpawnFlyingBats_Timer;
+
+ bool PhaseTwo;
+
+ void Reset()
+ {
+ Charge_Timer = 20000;
+ SonicBurst_Timer = 8000;
+ Screech_Timer = 13000;
+ SpawnBats_Timer = 60000;
+ ShadowWordPain_Timer = 6000;
+ MindFlay_Timer = 11000;
+ ChainMindFlay_Timer = 26000;
+ GreaterHeal_Timer = 50000;
+ SpawnFlyingBats_Timer = 10000;
+
+ PhaseTwo = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoCast(m_creature,SPELL_BAT_FORM);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ ScriptedInstance *pInstance = ((ScriptedInstance*)m_creature->GetInstanceData());
+ if(pInstance)
+ pInstance->SetData(DATA_JEKLIK_DEATH, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
+ {
+ if (Charge_Timer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(target)
+ {
+ DoCast(target,SPELL_CHARGE);
+
+ m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+ DoStartAttackAndMovement(target);
+ }
+
+ Charge_Timer = 15000 + rand()%15000;
+ }else Charge_Timer -= diff;
+
+ if (SonicBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SONICBURST);
+ SonicBurst_Timer = 8000 + rand()%5000;
+ }else SonicBurst_Timer -= diff;
+
+ if (Screech_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SCREECH);
+ Screech_Timer = 18000 + rand()%8000;
+ }else Screech_Timer -= diff;
+
+ if (SpawnBats_Timer < diff)
+ {
+ Unit* target = 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);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+
+ Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+
+ Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+
+ Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+
+ Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+ Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Bat ) { Bat ->AI()->AttackStart(target); }
+
+ SpawnBats_Timer = 60000;
+ }else SpawnBats_Timer -= diff;
+ }
+ else
+ {
+ if(PhaseTwo)
+ {
+ if(PhaseTwo && ShadowWordPain_Timer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(target)
+ {
+ DoCast(target, SPELL_SHADOW_WORD_PAIN);
+ ShadowWordPain_Timer = 12000 + rand()%6000;
+ }
+ }ShadowWordPain_Timer -=diff;
+
+ if(MindFlay_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ ChainMindFlay_Timer = 15000 + rand()%15000;
+ }ChainMindFlay_Timer -=diff;
+
+ if(GreaterHeal_Timer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature,SPELL_GREATERHEAL);
+ GreaterHeal_Timer = 25000 + rand()%10000;
+ }GreaterHeal_Timer -=diff;
+
+ if(SpawnFlyingBats_Timer < diff)
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(FlyingBat)
+ {
+ if(target)
+ FlyingBat->AI()->AttackStart(target);
+ }
+
+ SpawnFlyingBats_Timer = 10000 + rand()%5000;
+ }SpawnFlyingBats_Timer -=diff;
+ }
+ else
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15219);
+ DoResetThreat();
+ PhaseTwo = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+//Flying Bat
+struct TRINITY_DLL_DECL mob_batriderAI : public ScriptedAI
+{
+ mob_batriderAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint32 Bomb_Timer;
+ uint32 Check_Timer;
+
+ void Reset()
+ {
+ Bomb_Timer = 2000;
+ Check_Timer = 1000;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI (const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Bomb_Timer
+ if(Bomb_Timer < diff)
+ {
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoCast(target, SPELL_BOMB);
+ Bomb_Timer = 5000;
+ }
+ }else Bomb_Timer -= diff;
+
+ //Check_Timer
+ if(Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_JEKLIKISDEAD))
+ {
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->RemoveCorpse();
+ }
+ }
+
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_jeklik(Creature *_Creature)
+{
+ return new boss_jeklikAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_batrider(Creature *_Creature)
+{
+ return new mob_batriderAI (_Creature);
+}
+
+void AddSC_boss_jeklik()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_jeklik";
+ newscript->GetAI = GetAI_boss_jeklik;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_batrider";
+ newscript->GetAI = GetAI_mob_batrider;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
index 261d204a3f9..a5752845b92 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
@@ -1,272 +1,272 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Jin'do the Hexxer
-SD%Complete: 85
-SDComment: Mind Control not working because of core bug. Shades visible for all.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_BRAINWASHTOTEM 24262
-#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast.
-#define SPELL_HEX 24053
-#define SPELL_DELUSIONSOFJINDO 24306
-#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script.
-
-//Healing Ward Spell
-#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting...
-
-//Shade of Jindo Spell
-#define SPELL_SHADOWSHOCK 19460
-#define SPELL_INVISIBLE 24699
-
-#define SAY_AGGRO "Welcome to da great show friends! Step right up to die!"
-
-#define SOUND_AGGRO 8425
-
-struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
-{
- boss_jindoAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 BrainWashTotem_Timer;
- uint32 HealingWard_Timer;
- uint32 Hex_Timer;
- uint32 Delusions_Timer;
- uint32 Teleport_Timer;
-
- Creature *Shade;
- Creature *Skeletons;
- Creature *HealingWard;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- BrainWashTotem_Timer = 20000;
- HealingWard_Timer = 16000;
- Hex_Timer = 8000;
- Delusions_Timer = 10000;
- Teleport_Timer = 5000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //BrainWashTotem_Timer
- if (BrainWashTotem_Timer < diff)
- {
- DoCast(m_creature, SPELL_BRAINWASHTOTEM);
- BrainWashTotem_Timer = 18000 + rand()%8000;
- }else BrainWashTotem_Timer -= diff;
-
- //HealingWard_Timer
- if (HealingWard_Timer < diff)
- {
- //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD);
- HealingWard = m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
- HealingWard_Timer = 14000 + rand()%6000;
- }else HealingWard_Timer -= diff;
-
- //Hex_Timer
- if (Hex_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HEX);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
-
- Hex_Timer = 12000 + rand()%8000;
- }else Hex_Timer -= diff;
-
- //Casting the delusion curse with a shade. So shade will attack the same target with the curse.
- if (Delusions_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target, SPELL_DELUSIONSOFJINDO);
-
- Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Shade->AI()->AttackStart(target);
-
- Delusions_Timer = 4000 + rand()%8000;
- }else Delusions_Timer -= diff;
-
- //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
- if (Teleport_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoTeleportPlayer(target, -11583.7783,-1249.4278,77.5471,4.745);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(target,-100);
-
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Skeletons->AI()->AttackStart(target);
- }
-
- Teleport_Timer = 15000 + rand()%8000;
- }else Teleport_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Healing Ward
-struct TRINITY_DLL_DECL mob_healing_wardAI : public ScriptedAI
-{
- mob_healing_wardAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Heal_Timer;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Heal_Timer = 2000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- //Heal_Timer
- if(Heal_Timer < diff)
- {
- if(pInstance)
- {
- Unit *pJindo = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JINDO));
- DoCast(pJindo, SPELL_HEAL);
- }
- Heal_Timer = 3000;
- }else Heal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Shade of Jindo
-struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI
-{
- mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 ShadowShock_Timer;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- ShadowShock_Timer = 1000;
- m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
-
- //ShadowShock_Timer
- if(ShadowShock_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
- ShadowShock_Timer = 2000;
- }else ShadowShock_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_jindo(Creature *_Creature)
-{
- return new boss_jindoAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_healing_ward(Creature *_Creature)
-{
- return new mob_healing_wardAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_shade_of_jindo(Creature *_Creature)
-{
- return new mob_shade_of_jindoAI (_Creature);
-}
-
-void AddSC_boss_jindo()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_jindo";
- newscript->GetAI = GetAI_boss_jindo;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_healing_ward";
- newscript->GetAI = GetAI_mob_healing_ward;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_shade_of_jindo";
- newscript->GetAI = GetAI_mob_shade_of_jindo;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Jin'do the Hexxer
+SD%Complete: 85
+SDComment: Mind Control not working because of core bug. Shades visible for all.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_BRAINWASHTOTEM 24262
+#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast.
+#define SPELL_HEX 24053
+#define SPELL_DELUSIONSOFJINDO 24306
+#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script.
+
+//Healing Ward Spell
+#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting...
+
+//Shade of Jindo Spell
+#define SPELL_SHADOWSHOCK 19460
+#define SPELL_INVISIBLE 24699
+
+#define SAY_AGGRO "Welcome to da great show friends! Step right up to die!"
+
+#define SOUND_AGGRO 8425
+
+struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
+{
+ boss_jindoAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 BrainWashTotem_Timer;
+ uint32 HealingWard_Timer;
+ uint32 Hex_Timer;
+ uint32 Delusions_Timer;
+ uint32 Teleport_Timer;
+
+ Creature *Shade;
+ Creature *Skeletons;
+ Creature *HealingWard;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ BrainWashTotem_Timer = 20000;
+ HealingWard_Timer = 16000;
+ Hex_Timer = 8000;
+ Delusions_Timer = 10000;
+ Teleport_Timer = 5000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //BrainWashTotem_Timer
+ if (BrainWashTotem_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_BRAINWASHTOTEM);
+ BrainWashTotem_Timer = 18000 + rand()%8000;
+ }else BrainWashTotem_Timer -= diff;
+
+ //HealingWard_Timer
+ if (HealingWard_Timer < diff)
+ {
+ //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD);
+ HealingWard = m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
+ HealingWard_Timer = 14000 + rand()%6000;
+ }else HealingWard_Timer -= diff;
+
+ //Hex_Timer
+ if (Hex_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HEX);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
+
+ Hex_Timer = 12000 + rand()%8000;
+ }else Hex_Timer -= diff;
+
+ //Casting the delusion curse with a shade. So shade will attack the same target with the curse.
+ if (Delusions_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target, SPELL_DELUSIONSOFJINDO);
+
+ Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Shade->AI()->AttackStart(target);
+
+ Delusions_Timer = 4000 + rand()%8000;
+ }else Delusions_Timer -= diff;
+
+ //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
+ if (Teleport_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoTeleportPlayer(target, -11583.7783,-1249.4278,77.5471,4.745);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(target,-100);
+
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Skeletons->AI()->AttackStart(target);
+ }
+
+ Teleport_Timer = 15000 + rand()%8000;
+ }else Teleport_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Healing Ward
+struct TRINITY_DLL_DECL mob_healing_wardAI : public ScriptedAI
+{
+ mob_healing_wardAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Heal_Timer;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Heal_Timer = 2000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ //Heal_Timer
+ if(Heal_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *pJindo = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JINDO));
+ DoCast(pJindo, SPELL_HEAL);
+ }
+ Heal_Timer = 3000;
+ }else Heal_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Shade of Jindo
+struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI
+{
+ mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 ShadowShock_Timer;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ ShadowShock_Timer = 1000;
+ m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+
+ //ShadowShock_Timer
+ if(ShadowShock_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
+ ShadowShock_Timer = 2000;
+ }else ShadowShock_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_jindo(Creature *_Creature)
+{
+ return new boss_jindoAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_healing_ward(Creature *_Creature)
+{
+ return new mob_healing_wardAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_shade_of_jindo(Creature *_Creature)
+{
+ return new mob_shade_of_jindoAI (_Creature);
+}
+
+void AddSC_boss_jindo()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_jindo";
+ newscript->GetAI = GetAI_boss_jindo;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_healing_ward";
+ newscript->GetAI = GetAI_mob_healing_ward;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_shade_of_jindo";
+ newscript->GetAI = GetAI_mob_shade_of_jindo;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
index d3371b7712a..c9ba03a1d83 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
@@ -1,311 +1,311 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mandokir
-SD%Complete: 90
-SDComment: Ohgan function needs improvements.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_CHARGE 24315
-#define SPELL_CLEAVE 20691
-#define SPELL_FEAR 29321
-#define SPELL_WHIRLWIND 24236
-#define SPELL_MORTAL_STRIKE 24573
-#define SPELL_ENRAGE 23537
-#define SPELL_WATCH 24314
-#define SPELL_LEVEL_UP 24312
-
-//Ohgans Spells
-#define SPELL_SUNDERARMOR 24317
-
-#define SAY_AGGRO "I'll feed your souls to Hakkar himself!"
-#define SOUND_AGGRO 8413
-
-#define SAY_WATCH "I'm keeping my eye on you, $N!"
-#define SAY_KILL "DING!"
-
-struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI
-{
- boss_mandokirAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 Watch_Timer;
- uint32 TargetInRange;
- uint32 Cleave_Timer;
- uint32 Whirlwind_Timer;
- uint32 Fear_Timer;
- uint32 MortalStrike_Timer;
- uint32 Check_Timer;
- float targetX;
- float targetY;
- float targetZ;
-
- ScriptedInstance *pInstance;
-
- bool endWatch;
- bool someWatched;
- bool RaptorDead;
- bool CombatStart;
-
- uint64 WatchTarget;
-
- void Reset()
- {
- Watch_Timer = 33000;
- Cleave_Timer = 7000;
- Whirlwind_Timer = 20000;
- Fear_Timer = 1000;
- MortalStrike_Timer = 1000;
- Check_Timer = 1000;
-
- targetX = 0.0;
- targetY = 0.0;
- targetZ = 0.0;
- TargetInRange = 0;
-
- WatchTarget = 0;
-
- someWatched = false;
- endWatch = false;
- RaptorDead = false;
- CombatStart = false;
-
- DoCast(m_creature, 23243);
- }
-
- void KilledUnit(Unit* victim)
- {
- if(victim->GetTypeId() == TYPEID_PLAYER)
- {
- DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
- DoCast(m_creature, SPELL_LEVEL_UP, true);
- }
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
- if(!CombatStart)
- {
- //At combat Start Mandokir is mounted so we must unmount it first
- m_creature->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);
- CombatStart = true;
- }
-
- if (Watch_Timer < diff) //Every 20 Sec Mandokir will check this
- {
- 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);
-
- if( pUnit && (
- targetX != pUnit->GetPositionX() ||
- targetY != pUnit->GetPositionY() ||
- targetZ != pUnit->GetPositionZ() ||
- pUnit->isInCombat()))
- {
- if(m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
- {
- DoCast(pUnit,24316);
- }
- else
- {
- DoCast(pUnit,SPELL_CHARGE);
- m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
- DoStartAttackAndMovement(pUnit);
- }
- }
- }
- someWatched = false;
- Watch_Timer = 20000;
- }else Watch_Timer -= diff;
-
- if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target
- {
- Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(p)
- {
- DoYell(SAY_WATCH, LANG_UNIVERSAL, p);
- DoCast(p, SPELL_WATCH);
- WatchTarget = p->GetGUID();
- someWatched = true;
- endWatch = true;
- }
- }
-
- if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
- {
- Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget);
- if (pUnit)
- {
- targetX = pUnit->GetPositionX();
- targetY = pUnit->GetPositionY();
- targetZ = pUnit->GetPositionZ();
- }
- endWatch = false;
- }
-
- if(!someWatched)
- {
- //Cleave
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //Whirlwind
- if (Whirlwind_Timer < diff)
- {
- DoCast(m_creature,SPELL_WHIRLWIND);
- Whirlwind_Timer = 18000;
- }else Whirlwind_Timer -= diff;
-
- //If more then 3 targets in melee range mandokir will cast fear
- if (Fear_Timer < diff)
- {
- TargetInRange = 0;
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for(; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid());
- if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
- TargetInRange++;
- }
-
- if(TargetInRange > 3)
- DoCast(m_creature->getVictim(),SPELL_FEAR);
-
- Fear_Timer = 4000;
- }else Fear_Timer -=diff;
-
- //Mortal Strike if target below 50% hp
- if (m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5)
- {
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE);
- MortalStrike_Timer = 15000;
- }else MortalStrike_Timer -= diff;
- }
- }
- //Checking if Ohgan is dead. If yes Mandokir will enrage.
- if(Check_Timer < diff)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_OHGANISDEAD))
- {
- if (!RaptorDead)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- RaptorDead = true;
- }
- }
- }
-
- Check_Timer = 1000;
- }else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-//Ohgan
-struct TRINITY_DLL_DECL mob_ohganAI : public ScriptedAI
-{
- mob_ohganAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- uint32 SunderArmor_Timer;
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- SunderArmor_Timer = 5000;
- }
-
- void Aggro(Unit *who) {}
-
- void JustDied(Unit* Killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_OHGAN_DEATH, 0);
- }
-
- void UpdateAI (const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SunderArmor_Timer
- if(SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR);
- SunderArmor_Timer = 10000 + rand()%5000;
- }else SunderArmor_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_mandokir(Creature *_Creature)
-{
- return new boss_mandokirAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_ohgan(Creature *_Creature)
-{
- return new mob_ohganAI (_Creature);
-}
-
-void AddSC_boss_mandokir()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_mandokir";
- newscript->GetAI = GetAI_boss_mandokir;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ohgan";
- newscript->GetAI = GetAI_mob_ohgan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mandokir
+SD%Complete: 90
+SDComment: Ohgan function needs improvements.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_CHARGE 24315
+#define SPELL_CLEAVE 20691
+#define SPELL_FEAR 29321
+#define SPELL_WHIRLWIND 24236
+#define SPELL_MORTAL_STRIKE 24573
+#define SPELL_ENRAGE 23537
+#define SPELL_WATCH 24314
+#define SPELL_LEVEL_UP 24312
+
+//Ohgans Spells
+#define SPELL_SUNDERARMOR 24317
+
+#define SAY_AGGRO "I'll feed your souls to Hakkar himself!"
+#define SOUND_AGGRO 8413
+
+#define SAY_WATCH "I'm keeping my eye on you, $N!"
+#define SAY_KILL "DING!"
+
+struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI
+{
+ boss_mandokirAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 Watch_Timer;
+ uint32 TargetInRange;
+ uint32 Cleave_Timer;
+ uint32 Whirlwind_Timer;
+ uint32 Fear_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 Check_Timer;
+ float targetX;
+ float targetY;
+ float targetZ;
+
+ ScriptedInstance *pInstance;
+
+ bool endWatch;
+ bool someWatched;
+ bool RaptorDead;
+ bool CombatStart;
+
+ uint64 WatchTarget;
+
+ void Reset()
+ {
+ Watch_Timer = 33000;
+ Cleave_Timer = 7000;
+ Whirlwind_Timer = 20000;
+ Fear_Timer = 1000;
+ MortalStrike_Timer = 1000;
+ Check_Timer = 1000;
+
+ targetX = 0.0;
+ targetY = 0.0;
+ targetZ = 0.0;
+ TargetInRange = 0;
+
+ WatchTarget = 0;
+
+ someWatched = false;
+ endWatch = false;
+ RaptorDead = false;
+ CombatStart = false;
+
+ DoCast(m_creature, 23243);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if(victim->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
+ DoCast(m_creature, SPELL_LEVEL_UP, true);
+ }
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+ if(!CombatStart)
+ {
+ //At combat Start Mandokir is mounted so we must unmount it first
+ m_creature->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);
+ CombatStart = true;
+ }
+
+ if (Watch_Timer < diff) //Every 20 Sec Mandokir will check this
+ {
+ 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);
+
+ if( pUnit && (
+ targetX != pUnit->GetPositionX() ||
+ targetY != pUnit->GetPositionY() ||
+ targetZ != pUnit->GetPositionZ() ||
+ pUnit->isInCombat()))
+ {
+ if(m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
+ {
+ DoCast(pUnit,24316);
+ }
+ else
+ {
+ DoCast(pUnit,SPELL_CHARGE);
+ m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
+ DoStartAttackAndMovement(pUnit);
+ }
+ }
+ }
+ someWatched = false;
+ Watch_Timer = 20000;
+ }else Watch_Timer -= diff;
+
+ if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target
+ {
+ Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(p)
+ {
+ DoYell(SAY_WATCH, LANG_UNIVERSAL, p);
+ DoCast(p, SPELL_WATCH);
+ WatchTarget = p->GetGUID();
+ someWatched = true;
+ endWatch = true;
+ }
+ }
+
+ if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
+ {
+ Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget);
+ if (pUnit)
+ {
+ targetX = pUnit->GetPositionX();
+ targetY = pUnit->GetPositionY();
+ targetZ = pUnit->GetPositionZ();
+ }
+ endWatch = false;
+ }
+
+ if(!someWatched)
+ {
+ //Cleave
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //Whirlwind
+ if (Whirlwind_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_WHIRLWIND);
+ Whirlwind_Timer = 18000;
+ }else Whirlwind_Timer -= diff;
+
+ //If more then 3 targets in melee range mandokir will cast fear
+ if (Fear_Timer < diff)
+ {
+ TargetInRange = 0;
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for(; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid());
+ if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
+ TargetInRange++;
+ }
+
+ if(TargetInRange > 3)
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+
+ Fear_Timer = 4000;
+ }else Fear_Timer -=diff;
+
+ //Mortal Strike if target below 50% hp
+ if (m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5)
+ {
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE);
+ MortalStrike_Timer = 15000;
+ }else MortalStrike_Timer -= diff;
+ }
+ }
+ //Checking if Ohgan is dead. If yes Mandokir will enrage.
+ if(Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_OHGANISDEAD))
+ {
+ if (!RaptorDead)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ RaptorDead = true;
+ }
+ }
+ }
+
+ Check_Timer = 1000;
+ }else Check_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+//Ohgan
+struct TRINITY_DLL_DECL mob_ohganAI : public ScriptedAI
+{
+ mob_ohganAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ uint32 SunderArmor_Timer;
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ SunderArmor_Timer = 5000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void JustDied(Unit* Killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_OHGAN_DEATH, 0);
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SunderArmor_Timer
+ if(SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 10000 + rand()%5000;
+ }else SunderArmor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_mandokir(Creature *_Creature)
+{
+ return new boss_mandokirAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_ohgan(Creature *_Creature)
+{
+ return new mob_ohganAI (_Creature);
+}
+
+void AddSC_boss_mandokir()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_mandokir";
+ newscript->GetAI = GetAI_boss_mandokir;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ohgan";
+ newscript->GetAI = GetAI_mob_ohgan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
index 3f3bb587eb6..6330e49dde6 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
@@ -1,251 +1,251 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Marli
-SD%Complete: 80
-SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_CHARGE 22911
-#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell
-#define SPELL_ENVOLWINGWEB 24110
-#define SPELL_POISONVOLLEY 24099
-#define SPELL_SPIDER_FORM 24084
-
-//The Spider Spells
-#define SPELL_LEVELUP 24312 //Not right Spell.
-
-#define SAY_AGGRO "Draw me to your web mistress Shadra. Unleash your venom!"
-#define SOUND_AGGRO 8418
-
-#define SAY_DEATH "ShadraDeath - Bless you mortal for this release. Hakkar controls me no longer..."
-#define SOUND_DEATH 8423
-
-struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI
-{
- boss_marliAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SpawnStartSpiders_Timer;
- uint32 PoisonVolley_Timer;
- uint32 SpawnSpider_Timer;
- uint32 Charge_Timer;
- uint32 Aspect_Timer;
- uint32 Transform_Timer;
- uint32 TransformBack_Timer;
-
- Creature *Spider;
- bool Spawned;
- bool PhaseTwo;
-
- void Reset()
- {
- SpawnStartSpiders_Timer = 1000;
- PoisonVolley_Timer = 15000;
- SpawnSpider_Timer = 30000;
- Charge_Timer = 1500;
- Aspect_Timer = 12000;
- Transform_Timer = 45000;
- TransformBack_Timer = 25000;
-
- Spawned = false;
- PhaseTwo = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- pInstance->SetData(DATA_MARLI_DEATH, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
- if (PoisonVolley_Timer < diff)
- {
- DoCast(m_creature->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);
- Aspect_Timer = 13000 + rand()%5000;
- }else Aspect_Timer -= diff;
-
- if (!Spawned && SpawnStartSpiders_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Spider ) { Spider ->AI()->AttackStart(target); }
- Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Spider ) { Spider ->AI()->AttackStart(target); }
- Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Spider ) { Spider ->AI()->AttackStart(target); }
- Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Spider ) { Spider ->AI()->AttackStart(target); }
-
- Spawned = true;
- }else SpawnStartSpiders_Timer -= diff;
-
- if (SpawnSpider_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(target && Spider ) { Spider ->AI()->AttackStart(target); }
-
- SpawnSpider_Timer = 12000 + rand()%5000;
- }else SpawnSpider_Timer -= diff;
-
- if(!PhaseTwo && Transform_Timer < diff)
- {
- 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);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
-
- PhaseTwo = true;
- Transform_Timer = 35000 + rand()%25000;
- }else Transform_Timer -= diff;
-
- if (PhaseTwo)
- {
- if (Charge_Timer < diff)
- {
- Unit* target = NULL;
- int i = 0 ;
- while (i < 3) // max 3 tries to get a random target with power_mana
- {
- ++i; //not aggro leader
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- if (target->getPowerType() == POWER_MANA)
- i=3;
- }
- if (target)
- DoCast(target, SPELL_CHARGE);
- // m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- // m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
- DoStartAttackAndMovement(target);
-
- Charge_Timer = 8000;
- }else Charge_Timer -= diff;
-
- if (TransformBack_Timer < diff)
- {
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,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);
-
- PhaseTwo = false;
- TransformBack_Timer = 25000 + rand()%15000;
- }else TransformBack_Timer -= diff;
-
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-//Spawn of Marli
-struct TRINITY_DLL_DECL mob_spawn_of_marliAI : public ScriptedAI
-{
- mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 LevelUp_Timer;
-
- void Reset()
- {
- LevelUp_Timer = 3000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //LevelUp_Timer
- if(LevelUp_Timer < diff)
- {
- DoCast(m_creature,SPELL_LEVELUP);
- LevelUp_Timer = 3000;
- }else LevelUp_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_marli(Creature *_Creature)
-{
- return new boss_marliAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_spawn_of_marli(Creature *_Creature)
-{
- return new mob_spawn_of_marliAI (_Creature);
-}
-
-void AddSC_boss_marli()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_marli";
- newscript->GetAI = GetAI_boss_marli;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_spawn_of_marli";
- newscript->GetAI = GetAI_mob_spawn_of_marli;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Marli
+SD%Complete: 80
+SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_CHARGE 22911
+#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell
+#define SPELL_ENVOLWINGWEB 24110
+#define SPELL_POISONVOLLEY 24099
+#define SPELL_SPIDER_FORM 24084
+
+//The Spider Spells
+#define SPELL_LEVELUP 24312 //Not right Spell.
+
+#define SAY_AGGRO "Draw me to your web mistress Shadra. Unleash your venom!"
+#define SOUND_AGGRO 8418
+
+#define SAY_DEATH "ShadraDeath - Bless you mortal for this release. Hakkar controls me no longer..."
+#define SOUND_DEATH 8423
+
+struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI
+{
+ boss_marliAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SpawnStartSpiders_Timer;
+ uint32 PoisonVolley_Timer;
+ uint32 SpawnSpider_Timer;
+ uint32 Charge_Timer;
+ uint32 Aspect_Timer;
+ uint32 Transform_Timer;
+ uint32 TransformBack_Timer;
+
+ Creature *Spider;
+ bool Spawned;
+ bool PhaseTwo;
+
+ void Reset()
+ {
+ SpawnStartSpiders_Timer = 1000;
+ PoisonVolley_Timer = 15000;
+ SpawnSpider_Timer = 30000;
+ Charge_Timer = 1500;
+ Aspect_Timer = 12000;
+ Transform_Timer = 45000;
+ TransformBack_Timer = 25000;
+
+ Spawned = false;
+ PhaseTwo = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ pInstance->SetData(DATA_MARLI_DEATH, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+ if (PoisonVolley_Timer < diff)
+ {
+ DoCast(m_creature->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);
+ Aspect_Timer = 13000 + rand()%5000;
+ }else Aspect_Timer -= diff;
+
+ if (!Spawned && SpawnStartSpiders_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Spider ) { Spider ->AI()->AttackStart(target); }
+ Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Spider ) { Spider ->AI()->AttackStart(target); }
+ Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Spider ) { Spider ->AI()->AttackStart(target); }
+ Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Spider ) { Spider ->AI()->AttackStart(target); }
+
+ Spawned = true;
+ }else SpawnStartSpiders_Timer -= diff;
+
+ if (SpawnSpider_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(target && Spider ) { Spider ->AI()->AttackStart(target); }
+
+ SpawnSpider_Timer = 12000 + rand()%5000;
+ }else SpawnSpider_Timer -= diff;
+
+ if(!PhaseTwo && Transform_Timer < diff)
+ {
+ 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);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
+
+ PhaseTwo = true;
+ Transform_Timer = 35000 + rand()%25000;
+ }else Transform_Timer -= diff;
+
+ if (PhaseTwo)
+ {
+ if (Charge_Timer < diff)
+ {
+ Unit* target = NULL;
+ int i = 0 ;
+ while (i < 3) // max 3 tries to get a random target with power_mana
+ {
+ ++i; //not aggro leader
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ if (target->getPowerType() == POWER_MANA)
+ i=3;
+ }
+ if (target)
+ DoCast(target, SPELL_CHARGE);
+ // m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ // m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+ DoStartAttackAndMovement(target);
+
+ Charge_Timer = 8000;
+ }else Charge_Timer -= diff;
+
+ if (TransformBack_Timer < diff)
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,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);
+
+ PhaseTwo = false;
+ TransformBack_Timer = 25000 + rand()%15000;
+ }else TransformBack_Timer -= diff;
+
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+//Spawn of Marli
+struct TRINITY_DLL_DECL mob_spawn_of_marliAI : public ScriptedAI
+{
+ mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 LevelUp_Timer;
+
+ void Reset()
+ {
+ LevelUp_Timer = 3000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //LevelUp_Timer
+ if(LevelUp_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_LEVELUP);
+ LevelUp_Timer = 3000;
+ }else LevelUp_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_marli(Creature *_Creature)
+{
+ return new boss_marliAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_spawn_of_marli(Creature *_Creature)
+{
+ return new mob_spawn_of_marliAI (_Creature);
+}
+
+void AddSC_boss_marli()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_marli";
+ newscript->GetAI = GetAI_boss_marli;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_spawn_of_marli";
+ newscript->GetAI = GetAI_mob_spawn_of_marli;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
index 8e2824f1f5e..75b82ab9912 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
@@ -1,151 +1,151 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Renataki
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_AMBUSH 24337
-#define SPELL_THOUSANDBLADES 24649
-
-struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI
-{
- boss_renatakiAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Invisible_Timer;
- uint32 Ambush_Timer;
- uint32 Visible_Timer;
- uint32 Aggro_Timer;
- uint32 ThousandBlades_Timer;
-
- bool Invisible;
- bool Ambushed;
-
- void Reset()
- {
- Invisible_Timer = 8000 + rand()%10000;
- Ambush_Timer = 3000;
- Visible_Timer = 4000;
- Aggro_Timer = 15000 + rand()%10000;
- ThousandBlades_Timer = 4000 + rand()%4000;
-
- Invisible = false;
- Ambushed = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Invisible_Timer
- if (Invisible_Timer < diff)
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
- Invisible = true;
-
- Invisible_Timer = 15000 + rand()%15000;
- }else Invisible_Timer -= diff;
-
- if (Invisible)
- {
- if (Ambush_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- {
- m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
- DoCast(target,SPELL_AMBUSH);
- }
-
- Ambushed = true;
- Ambush_Timer = 3000;
- }else Ambush_Timer -= diff;
- }
-
- if (Ambushed)
- {
- if (Visible_Timer < diff)
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15268);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 31818);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Invisible = false;
-
- Visible_Timer = 4000;
- }else Visible_Timer -= diff;
- }
-
- //Resetting some aggro so he attacks other gamers
- if(!Invisible)
- if (Aggro_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
-
- if (target)
- DoStartAttackAndMovement(target);
-
- Aggro_Timer = 7000 + rand()%13000;
- }else Aggro_Timer -= diff;
-
- if (!Invisible)
- if(ThousandBlades_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_THOUSANDBLADES);
- ThousandBlades_Timer = 7000 + rand()%5000;
- }else ThousandBlades_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_renataki(Creature *_Creature)
-{
- return new boss_renatakiAI (_Creature);
-}
-
-void AddSC_boss_renataki()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_renataki";
- newscript->GetAI = GetAI_boss_renataki;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Renataki
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_AMBUSH 24337
+#define SPELL_THOUSANDBLADES 24649
+
+struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI
+{
+ boss_renatakiAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Invisible_Timer;
+ uint32 Ambush_Timer;
+ uint32 Visible_Timer;
+ uint32 Aggro_Timer;
+ uint32 ThousandBlades_Timer;
+
+ bool Invisible;
+ bool Ambushed;
+
+ void Reset()
+ {
+ Invisible_Timer = 8000 + rand()%10000;
+ Ambush_Timer = 3000;
+ Visible_Timer = 4000;
+ Aggro_Timer = 15000 + rand()%10000;
+ ThousandBlades_Timer = 4000 + rand()%4000;
+
+ Invisible = false;
+ Ambushed = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Invisible_Timer
+ if (Invisible_Timer < diff)
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
+ Invisible = true;
+
+ Invisible_Timer = 15000 + rand()%15000;
+ }else Invisible_Timer -= diff;
+
+ if (Invisible)
+ {
+ if (Ambush_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ {
+ m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+ DoCast(target,SPELL_AMBUSH);
+ }
+
+ Ambushed = true;
+ Ambush_Timer = 3000;
+ }else Ambush_Timer -= diff;
+ }
+
+ if (Ambushed)
+ {
+ if (Visible_Timer < diff)
+ {
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15268);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 31818);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Invisible = false;
+
+ Visible_Timer = 4000;
+ }else Visible_Timer -= diff;
+ }
+
+ //Resetting some aggro so he attacks other gamers
+ if(!Invisible)
+ if (Aggro_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+
+ if (target)
+ DoStartAttackAndMovement(target);
+
+ Aggro_Timer = 7000 + rand()%13000;
+ }else Aggro_Timer -= diff;
+
+ if (!Invisible)
+ if(ThousandBlades_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_THOUSANDBLADES);
+ ThousandBlades_Timer = 7000 + rand()%5000;
+ }else ThousandBlades_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_renataki(Creature *_Creature)
+{
+ return new boss_renatakiAI (_Creature);
+}
+
+void AddSC_boss_renataki()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_renataki";
+ newscript->GetAI = GetAI_boss_renataki;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
index eaa824543c7..26ecadadfd4 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
@@ -1,545 +1,545 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Thekal
-SD%Complete: 95
-SDComment: Almost finished.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_MORTALCLEAVE 22859
-#define SPELL_SILENCE 23207
-#define SPELL_FRENZY 23342
-#define SPELL_FORCEPUNCH 24189
-#define SPELL_CHARGE 24408
-#define SPELL_ENRAGE 23537
-#define SPELL_SUMMONTIGERS 24183
-#define SPELL_TIGER_FORM 24169
-#define SPELL_RESURRECT 24173 //We will not use this spell.
-
-//Zealot Lor'Khan Spells
-#define SPELL_SHIELD 25020
-#define SPELL_BLOODLUST 24185
-#define SPELL_GREATERHEAL 24208
-#define SPELL_DISARM 22691
-
-//Zealot Lor'Khan Spells
-#define SPELL_SWEEPINGSTRIKES 18765
-#define SPELL_SINISTERSTRIKE 15667
-#define SPELL_GOUGE 24698
-#define SPELL_KICK 15614
-#define SPELL_BLIND 21060
-
-#define SAY_AGGRO "Shirvallah fill me with your rage!"
-#define SOUND_AGGRO 8419
-
-#define SAY_DEATH "Hakkar binds me no more. Peace at last."
-#define SOUND_DEATH 8424
-
-struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
-{
- boss_thekalAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 MortalCleave_Timer;
- uint32 Silence_Timer;
- uint32 Frenzy_Timer;
- uint32 ForcePunch_Timer;
- uint32 Charge_Timer;
- uint32 Enrage_Timer;
- uint32 SummonTigers_Timer;
- uint32 Check_Timer;
- uint32 Resurrect_Timer;
-
- ScriptedInstance *pInstance;
- bool Enraged;
- bool PhaseTwo;
- bool WasDead;
-
- void Reset()
- {
- MortalCleave_Timer = 4000;
- Silence_Timer = 9000;
- Frenzy_Timer = 30000;
- ForcePunch_Timer = 4000;
- Charge_Timer = 12000;
- Enrage_Timer = 32000;
- SummonTigers_Timer = 25000;
- Check_Timer = 10000;
- Resurrect_Timer = 10000;
-
- Enraged = false;
- PhaseTwo = false;
- WasDead = false;
-
- if(pInstance)
- pInstance->SetData(DATA_THEKAL_ALIVE, 0);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- pInstance->SetData(DATA_THEKAL_DEATH, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
-
- //Check_Timer for the death of LorKhan and Zath.
- if(!WasDead && Check_Timer < diff)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_LORKHANISDEAD))
- {
- //Resurrect LorKhan
- Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->setFaction(14);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
- }
-
- if(pInstance->GetData(DATA_ZATHISDEAD))
- {
- //Resurrect Zath
- Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->setFaction(14);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
- }
- }
-
- Check_Timer = 5000;
- }else Check_Timer -= diff;
-
- if (!PhaseTwo && MortalCleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALCLEAVE);
- MortalCleave_Timer = 15000 + rand()%5000;
- }else MortalCleave_Timer -= diff;
-
- if (!PhaseTwo && Silence_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SILENCE);
- Silence_Timer = 20000 + rand()%5000;
- }else Silence_Timer -= diff;
-
- if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
- m_creature->AttackStop();
-
- if(pInstance)
- pInstance->SetData(DATA_THEKALFAKE_DEATH, 0);
-
- WasDead=true;
- }
-
- //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
- if(!PhaseTwo && WasDead)
- {
- if (Resurrect_Timer < diff)
- {
- DoCast(m_creature,SPELL_TIGER_FORM);
- m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->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);
- DoResetThreat();
- PhaseTwo = true;
- }else Resurrect_Timer -= diff;
- }
-
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead)
- {
- WasDead = false;
- }
-
- if (PhaseTwo)
- {
- if (Charge_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_CHARGE);
- m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
- DoStartAttackAndMovement(target);
- DoResetThreat();
-
- Charge_Timer = 15000 + rand()%7000;
- }else Charge_Timer -= diff;
-
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- Frenzy_Timer = 30000;
- }else Frenzy_Timer -= diff;
-
- if (ForcePunch_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SILENCE);
- ForcePunch_Timer = 16000 + rand()%5000;
- }else ForcePunch_Timer -= diff;
-
- if (SummonTigers_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUMMONTIGERS);
- SummonTigers_Timer = 10000 + rand()%4000;
- }else SummonTigers_Timer -= diff;
-
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-//Zealot Lor'Khan
-struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
-{
- mob_zealot_lorkhanAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 Shield_Timer;
- uint32 BloodLust_Timer;
- uint32 GreaterHeal_Timer;
- uint32 Disarm_Timer;
- uint32 Check_Timer;
-
- bool FakeDeath;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- Shield_Timer = 1000;
- BloodLust_Timer = 16000;
- GreaterHeal_Timer = 32000;
- Disarm_Timer = 6000;
- Check_Timer = 10000;
-
- FakeDeath = false;
-
- if(pInstance)
- pInstance->SetData(DATA_LORKHAN_ALIVE, 0);
-
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shield_Timer
- if(Shield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELD);
- Shield_Timer = 61000;
- }else Shield_Timer -= diff;
-
- //BloodLust_Timer
- if(BloodLust_Timer < diff)
- {
- DoCast(m_creature,SPELL_BLOODLUST);
- BloodLust_Timer = 20000+rand()%8000;
- }else BloodLust_Timer -= diff;
-
- //Casting Greaterheal to Thekal or Zath if they are in meele range.
- if(GreaterHeal_Timer < diff)
- {
- if(pInstance)
- {
- Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
- Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
-
- switch(rand()%2)
- {
- case 0:
- if(m_creature->IsWithinDistInMap(pThekal, ATTACK_DISTANCE))
- DoCast(pThekal, SPELL_GREATERHEAL);
- break;
- case 1:
- if(m_creature->IsWithinDistInMap(pZath, ATTACK_DISTANCE))
- DoCast(pZath, SPELL_GREATERHEAL);
- break;
- }
- }
-
- GreaterHeal_Timer = 15000+rand()%5000;
- }else GreaterHeal_Timer -= diff;
-
- //Disarm_Timer
- if(Disarm_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_DISARM);
- Disarm_Timer = 15000+rand()%10000;
- }else Disarm_Timer -= diff;
-
- //Check_Timer for the death of LorKhan and Zath.
- if(!FakeDeath && Check_Timer < diff)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
- {
- //Resurrect Thekal
- Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
- }
-
- if(pInstance->GetData(DATA_ZATHISDEAD))
- {
- //Resurrect Zath
- Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->setFaction(14);
- pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
- }
- }
-
- Check_Timer = 5000;
- }else Check_Timer -= diff;
-
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
- m_creature->setFaction(35);
- m_creature->AttackStop();
-
- if(pInstance)
- pInstance->SetData(DATA_LORKHAN_DEATH, 0);
-
- FakeDeath = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-//Zealot Zath
-struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
-{
- mob_zealot_zathAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
- Reset();
- }
-
- uint32 SweepingStrikes_Timer;
- uint32 SinisterStrike_Timer;
- uint32 Gouge_Timer;
- uint32 Kick_Timer;
- uint32 Blind_Timer;
- uint32 Check_Timer;
-
- bool FakeDeath;
-
- ScriptedInstance *pInstance;
-
- void Reset()
- {
- SweepingStrikes_Timer = 13000;
- SinisterStrike_Timer = 8000;
- Gouge_Timer = 25000;
- Kick_Timer = 18000;
- Blind_Timer = 5000;
- Check_Timer = 10000;
-
- FakeDeath = false;
-
- if(pInstance)
- pInstance->SetData(DATA_ZATH_ALIVE, 0);
-
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SweepingStrikes_Timer
- if(SweepingStrikes_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SWEEPINGSTRIKES);
- SweepingStrikes_Timer = 22000+rand()%4000;
- }else SweepingStrikes_Timer -= diff;
-
- //SinisterStrike_Timer
- if(SinisterStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
- SinisterStrike_Timer = 8000+rand()%8000;
- }else SinisterStrike_Timer -= diff;
-
- //Gouge_Timer
- if(Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GOUGE);
-
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
-
- Gouge_Timer = 17000+rand()%10000;
- }else Gouge_Timer -= diff;
-
- //Kick_Timer
- if(Kick_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KICK);
- Kick_Timer = 15000+rand()%10000;
- }else Kick_Timer -= diff;
-
- //Blind_Timer
- if(Blind_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLIND);
- Blind_Timer = 10000+rand()%10000;
- }else Blind_Timer -= diff;
-
- //Check_Timer for the death of LorKhan and Zath.
- if(!FakeDeath && Check_Timer < diff)
- {
- if(pInstance)
- {
- if(pInstance->GetData(DATA_LORKHANISDEAD))
- {
- //Resurrect LorKhan
- Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->setFaction(14);
- pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
- }
-
- if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
- {
- //Resurrect Thekal
- Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
- }
- }
-
- Check_Timer = 5000;
- }else Check_Timer -= diff;
-
- if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
- m_creature->setFaction(35);
- m_creature->AttackStop();
-
- if(pInstance)
- pInstance->SetData(DATA_ZATH_DEATH, 0);
-
- FakeDeath = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_thekal(Creature *_Creature)
-{
- return new boss_thekalAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_zealot_lorkhan(Creature *_Creature)
-{
- return new mob_zealot_lorkhanAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_zealot_zath(Creature *_Creature)
-{
- return new mob_zealot_zathAI (_Creature);
-}
-
-void AddSC_boss_thekal()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_thekal";
- newscript->GetAI = GetAI_boss_thekal;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_zealot_lorkhan";
- newscript->GetAI = GetAI_mob_zealot_lorkhan;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_zealot_zath";
- newscript->GetAI = GetAI_mob_zealot_zath;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Thekal
+SD%Complete: 95
+SDComment: Almost finished.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_MORTALCLEAVE 22859
+#define SPELL_SILENCE 23207
+#define SPELL_FRENZY 23342
+#define SPELL_FORCEPUNCH 24189
+#define SPELL_CHARGE 24408
+#define SPELL_ENRAGE 23537
+#define SPELL_SUMMONTIGERS 24183
+#define SPELL_TIGER_FORM 24169
+#define SPELL_RESURRECT 24173 //We will not use this spell.
+
+//Zealot Lor'Khan Spells
+#define SPELL_SHIELD 25020
+#define SPELL_BLOODLUST 24185
+#define SPELL_GREATERHEAL 24208
+#define SPELL_DISARM 22691
+
+//Zealot Lor'Khan Spells
+#define SPELL_SWEEPINGSTRIKES 18765
+#define SPELL_SINISTERSTRIKE 15667
+#define SPELL_GOUGE 24698
+#define SPELL_KICK 15614
+#define SPELL_BLIND 21060
+
+#define SAY_AGGRO "Shirvallah fill me with your rage!"
+#define SOUND_AGGRO 8419
+
+#define SAY_DEATH "Hakkar binds me no more. Peace at last."
+#define SOUND_DEATH 8424
+
+struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
+{
+ boss_thekalAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 MortalCleave_Timer;
+ uint32 Silence_Timer;
+ uint32 Frenzy_Timer;
+ uint32 ForcePunch_Timer;
+ uint32 Charge_Timer;
+ uint32 Enrage_Timer;
+ uint32 SummonTigers_Timer;
+ uint32 Check_Timer;
+ uint32 Resurrect_Timer;
+
+ ScriptedInstance *pInstance;
+ bool Enraged;
+ bool PhaseTwo;
+ bool WasDead;
+
+ void Reset()
+ {
+ MortalCleave_Timer = 4000;
+ Silence_Timer = 9000;
+ Frenzy_Timer = 30000;
+ ForcePunch_Timer = 4000;
+ Charge_Timer = 12000;
+ Enrage_Timer = 32000;
+ SummonTigers_Timer = 25000;
+ Check_Timer = 10000;
+ Resurrect_Timer = 10000;
+
+ Enraged = false;
+ PhaseTwo = false;
+ WasDead = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_THEKAL_ALIVE, 0);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ pInstance->SetData(DATA_THEKAL_DEATH, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+
+ //Check_Timer for the death of LorKhan and Zath.
+ if(!WasDead && Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_LORKHANISDEAD))
+ {
+ //Resurrect LorKhan
+ Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
+ pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->setFaction(14);
+ pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
+ }
+
+ if(pInstance->GetData(DATA_ZATHISDEAD))
+ {
+ //Resurrect Zath
+ Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
+ pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->setFaction(14);
+ pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
+ }
+ }
+
+ Check_Timer = 5000;
+ }else Check_Timer -= diff;
+
+ if (!PhaseTwo && MortalCleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALCLEAVE);
+ MortalCleave_Timer = 15000 + rand()%5000;
+ }else MortalCleave_Timer -= diff;
+
+ if (!PhaseTwo && Silence_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SILENCE);
+ Silence_Timer = 20000 + rand()%5000;
+ }else Silence_Timer -= diff;
+
+ if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->AttackStop();
+
+ if(pInstance)
+ pInstance->SetData(DATA_THEKALFAKE_DEATH, 0);
+
+ WasDead=true;
+ }
+
+ //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
+ if(!PhaseTwo && WasDead)
+ {
+ if (Resurrect_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_TIGER_FORM);
+ m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->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);
+ DoResetThreat();
+ PhaseTwo = true;
+ }else Resurrect_Timer -= diff;
+ }
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead)
+ {
+ WasDead = false;
+ }
+
+ if (PhaseTwo)
+ {
+ if (Charge_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(target,SPELL_CHARGE);
+ m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
+ DoStartAttackAndMovement(target);
+ DoResetThreat();
+
+ Charge_Timer = 15000 + rand()%7000;
+ }else Charge_Timer -= diff;
+
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ Frenzy_Timer = 30000;
+ }else Frenzy_Timer -= diff;
+
+ if (ForcePunch_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SILENCE);
+ ForcePunch_Timer = 16000 + rand()%5000;
+ }else ForcePunch_Timer -= diff;
+
+ if (SummonTigers_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUMMONTIGERS);
+ SummonTigers_Timer = 10000 + rand()%4000;
+ }else SummonTigers_Timer -= diff;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enraged = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+//Zealot Lor'Khan
+struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
+{
+ mob_zealot_lorkhanAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 Shield_Timer;
+ uint32 BloodLust_Timer;
+ uint32 GreaterHeal_Timer;
+ uint32 Disarm_Timer;
+ uint32 Check_Timer;
+
+ bool FakeDeath;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ Shield_Timer = 1000;
+ BloodLust_Timer = 16000;
+ GreaterHeal_Timer = 32000;
+ Disarm_Timer = 6000;
+ Check_Timer = 10000;
+
+ FakeDeath = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_LORKHAN_ALIVE, 0);
+
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shield_Timer
+ if(Shield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELD);
+ Shield_Timer = 61000;
+ }else Shield_Timer -= diff;
+
+ //BloodLust_Timer
+ if(BloodLust_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BLOODLUST);
+ BloodLust_Timer = 20000+rand()%8000;
+ }else BloodLust_Timer -= diff;
+
+ //Casting Greaterheal to Thekal or Zath if they are in meele range.
+ if(GreaterHeal_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
+ Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
+
+ switch(rand()%2)
+ {
+ case 0:
+ if(m_creature->IsWithinDistInMap(pThekal, ATTACK_DISTANCE))
+ DoCast(pThekal, SPELL_GREATERHEAL);
+ break;
+ case 1:
+ if(m_creature->IsWithinDistInMap(pZath, ATTACK_DISTANCE))
+ DoCast(pZath, SPELL_GREATERHEAL);
+ break;
+ }
+ }
+
+ GreaterHeal_Timer = 15000+rand()%5000;
+ }else GreaterHeal_Timer -= diff;
+
+ //Disarm_Timer
+ if(Disarm_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DISARM);
+ Disarm_Timer = 15000+rand()%10000;
+ }else Disarm_Timer -= diff;
+
+ //Check_Timer for the death of LorKhan and Zath.
+ if(!FakeDeath && Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
+ {
+ //Resurrect Thekal
+ Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
+ pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pThekal->setFaction(14);
+ pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
+ }
+
+ if(pInstance->GetData(DATA_ZATHISDEAD))
+ {
+ //Resurrect Zath
+ Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
+ pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pZath->setFaction(14);
+ pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
+ }
+ }
+
+ Check_Timer = 5000;
+ }else Check_Timer -= diff;
+
+ if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->setFaction(35);
+ m_creature->AttackStop();
+
+ if(pInstance)
+ pInstance->SetData(DATA_LORKHAN_DEATH, 0);
+
+ FakeDeath = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//Zealot Zath
+struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
+{
+ mob_zealot_zathAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
+ Reset();
+ }
+
+ uint32 SweepingStrikes_Timer;
+ uint32 SinisterStrike_Timer;
+ uint32 Gouge_Timer;
+ uint32 Kick_Timer;
+ uint32 Blind_Timer;
+ uint32 Check_Timer;
+
+ bool FakeDeath;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ SweepingStrikes_Timer = 13000;
+ SinisterStrike_Timer = 8000;
+ Gouge_Timer = 25000;
+ Kick_Timer = 18000;
+ Blind_Timer = 5000;
+ Check_Timer = 10000;
+
+ FakeDeath = false;
+
+ if(pInstance)
+ pInstance->SetData(DATA_ZATH_ALIVE, 0);
+
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SweepingStrikes_Timer
+ if(SweepingStrikes_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SWEEPINGSTRIKES);
+ SweepingStrikes_Timer = 22000+rand()%4000;
+ }else SweepingStrikes_Timer -= diff;
+
+ //SinisterStrike_Timer
+ if(SinisterStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
+ SinisterStrike_Timer = 8000+rand()%8000;
+ }else SinisterStrike_Timer -= diff;
+
+ //Gouge_Timer
+ if(Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GOUGE);
+
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
+
+ Gouge_Timer = 17000+rand()%10000;
+ }else Gouge_Timer -= diff;
+
+ //Kick_Timer
+ if(Kick_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KICK);
+ Kick_Timer = 15000+rand()%10000;
+ }else Kick_Timer -= diff;
+
+ //Blind_Timer
+ if(Blind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLIND);
+ Blind_Timer = 10000+rand()%10000;
+ }else Blind_Timer -= diff;
+
+ //Check_Timer for the death of LorKhan and Zath.
+ if(!FakeDeath && Check_Timer < diff)
+ {
+ if(pInstance)
+ {
+ if(pInstance->GetData(DATA_LORKHANISDEAD))
+ {
+ //Resurrect LorKhan
+ Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
+ pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pLorKhan->setFaction(14);
+ pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
+ }
+
+ if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
+ {
+ //Resurrect Thekal
+ Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
+ pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pThekal->setFaction(14);
+ pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
+ }
+ }
+
+ Check_Timer = 5000;
+ }else Check_Timer -= diff;
+
+ if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->setFaction(35);
+ m_creature->AttackStop();
+
+ if(pInstance)
+ pInstance->SetData(DATA_ZATH_DEATH, 0);
+
+ FakeDeath = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_thekal(Creature *_Creature)
+{
+ return new boss_thekalAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_zealot_lorkhan(Creature *_Creature)
+{
+ return new mob_zealot_lorkhanAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_zealot_zath(Creature *_Creature)
+{
+ return new mob_zealot_zathAI (_Creature);
+}
+
+void AddSC_boss_thekal()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_thekal";
+ newscript->GetAI = GetAI_boss_thekal;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_zealot_lorkhan";
+ newscript->GetAI = GetAI_mob_zealot_lorkhan;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_zealot_zath";
+ newscript->GetAI = GetAI_mob_zealot_zath;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
index fbac0c68865..771b61c372f 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
@@ -1,200 +1,200 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Venoxis
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_HOLY_FIRE 23860
-#define SPELL_HOLY_WRATH 28883 //Not sure if this or 23979
-#define SPELL_VENOMSPIT 23862
-#define SPELL_HOLY_NOVA 23858
-#define SPELL_POISON_CLOUD 23861
-#define SPELL_SNAKE_FORM 23849
-#define SPELL_RENEW 23895
-#define SPELL_BERSERK 23537
-#define SPELL_DISPELL 23859
-
-#define SAY_AGGRO "Let the coils of hate unfurl!"
-#define SOUND_AGGRO 8421
-
-struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI
-{
- boss_venoxisAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HolyFire_Timer;
- uint32 HolyWrath_Timer;
- uint32 VenomSpit_Timer;
- uint32 Renew_Timer;
- uint32 PoisonCloud_Timer;
- uint32 HolyNova_Timer;
- uint32 Dispell_Timer;
- uint32 TargetInRange;
-
- bool PhaseTwo;
- bool InBerserk;
-
- void Reset()
- {
- HolyFire_Timer = 10000;
- HolyWrath_Timer = 60500;
- VenomSpit_Timer = 5500;
- Renew_Timer = 30500;
- PoisonCloud_Timer = 2000;
- HolyNova_Timer = 5000;
- Dispell_Timer = 35000;
- TargetInRange = 0;
-
- PhaseTwo = false;
- InBerserk= false;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- }
-
- void JustDied(Unit* Killer)
- {
- ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
- if(pInstance)
- pInstance->SetData(DATA_VENOXIS_DEATH, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if( m_creature->getVictim() && m_creature->isAlive())
- {
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
- {
- if (Dispell_Timer < diff)
- {
- DoCast(m_creature, SPELL_DISPELL);
- Dispell_Timer = 15000 + rand()%15000;
- }else Dispell_Timer -= diff;
-
- if (Renew_Timer < diff)
- {
- DoCast(m_creature, SPELL_RENEW);
- Renew_Timer = 20000 + rand()%10000;
- }else Renew_Timer -= diff;
-
- if (HolyWrath_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HOLY_WRATH);
- HolyWrath_Timer = 15000 + rand()%10000;
- }else HolyWrath_Timer -= diff;
-
- if (HolyNova_Timer < diff)
- {
- Unit* target = NULL;
- TargetInRange = 0;
- for(int i=0; i<10; i++)
- {
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,i);
- if(target)
- if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
- TargetInRange++;
- }
-
- if(TargetInRange > 1)
- {
- DoCast(m_creature->getVictim(),SPELL_HOLY_NOVA);
- HolyNova_Timer = 1000;
- }
- else
- {
- HolyNova_Timer = 2000;
- }
-
- }else HolyNova_Timer -= diff;
-
- if (HolyFire_Timer < diff && TargetInRange < 3)
- {
- Unit* targetrandom = NULL;
- targetrandom = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(targetrandom, SPELL_HOLY_FIRE);
- HolyFire_Timer = 8000;
- }else HolyFire_Timer -= diff;
- }
- else
- {
- if(!PhaseTwo)
- {
- 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);
- DoResetThreat();
- PhaseTwo = true;
- }
-
- if(PhaseTwo && PoisonCloud_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD);
- PoisonCloud_Timer = 15000;
- }PoisonCloud_Timer -=diff;
-
- if (PhaseTwo && VenomSpit_Timer < diff)
- {
- Unit* targetrandom = NULL;
- targetrandom = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(targetrandom, SPELL_VENOMSPIT);
- VenomSpit_Timer = 15000 + rand()%5000;
- }else VenomSpit_Timer -= diff;
-
- if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11))
- {
- if (!InBerserk)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_BERSERK);
- InBerserk = true;
- }
- }
- }
- DoMeleeAttackIfReady();
- }
- }
-};
-CreatureAI* GetAI_boss_venoxis(Creature *_Creature)
-{
- return new boss_venoxisAI (_Creature);
-}
-
-void AddSC_boss_venoxis()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_venoxis";
- newscript->GetAI = GetAI_boss_venoxis;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Venoxis
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_HOLY_FIRE 23860
+#define SPELL_HOLY_WRATH 28883 //Not sure if this or 23979
+#define SPELL_VENOMSPIT 23862
+#define SPELL_HOLY_NOVA 23858
+#define SPELL_POISON_CLOUD 23861
+#define SPELL_SNAKE_FORM 23849
+#define SPELL_RENEW 23895
+#define SPELL_BERSERK 23537
+#define SPELL_DISPELL 23859
+
+#define SAY_AGGRO "Let the coils of hate unfurl!"
+#define SOUND_AGGRO 8421
+
+struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI
+{
+ boss_venoxisAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HolyFire_Timer;
+ uint32 HolyWrath_Timer;
+ uint32 VenomSpit_Timer;
+ uint32 Renew_Timer;
+ uint32 PoisonCloud_Timer;
+ uint32 HolyNova_Timer;
+ uint32 Dispell_Timer;
+ uint32 TargetInRange;
+
+ bool PhaseTwo;
+ bool InBerserk;
+
+ void Reset()
+ {
+ HolyFire_Timer = 10000;
+ HolyWrath_Timer = 60500;
+ VenomSpit_Timer = 5500;
+ Renew_Timer = 30500;
+ PoisonCloud_Timer = 2000;
+ HolyNova_Timer = 5000;
+ Dispell_Timer = 35000;
+ TargetInRange = 0;
+
+ PhaseTwo = false;
+ InBerserk= false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
+ if(pInstance)
+ pInstance->SetData(DATA_VENOXIS_DEATH, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50))
+ {
+ if (Dispell_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_DISPELL);
+ Dispell_Timer = 15000 + rand()%15000;
+ }else Dispell_Timer -= diff;
+
+ if (Renew_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_RENEW);
+ Renew_Timer = 20000 + rand()%10000;
+ }else Renew_Timer -= diff;
+
+ if (HolyWrath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HOLY_WRATH);
+ HolyWrath_Timer = 15000 + rand()%10000;
+ }else HolyWrath_Timer -= diff;
+
+ if (HolyNova_Timer < diff)
+ {
+ Unit* target = NULL;
+ TargetInRange = 0;
+ for(int i=0; i<10; i++)
+ {
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,i);
+ if(target)
+ if(m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
+ TargetInRange++;
+ }
+
+ if(TargetInRange > 1)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HOLY_NOVA);
+ HolyNova_Timer = 1000;
+ }
+ else
+ {
+ HolyNova_Timer = 2000;
+ }
+
+ }else HolyNova_Timer -= diff;
+
+ if (HolyFire_Timer < diff && TargetInRange < 3)
+ {
+ Unit* targetrandom = NULL;
+ targetrandom = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(targetrandom, SPELL_HOLY_FIRE);
+ HolyFire_Timer = 8000;
+ }else HolyFire_Timer -= diff;
+ }
+ else
+ {
+ if(!PhaseTwo)
+ {
+ 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);
+ DoResetThreat();
+ PhaseTwo = true;
+ }
+
+ if(PhaseTwo && PoisonCloud_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD);
+ PoisonCloud_Timer = 15000;
+ }PoisonCloud_Timer -=diff;
+
+ if (PhaseTwo && VenomSpit_Timer < diff)
+ {
+ Unit* targetrandom = NULL;
+ targetrandom = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ DoCast(targetrandom, SPELL_VENOMSPIT);
+ VenomSpit_Timer = 15000 + rand()%5000;
+ }else VenomSpit_Timer -= diff;
+
+ if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11))
+ {
+ if (!InBerserk)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_BERSERK);
+ InBerserk = true;
+ }
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+CreatureAI* GetAI_boss_venoxis(Creature *_Creature)
+{
+ return new boss_venoxisAI (_Creature);
+}
+
+void AddSC_boss_venoxis()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_venoxis";
+ newscript->GetAI = GetAI_boss_venoxis;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
index eba8a41729c..3ac05c97b04 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
@@ -1,84 +1,84 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Wushoolay
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-#define SPELL_LIGHTNINGCLOUD 25033
-#define SPELL_LIGHTNINGWAVE 24819
-
-struct TRINITY_DLL_DECL boss_wushoolayAI : public ScriptedAI
-{
- boss_wushoolayAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 LightningCloud_Timer;
- uint32 LightningWave_Timer;
-
- void Reset()
- {
- LightningCloud_Timer = 5000 + rand()%5000;
- LightningWave_Timer = 8000 + rand()%8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //LightningCloud_Timer
- if (LightningCloud_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_LIGHTNINGCLOUD);
- LightningCloud_Timer = 15000 + rand()%5000;
- }else LightningCloud_Timer -= diff;
-
- //LightningWave_Timer
- if (LightningWave_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_LIGHTNINGWAVE);
-
- LightningWave_Timer = 12000 + rand()%4000;
- }else LightningWave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_wushoolay(Creature *_Creature)
-{
- return new boss_wushoolayAI (_Creature);
-}
-
-void AddSC_boss_wushoolay()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_wushoolay";
- newscript->GetAI = GetAI_boss_wushoolay;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Wushoolay
+SD%Complete: 100
+SDComment:
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+#define SPELL_LIGHTNINGCLOUD 25033
+#define SPELL_LIGHTNINGWAVE 24819
+
+struct TRINITY_DLL_DECL boss_wushoolayAI : public ScriptedAI
+{
+ boss_wushoolayAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 LightningCloud_Timer;
+ uint32 LightningWave_Timer;
+
+ void Reset()
+ {
+ LightningCloud_Timer = 5000 + rand()%5000;
+ LightningWave_Timer = 8000 + rand()%8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //LightningCloud_Timer
+ if (LightningCloud_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_LIGHTNINGCLOUD);
+ LightningCloud_Timer = 15000 + rand()%5000;
+ }else LightningCloud_Timer -= diff;
+
+ //LightningWave_Timer
+ if (LightningWave_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_LIGHTNINGWAVE);
+
+ LightningWave_Timer = 12000 + rand()%4000;
+ }else LightningWave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_wushoolay(Creature *_Creature)
+{
+ return new boss_wushoolayAI (_Creature);
+}
+
+void AddSC_boss_wushoolay()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_wushoolay";
+ newscript->GetAI = GetAI_boss_wushoolay;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
index d4d181db15a..0dcbb83c4df 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
+++ b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
@@ -1,36 +1,36 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_ZULGURUB_H
-#define DEF_ZULGURUB_H
-
-#define DATA_ARLOKKISDEAD 1
-#define DATA_ARLOKK_DEATH 2
-#define DATA_JEKLIKISDEAD 3
-#define DATA_JEKLIK_DEATH 4
-#define DATA_JINDO 5
-#define DATA_LORKHAN 6
-#define DATA_LORKHANISALIVE 7
-#define DATA_LORKHANISDEAD 8
-#define DATA_LORKHAN_ALIVE 9
-#define DATA_LORKHAN_DEATH 10
-#define DATA_MARLIISDEAD 11
-#define DATA_MARLI_DEATH 12
-#define DATA_OHGANISDEAD 13
-#define DATA_OHGAN_DEATH 14
-#define DATA_THEKAL 15
-#define DATA_THEKALFAKE_DEATH 16
-#define DATA_THEKALISALIVE 17
-#define DATA_THEKALISDEAD 18
-#define DATA_THEKALISFAKEDEAD 19
-#define DATA_THEKAL_ALIVE 20
-#define DATA_THEKAL_DEATH 21
-#define DATA_VENOXISISDEAD 22
-#define DATA_VENOXIS_DEATH 23
-#define DATA_ZATH 24
-#define DATA_ZATHISALIVE 25
-#define DATA_ZATHISDEAD 26
-#define DATA_ZATH_ALIVE 27
-#define DATA_ZATH_DEATH 28
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_ZULGURUB_H
+#define DEF_ZULGURUB_H
+
+#define DATA_ARLOKKISDEAD 1
+#define DATA_ARLOKK_DEATH 2
+#define DATA_JEKLIKISDEAD 3
+#define DATA_JEKLIK_DEATH 4
+#define DATA_JINDO 5
+#define DATA_LORKHAN 6
+#define DATA_LORKHANISALIVE 7
+#define DATA_LORKHANISDEAD 8
+#define DATA_LORKHAN_ALIVE 9
+#define DATA_LORKHAN_DEATH 10
+#define DATA_MARLIISDEAD 11
+#define DATA_MARLI_DEATH 12
+#define DATA_OHGANISDEAD 13
+#define DATA_OHGAN_DEATH 14
+#define DATA_THEKAL 15
+#define DATA_THEKALFAKE_DEATH 16
+#define DATA_THEKALISALIVE 17
+#define DATA_THEKALISDEAD 18
+#define DATA_THEKALISFAKEDEAD 19
+#define DATA_THEKAL_ALIVE 20
+#define DATA_THEKAL_DEATH 21
+#define DATA_VENOXISISDEAD 22
+#define DATA_VENOXIS_DEATH 23
+#define DATA_ZATH 24
+#define DATA_ZATHISALIVE 25
+#define DATA_ZATHISDEAD 26
+#define DATA_ZATH_ALIVE 27
+#define DATA_ZATH_DEATH 28
+#endif
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
index 69da6e4be11..501c200fa5c 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
@@ -1,238 +1,238 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_ZulGurub
-SD%Complete: 80
-SDComment: Missing reset function after killing a boss for Ohgan, Thekal.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_zulgurub.h"
-
-struct TRINITY_DLL_DECL instance_zulgurub : public ScriptedInstance
-{
- instance_zulgurub(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
- bool IsBossDied[9];
-
- //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
- uint64 LorKhanGUID;
- uint64 ZathGUID;
- uint64 ThekalGUID;
- uint64 JindoGUID;
-
- void OnCreatureCreate (Creature *creature, uint32 creature_entry)
- {
- switch (creature_entry)
- {
- case 11347:
- LorKhanGUID = creature->GetGUID();
- break;
-
- case 11348:
- ZathGUID = creature->GetGUID();
- break;
-
- case 14509:
- ThekalGUID = creature->GetGUID();
- break;
-
- case 11380:
- JindoGUID = creature->GetGUID();
- break;
- }
- }
-
- void Initialize()
- {
- IsBossDied[0] = false;
- IsBossDied[1] = false;
- IsBossDied[2] = false;
- IsBossDied[3] = false;
- IsBossDied[4] = false;
- IsBossDied[5] = false;
- IsBossDied[6] = false;
-
- IsBossDied[7] = false;
- IsBossDied[8] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- //not active in Zul'Gurub
- return false;
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_JEKLIKISDEAD:
- if(IsBossDied[0])
- return 1;
- break;
-
- case DATA_VENOXISISDEAD:
- if(IsBossDied[1])
- return 1;
- break;
-
- case DATA_MARLIISDEAD:
- if(IsBossDied[2])
- return 1;
- break;
-
- case DATA_THEKALISDEAD:
- if(IsBossDied[3])
- return 1;
- break;
-
- case DATA_ARLOKKISDEAD:
- if(IsBossDied[4])
- return 1;
- break;
-
- case DATA_LORKHANISDEAD:
- if(IsBossDied[5])
- return 1;
- break;
-
- case DATA_ZATHISDEAD:
- if(IsBossDied[6])
- return 1;
- break;
-
- case DATA_THEKALISFAKEDEAD:
- if(IsBossDied[7])
- return 1;
- break;
-
- case DATA_OHGANISDEAD:
- if(IsBossDied[8])
- return 1;
- break;
-
- //Boss is not dead. Resetting function for some bosses after killing them but whiping at the complete encounter.
-
- case DATA_THEKALISALIVE:
- if(IsBossDied[3])
- return 0;
- break;
-
- case DATA_LORKHANISALIVE:
- if(IsBossDied[5])
- return 0;
- break;
-
- case DATA_ZATHISALIVE:
- if(IsBossDied[6])
- return 0;
- break;
- }
-
- return 0;
- }
-
- uint64 GetData64 (uint32 identifier)
- {
- switch(identifier)
- {
- case DATA_LORKHAN:
- return LorKhanGUID;
-
- case DATA_ZATH:
- return ZathGUID;
-
- case DATA_THEKAL:
- return ThekalGUID;
-
- case DATA_JINDO:
- return JindoGUID;
- }
- return 0;
- } // end GetData64
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_JEKLIK_DEATH:
- IsBossDied[0] = true;
- break;
-
- case DATA_VENOXIS_DEATH:
- IsBossDied[1] = true;
- break;
-
- case DATA_MARLI_DEATH:
- IsBossDied[2] = true;
- break;
-
- case DATA_THEKAL_DEATH:
- IsBossDied[3] = true;
- break;
-
- case DATA_ARLOKK_DEATH:
- IsBossDied[4] = true;
- break;
-
- case DATA_LORKHAN_DEATH:
- IsBossDied[5] = true;
- break;
-
- case DATA_ZATH_DEATH:
- IsBossDied[6] = true;
- break;
-
- case DATA_THEKALFAKE_DEATH:
- IsBossDied[7] = true;
- break;
-
- case DATA_OHGAN_DEATH:
- IsBossDied[8] = true;
- break;
-
- case DATA_LORKHAN_ALIVE:
- IsBossDied[5] = false;
- break;
-
- case DATA_ZATH_ALIVE:
- IsBossDied[6] = false;
- break;
-
- case DATA_THEKAL_ALIVE:
- IsBossDied[7] = false;
- break;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_zulgurub(Map* map)
-{
- return new instance_zulgurub(map);
-}
-
-void AddSC_instance_zulgurub()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_zulgurub";
- newscript->GetInstanceData = GetInstanceData_instance_zulgurub;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_ZulGurub
+SD%Complete: 80
+SDComment: Missing reset function after killing a boss for Ohgan, Thekal.
+SDCategory: Zul'Gurub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_zulgurub.h"
+
+struct TRINITY_DLL_DECL instance_zulgurub : public ScriptedInstance
+{
+ instance_zulgurub(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
+ bool IsBossDied[9];
+
+ //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
+ uint64 LorKhanGUID;
+ uint64 ZathGUID;
+ uint64 ThekalGUID;
+ uint64 JindoGUID;
+
+ void OnCreatureCreate (Creature *creature, uint32 creature_entry)
+ {
+ switch (creature_entry)
+ {
+ case 11347:
+ LorKhanGUID = creature->GetGUID();
+ break;
+
+ case 11348:
+ ZathGUID = creature->GetGUID();
+ break;
+
+ case 14509:
+ ThekalGUID = creature->GetGUID();
+ break;
+
+ case 11380:
+ JindoGUID = creature->GetGUID();
+ break;
+ }
+ }
+
+ void Initialize()
+ {
+ IsBossDied[0] = false;
+ IsBossDied[1] = false;
+ IsBossDied[2] = false;
+ IsBossDied[3] = false;
+ IsBossDied[4] = false;
+ IsBossDied[5] = false;
+ IsBossDied[6] = false;
+
+ IsBossDied[7] = false;
+ IsBossDied[8] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ //not active in Zul'Gurub
+ return false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_JEKLIKISDEAD:
+ if(IsBossDied[0])
+ return 1;
+ break;
+
+ case DATA_VENOXISISDEAD:
+ if(IsBossDied[1])
+ return 1;
+ break;
+
+ case DATA_MARLIISDEAD:
+ if(IsBossDied[2])
+ return 1;
+ break;
+
+ case DATA_THEKALISDEAD:
+ if(IsBossDied[3])
+ return 1;
+ break;
+
+ case DATA_ARLOKKISDEAD:
+ if(IsBossDied[4])
+ return 1;
+ break;
+
+ case DATA_LORKHANISDEAD:
+ if(IsBossDied[5])
+ return 1;
+ break;
+
+ case DATA_ZATHISDEAD:
+ if(IsBossDied[6])
+ return 1;
+ break;
+
+ case DATA_THEKALISFAKEDEAD:
+ if(IsBossDied[7])
+ return 1;
+ break;
+
+ case DATA_OHGANISDEAD:
+ if(IsBossDied[8])
+ return 1;
+ break;
+
+ //Boss is not dead. Resetting function for some bosses after killing them but whiping at the complete encounter.
+
+ case DATA_THEKALISALIVE:
+ if(IsBossDied[3])
+ return 0;
+ break;
+
+ case DATA_LORKHANISALIVE:
+ if(IsBossDied[5])
+ return 0;
+ break;
+
+ case DATA_ZATHISALIVE:
+ if(IsBossDied[6])
+ return 0;
+ break;
+ }
+
+ return 0;
+ }
+
+ uint64 GetData64 (uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_LORKHAN:
+ return LorKhanGUID;
+
+ case DATA_ZATH:
+ return ZathGUID;
+
+ case DATA_THEKAL:
+ return ThekalGUID;
+
+ case DATA_JINDO:
+ return JindoGUID;
+ }
+ return 0;
+ } // end GetData64
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_JEKLIK_DEATH:
+ IsBossDied[0] = true;
+ break;
+
+ case DATA_VENOXIS_DEATH:
+ IsBossDied[1] = true;
+ break;
+
+ case DATA_MARLI_DEATH:
+ IsBossDied[2] = true;
+ break;
+
+ case DATA_THEKAL_DEATH:
+ IsBossDied[3] = true;
+ break;
+
+ case DATA_ARLOKK_DEATH:
+ IsBossDied[4] = true;
+ break;
+
+ case DATA_LORKHAN_DEATH:
+ IsBossDied[5] = true;
+ break;
+
+ case DATA_ZATH_DEATH:
+ IsBossDied[6] = true;
+ break;
+
+ case DATA_THEKALFAKE_DEATH:
+ IsBossDied[7] = true;
+ break;
+
+ case DATA_OHGAN_DEATH:
+ IsBossDied[8] = true;
+ break;
+
+ case DATA_LORKHAN_ALIVE:
+ IsBossDied[5] = false;
+ break;
+
+ case DATA_ZATH_ALIVE:
+ IsBossDied[6] = false;
+ break;
+
+ case DATA_THEKAL_ALIVE:
+ IsBossDied[7] = false;
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_zulgurub(Map* map)
+{
+ return new instance_zulgurub(map);
+}
+
+void AddSC_instance_zulgurub()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_zulgurub";
+ newscript->GetInstanceData = GetInstanceData_instance_zulgurub;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index 194c2da640f..fcfc450e86c 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -246,6 +246,9 @@ void WorldSession::LogoutPlayer(bool Save)
if (_player)
{
+ if (uint64 lguid = GetPlayer()->GetLootGUID())
+ DoLootRelease(lguid);
+
///- If the player just died before logging out, make him appear as a ghost
//FIXME: logout must be delayed in case lost connection with client in time of combat
if (_player->GetDeathTimer())