From 7bb862a8f9f475978645b20552452d76909e0bc2 Mon Sep 17 00:00:00 2001 From: insunaa Date: Sun, 9 Oct 2022 16:25:38 +0200 Subject: [PATCH 01/26] Add Meson Build System to CMaNGOS WotLK --- contrib/extractor/meson.build | 18 + contrib/git_id/meson.build | 3 + contrib/mmap/meson.build | 51 ++ contrib/vmap_assembler/meson.build | 31 + contrib/vmap_extractor/meson.build | 7 + .../vmap_extractor/vmapextract/meson.build | 20 + dep/g3dlite/meson.build | 52 ++ dep/libmpq/meson.build | 34 + dep/meson.build | 8 + dep/recastnavigation/Detour/meson.build | 26 + dep/recastnavigation/Recast/meson.build | 23 + dep/recastnavigation/meson.build | 14 + dep/src/bzip2/meson.build | 21 + dep/src/gsoap/meson.build | 6 + dep/src/meson.build | 7 + doc/meson.build | 12 + meson.build | 131 +++ meson_options.txt | 15 + src/framework/meson.build | 13 + src/game/meson.build | 805 ++++++++++++++++++ src/mangosd/meson.build | 34 + src/meson.build | 5 + src/realmd/meson.build | 29 + src/shared/meson.build | 90 ++ src/shared/meson_revision.h.in | 6 + subprojects/openssl.wrap | 15 + subprojects/sqlite3.wrap | 13 + subprojects/utfcpp.wrap | 13 + subprojects/zlib.wrap | 13 + 29 files changed, 1515 insertions(+) create mode 100644 contrib/extractor/meson.build create mode 100644 contrib/git_id/meson.build create mode 100644 contrib/mmap/meson.build create mode 100644 contrib/vmap_assembler/meson.build create mode 100644 contrib/vmap_extractor/meson.build create mode 100644 contrib/vmap_extractor/vmapextract/meson.build create mode 100644 dep/g3dlite/meson.build create mode 100644 dep/libmpq/meson.build create mode 100644 dep/meson.build create mode 100644 dep/recastnavigation/Detour/meson.build create mode 100644 dep/recastnavigation/Recast/meson.build create mode 100644 dep/recastnavigation/meson.build create mode 100644 dep/src/bzip2/meson.build create mode 100644 dep/src/gsoap/meson.build create mode 100644 dep/src/meson.build create mode 100644 doc/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 src/framework/meson.build create mode 100644 src/game/meson.build create mode 100644 src/mangosd/meson.build create mode 100644 src/meson.build create mode 100644 src/realmd/meson.build create mode 100644 src/shared/meson.build create mode 100644 src/shared/meson_revision.h.in create mode 100644 subprojects/openssl.wrap create mode 100644 subprojects/sqlite3.wrap create mode 100644 subprojects/utfcpp.wrap create mode 100644 subprojects/zlib.wrap diff --git a/contrib/extractor/meson.build b/contrib/extractor/meson.build new file mode 100644 index 00000000000..ad7a78c5047 --- /dev/null +++ b/contrib/extractor/meson.build @@ -0,0 +1,18 @@ +ad_sources = [ + 'loadlib/loadlib.cpp', + 'loadlib/adt.cpp', + 'loadlib/wdt.cpp', + 'dbcfile.cpp', + 'mpq_libmpq.cpp', + 'System.cpp', +] + +executable('ad', + ad_sources, + link_with: [lib_libmpq], + include_directories: global_includes, + dependencies: [boost_dep, zlib_dep], + link_args: _linker_args, + install_dir: 'bin/tools', + install: true +) diff --git a/contrib/git_id/meson.build b/contrib/git_id/meson.build new file mode 100644 index 00000000000..4d46efc4d0a --- /dev/null +++ b/contrib/git_id/meson.build @@ -0,0 +1,3 @@ +executable('git_id', + 'git_id.cpp', +) \ No newline at end of file diff --git a/contrib/mmap/meson.build b/contrib/mmap/meson.build new file mode 100644 index 00000000000..3d8fcdb630d --- /dev/null +++ b/contrib/mmap/meson.build @@ -0,0 +1,51 @@ +movemapgen_args = '' +movemapgen_args = [movemapgen_args, '-DMMAP_GENERATOR', '-DNO_CORE_FUNCS', '-DNO_vsnprintf', '-DDT_POLYREF64'] +movemapgen_sources = [ + 'src/generator.cpp', + 'src/IntermediateValues.cpp', + 'src/MapBuilder.cpp', + 'src/TerrainBuilder.cpp', + 'src/VMapExtensions.cpp' +] + +if build_machine.system() == 'linux' + movemapgen_args = [movemapgen_args, '-ggdb'] +endif + +vmaplib = static_library('vmaplib', + ['../../src/game/Vmap/BIH.cpp', '../../src/game/Vmap/VMapManager2.cpp', '../../src/game/Vmap/MapTree.cpp', '../../src/game/Vmap/TileAssembler.cpp', '../../src/game/Vmap/WorldModel.cpp', '../../src/game/Vmap/ModelInstance.cpp', '../../src/game/Vmap/GameObjectModelVmaps.cpp'], + include_directories: global_includes, + dependencies: [zlib_dep, boost_dep], + cpp_args: movemapgen_args, + link_with: [g3dlib, detourlib, recastlib, frameworklib, sharedlib], + install : false +) + +mmaplib = static_library('mmaplib', + ['src/generator.cpp', 'src/IntermediateValues.cpp', 'src/MapBuilder.cpp', 'src/TerrainBuilder.cpp', 'src/VMapExtensions.cpp', '../../src/game/MotionGenerators/MoveMapSharedDefines.cpp'], + include_directories: global_includes, + dependencies: [zlib_dep, boost_dep], + cpp_args: movemapgen_args, + link_with: [vmaplib, detourlib, recastlib, g3dlib, frameworklib], + install: false +) + +if get_option('BUILD_EXTRACTORS') + if build_machine.system() == 'linux' + local_linker = [_linker_args, '-rdynamic'] + endif + executable('MoveMapGen', + movemapgen_sources, + link_with: [vmaplib, detourlib, recastlib, mmaplib], + include_directories: global_includes, + dependencies: [boost_dep, zlib_dep], + cpp_args: movemapgen_args, + link_args: _linker_args, + install_dir: 'bin/tools', + install: true + ) + install_data(movemapgen_script_file, install_dir: 'bin/tools') + install_data(offmesh_file, install_dir: 'bin/tools') + install_data(config_json_file, install_dir: 'bin/tools') +endif + diff --git a/contrib/vmap_assembler/meson.build b/contrib/vmap_assembler/meson.build new file mode 100644 index 00000000000..39742f3b437 --- /dev/null +++ b/contrib/vmap_assembler/meson.build @@ -0,0 +1,31 @@ +assembler_args = '' +if get_option('DEBUG') + assembler_args = [assembler_args, '-DIOMAP_DEBUG'] +endif + +assembler_args = [assembler_args, '-DNO_CORE_FUNCS'] + +if build_machine.system() == 'linux' + assembler_args = [assembler_args, '-ggdb'] +endif + +vmap_assembler_sources = [ + '../../src/game/Vmap/BIH.cpp', + '../../src/game/Vmap/VMapManager2.cpp', + '../../src/game/Vmap/MapTree.cpp', + '../../src/game/Vmap/TileAssembler.cpp', + '../../src/game/Vmap/WorldModel.cpp', + '../../src/game/Vmap/ModelInstance.cpp', + 'vmap_assembler.cpp' +] + +executable('vmap_assembler', + vmap_assembler_sources, + link_with: [sharedlib, g3dlib, frameworklib], + include_directories: global_includes, + dependencies: [boost_dep, zlib_dep], + cpp_args: assembler_args, + link_args: _linker_args, + install_dir: 'bin/tools', + install: true +) \ No newline at end of file diff --git a/contrib/vmap_extractor/meson.build b/contrib/vmap_extractor/meson.build new file mode 100644 index 00000000000..3188f07f848 --- /dev/null +++ b/contrib/vmap_extractor/meson.build @@ -0,0 +1,7 @@ +vmap_extractor_args = ['-DIOMAP_DEBUG', '-DUSE_LIBMPQ04'] + +if build_machine.system() == 'linux' + vmap_extractor_args = [vmap_extractor_args, '-ggdb'] +endif + +subdir('vmapextract') \ No newline at end of file diff --git a/contrib/vmap_extractor/vmapextract/meson.build b/contrib/vmap_extractor/vmapextract/meson.build new file mode 100644 index 00000000000..08174f1bb3f --- /dev/null +++ b/contrib/vmap_extractor/vmapextract/meson.build @@ -0,0 +1,20 @@ +vmap_extractor_sources = [ + 'adtfile.cpp', + 'dbcfile.cpp', + 'gameobject_extract.cpp', + 'model.cpp', + 'mpq_libmpq.cpp', + 'vmapexport.cpp', + 'wdtfile.cpp', + 'wmo.cpp' +] + +executable('vmap_extractor', + vmap_extractor_sources, + include_directories: global_includes, + link_with: [g3dlib, lib_libmpq, detourlib, recastlib], + link_args: _linker_args, + install_dir: 'bin/tools', + install: true +) +install_data(extractor_script_file, install_dir: 'bin/tools') \ No newline at end of file diff --git a/dep/g3dlite/meson.build b/dep/g3dlite/meson.build new file mode 100644 index 00000000000..d67873f1ab0 --- /dev/null +++ b/dep/g3dlite/meson.build @@ -0,0 +1,52 @@ +g3d_sources = [ + 'AABox.cpp', + 'Any.cpp', + 'BinaryFormat.cpp', + 'BinaryInput.cpp', + 'BinaryOutput.cpp', + 'Box.cpp', + 'Capsule.cpp', + 'CollisionDetection.cpp', + 'CoordinateFrame.cpp', + 'Crypto.cpp', + 'Cylinder.cpp', + 'FileSystem.cpp', + 'Line.cpp', + 'LineSegment.cpp', + 'Log.cpp', + 'Matrix3.cpp', + 'Matrix4.cpp', + 'MemoryManager.cpp', + 'PhysicsFrame.cpp', + 'Plane.cpp', + 'Quat.cpp', + 'Random.cpp', + 'Ray.cpp', + 'ReferenceCount.cpp', + 'RegistryUtil.cpp', + 'Sphere.cpp', + 'System.cpp', + 'TextInput.cpp', + 'TextOutput.cpp', + 'Triangle.cpp', + 'UprightFrame.cpp', + 'Vector2.cpp', + 'Vector3.cpp', + 'Vector4.cpp', + 'debugAssert.cpp', + 'fileutils.cpp', + 'format.cpp', + 'g3dfnmatch.cpp', + 'g3dmath.cpp', + 'prompt.cpp', + 'stringutils.cpp', + 'uint128.cpp' +] + +g3d_inc = include_directories('G3D', '../include') + +g3dlib = static_library('g3dlite', + g3d_sources, + include_directories: g3d_inc, + dependencies: zlib_dep, + install : false) \ No newline at end of file diff --git a/dep/libmpq/meson.build b/dep/libmpq/meson.build new file mode 100644 index 00000000000..9cb6aeb0dfb --- /dev/null +++ b/dep/libmpq/meson.build @@ -0,0 +1,34 @@ +libmpq_sources = [ + 'config.h', + 'libmpq/common.c', + 'libmpq/common.h', + 'libmpq/crypt_buf.h', + 'libmpq/explode.c', + 'libmpq/explode.h', + 'libmpq/extract.c', + 'libmpq/huffman.c', + 'libmpq/huffman.h', + 'libmpq/mpq-internal.h', + 'libmpq/mpq.c', + 'libmpq/mpq.h', + 'libmpq/pack_begin.h', + 'libmpq/pack_end.h', + 'libmpq/platform.h', + 'libmpq/wave.c', + 'libmpq/wave.h' +] + +libmpq_inc_dir = ['.'] + +if meson.get_compiler('cpp').get_id() == 'msvc' + libmpq_inc_dir = [libmpq_inc_dir, 'win'] +endif + +libmpq_inc = include_directories(libmpq_inc_dir) + +lib_libmpq = static_library('libmpq', + libmpq_sources, + include_directories: libmpq_inc, + dependencies: [zlib_dep, bzip2_dep], + install : false +) \ No newline at end of file diff --git a/dep/meson.build b/dep/meson.build new file mode 100644 index 00000000000..7ea6c11152b --- /dev/null +++ b/dep/meson.build @@ -0,0 +1,8 @@ +if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') or get_option('BUILD_EXTRACTORS') + subdir('recastnavigation') + subdir('src') + subdir('g3dlite') + if get_option('BUILD_EXTRACTORS') + subdir('libmpq') + endif +endif \ No newline at end of file diff --git a/dep/recastnavigation/Detour/meson.build b/dep/recastnavigation/Detour/meson.build new file mode 100644 index 00000000000..a8b4604a843 --- /dev/null +++ b/dep/recastnavigation/Detour/meson.build @@ -0,0 +1,26 @@ +detour_sources = [ + 'Source/DetourAlloc.cpp', + 'Source/DetourAssert.cpp', + 'Source/DetourCommon.cpp', + 'Source/DetourNavMesh.cpp', + 'Source/DetourNavMeshBuilder.cpp', + 'Source/DetourNavMeshQuery.cpp', + 'Source/DetourNode.cpp', + 'Include/DetourAlloc.h', + 'Include/DetourAssert.h', + 'Include/DetourCommon.h', + 'Include/DetourMath.h', + 'Include/DetourNavMesh.h', + 'Include/DetourNavMeshBuilder.h', + 'Include/DetourNavMeshQuery.h', + 'Include/DetourNode.h', + 'Include/DetourStatus.h' +] + +detour_inc = include_directories('Include') + +detourlib = static_library('Detour', + detour_sources, + include_directories: detour_inc, + cpp_args: recastnav_args, + install : false) \ No newline at end of file diff --git a/dep/recastnavigation/Recast/meson.build b/dep/recastnavigation/Recast/meson.build new file mode 100644 index 00000000000..ead65597fd2 --- /dev/null +++ b/dep/recastnavigation/Recast/meson.build @@ -0,0 +1,23 @@ +recast_sources = [ + 'Source/Recast.cpp', + 'Source/RecastAlloc.cpp', + 'Source/RecastArea.cpp', + 'Source/RecastAssert.cpp', + 'Source/RecastContour.cpp', + 'Source/RecastFilter.cpp', + 'Source/RecastLayers.cpp', + 'Source/RecastMesh.cpp', + 'Source/RecastMeshDetail.cpp', + 'Source/RecastRasterization.cpp', + 'Source/RecastRegion.cpp', + 'Include/Recast.h', + 'Include/RecastAlloc.h', + 'Include/RecastAssert.h' +] + +recastlib = static_library('recast', + recast_sources, + include_directories: include_directories('Include'), + cpp_args: recastnav_args, + install : false +) \ No newline at end of file diff --git a/dep/recastnavigation/meson.build b/dep/recastnavigation/meson.build new file mode 100644 index 00000000000..6cc57ac9b1c --- /dev/null +++ b/dep/recastnavigation/meson.build @@ -0,0 +1,14 @@ +if get_option('BUILD_GAME_SERVER') or get_option('BUILD_EXTRACTORS') or get_option('BUILD_RECASTDEMOMOD') + recastnav_args = '-DDT_POLYREF64' + subdir('Detour') +endif + +if get_option('BUILD_EXTRACTORS') or get_option('BUILD_RECASTDEMOMOD') + subdir('Recast') +endif + +if get_option('BUILD_RECASTDEMOMOD') + subdir('DetourCrowd') + subdir('DetourTileCache') + subdir('DebugUtils') +endif \ No newline at end of file diff --git a/dep/src/bzip2/meson.build b/dep/src/bzip2/meson.build new file mode 100644 index 00000000000..d6d94c17cc5 --- /dev/null +++ b/dep/src/bzip2/meson.build @@ -0,0 +1,21 @@ +bzip2_sources = [ + 'compress.c', + 'crctable.c', + 'decompress.c', + 'huffman.c', + 'randtable.c', + 'blocksort.c', + 'bzlib.c' +] + +bz2_inc = include_directories('.') + +bz2lib = static_library('bzip2', + bzip2_sources, + include_directories: [global_includes, bz2_inc], + install : false) + +bzip2_dep = declare_dependency( + include_directories: bz2_inc, + link_with: bz2lib +) \ No newline at end of file diff --git a/dep/src/gsoap/meson.build b/dep/src/gsoap/meson.build new file mode 100644 index 00000000000..13611254ab1 --- /dev/null +++ b/dep/src/gsoap/meson.build @@ -0,0 +1,6 @@ +gsoap_sources = ['stdsoap2.cpp'] + +gsoaplib = static_library('gsoap', + gsoap_sources, + include_directories: global_includes, + install : false) \ No newline at end of file diff --git a/dep/src/meson.build b/dep/src/meson.build new file mode 100644 index 00000000000..cf0c7baa5b3 --- /dev/null +++ b/dep/src/meson.build @@ -0,0 +1,7 @@ +subdir('gsoap') +if get_option('BUILD_EXTRACTORS') + bzip2_dep = dependency('bzip2', required: false) + if not bzip2_dep.found() + subdir('bzip2') + endif +endif \ No newline at end of file diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 00000000000..45d4466d891 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,12 @@ +doxygen = find_program('doxygen', required : false) +if doxygen.found() + doxy_file = configure_file( + configuration: {'PACKAGE': meson.project_name(), 'VERSION': meson.project_version(), 'TOPSRCDIR': meson.source_root(), 'DESTDIR': meson.build_root() + '/doc/docs'}, + input: 'Doxyfile.dist', + output: 'Doxyfile' + ) + run_command([doxygen, meson.build_root() + '/doc/Doxyfile'], check: false) + install_subdir(meson.build_root() + '/doc/docs/html', install_dir: 'docs') +else + warning('Documentation disabled without doxygen') +endif diff --git a/meson.build b/meson.build new file mode 100644 index 00000000000..03e36fd2d95 --- /dev/null +++ b/meson.build @@ -0,0 +1,131 @@ +project('CMaNGOS WotLK', 'cpp', 'c', + default_options : ['cpp_std=c++17', 'buildtype=release', 'warning_level=0', 'default_library=static']) + +if build_machine.system() == 'windows' + add_project_arguments('/Zc:strictStrings-', language : 'cpp') +endif + +_linker_args = '' + +boost_dep = dependency('boost', version: '>=1.66.0', static: true, modules: ['thread', 'program_options', 'system', 'filesystem'], required: false) +if not boost_dep.found() + message('Static Boost libraries could not be found. Trying dynamic libraries') + boost_dep = dependency('boost', version: '>=1.66.0', static:false, modules: ['thread', 'program_options', 'system', 'filesystem'], required: true) +endif +dblib_dep = dependency('mariadb', 'libmariadb', 'mysql', 'libmysql', 'postgresql', required: false) +zlib_dep = dependency('zlib', version: '>=1.2.13', static: true, fallback: ['zlib', 'zlib_dep'], required: true) +openssl_dep = dependency('openssl', version: '>=1.1.1', static: true, fallback: ['openssl'], required: true) +utfcpp_dep = dependency('utf8cpp', 'utfcpp', static: true, required: false) + +global_includes = include_directories('src/game', 'dep/libmpq', 'src', 'src/framework', 'src/game/Vmap', + 'dep/json', 'dep/g3dlite', 'src/shared', 'dep/recastnavigation', + 'dep/recastnavigation/Recast/Include', 'dep/recastnavigation/Detour/Include', + 'src/game/MotionGenerators', 'dep/include/bzip2', 'dep/include/gsoap', + 'dep/include') + +if not dblib_dep.found() + if build_machine.system() == 'windows' + mysql_dirs = [ + 'C:\Program Files\MySQL\MySQL Server 8.0\lib', + 'C:\Program Files\MySQL\MySQL Server 5.7\lib', + 'C:\Program Files\MariaDB 11.0\lib', + 'C:\Program Files\MariaDB 11.1\lib', + 'C:\Program Files\MariaDB 11.2\lib', + ] + + fs = import('fs') + if fs.is_dir('C:\Program Files\MySQL\MySQL Server 8.0\lib') + mysql_dll = 'C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll' + elif fs.is_dir('C:\Program Files\MySQL\MySQL Server 5.7\lib') + mysql_dll = 'C:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.2\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.2\lib\libmariadb.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.1\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.1\liblibmariadb.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.0\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.0\lib\libmariadb.dll' + else + error('No local MySQL Server installation found') + endif + + dblib_dep = meson.get_compiler('cpp').find_library('mysql', dirs: mysql_dirs, static: true, required: false) + if not dblib_dep.found() + dblib_dep = meson.get_compiler('cpp').find_library('mariadb', dirs: mysql_dirs, static: true, required: false) + endif + install_data(mysql_dll, install_dir: get_option('bindir')) + else + error('Either MySQL or MariaDB are required to build CMaNGOS') + endif +endif + +if not dblib_dep.found() + error('Either MySQL or MariaDB are required to build CMaNGOS') +endif + +if get_option('POSTGRESQL') + add_project_arguments('-DDO_POSTGRESQL', language: 'cpp') +endif + +if get_option('DEBUG') + add_project_arguments('-g3', language: 'cpp') +endif + +if not get_option('WARNINGS') + add_project_arguments('-w', language: 'cpp') +endif + +if build_machine.system() == 'linux' + add_project_arguments('-DSYSCONFDIR="../etc/"', language: 'cpp') +endif + +add_project_arguments('-DBOOST_ALL_NO_LIB', language: 'cpp') + +if get_option('BUILD_SCRIPTDEV') + add_project_arguments('-DBUILD_SCRIPTDEV', language: 'cpp') +endif +if get_option('BUILD_PLAYERBOT') + add_project_arguments('-DBUILD_PLAYERBOT', language: 'cpp') +endif +if get_option('BUILD_AHBOT') + add_project_arguments('-DBUILD_AHBOT', language: 'cpp') +endif +if get_option('BUILD_METRICS') + add_project_arguments('-DBUILD_METRICS', language: 'cpp') +endif + +if get_option('BUILD_DOCS') + subdir('doc') +endif + +if get_option('BUILD_RECASTDEMOMOD') + error('RECASTDEMOMOD currently unavailable') + if build_machine.system() == 'windows' + if not get_option('BUILD_EXTRACTORS') + subdir('contrib/mmap') + endif + subdir('contrib/recastdemomod') + else + message('BUILD_RECASTDEMOMOD forced to OFF. Not supported on non windows system.') + endif +endif + +if get_option('BUILD_GIT_ID') + subdir('contrib/git_id') +endif + +subdir('dep') +if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') or get_option('BUILD_EXTRACTORS') + subdir('src') +endif + +if get_option('BUILD_EXTRACTORS') + extractor_script_file = files('contrib/extractor_scripts/ExtractResources.sh') + movemapgen_script_file = files('contrib/extractor_scripts/MoveMapGen.sh') + config_json_file = files('contrib/extractor_scripts/config.json') + offmesh_file = files('contrib/extractor_scripts/offmesh.txt') + subdir('contrib/extractor') + subdir('contrib/vmap_extractor') + subdir('contrib/vmap_assembler') + subdir('contrib/mmap') +endif + diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000000..98e8bd4e5bb --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,15 @@ +option('DEBUG', type : 'boolean', value: false, description: 'Include additional debug-code in core') +option('WARNINGS', type : 'boolean', value: false, description: 'Show all warnings during compile') +option('POSTGRESQL', type : 'boolean', value: false, description: 'Use PostgreSQL') +option('PCH', type : 'boolean', value: true, description: 'Use precompiled headers') +option('BUILD_GAME_SERVER', type : 'boolean', value: true, description: 'Build game server') +option('BUILD_LOGIN_SERVER', type : 'boolean', value: true, description: 'Build login server') +option('BUILD_EXTRACTORS', type : 'boolean', value: false, description: 'Build map/dbc/vmap/mmap extractors') +option('BUILD_SCRIPTDEV', type : 'boolean', value: true, description: 'Build ScriptDev. (Off speeds up build)') +option('BUILD_PLAYERBOT', type : 'boolean', value: false, description: 'Build Playerbot mod') +option('BUILD_AHBOT', type : 'boolean', value: false, description: 'Build Acution House Bot mod') +option('BUILD_METRICS', type : 'boolean', value: false, description: 'Build Metrics, generate data for Grafana') +option('BUILD_RECASTDEMOMOD', type : 'boolean', value: false, description: 'Build map/vmap/mmap viewer') +option('BUILD_GIT_ID', type : 'boolean', value: false, description: 'Build git_id') +option('BUILD_DOCS', type : 'boolean', value: false, description: 'Build documentation with doxygen') +option('USE_ANTICHEAT', type : 'boolean', value: true, description: 'Use anticheat system') diff --git a/src/framework/meson.build b/src/framework/meson.build new file mode 100644 index 00000000000..477e80daee0 --- /dev/null +++ b/src/framework/meson.build @@ -0,0 +1,13 @@ +framework_sources = [ + 'Policies/ObjectLifeTime.cpp', + 'Utilities/EventProcessor.cpp' +] + +if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') or get_option('BUILD_EXTRACTORS') +frameworklib = static_library('framework', + framework_sources, + include_directories: global_includes, + dependencies: [boost_dep, dblib_dep, zlib_dep, openssl_dep, utfcpp_dep], + install : false +) +endif \ No newline at end of file diff --git a/src/game/meson.build b/src/game/meson.build new file mode 100644 index 00000000000..c03e467ad8d --- /dev/null +++ b/src/game/meson.build @@ -0,0 +1,805 @@ +game_sources = [ + 'Weather/Weather.cpp', + 'OutdoorPvP/OutdoorPvPEP.cpp', + 'OutdoorPvP/OutdoorPvPTF.cpp', + 'OutdoorPvP/OutdoorPvPSI.cpp', + 'OutdoorPvP/OutdoorPvPHP.cpp', + 'OutdoorPvP/OutdoorPvPGH.cpp', + 'OutdoorPvP/OutdoorPvP.cpp', + 'OutdoorPvP/OutdoorPvPZM.cpp', + 'OutdoorPvP/OutdoorPvPNA.cpp', + 'OutdoorPvP/OutdoorPvPMgr.cpp', + 'GMTickets/GMTicketMgr.cpp', + 'GMTickets/GMTicketHandler.cpp', + 'World/WorldStateVariableManager.cpp', + 'World/World.cpp', + 'World/WorldStateExpression.cpp', + 'World/WorldState.cpp', + 'Trade/TradeHandler.cpp', + 'Anticheat/module/Antispam/antispam.cpp', + 'Anticheat/module/Antispam/antispammgr.cpp', + 'Anticheat/module/config.cpp', + 'Anticheat/module/Warden/wardenmodule.cpp', + 'Anticheat/module/Warden/wardenmac.cpp', + 'Anticheat/module/Warden/wardenmodulemgr.cpp', + 'Anticheat/module/Warden/wardenscan.cpp', + 'Anticheat/module/Warden/wardenwin.cpp', + 'Anticheat/module/Warden/warden.cpp', + 'Anticheat/module/Warden/wardenscanmgr.cpp', + 'Anticheat/module/AddonHandler.cpp', + 'Anticheat/module/libanticheat.cpp', + 'Anticheat/module/anticheatchatcommandsfunctions.cpp', + 'Anticheat/module/Movement/movement.cpp', + 'BattleGround/BattleGroundMgr.cpp', + 'BattleGround/BattleGroundHandler.cpp', + 'BattleGround/BattleGroundRL.cpp', + 'BattleGround/BattleGroundIC.cpp', + 'BattleGround/BattleGround.cpp', + 'BattleGround/BattleGroundAV.cpp', + 'BattleGround/BattleGroundWS.cpp', + 'BattleGround/BattleGroundSA.cpp', + 'BattleGround/BattleGroundEY.cpp', + 'BattleGround/BattleGroundAB.cpp', + 'BattleGround/BattleGroundDS.cpp', + 'BattleGround/BattleGroundRV.cpp', + 'BattleGround/BattleGroundNA.cpp', + 'BattleGround/BattleGroundBE.cpp', + 'Entities/SkillHandler.cpp', + 'Entities/MiscHandler.cpp', + 'Entities/QueryHandler.cpp', + 'Entities/Corpse.cpp', + 'Entities/ObjectGuid.cpp', + 'Entities/StatSystem.cpp', + 'Entities/Bag.cpp', + 'Entities/CharacterHandler.cpp', + 'Entities/Pet.cpp', + 'Entities/ItemHandler.cpp', + 'Entities/Relations.cpp', + 'Entities/NPCHandler.cpp', + 'Entities/RafHandler.cpp', + 'Entities/Vehicle.cpp', + 'Entities/CreatureLinkingMgr.cpp', + 'Entities/Taxi.cpp', + 'Entities/DynamicObject.cpp', + 'Entities/Totem.cpp', + 'Entities/PetHandler.cpp', + 'Entities/Object.cpp', + 'Entities/Transports.cpp', + 'Entities/GossipDef.cpp', + 'Entities/ItemEnchantmentMgr.cpp', + 'Entities/UpdateData.cpp', + 'Entities/EntitiesMgr.cpp', + 'Entities/GameObject.cpp', + 'Entities/Camera.cpp', + 'Entities/TemporarySpawn.cpp', + 'Entities/PetitionsHandler.cpp', + 'Entities/ItemPrototype.cpp', + 'Entities/Creature.cpp', + 'Entities/CreatureSettings.cpp', + 'Entities/VehicleHandler.cpp', + 'Entities/ObjectVisibility.cpp', + 'Entities/Item.cpp', + 'Entities/Unit.cpp', + 'Entities/Player.cpp', + 'Entities/UpdateFields.cpp', + 'GameEvents/GameEventMgr.cpp', + 'GameEvents/moon.cpp', + 'AI/ScriptDevAI/base/pet_ai.cpp', + 'AI/ScriptDevAI/base/guard_ai.cpp', + 'AI/ScriptDevAI/base/CombatAI.cpp', + 'AI/ScriptDevAI/base/BossAI.cpp', + 'AI/ScriptDevAI/base/follower_ai.cpp', + 'AI/ScriptDevAI/base/TimerAI.cpp', + 'AI/ScriptDevAI/base/escort_ai.cpp', + 'AI/ScriptDevAI/include/sc_grid_searchers.cpp', + 'AI/ScriptDevAI/include/sc_instance.cpp', + 'AI/ScriptDevAI/include/sc_creature.cpp', + 'AI/ScriptDevAI/system/ScriptLoader.cpp', + 'AI/ScriptDevAI/system/system.cpp', + 'AI/ScriptDevAI/ScriptDevAIMgr.cpp', + 'AI/BaseAI/GuardAI.cpp', + 'AI/BaseAI/CreatureAI.cpp', + 'AI/BaseAI/PetAI.cpp', + 'AI/BaseAI/GuardianAI.cpp', + 'AI/BaseAI/PossessedAI.cpp', + 'AI/BaseAI/TotemAI.cpp', + 'AI/BaseAI/UnitAI.cpp', + 'AI/BaseAI/GameObjectAI.cpp', + 'AI/BaseAI/NullCreatureAI.cpp', + 'AI/EventAI/CreatureEventAI.cpp', + 'AI/EventAI/CreatureEventAIMgr.cpp', + 'AI/CreatureAISelector.cpp', + 'AI/CreatureAIRegistry.cpp', + 'AI/PlayerAI/PlayerAI.cpp', + 'AI/PlayerAI/CharmAI.cpp', + 'Calendar/Calendar.cpp', + 'Calendar/CalendarHandler.cpp', + 'Models/M2Stores.cpp', + 'Cinematics/CinematicMgr.cpp', + 'Arena/ArenaTeam.cpp', + 'Arena/ArenaTeamHandler.cpp', + 'VoiceChat/VoiceChatHandler.cpp', + 'DBScripts/ScriptMgr.cpp', + 'Maps/SpawnGroup.cpp', + 'Maps/GridMap.cpp', + 'Maps/Map.cpp', + 'Maps/SpawnManager.cpp', + 'Maps/MapDataContainer.cpp', + 'Maps/TaxiHandler.cpp', + 'Maps/InstanceData.cpp', + 'Maps/TransportMgr.cpp', + 'Maps/ObjectPosSelector.cpp', + 'Maps/TransportSystem.cpp', + 'Maps/MapManager.cpp', + 'Maps/MapPersistentStateMgr.cpp', + 'Maps/MapUpdater.cpp', + 'Quests/QuestDef.cpp', + 'Quests/QuestHandler.cpp', + 'MotionGenerators/IdleMovementGenerator.cpp', + 'MotionGenerators/PathFinder.cpp', + 'MotionGenerators/TargetedMovementGenerator.cpp', + 'MotionGenerators/HomeMovementGenerator.cpp', + 'MotionGenerators/PointMovementGenerator.cpp', + 'MotionGenerators/MovementHandler.cpp', + 'MotionGenerators/WrapperMovementGenerator.cpp', + 'MotionGenerators/MotionMaster.cpp', + 'MotionGenerators/MoveMap.cpp', + 'MotionGenerators/WaypointManager.cpp', + 'MotionGenerators/FollowerReference.cpp', + 'MotionGenerators/WaypointMovementGenerator.cpp', + 'MotionGenerators/MoveMapSharedDefines.cpp', + 'MotionGenerators/MovementGenerator.cpp', + 'MotionGenerators/RandomMovementGenerator.cpp', + 'MotionGenerators/PathMovementGenerator.cpp', + 'Tools/CharacterDatabaseCleaner.cpp', + 'Tools/PlayerDump.cpp', + 'Pools/PoolManager.cpp', + 'Guilds/Guild.cpp', + 'Guilds/GuildMgr.cpp', + 'Guilds/GuildHandler.cpp', + 'Battlefield/Battlefield.cpp', + 'Battlefield/BattlefieldWG.cpp', + 'Battlefield/BattlefieldHandler.cpp', + 'Chat/Level2.cpp', + 'Chat/Level1.cpp', + 'Chat/ChannelMgr.cpp', + 'Chat/Level0.cpp', + 'Chat/debugcmds.cpp', + 'Chat/Channel.cpp', + 'Chat/ChatHandler.cpp', + 'Chat/Level3.cpp', + 'Chat/TicketCommands.cpp', + 'Chat/NpcCommands.cpp', + 'Chat/ChannelHandler.cpp', + 'Chat/Chat.cpp', + 'Globals/Locales.cpp', + 'Globals/CombatCondition.cpp', + 'Globals/Conditions.cpp', + 'Globals/GraveyardManager.cpp', + 'Globals/ObjectAccessor.cpp', + 'Globals/ObjectMgr.cpp', + 'Globals/UnitCondition.cpp', + 'AuctionHouse/AuctionHouseHandler.cpp', + 'AuctionHouse/AuctionHouseMgr.cpp', + 'AuctionHouseBot/AuctionHouseBot.cpp', + 'Combat/CombatHandler.cpp', + 'Combat/HostileRefManager.cpp', + 'Combat/DuelHandler.cpp', + 'Combat/CombatManager.cpp', + 'Combat/ThreatManager.cpp', + 'Loot/LootMgr.cpp', + 'Loot/LootHandler.cpp', + 'Spells/Scripts/SpellScript.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Paladin.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Priest.cpp', + 'Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Hunter.cpp', + 'Spells/Scripts/Scripting/ClassScripts/ScalingAuras.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Druid.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Rogue.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Warrior.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Warlock.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Shaman.cpp', + 'Spells/Scripts/Scripting/ClassScripts/Mage.cpp', + 'Spells/SpellHandler.cpp', + 'Spells/Spell.cpp', + 'Spells/SpellAuras.cpp', + 'Spells/UnitAuraProcHandler.cpp', + 'Spells/SpellMgr.cpp', + 'Spells/SpellTargets.cpp', + 'Spells/SpellDefines.cpp', + 'Spells/SpellEffects.cpp', + 'Groups/GroupHandler.cpp', + 'Groups/GroupReference.cpp', + 'Groups/Group.cpp', + 'Social/SocialMgr.cpp', + 'Skills/SkillExtraItems.cpp', + 'Skills/SkillDiscovery.cpp', + 'Vmap/VMapManager2.cpp', + 'Vmap/VMapFactory.cpp', + 'Vmap/BIH.cpp', + 'Vmap/DynamicTree.cpp', + 'Vmap/ModelInstance.cpp', + 'Vmap/WorldModel.cpp', + 'Vmap/TileAssembler.cpp', + 'Vmap/GameObjectModelVmaps.cpp', + 'Vmap/GameObjectModel.cpp', + 'Vmap/MapTree.cpp', + 'Achievements/AchievementMgr.cpp', + 'LFG/LFGQueue.cpp', + 'LFG/LFG.cpp', + 'LFG/LFGMgr.cpp', + 'LFG/LFGHandler.cpp', + 'Server/SQLStorages.cpp', + 'Server/DBCStores.cpp', + 'Server/PacketLog.cpp', + 'Server/Opcodes.cpp', + 'Server/WorldSession.cpp', + 'Server/WorldSocket.cpp', + 'Server/AuthCrypt.cpp', + 'Grids/GridNotifiers.cpp', + 'Grids/ObjectGridLoader.cpp', + 'Grids/GridStates.cpp', + 'Movement/util.cpp', + 'Movement/packet_builder.cpp', + 'Movement/spline.cpp', + 'Movement/MoveSpline.cpp', + 'Movement/MoveSplineInit.cpp', + 'Accounts/AccountMgr.cpp', + 'Reputation/ReputationMgr.cpp', + 'Mails/MassMailMgr.cpp', + 'Mails/MailHandler.cpp', + 'Mails/Mail.cpp' +] + +scriptdev_sources = [ + 'AI/ScriptDevAI/scripts/battlegrounds/battlegrounds.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/uldaman/uldaman.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stranglethorn_vale.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/arathi_highlands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/westfall.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/karazhanScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_curator.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/chess_event.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/karazhan.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/loch_modan.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/stratholmeScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/stratholme.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/isle_of_queldanas.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/undercity.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/dun_morogh.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/burning_steppes.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/silverpine_forest.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/eversong_woods.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scholomance/scholomance.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/silvermoon_city.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/world_eastern_kingdoms.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/hinterlands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/ironforge.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateauScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/tirisfal_glades.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/deadmines/deadmines.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/magisters_terraceScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/swamp_of_sorrows.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/zulaman.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/zulamanScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_malacrass.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunken_temple/sunken_templeScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/shadowfang_keep/boss_hummel.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/boss_kazzak.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/searing_gorge.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackwing_lair/blackwing_lair.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/western_plaguelands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/alterac_mountains.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_garr.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/molten_core.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/molten_coreScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_enclave/world_map_ebon_hold.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/boss_coren_direbrew.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/blasted_lands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/wetlands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/ghostlands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/zulgurubScripts.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/zulgurub.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/stormwind_city.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/eastern_plaguelands.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/redridge_mountains.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/elwynn_forest.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/gnomeregan/boss_thermaplugg.cpp', + 'AI/ScriptDevAI/scripts/eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp', + 'AI/ScriptDevAI/scripts/world/bosses_emerald_dragons.cpp', + 'AI/ScriptDevAI/scripts/world/guards.cpp', + 'AI/ScriptDevAI/scripts/world/spell_scripts_wotlk.cpp', + 'AI/ScriptDevAI/scripts/world/npc_professions.cpp', + 'AI/ScriptDevAI/scripts/world/areatrigger_scripts.cpp', + 'AI/ScriptDevAI/scripts/world/npcs_special.cpp', + 'AI/ScriptDevAI/scripts/world/lunar_festival.cpp', + 'AI/ScriptDevAI/scripts/world/hallows_end.cpp', + 'AI/ScriptDevAI/scripts/world/midsummer_festival.cpp', + 'AI/ScriptDevAI/scripts/world/brewfest.cpp', + 'AI/ScriptDevAI/scripts/world/shade_of_the_horseman.cpp', + 'AI/ScriptDevAI/scripts/world/scourge_invasion.cpp', + 'AI/ScriptDevAI/scripts/world/world_map_scripts.cpp', + 'AI/ScriptDevAI/scripts/world/suns_reach_reclamation.cpp', + 'AI/ScriptDevAI/scripts/world/mob_generic_creature.cpp', + 'AI/ScriptDevAI/scripts/world/item_scripts_wotlk.cpp', + 'AI/ScriptDevAI/scripts/world/item_scripts.cpp', + 'AI/ScriptDevAI/scripts/world/boss_highlord_kruul.cpp', + 'AI/ScriptDevAI/scripts/world/spell_scripts.cpp', + 'AI/ScriptDevAI/scripts/world/war_effort.cpp', + 'AI/ScriptDevAI/scripts/world/childrens_week_tbc.cpp', + 'AI/ScriptDevAI/scripts/world/quest_scripts.cpp', + 'AI/ScriptDevAI/scripts/world/go_scripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ashenvale.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/world_kalimdor.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/felwood.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/maraudon/boss_noxxion.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/maraudon/instance_maraudon.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/azshara.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/azuremyst_isle.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/darkshore.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/feralas.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/stonetalon_mountains.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/blackfathom_deeps/instance_blackfathom_deeps.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/wailing_caverns/wailing_cavernsScripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/boss_azuregos.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/silithus.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/tanaris.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/hyjalScripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbradScripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/dark_portal/dark_portalScripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqirajScripts.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/dustwallow_marsh.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/zulfarrak/instance_zulfarrak.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/zulfarrak/zulfarrak.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/zulfarrak/boss_zumrah.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/teldrassil.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/winterspring.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/onyxias_lair/instance_onyxias_lair.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/orgrimmar.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/durotar.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/desolace.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/thousand_needles.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/ungoro_crater.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/mulgore.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/the_barrens.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/moonglade.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/thunder_bluff.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/bloodmyst_isle.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/dire_maul/instance_dire_maul.cpp', + 'AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp', + 'AI/ScriptDevAI/scripts/outland/nagrand.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_peninsula.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_mechanar/boss_mechano_lord_capacitus.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_mechanar/mechanar.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_thorngrin_the_tender.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/arcatrazScripts.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/boss_soccothrates.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/boss_dalliah.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_alar.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/the_eye.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/shattered_hallsScripts.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.cpp', + 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp', + 'AI/ScriptDevAI/scripts/outland/zangarmarsh.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_mother_shahraz.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_illidan.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/black_temple.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_supremus.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_shade_of_akama.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_reliquary_of_souls.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/black_templeScripts.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_bloodboil.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp', + 'AI/ScriptDevAI/scripts/outland/black_temple/boss_warlord_najentus.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/boss_yor.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombsScripts.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/sethekk_halls/boss_anzu.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/sethekk_halls/sethekk_halls.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp', + 'AI/ScriptDevAI/scripts/outland/auchindoun/sethekk_halls/boss_talon_king_ikiss.cpp', + 'AI/ScriptDevAI/scripts/outland/blades_edge_mountains.cpp', + 'AI/ScriptDevAI/scripts/outland/boss_terokk.cpp', + 'AI/ScriptDevAI/scripts/outland/boss_doomlord_kazzak.cpp', + 'AI/ScriptDevAI/scripts/outland/netherstorm.cpp', + 'AI/ScriptDevAI/scripts/outland/shattrath_city.cpp', + 'AI/ScriptDevAI/scripts/outland/boss_doomwalker.cpp', + 'AI/ScriptDevAI/scripts/outland/world_outland.cpp', + 'AI/ScriptDevAI/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp', + 'AI/ScriptDevAI/scripts/outland/gruuls_lair/boss_gruul.cpp', + 'AI/ScriptDevAI/scripts/outland/gruuls_lair/gruuls_lair.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/slave_pens/boss_ahune.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/slave_pens/slave_pens.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_hydross_the_unstable.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_fathomlord_karathress.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_leotheras_the_blind.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_lady_vashj.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/serpent_shrine.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_morogrim_tidewalker.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/serpent_shrine/boss_the_lurker_below.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/underbog/boss_swamplord_muselek.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/underbog/boss_black_stalker.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/underbog/underbog.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/steam_vault/steam_vault.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/steam_vault/boss_warlord_kalithresh.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp', + 'AI/ScriptDevAI/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp', + 'AI/ScriptDevAI/scripts/outland/shadowmoon_valley.cpp', + 'AI/ScriptDevAI/scripts/outland/bashir_landing.cpp', + 'AI/ScriptDevAI/scripts/outland/shartuul_transporter.cpp', + 'AI/ScriptDevAI/scripts/outland/terokkar_forest.cpp', + 'AI/ScriptDevAI/scripts/northrend/wintergrasp.cpp', + 'AI/ScriptDevAI/scripts/northrend/world_northrend.cpp', + 'AI/ScriptDevAI/scripts/northrend/grizzly_hills.cpp', + 'AI/ScriptDevAI/scripts/northrend/dalaran.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/nexus/boss_telestra.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/nexus/boss_anomalus.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/nexus/nexus.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/nexus/boss_keristrasza.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/nexus/boss_ormorok.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/oculus/oculus.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/oculus/oculusScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/oculus/boss_varos.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/oculus/boss_urom.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/oculus/boss_eregos.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp', + 'AI/ScriptDevAI/scripts/northrend/nexus/eye_of_eternity/eye_of_eternity.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_bronjahm.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflection.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflectionScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/pit_of_saronScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_krick_and_ick.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/pit_of_saron.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/icecrown_citadel.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_festergut.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lady_deathwhisper.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/gunship_battle.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/icecrown_citadelScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_deathbringer_saurfang.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_valithria_dreamwalker.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_patchwerk.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_heigan.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_anubrekhan.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_thaddius.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_noth.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/naxxramas.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/naxxramasScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_four_horsemen.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_gothik.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_sapphiron.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_gluth.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_maexxna.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_kelthuzad.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_faerlina.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_razuvious.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_loatheb.cpp', + 'AI/ScriptDevAI/scripts/northrend/naxxramas/boss_grobbulus.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_stone/halls_of_stoneScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_xt_002.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/assembly_of_iron.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_algalon.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_freya.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_ignis.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_thorim.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduarScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_hodir.cpp', + 'AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusaderScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_jaraxxus.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_faction_champions.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_northrend_beasts.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_champion/instance_trial_of_the_champion.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp', + 'AI/ScriptDevAI/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp', + 'AI/ScriptDevAI/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp', + 'AI/ScriptDevAI/scripts/northrend/obsidian_sanctum/obsidian_sanctum.cpp', + 'AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp', + 'AI/ScriptDevAI/scripts/northrend/dragonblight.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/boss_baltharus.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/boss_halion.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/boss_zarithrian.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/ruby_sanctumScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/boss_saviana.cpp', + 'AI/ScriptDevAI/scripts/northrend/ruby_sanctum/ruby_sanctum.cpp', + 'AI/ScriptDevAI/scripts/northrend/howling_fjord.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_gortok.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keepScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar.cpp', + 'AI/ScriptDevAI/scripts/northrend/storm_peaks.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/boss_eck.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/boss_galdarah.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/boss_colossus.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/boss_moorabi.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/gundrak.cpp', + 'AI/ScriptDevAI/scripts/northrend/gundrak/boss_sladran.cpp', + 'AI/ScriptDevAI/scripts/northrend/icecrown.cpp', + 'AI/ScriptDevAI/scripts/northrend/draktharon_keep/boss_trollgore.cpp', + 'AI/ScriptDevAI/scripts/northrend/draktharon_keep/boss_tharonja.cpp', + 'AI/ScriptDevAI/scripts/northrend/draktharon_keep/instance_draktharon_keep.cpp', + 'AI/ScriptDevAI/scripts/northrend/draktharon_keep/boss_novos.cpp', + 'AI/ScriptDevAI/scripts/northrend/vault_of_archavon/boss_archavon.cpp', + 'AI/ScriptDevAI/scripts/northrend/vault_of_archavon/boss_toravon.cpp', + 'AI/ScriptDevAI/scripts/northrend/vault_of_archavon/boss_koralon.cpp', + 'AI/ScriptDevAI/scripts/northrend/vault_of_archavon/boss_emalon.cpp', + 'AI/ScriptDevAI/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/azjol-nerub/boss_hadronox.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/azjol-nerub/boss_krikthir.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/azjol-nerub/azjol-nerub.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/azjol-nerub/boss_anubarak.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/boss_nadox.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/boss_amanitar.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/ahnkahet.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/boss_volazj.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/boss_jedoga.cpp', + 'AI/ScriptDevAI/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp', + 'AI/ScriptDevAI/scripts/northrend/borean_tundra.cpp', + 'AI/ScriptDevAI/scripts/northrend/violet_hold/boss_ichoron.cpp', + 'AI/ScriptDevAI/scripts/northrend/violet_hold/violet_holdScripts.cpp', + 'AI/ScriptDevAI/scripts/northrend/violet_hold/boss_xevozz.cpp', + 'AI/ScriptDevAI/scripts/northrend/violet_hold/violet_hold.cpp', + 'AI/ScriptDevAI/scripts/northrend/zuldrak.cpp', + 'AI/ScriptDevAI/scripts/examples/example_escort.cpp', + 'AI/ScriptDevAI/scripts/examples/example_creature.cpp', + 'AI/ScriptDevAI/scripts/examples/example_misc.cpp', + 'AI/ScriptDevAI/scripts/examples/example_gossip_codebox.cpp', +] + +playerbot_sources = [ + 'PlayerBot/Base/PlayerbotClassAI.cpp', + 'PlayerBot/Base/PlayerbotMgr.cpp', + 'PlayerBot/Base/PlayerbotAI.cpp', + 'PlayerBot/AI/PlayerbotDruidAI.cpp', + 'PlayerBot/AI/PlayerbotWarlockAI.cpp', + 'PlayerBot/AI/PlayerbotDeathKnightAI.cpp', + 'PlayerBot/AI/PlayerbotMageAI.cpp', + 'PlayerBot/AI/PlayerbotPriestAI.cpp', + 'PlayerBot/AI/PlayerbotWarriorAI.cpp', + 'PlayerBot/AI/PlayerbotHunterAI.cpp', + 'PlayerBot/AI/PlayerbotRogueAI.cpp', + 'PlayerBot/AI/PlayerbotShamanAI.cpp', + 'PlayerBot/AI/PlayerbotPaladinAI.cpp', +] + +game_inc_dirs = ['.', 'Vmap', 'AuctionHouseBot', 'BattleGround', 'OutdoorPvP', 'PlayerBot'] + +if utfcpp_dep.found() == false + game_inc_dirs = [game_inc_dirs, '../../dep/include/utf8cpp'] +endif + +if build_machine.system() == 'windows' + game_inc_dirs = game_inc_dirs + ['../../dep/lib/include', '../../dep/lib/include/mysql'] +endif + +game_inc = include_directories(game_inc_dirs) + +if get_option('BUILD_SCRIPTDEV') + game_sources = [game_sources, scriptdev_sources] +endif + +if get_option('BUILD_PLAYERBOT') + game_sources = [game_sources, playerbot_sources] + install_data('PlayerBot/playerbot.conf.dist.in', rename: 'playerbot.conf.dist', install_dir: 'etc') +endif + +if not get_option('USE_ANTICHEAT') + game_sources = [game_sources, './Anticheat/Anticheat.cpp'] +else + install_data('Anticheat/module/anticheat.conf.dist.in', rename: 'anticheat.conf.dist', install_dir: 'etc') + install_subdir('Anticheat/module/warden_modules', install_dir : 'bin') # mydir subtree -> include/mydir +endif + +if get_option('BUILD_AHBOT') + install_data('AuctionHouseBot/ahbot.conf.dist.in', rename: 'ahbot.conf.dist', install_dir: 'etc') +endif + +if not get_option('PCH') + pch_files = [] +else + pch_files = ['../game/pchdef.h', '../game/pchdef.cpp'] +endif + +game_args = ['-DDT_POLYREF64', '-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0'] + +if get_option('BUILD_GAME_SERVER') +gamelib = static_library('game', + game_sources, + include_directories: [game_inc, global_includes], + dependencies: [zlib_dep, boost_dep, dblib_dep, utfcpp_dep], + link_with: [frameworklib, sharedlib, g3dlib, detourlib], + cpp_args: game_args, + cpp_pch: pch_files, + install : false +) +endif diff --git a/src/mangosd/meson.build b/src/mangosd/meson.build new file mode 100644 index 00000000000..a7011253338 --- /dev/null +++ b/src/mangosd/meson.build @@ -0,0 +1,34 @@ +mangosd_sources = [ + 'Master.cpp', + 'MaNGOSsoap.cpp', + 'soapC.cpp', + 'WorldRunnable.cpp', + 'Main.cpp', + 'CliRunnable.cpp', + 'RASocket.cpp', + 'soapServer.cpp' +] + +mangosd_inc_dirs = [] + +if utfcpp_dep.found() == false + mangosd_inc_dirs = [mangosd_inc_dirs, '../../dep/include/utf8cpp'] +endif + +if build_machine.system() == 'windows' + mangosd_inc_dirs = [mangosd_inc_dirs, '../../dep/lib/include', '../../dep/lib/include/mysql'] +endif + +mangosd_inc = include_directories(mangosd_inc_dirs) + +if get_option('BUILD_GAME_SERVER') + executable('mangosd', + mangosd_sources, + link_with: [sharedlib, gamelib, gsoaplib], + include_directories: [mangosd_inc, global_includes], + dependencies: [boost_dep, dblib_dep, zlib_dep, openssl_dep, utfcpp_dep], + link_args: _linker_args, + install: true + ) + install_data('mangosd.conf.dist.in', rename: 'mangosd.conf.dist', install_dir: 'etc') +endif \ No newline at end of file diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000000..1ca4f20955f --- /dev/null +++ b/src/meson.build @@ -0,0 +1,5 @@ +subdir('framework') +subdir('shared') +subdir('game') +subdir('mangosd') +subdir('realmd') \ No newline at end of file diff --git a/src/realmd/meson.build b/src/realmd/meson.build new file mode 100644 index 00000000000..6e776c30697 --- /dev/null +++ b/src/realmd/meson.build @@ -0,0 +1,29 @@ +realmd_sources = [ + 'AuthSocket.cpp', + 'Main.cpp', + 'RealmList.cpp' +] + +realmd_inc_dirs = [] + +if utfcpp_dep.found() == false + realmd_inc_dirs = [realmd_inc_dirs, '../../dep/include/utf8cpp'] +endif + +if build_machine.system() == 'windows' + realmd_inc_dirs = realmd_inc_dirs + ['../../dep/lib/include', '../../dep/lib/include/mysql'] +endif + +realmd_inc = include_directories(realmd_inc_dirs) + +if get_option('BUILD_LOGIN_SERVER') +executable('realmd', + realmd_sources, + link_with: [sharedlib], + include_directories: [realmd_inc, global_includes], + dependencies: [boost_dep, dblib_dep, zlib_dep, openssl_dep, utfcpp_dep], + link_args: _linker_args, + install: true +) +install_data('realmd.conf.dist.in', rename: 'realmd.conf.dist', install_dir: 'etc') +endif \ No newline at end of file diff --git a/src/shared/meson.build b/src/shared/meson.build new file mode 100644 index 00000000000..5ab2fc8b784 --- /dev/null +++ b/src/shared/meson.build @@ -0,0 +1,90 @@ +shared_sources = [ + 'Metric/Measurement.cpp', + 'Metric/Metric.cpp', + 'Util/Util.cpp', + 'Multithreading/Messager.cpp', + 'Log.cpp', + 'Util/ProgressBar.cpp', + 'Multithreading/Threading.cpp', + 'Util/ByteBuffer.cpp', + 'Database/SqlPreparedStatement.cpp', + 'Database/SqlDelayThread.cpp', + 'Database/Field.cpp', + 'Database/Database.cpp', + 'Database/SqlOperations.cpp', + 'Database/QueryResultPostgre.cpp', + 'Database/DBCFileLoader.cpp', + 'Database/DatabasePostgre.cpp', + 'Database/SQLStorage.cpp', + 'Database/QueryResultMysql.cpp', + 'Database/DatabaseMysql.cpp', + 'Auth/SRP6.cpp', + 'Auth/SARC4.cpp', + 'Auth/base32.cpp', + 'Auth/HMACSHA1.cpp', + 'Auth/BigNumber.cpp', + 'Common.cpp', + 'Network/Socket.cpp', + 'Network/PacketBuffer.cpp', + 'Network/NetworkThread.cpp', + 'Network/Listener.cpp', + 'Config/Config.cpp' +] + +shared_linux = [ + 'Platform/PosixDaemon.cpp' +] + +shared_windows = [ + 'Platform/WheatyExceptionReport.cpp', + 'Platform/ServiceWin32.cpp' +] + +shared_inc_dirs = ['Database'] + +if utfcpp_dep.found() == false + shared_inc_dirs = [shared_inc_dirs, '../../dep/include/utf8cpp'] +endif + +if build_machine.system() == 'windows' + shared_sources = shared_sources + shared_windows + shared_inc_dirs = shared_inc_dirs + ['../../dep/lib/include', '../../dep/lib/include/mysql'] +else + shared_sources = shared_sources + shared_linux +endif + +shared_inc = include_directories(shared_inc_dirs) + +revision_target = vcs_tag( + command : ['git', 'rev-parse', 'HEAD'], + fallback : 'Devel', + input : 'meson_revision.h.in', + output : 'meson_revision.h.temp', + replace_string : '@REVISION_ID@' +) + +actual_rev = vcs_tag( + command: ['git', 'show', '--quiet', '--date=iso-strict', '--format="%ad"', 'HEAD'], + fallback: '"0000-00-00T00:00:00+00:00"', + input: revision_target, + output: 'revision.h', + replace_string: '@REVISION_DATE@' +) + +if not get_option('PCH') + pch_files = [] +else + pch_files = ['../shared/pchdef.h', '../shared/pchdef.cpp'] +endif + +if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') or get_option('BUILD_EXTRACTORS') +sharedlib = static_library('shared', + [actual_rev, shared_sources], + include_directories: [global_includes, shared_inc], + implicit_include_directories: true, + dependencies: [zlib_dep, boost_dep, dblib_dep, openssl_dep, utfcpp_dep], + cpp_pch: pch_files, + link_with: [frameworklib], + install : false +) +endif diff --git a/src/shared/meson_revision.h.in b/src/shared/meson_revision.h.in new file mode 100644 index 00000000000..3ed189ee9d3 --- /dev/null +++ b/src/shared/meson_revision.h.in @@ -0,0 +1,6 @@ +#ifndef __REVISION_H__ +#define __REVISION_H__ + #define REVISION_ID "@REVISION_ID@" + #define REVISION_DATE @REVISION_DATE@ + #define VERSION "0.18" +#endif // __REVISION_H__ diff --git a/subprojects/openssl.wrap b/subprojects/openssl.wrap new file mode 100644 index 00000000000..7d15b54cfce --- /dev/null +++ b/subprojects/openssl.wrap @@ -0,0 +1,15 @@ +[wrap-file] +directory = openssl-3.0.8 +source_url = https://www.openssl.org/source/openssl-3.0.8.tar.gz +source_filename = openssl-3.0.8.tar.gz +source_hash = 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e +patch_filename = openssl_3.0.8-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.8-1/get_patch +patch_hash = 12d9c884174a91ccd1aa9230e9567c019f8a582ce46c98736f99a5200b4f2514 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.8-1/openssl-3.0.8.tar.gz +wrapdb_version = 3.0.8-1 + +[provide] +libcrypto = libcrypto_dep +libssl = libssl_dep +openssl = openssl_dep diff --git a/subprojects/sqlite3.wrap b/subprojects/sqlite3.wrap new file mode 100644 index 00000000000..27d0bf156cf --- /dev/null +++ b/subprojects/sqlite3.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = sqlite-amalgamation-3430200 +source_url = https://www.sqlite.org/2023/sqlite-amalgamation-3430200.zip +source_filename = sqlite-amalgamation-3430200.zip +source_hash = a17ac8792f57266847d57651c5259001d1e4e4b46be96ec0d985c953925b2a1c +patch_filename = sqlite3_3.43.2-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.43.2-1/get_patch +patch_hash = 8bfec4036b76fcd0bc8376c0d252a24f5a0925a13c80d411296841a15ac0c3ac +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.43.2-1/sqlite-amalgamation-3430200.zip +wrapdb_version = 3.43.2-1 + +[provide] +sqlite3 = sqlite3_dep diff --git a/subprojects/utfcpp.wrap b/subprojects/utfcpp.wrap new file mode 100644 index 00000000000..3512216208d --- /dev/null +++ b/subprojects/utfcpp.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = utfcpp-3.2.4 +source_url = https://github.com/nemtrif/utfcpp/archive/v3.2.4.tar.gz +source_filename = utfcpp-3.2.4.tar.gz +source_hash = fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e +patch_filename = utfcpp_3.2.4-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/utfcpp_3.2.4-1/get_patch +patch_hash = 8e233b728579a5e14784e6886767b8e467862fe80baa19e4bea1e3e7c4cf12ae +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/utfcpp_3.2.4-1/utfcpp-3.2.4.tar.gz +wrapdb_version = 3.2.4-1 + +[provide] +utf8cpp = utfcpp_dep diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 00000000000..2f1a1e2c612 --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = zlib-1.3 +source_url = http://zlib.net/fossils/zlib-1.3.tar.gz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3-4/zlib-1.3.tar.gz +source_filename = zlib-1.3.tar.gz +source_hash = ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e +patch_filename = zlib_1.3-4_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3-4/get_patch +patch_hash = 580e61fa3ca9b9ad0d39684b6b889ae92eb5c362c641d8f0d34cf19d49b766ce +wrapdb_version = 1.3-4 + +[provide] +zlib = zlib_dep From 2de2cccd30bb4afd064c99fe52bf23c714f1c4a5 Mon Sep 17 00:00:00 2001 From: insunaa Date: Sun, 4 Feb 2024 23:36:16 +0100 Subject: [PATCH 02/26] Meson: Add SQLite --- meson.build | 69 ++++++++++++++++++++++++------------------ meson_options.txt | 1 + src/shared/meson.build | 2 ++ 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/meson.build b/meson.build index 03e36fd2d95..cccc1b83506 100644 --- a/meson.build +++ b/meson.build @@ -16,6 +16,7 @@ dblib_dep = dependency('mariadb', 'libmariadb', 'mysql', 'libmysql', 'postgresql zlib_dep = dependency('zlib', version: '>=1.2.13', static: true, fallback: ['zlib', 'zlib_dep'], required: true) openssl_dep = dependency('openssl', version: '>=1.1.1', static: true, fallback: ['openssl'], required: true) utfcpp_dep = dependency('utf8cpp', 'utfcpp', static: true, required: false) +sqlite_dep = dependency('sqlite3', static: true, fallback: ['sqlite3'], required: get_option('SQLITE')) global_includes = include_directories('src/game', 'dep/libmpq', 'src', 'src/framework', 'src/game/Vmap', 'dep/json', 'dep/g3dlite', 'src/shared', 'dep/recastnavigation', @@ -23,49 +24,57 @@ global_includes = include_directories('src/game', 'dep/libmpq', 'src', 'src/fram 'src/game/MotionGenerators', 'dep/include/bzip2', 'dep/include/gsoap', 'dep/include') -if not dblib_dep.found() - if build_machine.system() == 'windows' - mysql_dirs = [ - 'C:\Program Files\MySQL\MySQL Server 8.0\lib', - 'C:\Program Files\MySQL\MySQL Server 5.7\lib', - 'C:\Program Files\MariaDB 11.0\lib', - 'C:\Program Files\MariaDB 11.1\lib', - 'C:\Program Files\MariaDB 11.2\lib', - ] - - fs = import('fs') - if fs.is_dir('C:\Program Files\MySQL\MySQL Server 8.0\lib') - mysql_dll = 'C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll' - elif fs.is_dir('C:\Program Files\MySQL\MySQL Server 5.7\lib') - mysql_dll = 'C:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll' - elif fs.is_dir('C:\Program Files\MariaDB 11.2\lib') - mysql_dll = 'C:\Program Files\MariaDB 11.2\lib\libmariadb.dll' - elif fs.is_dir('C:\Program Files\MariaDB 11.1\lib') - mysql_dll = 'C:\Program Files\MariaDB 11.1\liblibmariadb.dll' - elif fs.is_dir('C:\Program Files\MariaDB 11.0\lib') - mysql_dll = 'C:\Program Files\MariaDB 11.0\lib\libmariadb.dll' +if not get_option('SQLITE') + if not dblib_dep.found() + if build_machine.system() == 'windows' + mysql_dirs = [ + 'C:\Program Files\MySQL\MySQL Server 8.0\lib', + 'C:\Program Files\MySQL\MySQL Server 5.7\lib', + 'C:\Program Files\MariaDB 11.0\lib', + 'C:\Program Files\MariaDB 11.1\lib', + 'C:\Program Files\MariaDB 11.2\lib', + ] + + fs = import('fs') + if fs.is_dir('C:\Program Files\MySQL\MySQL Server 8.0\lib') + mysql_dll = 'C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll' + elif fs.is_dir('C:\Program Files\MySQL\MySQL Server 5.7\lib') + mysql_dll = 'C:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.2\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.2\lib\libmariadb.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.1\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.1\liblibmariadb.dll' + elif fs.is_dir('C:\Program Files\MariaDB 11.0\lib') + mysql_dll = 'C:\Program Files\MariaDB 11.0\lib\libmariadb.dll' + else + error('No local MySQL Server installation found') + endif + + dblib_dep = meson.get_compiler('cpp').find_library('mysql', dirs: mysql_dirs, static: true, required: false) + if not dblib_dep.found() + dblib_dep = meson.get_compiler('cpp').find_library('mariadb', dirs: mysql_dirs, static: true, required: false) + endif + install_data(mysql_dll, install_dir: get_option('bindir')) else error('No local MySQL Server installation found') endif - - dblib_dep = meson.get_compiler('cpp').find_library('mysql', dirs: mysql_dirs, static: true, required: false) - if not dblib_dep.found() - dblib_dep = meson.get_compiler('cpp').find_library('mariadb', dirs: mysql_dirs, static: true, required: false) - endif - install_data(mysql_dll, install_dir: get_option('bindir')) - else - error('Either MySQL or MariaDB are required to build CMaNGOS') endif +else + dblib_dep = sqlite_dep endif if not dblib_dep.found() - error('Either MySQL or MariaDB are required to build CMaNGOS') + error('No local SQL Server installation found') endif if get_option('POSTGRESQL') add_project_arguments('-DDO_POSTGRESQL', language: 'cpp') endif +if get_option('SQLITE') + add_project_arguments('-DDO_SQLITE=1', language: 'cpp') +endif + if get_option('DEBUG') add_project_arguments('-g3', language: 'cpp') endif diff --git a/meson_options.txt b/meson_options.txt index 98e8bd4e5bb..f501d07409b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,7 @@ option('DEBUG', type : 'boolean', value: false, description: 'Include additional debug-code in core') option('WARNINGS', type : 'boolean', value: false, description: 'Show all warnings during compile') option('POSTGRESQL', type : 'boolean', value: false, description: 'Use PostgreSQL') +option('SQLITE', type : 'boolean', value: false, description: 'Use SQLite') option('PCH', type : 'boolean', value: true, description: 'Use precompiled headers') option('BUILD_GAME_SERVER', type : 'boolean', value: true, description: 'Build game server') option('BUILD_LOGIN_SERVER', type : 'boolean', value: true, description: 'Build login server') diff --git a/src/shared/meson.build b/src/shared/meson.build index 5ab2fc8b784..66493f4a0a6 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -13,8 +13,10 @@ shared_sources = [ 'Database/Database.cpp', 'Database/SqlOperations.cpp', 'Database/QueryResultPostgre.cpp', + 'Database/QueryResultSqlite.cpp', 'Database/DBCFileLoader.cpp', 'Database/DatabasePostgre.cpp', + 'Database/DatabaseSqlite.cpp', 'Database/SQLStorage.cpp', 'Database/QueryResultMysql.cpp', 'Database/DatabaseMysql.cpp', From 053731f67c265ee37a983a30e92b95536106e33a Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 5 Feb 2024 22:13:28 +0100 Subject: [PATCH 03/26] Meson: Update wrap dependencies --- subprojects/openssl.wrap | 10 +++++----- subprojects/sqlite3.wrap | 18 +++++++++--------- subprojects/zlib.wrap | 18 +++++++++--------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/subprojects/openssl.wrap b/subprojects/openssl.wrap index 7d15b54cfce..873d55106e9 100644 --- a/subprojects/openssl.wrap +++ b/subprojects/openssl.wrap @@ -3,11 +3,11 @@ directory = openssl-3.0.8 source_url = https://www.openssl.org/source/openssl-3.0.8.tar.gz source_filename = openssl-3.0.8.tar.gz source_hash = 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e -patch_filename = openssl_3.0.8-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.8-1/get_patch -patch_hash = 12d9c884174a91ccd1aa9230e9567c019f8a582ce46c98736f99a5200b4f2514 -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.8-1/openssl-3.0.8.tar.gz -wrapdb_version = 3.0.8-1 +patch_filename = openssl_3.0.8-3_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.8-3/get_patch +patch_hash = 300da189e106942347d61a4a4295aa2edbcf06184f8d13b4cee0bed9fb936963 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.8-3/openssl-3.0.8.tar.gz +wrapdb_version = 3.0.8-3 [provide] libcrypto = libcrypto_dep diff --git a/subprojects/sqlite3.wrap b/subprojects/sqlite3.wrap index 27d0bf156cf..bacc6f5a552 100644 --- a/subprojects/sqlite3.wrap +++ b/subprojects/sqlite3.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = sqlite-amalgamation-3430200 -source_url = https://www.sqlite.org/2023/sqlite-amalgamation-3430200.zip -source_filename = sqlite-amalgamation-3430200.zip -source_hash = a17ac8792f57266847d57651c5259001d1e4e4b46be96ec0d985c953925b2a1c -patch_filename = sqlite3_3.43.2-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.43.2-1/get_patch -patch_hash = 8bfec4036b76fcd0bc8376c0d252a24f5a0925a13c80d411296841a15ac0c3ac -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.43.2-1/sqlite-amalgamation-3430200.zip -wrapdb_version = 3.43.2-1 +directory = sqlite-amalgamation-3450100 +source_url = https://www.sqlite.org/2024/sqlite-amalgamation-3450100.zip +source_filename = sqlite-amalgamation-3450100.zip +source_hash = 5592243caf28b2cdef41e6ab58d25d653dfc53deded8450eb66072c929f030c4 +patch_filename = sqlite3_3.45.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.45.1-1/get_patch +patch_hash = fc2d083fed0de64991c9754a25c7532ef1fd581f7751778b5484f099bec5d6dd +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.45.1-1/sqlite-amalgamation-3450100.zip +wrapdb_version = 3.45.1-1 [provide] sqlite3 = sqlite3_dep diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap index 2f1a1e2c612..aa14de17740 100644 --- a/subprojects/zlib.wrap +++ b/subprojects/zlib.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = zlib-1.3 -source_url = http://zlib.net/fossils/zlib-1.3.tar.gz -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3-4/zlib-1.3.tar.gz -source_filename = zlib-1.3.tar.gz -source_hash = ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e -patch_filename = zlib_1.3-4_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3-4/get_patch -patch_hash = 580e61fa3ca9b9ad0d39684b6b889ae92eb5c362c641d8f0d34cf19d49b766ce -wrapdb_version = 1.3-4 +directory = zlib-1.3.1 +source_url = http://zlib.net/fossils/zlib-1.3.1.tar.gz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3.1-1/zlib-1.3.1.tar.gz +source_filename = zlib-1.3.1.tar.gz +source_hash = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 +patch_filename = zlib_1.3.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.1-1/get_patch +patch_hash = e79b98eb24a75392009cec6f99ca5cdca9881ff20bfa174e8b8926d5c7a47095 +wrapdb_version = 1.3.1-1 [provide] zlib = zlib_dep From 9407c7a83f8f395418b946c218bce3808865aae7 Mon Sep 17 00:00:00 2001 From: insunaa Date: Tue, 6 Feb 2024 18:52:50 +0100 Subject: [PATCH 04/26] Meson: Fix some Windows issues --- meson.build | 8 +++++++- meson_options.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cccc1b83506..a13cd4dce09 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('CMaNGOS WotLK', 'cpp', 'c', - default_options : ['cpp_std=c++17', 'buildtype=release', 'warning_level=0', 'default_library=static']) + default_options : ['cpp_std=vc++17,c++17', 'buildtype=release', 'warning_level=0', 'default_library=static']) if build_machine.system() == 'windows' add_project_arguments('/Zc:strictStrings-', language : 'cpp') @@ -33,6 +33,7 @@ if not get_option('SQLITE') 'C:\Program Files\MariaDB 11.0\lib', 'C:\Program Files\MariaDB 11.1\lib', 'C:\Program Files\MariaDB 11.2\lib', + get_option('LIBMYSQL_PATH'), ] fs = import('fs') @@ -46,6 +47,8 @@ if not get_option('SQLITE') mysql_dll = 'C:\Program Files\MariaDB 11.1\liblibmariadb.dll' elif fs.is_dir('C:\Program Files\MariaDB 11.0\lib') mysql_dll = 'C:\Program Files\MariaDB 11.0\lib\libmariadb.dll' + elif fs.is_dir(get_option('LIBMYSQL_PATH')) + mysql_dll = get_option('LIBMYSQL_PATH') + '\libmysql.dll' else error('No local MySQL Server installation found') endif @@ -87,6 +90,9 @@ if build_machine.system() == 'linux' add_project_arguments('-DSYSCONFDIR="../etc/"', language: 'cpp') endif +if build_machine.system() == 'windows' + meson.get_compiler('cpp'). + add_project_arguments('-DBOOST_ALL_NO_LIB', language: 'cpp') if get_option('BUILD_SCRIPTDEV') diff --git a/meson_options.txt b/meson_options.txt index f501d07409b..24a7d118053 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,3 +14,4 @@ option('BUILD_RECASTDEMOMOD', type : 'boolean', value: false, description: 'Buil option('BUILD_GIT_ID', type : 'boolean', value: false, description: 'Build git_id') option('BUILD_DOCS', type : 'boolean', value: false, description: 'Build documentation with doxygen') option('USE_ANTICHEAT', type : 'boolean', value: true, description: 'Use anticheat system') +option('LIBMYSQL_PATH', type : 'string', value: '', description: 'Path to the MySQL Library') From 08d1255bdbd485c1a682c8b2e49c91e21adc3314 Mon Sep 17 00:00:00 2001 From: insunaa Date: Wed, 7 Feb 2024 10:53:25 +0100 Subject: [PATCH 05/26] Meson: Remove Experiment --- meson.build | 3 --- 1 file changed, 3 deletions(-) diff --git a/meson.build b/meson.build index a13cd4dce09..97950ef0e8c 100644 --- a/meson.build +++ b/meson.build @@ -90,9 +90,6 @@ if build_machine.system() == 'linux' add_project_arguments('-DSYSCONFDIR="../etc/"', language: 'cpp') endif -if build_machine.system() == 'windows' - meson.get_compiler('cpp'). - add_project_arguments('-DBOOST_ALL_NO_LIB', language: 'cpp') if get_option('BUILD_SCRIPTDEV') From 8662f37e8f96e22bd60f2f04b49035768d6f0c80 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 19 Feb 2024 13:35:03 +0100 Subject: [PATCH 06/26] Meson: Add license, minimum version, fix PCH --- meson.build | 2 ++ src/game/meson.build | 2 +- src/shared/meson.build | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 97950ef0e8c..2664f27af86 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,6 @@ project('CMaNGOS WotLK', 'cpp', 'c', + license: 'GPL-2.0-only', + meson_version: '>=1.3.1', default_options : ['cpp_std=vc++17,c++17', 'buildtype=release', 'warning_level=0', 'default_library=static']) if build_machine.system() == 'windows' diff --git a/src/game/meson.build b/src/game/meson.build index c03e467ad8d..2f2b2b8c465 100644 --- a/src/game/meson.build +++ b/src/game/meson.build @@ -787,7 +787,7 @@ endif if not get_option('PCH') pch_files = [] else - pch_files = ['../game/pchdef.h', '../game/pchdef.cpp'] + pch_files = ['../game/pchdef.h'] endif game_args = ['-DDT_POLYREF64', '-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0'] diff --git a/src/shared/meson.build b/src/shared/meson.build index 66493f4a0a6..46ca2dad247 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -76,7 +76,7 @@ actual_rev = vcs_tag( if not get_option('PCH') pch_files = [] else - pch_files = ['../shared/pchdef.h', '../shared/pchdef.cpp'] + pch_files = ['../shared/pchdef.h'] endif if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') or get_option('BUILD_EXTRACTORS') From 12312f1fc3d2dbbbf53a9858088fdb0597409fa2 Mon Sep 17 00:00:00 2001 From: insunaa Date: Thu, 14 Mar 2024 12:31:41 +0100 Subject: [PATCH 07/26] Add changes to Log.h --- src/shared/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/meson.build b/src/shared/meson.build index 46ca2dad247..55fc7d15c74 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -3,7 +3,7 @@ shared_sources = [ 'Metric/Metric.cpp', 'Util/Util.cpp', 'Multithreading/Messager.cpp', - 'Log.cpp', + 'Log/Log.cpp', 'Util/ProgressBar.cpp', 'Multithreading/Threading.cpp', 'Util/ByteBuffer.cpp', From e469894761bcbbe91acfb2bb1887e8423c8b5ff1 Mon Sep 17 00:00:00 2001 From: insunaa Date: Fri, 3 May 2024 14:07:40 +0200 Subject: [PATCH 08/26] Meson: Remove unused files --- src/shared/meson.build | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/shared/meson.build b/src/shared/meson.build index 55fc7d15c74..3d4b13f23ef 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -26,10 +26,6 @@ shared_sources = [ 'Auth/HMACSHA1.cpp', 'Auth/BigNumber.cpp', 'Common.cpp', - 'Network/Socket.cpp', - 'Network/PacketBuffer.cpp', - 'Network/NetworkThread.cpp', - 'Network/Listener.cpp', 'Config/Config.cpp' ] From d324d3c3b12cf1abcd2a81818324ba944e3c7466 Mon Sep 17 00:00:00 2001 From: insunaa Date: Sat, 4 May 2024 15:14:09 +0200 Subject: [PATCH 09/26] Meson: Ignore Modules --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 34f87cabac2..8e1bacb6355 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,8 @@ cmake_install.cmake # Special exceptions # +src/modules + # recastnavigation directory needs exception !dep/recastnavigation/RecastDemo/Build/ /_build/ From 78cefcfda389b326489b6c90164a3ca6ca959c5e Mon Sep 17 00:00:00 2001 From: insunaa Date: Fri, 10 May 2024 10:26:14 +0200 Subject: [PATCH 10/26] Meson: Add Botanica changes --- src/game/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/meson.build b/src/game/meson.build index 2f2b2b8c465..5a4ab8aacb4 100644 --- a/src/game/meson.build +++ b/src/game/meson.build @@ -500,6 +500,7 @@ scriptdev_sources = [ 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp', 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp', 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_thorngrin_the_tender.cpp', + 'AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/botanica.cpp', 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp', 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/arcatrazScripts.cpp', 'AI/ScriptDevAI/scripts/outland/tempest_keep/arcatraz/boss_soccothrates.cpp', From 0cb27b437509dbb4d37098435c4a699c3c4c8ebc Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 15 Jul 2024 08:31:34 +0200 Subject: [PATCH 11/26] Meson: Set new minimum OpenSSL version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2664f27af86..db7ad36dd0c 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,7 @@ if not boost_dep.found() endif dblib_dep = dependency('mariadb', 'libmariadb', 'mysql', 'libmysql', 'postgresql', required: false) zlib_dep = dependency('zlib', version: '>=1.2.13', static: true, fallback: ['zlib', 'zlib_dep'], required: true) -openssl_dep = dependency('openssl', version: '>=1.1.1', static: true, fallback: ['openssl'], required: true) +openssl_dep = dependency('openssl', version: '>=3.0.14', static: true, fallback: ['openssl'], required: true) utfcpp_dep = dependency('utf8cpp', 'utfcpp', static: true, required: false) sqlite_dep = dependency('sqlite3', static: true, fallback: ['sqlite3'], required: get_option('SQLITE')) From 31d19a1c9b9751992f1d3ea9b8c8128686a66b2f Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 15 Jul 2024 08:32:49 +0200 Subject: [PATCH 12/26] Meson: Update wrap dependencies --- subprojects/sqlite3.wrap | 18 +++++++++--------- subprojects/utfcpp.wrap | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/subprojects/sqlite3.wrap b/subprojects/sqlite3.wrap index bacc6f5a552..5d2eb5c5122 100644 --- a/subprojects/sqlite3.wrap +++ b/subprojects/sqlite3.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = sqlite-amalgamation-3450100 -source_url = https://www.sqlite.org/2024/sqlite-amalgamation-3450100.zip -source_filename = sqlite-amalgamation-3450100.zip -source_hash = 5592243caf28b2cdef41e6ab58d25d653dfc53deded8450eb66072c929f030c4 -patch_filename = sqlite3_3.45.1-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.45.1-1/get_patch -patch_hash = fc2d083fed0de64991c9754a25c7532ef1fd581f7751778b5484f099bec5d6dd -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.45.1-1/sqlite-amalgamation-3450100.zip -wrapdb_version = 3.45.1-1 +directory = sqlite-amalgamation-3460000 +source_url = https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip +source_filename = sqlite-amalgamation-3460000.zip +source_hash = 712a7d09d2a22652fb06a49af516e051979a3984adb067da86760e60ed51a7f5 +patch_filename = sqlite3_3.46.0-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.46.0-1/get_patch +patch_hash = c6dda193e59e4bd11dbc6f399cae1904d231e0cb119224480bec6c94c5d0e04e +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.46.0-1/sqlite-amalgamation-3460000.zip +wrapdb_version = 3.46.0-1 [provide] sqlite3 = sqlite3_dep diff --git a/subprojects/utfcpp.wrap b/subprojects/utfcpp.wrap index 3512216208d..1416c2c132d 100644 --- a/subprojects/utfcpp.wrap +++ b/subprojects/utfcpp.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = utfcpp-3.2.4 -source_url = https://github.com/nemtrif/utfcpp/archive/v3.2.4.tar.gz -source_filename = utfcpp-3.2.4.tar.gz -source_hash = fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e -patch_filename = utfcpp_3.2.4-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/utfcpp_3.2.4-1/get_patch -patch_hash = 8e233b728579a5e14784e6886767b8e467862fe80baa19e4bea1e3e7c4cf12ae -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/utfcpp_3.2.4-1/utfcpp-3.2.4.tar.gz -wrapdb_version = 3.2.4-1 +directory = utfcpp-4.0.5 +source_url = https://github.com/nemtrif/utfcpp/archive/refs/tags/v4.0.5.tar.gz +source_filename = utfcpp-4.0.5.tar.gz +source_hash = ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf +patch_filename = utfcpp_4.0.5-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/utfcpp_4.0.5-1/get_patch +patch_hash = bedf83d77b07a2fb84582722aaf748498cab0267b023ff8460dae3730a2d0819 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/utfcpp_4.0.5-1/utfcpp-4.0.5.tar.gz +wrapdb_version = 4.0.5-1 [provide] utf8cpp = utfcpp_dep From e3722b56aa69e62c5a4b3016c4efb7d56cee06df Mon Sep 17 00:00:00 2001 From: insunaa Date: Sat, 3 Aug 2024 10:38:56 +0200 Subject: [PATCH 13/26] Meson: Remove Maker from list --- src/game/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/src/game/meson.build b/src/game/meson.build index 5a4ab8aacb4..073e0d90026 100644 --- a/src/game/meson.build +++ b/src/game/meson.build @@ -514,7 +514,6 @@ scriptdev_sources = [ 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.cpp', 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp', 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp', - 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp', 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp', 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.cpp', 'AI/ScriptDevAI/scripts/outland/hellfire_citadel/shattered_halls/shattered_hallsScripts.cpp', From bf4c076b06a3df516f441117997d14fb94b9eab5 Mon Sep 17 00:00:00 2001 From: insunaa Date: Sun, 8 Jan 2023 21:07:59 +0100 Subject: [PATCH 14/26] Ulduar: Convert Razorscale to BossAI + Spell Lists --- .../ulduar/ulduar/boss_razorscale.cpp | 893 ++++++++---------- 1 file changed, 411 insertions(+), 482 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index d5739a0b990..a07e034e330 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -23,6 +23,7 @@ EndScriptData */ #include "AI/ScriptDevAI/include/sc_common.h" #include "ulduar.h" +#include "AI/ScriptDevAI/base/BossAI.h" enum { @@ -91,11 +92,10 @@ enum GOSSIP_ITEM_START_RAZORSCALE = -3603009, GOSSIP_MENU_ID_WELCOME = 14317, - // phases - PHASE_AIR = 1, - PHASE_GROUNDED = 2, - PHASE_ONLY_GROUND = 3, - PHASE_TRANSITION = 4, + RAZORSCALE_SPELLSET_10N_AIR = 3318600, + RAZORSCALE_SPELLSET_10N_GROUND = 3318601, + RAZORSCALE_SPELLSET_25N_AIR = 3318600, + RAZORSCALE_SPELLSET_25N_GROUND = 3318601, }; static const DialogueEntry aIntroDialogue[] = @@ -120,43 +120,145 @@ static const float afRazorscaleSpawnersPos[3][3] = ## boss_razorscale ######*/ -struct boss_razorscaleAI : public ScriptedAI +enum RazorscaleActions { - boss_razorscaleAI(Creature* pCreature) : ScriptedAI(pCreature) + RAZORSCALE_BERSERK, + RAZORSCALE_SPAWN_ADDS, + RAZORSCALE_REPAIR_HARPOONS, + RAZORSCALE_TRANSITION_TO_GROUND, + RAZORSCALE_GROUNDED_FLAME_BREATH, + RAZORSCALE_GROUNDED_WING_BUFFET, + RAZORSCALE_GROUNDED_FIREBOLT, + RAZORSCALE_GROUNDED_LIFTOFF, + RAZORSCALE_HEALTH_CHECK, + RAZORSCALE_PLAYER_CHECK, + RAZORSCALE_ACTIONS_MAX, +}; + +struct boss_razorscaleAI : public BossAI +{ + boss_razorscaleAI(Creature* creature) : BossAI(creature, RAZORSCALE_ACTIONS_MAX), + m_instance(dynamic_cast(creature->GetInstanceData())), + m_isRegularMode(creature->GetMap()->IsRegularDifficulty()), + m_maxHarpoons(m_isRegularMode ? 2 : 4) { - m_pInstance = (instance_ulduar*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - m_uiMaxHarpoons = m_bIsRegularMode ? 2 : 4; + SetDataType(TYPE_RAZORSCALE); + AddCustomAction(RAZORSCALE_GROUNDED_FLAME_BREATH, true, [&]() + { + m_creature->RemoveAurasDueToSpell(SPELL_STUN); + if (DoCastSpellIfCan(m_creature, m_isRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) + { + DoBroadcastText(EMOTE_BREATH, m_creature); + ResetTimer(RAZORSCALE_GROUNDED_WING_BUFFET, 2s + 510ms); + } + }); + AddCustomAction(RAZORSCALE_GROUNDED_WING_BUFFET, true, [&]() + { + if (DoCastSpellIfCan(m_creature, SPELL_WING_BUFFET, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) + ResetTimer(RAZORSCALE_GROUNDED_FIREBOLT, 1s + 510ms); + }); + AddCustomAction(RAZORSCALE_GROUNDED_FIREBOLT, true, [&]() + { + if (DoCastSpellIfCan(m_creature, SPELL_FIREBOLT, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) + ResetTimer(RAZORSCALE_GROUNDED_LIFTOFF, 2s); + }); + AddCustomAction(RAZORSCALE_GROUNDED_LIFTOFF, true, [&]() + { + if (m_isGrounded) + { + SetCombatMovement(true); + DoResetThreat(); + DoStartMovement(m_creature->GetVictim()); + m_creature->SetSpellList(m_isRegularMode ? RAZORSCALE_SPELLSET_10N_GROUND : RAZORSCALE_SPELLSET_25N_GROUND); + } + // resume air phase + else + { + m_creature->SetLevitate(true); + m_creature->SetCanFly(true); + m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); + + float fX, fY, fZ; + m_creature->GetRespawnCoord(fX, fY, fZ); + + // use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail + uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); + m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); + m_creature->GetMotionMaster()->MovePointTOL(1, fX, fY, fZ, true); + m_creature->SetSpeedRate(MOVE_RUN, speedRate); + + // reset timers + m_currentHarpoon = 0; + m_harpoonsUsed = 0; + ResetTimer(RAZORSCALE_REPAIR_HARPOONS, 20s); + ResetCombatAction(RAZORSCALE_SPAWN_ADDS, 1s); + ++m_airPhaseCount; + + // set achiev criteria as failed + if (m_airPhaseCount >= 2 && m_instance) + m_instance->SetSpecialAchievementCriteria(TYPE_ACHIEV_QUICK_SHAVE, false); + } + + // make the Trappers evade or move to home position + for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) + { + if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) + pTrapper->AI()->EnterEvadeMode(); + } + }); + AddCustomAction(RAZORSCALE_TRANSITION_TO_GROUND, true, [&]() + { + // cast trap visual + for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) + { + if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) + pTrapper->CastSpell(m_creature, SPELL_SHACKLE, TRIGGERED_NONE); + } + + // stun Razorscale + if (DoCastSpellIfCan(m_creature, SPELL_STUN, CAST_TRIGGERED) == CAST_OK) + { + m_creature->SetLevitate(false); + m_creature->SetCanFly(false); + m_creature->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); + + ResetTimer(RAZORSCALE_GROUNDED_FLAME_BREATH, 30s); + } + }); + AddCustomAction(RAZORSCALE_HEALTH_CHECK, 1s, [&]() + { + if (m_creature->GetHealthPercent() <= 50.f) + { + DoBroadcastText(EMOTE_GROUNDED, m_creature); + m_isGrounded = true; + DisableTimer(RAZORSCALE_HEALTH_CHECK); + ResetTimer(RAZORSCALE_GROUNDED_FLAME_BREATH, 0s); + return; + } + ResetTimer(RAZORSCALE_HEALTH_CHECK, 1s); + }); + AddCombatAction(RAZORSCALE_PLAYER_CHECK, 2s); + AddCombatAction(RAZORSCALE_REPAIR_HARPOONS, true); + AddCombatAction(RAZORSCALE_BERSERK, 10min); + AddCombatAction(RAZORSCALE_SPAWN_ADDS, 1s); + m_creature->SetIgnoreMMAP(true); m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); Reset(); } - instance_ulduar* m_pInstance; - bool m_bIsRegularMode; - - uint8 m_uiPhase; - bool m_bIsGrounded; - - uint32 m_uiBerserkTimer; + instance_ulduar* m_instance; + bool m_isRegularMode; - uint32 m_uiFireballTimer; - uint32 m_uiDevouringFlameTimer; - uint32 m_uiDwarfSpawnTimer; - uint32 m_uiRepairHarpoonTimer; + bool m_isGrounded; + bool m_enterEvadeMode; - uint32 m_uiShackleTimer; - uint32 m_uiGroundedTimer; uint8 m_uiGroundedStep; - uint32 m_uiFlameBuffetTimer; - uint32 m_uiFuseArmorTimer; - uint32 m_uiFlameBreathTimer; - - uint8 m_uiMaxHarpoons; - uint8 m_uiCurrentHarpoon; - uint8 m_uiHarpoonsUsed; - uint8 m_uiFlyPhaseCount; + uint8 m_maxHarpoons; + uint8 m_currentHarpoon; + uint8 m_harpoonsUsed; + uint8 m_airPhaseCount; GuidList m_lEngineersGuids; GuidList m_lTrappersGuids; @@ -164,26 +266,13 @@ struct boss_razorscaleAI : public ScriptedAI void Reset() override { - m_uiPhase = PHASE_AIR; - m_bIsGrounded = false; - m_uiBerserkTimer = 10 * MINUTE * IN_MILLISECONDS; - - m_uiFireballTimer = 5000; - m_uiDevouringFlameTimer = 10000; - m_uiDwarfSpawnTimer = 1000; - m_uiRepairHarpoonTimer = 0; - - m_uiShackleTimer = 5000; - m_uiHarpoonsUsed = 0; - m_uiCurrentHarpoon = 0; - m_uiFlyPhaseCount = 0; + BossAI::Reset(); + m_isGrounded = false; + m_enterEvadeMode = false; - m_uiGroundedTimer = 30000; - m_uiGroundedStep = 0; - - m_uiFlameBuffetTimer = 10000; - m_uiFuseArmorTimer = 13000; - m_uiFlameBreathTimer = 15000; + m_harpoonsUsed = 0; + m_currentHarpoon = 0; + m_airPhaseCount = 0; // no combat movement in phase 1 SetCombatMovement(false); @@ -192,475 +281,272 @@ struct boss_razorscaleAI : public ScriptedAI m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); } - void JustDied(Unit* /*pKiller*/) override + void EnterEvadeMode() override { - if (m_pInstance) - m_pInstance->SetData(TYPE_RAZORSCALE, DONE); + if (m_creature->GetMap()->GetPlayersCountExceptGMs() > 0) + return; + BossAI::EnterEvadeMode(); } - void Aggro(Unit* /*pWho*/) override + void Aggro(Unit* who) override { - if (m_pInstance) - { - m_pInstance->SetData(TYPE_RAZORSCALE, IN_PROGRESS); - - // load engineers and harpoon data - m_pInstance->GetEngineersGuids(m_lEngineersGuids); - m_pInstance->GetTrappersGuids(m_lTrappersGuids); - m_pInstance->GetHarpoonsGuids(m_vHarpoonsGuids); - } + BossAI::Aggro(); + if (!m_instance) + return; + // load engineers and harpoon data + m_instance->GetEngineersGuids(m_lEngineersGuids); + m_instance->GetTrappersGuids(m_lTrappersGuids); + m_instance->GetHarpoonsGuids(m_vHarpoonsGuids); } void JustReachedHome() override { - if (m_pInstance) - m_pInstance->SetData(TYPE_RAZORSCALE, FAIL); - + BossAI::JustReachedHome(); m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); } - void JustSummoned(Creature* pSummoned) override + void JustSummoned(Creature* summoned) override { - if (pSummoned->GetEntry() == NPC_DEVOURING_FLAME) - pSummoned->CastSpell(pSummoned, m_bIsRegularMode ? SPELL_DEVOURING_FLAME_AURA : SPELL_DEVOURING_FLAME_AURA_H, TRIGGERED_OLD_TRIGGERED); - else if (pSummoned->GetEntry() == NPC_RAZORSCALE_SPAWNER) + if (summoned->GetEntry() == NPC_RAZORSCALE_SPAWNER) { - pSummoned->CastSpell(pSummoned, SPELL_SUMMON_MOLE_MACHINE, TRIGGERED_OLD_TRIGGERED); + summoned->CastSpell(summoned, SPELL_SUMMON_MOLE_MACHINE, TRIGGERED_OLD_TRIGGERED); // for central spawners inform that they should spawn a sentinel - if (pSummoned->GetPositionY() > -220.0f) - SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pSummoned); + if (summoned->GetPositionY() > -220.0f) + SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, summoned); } } - void ReceiveAIEvent(AIEventType eventType, Unit* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override + void ReceiveAIEvent(AIEventType eventType, Unit* /*sender*/, Unit* invoker, uint32 /*miscValue*/) override { // inform about the harpoon repair event if (eventType == AI_EVENT_CUSTOM_A) { DoMoveEngineersToHarpoon(); - m_uiRepairHarpoonTimer = 20000; + ResetCombatAction(RAZORSCALE_REPAIR_HARPOONS, 20s); } // inform about a harpoon being shot if (eventType == AI_EVENT_CUSTOM_B) { - ++m_uiHarpoonsUsed; + ++m_harpoonsUsed; // start grounded phase - if (m_uiHarpoonsUsed == m_uiMaxHarpoons) + if (m_harpoonsUsed == m_maxHarpoons) { // use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail - uint32 uiSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); + uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); m_creature->SetWalk(false); m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); - m_creature->GetMotionMaster()->MovePointTOL(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); - m_creature->SetSpeedRate(MOVE_RUN, uiSpeedRate); - - m_uiPhase = PHASE_TRANSITION; - m_uiShackleTimer = 5000; + //m_creature->GetMotionMaster()->MovePointTOL(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); + m_creature->GetMotionMaster()->MovePoint(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], FORCED_MOVEMENT_FLIGHT, false); + m_creature->SetSpeedRate(MOVE_RUN, speedRate); + ResetTimer(RAZORSCALE_TRANSITION_TO_GROUND, 5s); + DisableCombatAction(RAZORSCALE_SPAWN_ADDS); // move the trappers around float fX, fY, fZ; - uint8 uiIndex = 5; - if (m_pInstance) + uint8 index = 5; + if (m_instance) { - if (Creature* pController = m_pInstance->GetSingleCreatureFromStorage(NPC_RAZORSCALE_CONTROLLER)) + if (Creature* controller = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE_CONTROLLER)) { for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) { if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) { - pController->GetNearPoint(pController, fX, fY, fZ, 0, 50.0f, M_PI_F / 4 * uiIndex); + controller->GetNearPoint(controller, fX, fY, fZ, 0, 50.0f, M_PI_F / 4 * index); pTrapper->SetWalk(false); - uiSpeedRate = pTrapper->GetSpeedRate(MOVE_RUN); + speedRate = pTrapper->GetSpeedRate(MOVE_RUN); pTrapper->SetSpeedRate(MOVE_RUN, SPEED_RATE_HELPERS); pTrapper->GetMotionMaster()->MovePoint(1, fX, fY, fZ); - pTrapper->SetSpeedRate(MOVE_RUN, uiSpeedRate); - ++uiIndex; + pTrapper->SetSpeedRate(MOVE_RUN, speedRate); + ++index; } } } // yell that Razor is grounded - if (Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_EXPEDITION_COMMANDER)) - DoScriptText(SAY_GROUNDED, pCommander); + if (Creature* commander = m_instance->GetSingleCreatureFromStorage(NPC_EXPEDITION_COMMANDER)) + DoBroadcastText(SAY_GROUNDED, commander); } } } } - // function to spawn the mole machines - void DoSpawnMoleMachines() - { - // Note: this should be a little more random in therms of position and timer delays between the spawns - uint8 uiMaxMachines = roll_chance_i(33) ? 3 : 2; - float fX, fY, fZ; - - for (uint8 i = 0; i < uiMaxMachines; ++i) - { - m_creature->GetRandomPoint(afRazorscaleSpawnersPos[i][0], afRazorscaleSpawnersPos[i][1], afRazorscaleSpawnersPos[i][2], 10.0f, fX, fY, fZ); - m_creature->SummonCreature(NPC_RAZORSCALE_SPAWNER, fX, fY, fZ, 0, TEMPSPAWN_TIMED_DESPAWN, 10000); - } - } - // function to enable harpoon repair animation void DoMoveEngineersToHarpoon() { float fX, fY, fZ; - uint8 uiIndex = 1; + uint8 index = 1; // get the current harpoon and move the engineers in front of it - if (GameObject* pHarpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_uiCurrentHarpoon])) + if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_currentHarpoon])) { for (GuidList::const_iterator itr = m_lEngineersGuids.begin(); itr != m_lEngineersGuids.end(); ++itr) { - if (Creature* pEngineer = m_creature->GetMap()->GetCreature(*itr)) + if (Creature* engineer = m_creature->GetMap()->GetCreature(*itr)) { - pHarpoon->GetNearPoint(pHarpoon, fX, fY, fZ, 0, INTERACTION_DISTANCE, M_PI_F / 4 * uiIndex); + harpoon->GetNearPoint(harpoon, fX, fY, fZ, 0, INTERACTION_DISTANCE, M_PI_F / 4 * index); // ToDo: maybe there should be some emotes here - pEngineer->SetWalk(false); - pEngineer->GetMotionMaster()->MovePoint(1, fX, fY, fZ); - ++uiIndex; + engineer->SetWalk(false); + engineer->GetMotionMaster()->MovePoint(1, fX, fY, fZ); + engineer->HandleEmoteState(EMOTE_STATE_USESTANDING); + ++index; } } } - ++m_uiCurrentHarpoon; + ++m_currentHarpoon; } // function to repair nearby harpoon - void DoRepairHarpoon(GameObject* pSource) + void DoRepairHarpoon(GameObject* source) { // search for each entry of the nearby harpoon - GameObject* pNewHarpoon = GetClosestGameObjectWithEntry(pSource, GO_HARPOON_GUN_1, 5.0f); - if (!pNewHarpoon) - pNewHarpoon = GetClosestGameObjectWithEntry(pSource, GO_HARPOON_GUN_2, 5.0f); - if (!pNewHarpoon) - pNewHarpoon = GetClosestGameObjectWithEntry(pSource, GO_HARPOON_GUN_3, 5.0f); - if (!pNewHarpoon) - pNewHarpoon = GetClosestGameObjectWithEntry(pSource, GO_HARPOON_GUN_4, 5.0f); - - if (pNewHarpoon) + GameObject* newHarpoon = GetClosestGameObjectWithEntry(source, GO_HARPOON_GUN_1, 5.0f); + if (!newHarpoon) + newHarpoon = GetClosestGameObjectWithEntry(source, GO_HARPOON_GUN_2, 5.0f); + if (!newHarpoon) + newHarpoon = GetClosestGameObjectWithEntry(source, GO_HARPOON_GUN_3, 5.0f); + if (!newHarpoon) + newHarpoon = GetClosestGameObjectWithEntry(source, GO_HARPOON_GUN_4, 5.0f); + + if (newHarpoon) { - pNewHarpoon->SetRespawnTime(HOUR); - pNewHarpoon->Refresh(); + newHarpoon->SetRespawnTime(HOUR); + newHarpoon->Refresh(); } } - // custom threat management to support air phase with a high distance from the ground - bool SelectCustomHostileTarget() + std::chrono::milliseconds GetSubsequentActionTimer(uint32 action) { - if (m_uiPhase == PHASE_ONLY_GROUND || m_uiPhase == PHASE_GROUNDED) - return m_creature->SelectHostileTarget() && m_creature->GetVictim(); - - // Special handling for PHASE_AIR - - // Not started combat or evading prevented - if (!m_creature->IsInCombat() || m_creature->HasAuraType(SPELL_AURA_MOD_TAUNT)) - return false; - - // Check if there are still enemies (players) - ThreatList const& threatList = m_creature->getThreatManager().getThreatList(); - for (auto itr : threatList) + switch (action) { - if (itr->getUnitGuid().IsPlayer()) - return true; + case RAZORSCALE_PLAYER_CHECK: return 1s; + case RAZORSCALE_REPAIR_HARPOONS: return 20s; + case RAZORSCALE_SPAWN_ADDS: return 40s; } - - // Evade in air-phase - EnterEvadeMode(); - return false; } - void UpdateAI(const uint32 uiDiff) override + void ExecuteAction(uint32 action) override { - if (!SelectCustomHostileTarget()) - return; - - if (m_uiBerserkTimer) + switch (action) { - if (m_uiBerserkTimer <= uiDiff) + case RAZORSCALE_PLAYER_CHECK: { - if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) - m_uiBerserkTimer = 0; - } - else - m_uiBerserkTimer -= uiDiff; - } + if (!m_creature->IsInCombat() || m_creature->HasAuraType(SPELL_AURA_MOD_TAUNT)) + break; - switch (m_uiPhase) - { - case PHASE_AIR: - - if (m_uiFireballTimer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - { - if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H) == CAST_OK) - m_uiFireballTimer = 2000; - } - } - else - m_uiFireballTimer -= uiDiff; + // Check if there are still enemies (players) + if (m_creature->GetMap()->GetPlayersCountExceptGMs() > 0) + break; - if (m_uiDevouringFlameTimer < uiDiff) + ThreatList const& threatList = m_creature->getThreatManager().getThreatList(); + for (auto itr : threatList) { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - { - if (DoCastSpellIfCan(pTarget, SPELL_DEVOURING_FLAME) == CAST_OK) - m_uiDevouringFlameTimer = 10000; - } + if (itr->getUnitGuid().IsPlayer()) + break; } - else - m_uiDevouringFlameTimer -= uiDiff; - // harpoon is repaired; move to next one, or to home position if all are completed - if (m_uiRepairHarpoonTimer) + // Evade in air-phase + m_enterEvadeMode = true; + EnterEvadeMode(); + return; + } + case RAZORSCALE_BERSERK: + { + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) + DisableCombatAction(action); + return; + } + case RAZORSCALE_REPAIR_HARPOONS: + { + if (!m_currentHarpoon) { - if (m_uiRepairHarpoonTimer <= uiDiff) + // extinguish fires + if (!m_instance) + return; + if (Creature* commander = m_instance->GetSingleCreatureFromStorage(NPC_EXPEDITION_COMMANDER)) { - // handle fire extinguish after a grounded phase - if (!m_uiCurrentHarpoon) - { - // extinguish fires - if (m_pInstance) - { - if (Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_EXPEDITION_COMMANDER)) - { - if (Creature* pEngineer = GetClosestCreatureWithEntry(pCommander, NPC_EXPEDITION_ENGINEER, 15.0f)) - DoScriptText(SAY_EXTINGUISH_FIRE, pEngineer); - } - } - - // move engineers to the first harpoon again - DoMoveEngineersToHarpoon(); - m_uiRepairHarpoonTimer = 20000; - } - else - { - DoScriptText(EMOTE_HARPOON_READY, m_creature); - - // despawn the current broken harpoon and spawn the repaired one - if (GameObject* pHarpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_uiCurrentHarpoon - 1])) - { - pHarpoon->SetRespawnTime(HOUR); - pHarpoon->SetLootState(GO_JUST_DEACTIVATED); - - DoRepairHarpoon(pHarpoon); - } - - // if all harpoons have been repaired stop - if (m_uiCurrentHarpoon == m_uiMaxHarpoons) - { - for (GuidList::const_iterator itr = m_lEngineersGuids.begin(); itr != m_lEngineersGuids.end(); ++itr) - { - if (Creature* pEngineer = m_creature->GetMap()->GetCreature(*itr)) - pEngineer->GetMotionMaster()->MoveTargetedHome(); - } - - m_uiRepairHarpoonTimer = 0; - } - // move to next harpoon - else - { - DoMoveEngineersToHarpoon(); - m_uiRepairHarpoonTimer = 20000; - } - } + if (Creature* engineer = GetClosestCreatureWithEntry(commander, NPC_EXPEDITION_ENGINEER, 15.0f)) + DoBroadcastText(SAY_EXTINGUISH_FIRE, engineer); } - else - m_uiRepairHarpoonTimer -= uiDiff; - } - // spawn Mole Machines with dwarfes - if (m_uiDwarfSpawnTimer < uiDiff) - { - DoSpawnMoleMachines(); - m_uiDwarfSpawnTimer = 40000; + // move engineers to the first harpoon again + DoMoveEngineersToHarpoon(); + break; } else - m_uiDwarfSpawnTimer -= uiDiff; - - break; - case PHASE_TRANSITION: - - if (m_uiShackleTimer < uiDiff) { - // cast trap visual - for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) - { - if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) - pTrapper->CastSpell(m_creature, SPELL_SHACKLE, TRIGGERED_NONE); - } + DoBroadcastText(EMOTE_HARPOON_READY, m_creature); - // stun Razorscale - if (DoCastSpellIfCan(m_creature, SPELL_STUN) == CAST_OK) + // despawn the current broken harpoon and spawn the repaired one + if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_currentHarpoon - 1])) { - m_creature->SetLevitate(false); - m_creature->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); + harpoon->SetRespawnTime(HOUR); + harpoon->SetLootState(GO_JUST_DEACTIVATED); - m_uiPhase = PHASE_GROUNDED; - m_uiGroundedTimer = 30000; - m_uiGroundedStep = 0; - m_uiShackleTimer = 5000; + DoRepairHarpoon(harpoon); + harpoon->ForcedDespawn(); } - } - else - m_uiShackleTimer -= uiDiff; - break; - case PHASE_GROUNDED: - - if (m_uiGroundedTimer < uiDiff) - { - switch (m_uiGroundedStep) + // if all harpoons have been repaired stop + if (m_currentHarpoon == m_maxHarpoons) { - case 0: - m_creature->RemoveAurasDueToSpell(SPELL_STUN); - if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H) == CAST_OK) - { - DoScriptText(EMOTE_BREATH, m_creature); - m_uiGroundedTimer = 2500; - } - break; - case 1: - if (DoCastSpellIfCan(m_creature, SPELL_WING_BUFFET) == CAST_OK) - m_uiGroundedTimer = 1500; - break; - case 2: - if (DoCastSpellIfCan(m_creature, SPELL_FIREBOLT) == CAST_OK) - m_uiGroundedTimer = 2000; - break; - case 3: - // if fully grounded then go to ground phase - if (m_bIsGrounded) - { - SetCombatMovement(true); - DoResetThreat(); - DoStartMovement(m_creature->GetVictim()); - m_uiPhase = PHASE_ONLY_GROUND; - } - // resume air phase - else + for (GuidList::const_iterator itr = m_lEngineersGuids.begin(); itr != m_lEngineersGuids.end(); ++itr) + { + if (Creature* engineer = m_creature->GetMap()->GetCreature(*itr)) { - m_creature->SetLevitate(true); - m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); - - float fX, fY, fZ; - m_creature->GetRespawnCoord(fX, fY, fZ); - - // use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail - uint32 uiSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); - m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); - m_creature->GetMotionMaster()->MovePointTOL(1, fX, fY, fZ, true); - m_creature->SetSpeedRate(MOVE_RUN, uiSpeedRate); - - // reset timers - m_uiPhase = PHASE_AIR; - m_uiCurrentHarpoon = 0; - m_uiHarpoonsUsed = 0; - m_uiRepairHarpoonTimer = 20000; - m_uiFireballTimer = 5000; - m_uiDevouringFlameTimer = 10000; - ++m_uiFlyPhaseCount; - - // set achiev criteria as failed - if (m_uiFlyPhaseCount >= 2 && m_pInstance) - m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_QUICK_SHAVE, false); + engineer->GetMotionMaster()->MoveTargetedHome(); + engineer->HandleEmoteState(EMOTE_STATE_STAND); } + } - // make the Trappers evade or move to home position - for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) - { - if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) - pTrapper->AI()->EnterEvadeMode(); - } - break; + DisableCombatAction(action); + return; } - ++m_uiGroundedStep; - } - else - m_uiGroundedTimer -= uiDiff; - - // make boss land at 50% hp - if (!m_bIsGrounded && m_creature->GetHealthPercent() < 50.0f) - { - DoScriptText(EMOTE_GROUNDED, m_creature); - m_creature->RemoveAurasDueToSpell(SPELL_STUN); - m_uiGroundedStep = 1; - m_uiGroundedTimer = 0; - m_bIsGrounded = true; - } - - break; - case PHASE_ONLY_GROUND: - - if (m_uiDevouringFlameTimer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + // move to next harpoon + else { - if (DoCastSpellIfCan(pTarget, SPELL_DEVOURING_FLAME) == CAST_OK) - m_uiDevouringFlameTimer = 10000; + DoMoveEngineersToHarpoon(); + break; } } - else - m_uiDevouringFlameTimer -= uiDiff; - - if (m_uiFuseArmorTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_FUSE_ARMOR) == CAST_OK) - m_uiFuseArmorTimer = 13000; - } - else - m_uiFuseArmorTimer -= uiDiff; - - if (m_uiFlameBuffetTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET_H) == CAST_OK) - m_uiFlameBuffetTimer = 10000; - } - else - m_uiFlameBuffetTimer -= uiDiff; + } + case RAZORSCALE_SPAWN_ADDS: + { + uint8 uiMaxMachines = roll_chance_i(33) ? 3 : 2; + float fX, fY, fZ; - if (m_uiFlameBreathTimer < uiDiff) + for (uint8 i = 0; i < uiMaxMachines; ++i) { - if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H) == CAST_OK) - { - DoScriptText(EMOTE_BREATH, m_creature); - m_uiFlameBreathTimer = 15000; - } + m_creature->GetRandomPoint(afRazorscaleSpawnersPos[i][0], afRazorscaleSpawnersPos[i][1], afRazorscaleSpawnersPos[i][2], 10.0f, fX, fY, fZ); + m_creature->SummonCreature(NPC_RAZORSCALE_SPAWNER, fX, fY, fZ, 0, TEMPSPAWN_TIMED_DESPAWN, 10000); } - else - m_uiFlameBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); break; + } } + ResetCombatAction(action, GetSubsequentActionTimer(action)); } }; -UnitAI* GetAI_boss_razorscale(Creature* pCreature) -{ - return new boss_razorscaleAI(pCreature); -} - /*###### ## npc_expedition_commander ######*/ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper { - npc_expedition_commanderAI(Creature* pCreature) : ScriptedAI(pCreature), + npc_expedition_commanderAI(Creature* creature) : ScriptedAI(creature), DialogueHelper(aIntroDialogue) { - m_pInstance = (instance_ulduar*)pCreature->GetInstanceData(); - InitializeDialogueHelper(m_pInstance); + m_instance = (instance_ulduar*)creature->GetInstanceData(); + InitializeDialogueHelper(m_instance); m_bIntroDone = false; Reset(); } - instance_ulduar* m_pInstance; + instance_ulduar* m_instance; bool m_bIntroDone; @@ -668,21 +554,21 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper void Reset() override { } - void MoveInLineOfSight(Unit* pWho) override + void MoveInLineOfSight(Unit* who) override { // ToDo: verify if all this is correct. There may other parts of the intro which are currently missing - if (!m_bIntroDone && pWho->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(pWho, 20.0f)) + if (!m_bIntroDone && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 20.0f)) { - DoScriptText(SAY_INTRO_WELCOME, m_creature); + DoBroadcastText(SAY_INTRO_WELCOME, m_creature); m_bIntroDone = true; } - ScriptedAI::MoveInLineOfSight(pWho); + ScriptedAI::MoveInLineOfSight(who); } void JustDidDialogueStep(int32 iEntry) override { - if (!m_pInstance) + if (!m_instance) { script_error_log("Instance Ulduar: ERROR Failed to load instance data for this instace."); return; @@ -692,11 +578,11 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper { case NPC_EXPEDITION_ENGINEER: { - if (Creature* pEngineer = GetClosestCreatureWithEntry(m_creature, NPC_EXPEDITION_ENGINEER, 15.0f)) - DoScriptText(SAY_INTRO_1, pEngineer); + if (Creature* engineer = GetClosestCreatureWithEntry(m_creature, NPC_EXPEDITION_ENGINEER, 15.0f)) + DoBroadcastText(SAY_INTRO_1, engineer); GuidList m_lDefenderGuids; - m_pInstance->GetDefenderGuids(m_lDefenderGuids); + m_instance->GetDefenderGuids(m_lDefenderGuids); // move the defenders into attack position for (GuidList::const_iterator itr = m_lDefenderGuids.begin(); itr != m_lDefenderGuids.end(); ++itr) @@ -711,62 +597,58 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper break; } case NPC_RAZORSCALE: - if (Creature* pRazorscale = m_pInstance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + if (Creature* pRazorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) { if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid)) pRazorscale->AI()->AttackStart(pPlayer); + pRazorscale->SetInCombatWithZone(false); } break; case NPC_EXPEDITION_DEFENDER: - if (Creature* pEngineer = GetClosestCreatureWithEntry(m_creature, NPC_EXPEDITION_ENGINEER, 15.0f)) - DoScriptText(SAY_INTRO_3, pEngineer); + if (Creature* engineer = GetClosestCreatureWithEntry(m_creature, NPC_EXPEDITION_ENGINEER, 15.0f)) + DoBroadcastText(SAY_INTRO_3, engineer); // inform Razorscale about the start of the harpoon event - if (Creature* pRazorscale = m_pInstance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + if (Creature* pRazorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) m_creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pRazorscale); break; } } - void ReceiveAIEvent(AIEventType eventType, Unit* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override + void ReceiveAIEvent(AIEventType eventType, Unit* /*sender*/, Unit* invoker, uint32 /*miscValue*/) override { // start intro dialogue - if (eventType == AI_EVENT_CUSTOM_A && pInvoker->GetTypeId() == TYPEID_PLAYER) + if (eventType == AI_EVENT_CUSTOM_A && invoker->GetTypeId() == TYPEID_PLAYER) { StartNextDialogueText(NPC_EXPEDITION_ENGINEER); - m_playerGuid = pInvoker->GetObjectGuid(); + m_playerGuid = invoker->GetObjectGuid(); } } - void UpdateAI(const uint32 uiDiff) override { DialogueUpdate(uiDiff); } + void UpdateAI(const uint32 diff) override { DialogueUpdate(diff); } }; -UnitAI* GetAI_npc_expedition_commander(Creature* pCreature) -{ - return new npc_expedition_commanderAI(pCreature); -} - -bool GossipHello_npc_expedition_commander(Player* pPlayer, Creature* pCreature) +bool GossipHello_npc_expedition_commander(Player* pPlayer, Creature* creature) { - if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + if (ScriptedInstance* pInstance = (ScriptedInstance*)creature->GetInstanceData()) { if (pInstance->GetData(TYPE_RAZORSCALE) == NOT_STARTED || pInstance->GetData(TYPE_RAZORSCALE) == FAIL) pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START_RAZORSCALE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ID_WELCOME, pCreature->GetObjectGuid()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ID_WELCOME, creature->GetObjectGuid()); return true; } return false; } -bool GossipSelect_npc_expedition_commander(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +bool GossipSelect_npc_expedition_commander(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) { if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) { // start intro dialogue - pCreature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, pPlayer, pCreature); - pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, pPlayer, creature); + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pPlayer->CLOSE_GOSSIP_MENU(); } @@ -779,60 +661,82 @@ bool GossipSelect_npc_expedition_commander(Player* pPlayer, Creature* pCreature, struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI { - npc_razorscale_spawnerAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { Reset(); } - - uint32 m_uiSpawnTimer; - bool m_bIsSentinelSpawn; - - void Reset() override + npc_razorscale_spawnerAI(Creature* creature) : Scripted_NoMovementAI(creature), + m_instance(dynamic_cast(creature->GetInstanceData())) { - m_uiSpawnTimer = 5000; - m_bIsSentinelSpawn = false; + AddCustomAction(0, true, [&]() + { + GameObject* moleMachine = m_creature->GetMap()->GetGameObject(m_moleMachineGo); + if (!moleMachine) + return; + moleMachine->Use(m_creature); + moleMachine->ForcedDespawn(5000); + }); + AddCustomAction(1, 5s, [&]() + { + if (m_isSentinelSpawn) + DoCastSpellIfCan(m_creature, SPELL_SUMMON_IRON_VRYKUL, CAST_TRIGGERED); + else + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_DWARF_GUARDIAN, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_DWARF_WATCHER, CAST_TRIGGERED); + } + }); + SetReactState(REACT_PASSIVE); + SetRootSelf(true); } - void JustSummoned(Creature* pSummoned) override + uint32 m_uiSpawnTimer; + bool m_isSentinelSpawn = false; + ObjectGuid m_moleMachineGo; + instance_ulduar* m_instance; + + void JustSummoned(Creature* summoned) override { - pSummoned->SetInCombatWithZone(); + summoned->SetInCombatWithZone(); + summoned->SetIgnoreMMAP(true); + if (!m_instance) + return; + GuidList dwarves; + m_instance->GetEngineersGuids(dwarves); + for (ObjectGuid& guid : dwarves) + { + Creature* dwarf = m_creature->GetMap()->GetCreature(guid); + if (!dwarf) + continue; + dwarf->SetImmuneToNPC(false); + if (dwarf->AI()) + dwarf->AI()->SetReactState(REACT_PASSIVE); + m_creature->getThreatManager().addThreat(dwarf, 2000.f); + } + m_instance->GetDefenderGuids(dwarves); + for (ObjectGuid& guid : dwarves) + { + Creature* dwarf = m_creature->GetMap()->GetCreature(guid); + if (!dwarf) + continue; + dwarf->SetImmuneToNPC(false); + if (dwarf->AI()) + dwarf->AI()->SetReactState(REACT_AGGRESSIVE); + m_creature->getThreatManager().addThreat(dwarf, 2000.f); + } } void JustSummoned(GameObject* pGo) override { + m_moleMachineGo = pGo->GetObjectGuid(); + ResetTimer(0, 10s); pGo->Use(m_creature); } - void ReceiveAIEvent(AIEventType eventType, Unit* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override + void ReceiveAIEvent(AIEventType eventType, Unit* /*sender*/, Unit* invoker, uint32 /*miscValue*/) override { // inform that it should spawn a sentinel if (eventType == AI_EVENT_CUSTOM_A) - m_bIsSentinelSpawn = true; - } - - void UpdateAI(const uint32 uiDiff) override - { - if (m_uiSpawnTimer) - { - if (m_uiSpawnTimer <= uiDiff) - { - if (m_bIsSentinelSpawn) - DoCastSpellIfCan(m_creature, SPELL_SUMMON_IRON_VRYKUL, CAST_TRIGGERED); - else - { - DoCastSpellIfCan(m_creature, SPELL_SUMMON_DWARF_GUARDIAN, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SUMMON_DWARF_WATCHER, CAST_TRIGGERED); - } - m_uiSpawnTimer = 0; - } - else - m_uiSpawnTimer -= uiDiff; - } + m_isSentinelSpawn = true; } }; -UnitAI* GetAI_npc_razorscale_spawner(Creature* pCreature) -{ - return new npc_razorscale_spawnerAI(pCreature); -} - /*###### ## npc_harpoon_fire_state ######*/ @@ -840,45 +744,57 @@ UnitAI* GetAI_npc_razorscale_spawner(Creature* pCreature) // TODO Remove this 'script' when combat can be proper prevented from core-side struct npc_harpoon_fire_stateAI : public Scripted_NoMovementAI { - npc_harpoon_fire_stateAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { Reset(); } + npc_harpoon_fire_stateAI(Creature* creature) : Scripted_NoMovementAI(creature) + { + SetReactState(REACT_PASSIVE); + SetRootSelf(true); + } + + void DamageTaken(Unit* /*dealer*/, uint32& damage, DamageEffectType /*damageType*/, SpellEntry const* spellInfo) override + { + damage = 0; + if (spellInfo->Id != SPELL_FIREBOLT) + spellInfo = nullptr; + } void Reset() override { } - void AttackStart(Unit* /*pWho*/) override { } - void MoveInLineOfSight(Unit* /*pWho*/) override { } - void UpdateAI(const uint32 /*uiDiff*/) override { } + void AttackStart(Unit* /*who*/) override { } + void MoveInLineOfSight(Unit* /*who*/) override { } + void UpdateAI(const uint32 /*diff*/) override { } }; -UnitAI* GetAI_npc_harpoon_fire_state(Creature* pCreature) -{ - return new npc_harpoon_fire_stateAI(pCreature); -} - -bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget, ObjectGuid /*originalCasterGuid*/) +bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* creatureTarget, ObjectGuid /*originalCasterGuid*/) { // always check spellid and effectindex - if (uiSpellId == SPELL_FIREBOLT && uiEffIndex == EFFECT_INDEX_0 && pCreatureTarget->GetEntry() == NPC_HARPOON_FIRE_STATE) + if (uiSpellId == SPELL_FIREBOLT && uiEffIndex == EFFECT_INDEX_0 && creatureTarget->GetEntry() == NPC_HARPOON_FIRE_STATE) { - pCreatureTarget->CastSpell(pCreatureTarget, SPELL_HARPOON_FIRE, TRIGGERED_OLD_TRIGGERED); + creatureTarget->CastSpell(creatureTarget, SPELL_HARPOON_FIRE, TRIGGERED_OLD_TRIGGERED); // search for each entry of the nearby harpoon - GameObject* pHarpoon = GetClosestGameObjectWithEntry(pCreatureTarget, GO_HARPOON_GUN_1, 5.0f); - if (!pHarpoon) - pHarpoon = GetClosestGameObjectWithEntry(pCreatureTarget, GO_HARPOON_GUN_2, 5.0f); - if (!pHarpoon) - pHarpoon = GetClosestGameObjectWithEntry(pCreatureTarget, GO_HARPOON_GUN_3, 5.0f); - if (!pHarpoon) - pHarpoon = GetClosestGameObjectWithEntry(pCreatureTarget, GO_HARPOON_GUN_4, 5.0f); + GameObject* harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_1, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_2, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_3, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_4, 5.0f); // despawn the repaired harpoon - if (pHarpoon) - pHarpoon->SetLootState(GO_JUST_DEACTIVATED); + if (harpoon) + { + harpoon->SetLootState(GO_JUST_DEACTIVATED); + harpoon->ForcedDespawn(); + } // respawn broken harpoon - if (GameObject* pNewHarpoon = GetClosestGameObjectWithEntry(pCreatureTarget, GO_BROKEN_HARPOON, 5.0f)) - pNewHarpoon->Respawn(); + if (GameObject* newHarpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_BROKEN_HARPOON, 5.0f)) + { + newHarpoon->Refresh(); + newHarpoon->Respawn(); + } // force reset for harpoon trigger npcs - if (Creature* pTrigger = GetClosestCreatureWithEntry(pCreatureTarget, NPC_RAZORSCALE_CONTROLLER, 5.0f)) + if (Creature* pTrigger = GetClosestCreatureWithEntry(creatureTarget, NPC_RAZORSCALE_CONTROLLER, 5.0f)) pTrigger->InterruptNonMeleeSpells(false); // always return true when we are handling this spell and effect @@ -892,15 +808,15 @@ bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpel ## event_spell_harpoon_shot ######*/ -bool ProcessEventId_event_spell_harpoon_shot(uint32 /*uiEventId*/, Object* pSource, Object* /*pTarget*/, bool /*bIsStart*/) +bool ProcessEventId_event_spell_harpoon_shot(uint32 /*uiEventId*/, Object* source, Object* /*pTarget*/, bool /*bIsStart*/) { - if (((Creature*)pSource)->GetEntry() == NPC_RAZORSCALE_CONTROLLER) + if (((Creature*)source)->GetEntry() == NPC_RAZORSCALE_CONTROLLER) { - if (instance_ulduar* pInstance = (instance_ulduar*)((Creature*)pSource)->GetInstanceData()) + if (instance_ulduar* pInstance = (instance_ulduar*)((Creature*)source)->GetInstanceData()) { // event doesn't have target, so we need to give an explicit one if (Creature* pRazorscale = pInstance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) - ((Creature*)pSource)->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, (Creature*)pSource, pRazorscale); + ((Creature*)source)->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, (Creature*)source, pRazorscale); return true; } @@ -909,28 +825,39 @@ bool ProcessEventId_event_spell_harpoon_shot(uint32 /*uiEventId*/, Object* pSour return false; } +struct DevouringFlameRazorscale : public SpellScript +{ + void OnSummon(Spell* spell, Creature* summon) const override + { + if (summon->AI()) + summon->AI()->SetRootSelf(true); + bool isRegularModed = summon->GetMap()->IsRegularDifficulty(); + summon->CastSpell(nullptr, isRegularModed ? SPELL_DEVOURING_FLAME_AURA : SPELL_DEVOURING_FLAME_AURA_H, TRIGGERED_OLD_TRIGGERED); + } +}; + void AddSC_boss_razorscale() { Script* pNewScript = new Script; pNewScript->Name = "boss_razorscale"; - pNewScript->GetAI = GetAI_boss_razorscale; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->RegisterSelf(); pNewScript = new Script; pNewScript->Name = "npc_expedition_commander"; - pNewScript->GetAI = &GetAI_npc_expedition_commander; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->pGossipHello = GossipHello_npc_expedition_commander; pNewScript->pGossipSelect = GossipSelect_npc_expedition_commander; pNewScript->RegisterSelf(); pNewScript = new Script; pNewScript->Name = "npc_razorscale_spawner"; - pNewScript->GetAI = GetAI_npc_razorscale_spawner; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->RegisterSelf(); pNewScript = new Script; pNewScript->Name = "npc_harpoon_fire_state"; - pNewScript->GetAI = GetAI_npc_harpoon_fire_state; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_harpoon_fire_state; pNewScript->RegisterSelf(); @@ -938,4 +865,6 @@ void AddSC_boss_razorscale() pNewScript->Name = "event_spell_harpoon_shot"; pNewScript->pProcessEventId = &ProcessEventId_event_spell_harpoon_shot; pNewScript->RegisterSelf(); + + RegisterSpellScript("spell_devouring_flame_razorscale"); } From 6ebae2cf6e8b7773260edacf01242d524d6f5b4e Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 09:25:39 +0100 Subject: [PATCH 15/26] Broadcast Texts + Simplifications + Beauty Pass --- .../ulduar/ulduar/boss_razorscale.cpp | 178 ++++++++---------- 1 file changed, 79 insertions(+), 99 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index a07e034e330..61f10012c2d 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -27,16 +27,16 @@ EndScriptData */ enum { - SAY_INTRO_WELCOME = -1603036, - SAY_INTRO_1 = -1603037, - SAY_INTRO_2 = -1603038, - SAY_INTRO_3 = -1603039, - SAY_GROUNDED = -1603040, - SAY_EXTINGUISH_FIRE = -1603042, + SAY_INTRO_WELCOME = 33351, + SAY_INTRO_1 = 33820, + SAY_INTRO_2 = 33607, + SAY_INTRO_3 = 33816, + SAY_GROUNDED = 33606, + SAY_EXTINGUISH_FIRE = 33821, - EMOTE_BREATH = -1603041, - EMOTE_HARPOON_READY = -1603043, - EMOTE_GROUNDED = -1603044, + EMOTE_BREATH = 33657, + EMOTE_HARPOON_READY = 33857, + EMOTE_GROUNDED = 33931, // general spells (used in both ground and air phases) SPELL_BERSERK = 47008, @@ -138,9 +138,9 @@ enum RazorscaleActions struct boss_razorscaleAI : public BossAI { boss_razorscaleAI(Creature* creature) : BossAI(creature, RAZORSCALE_ACTIONS_MAX), - m_instance(dynamic_cast(creature->GetInstanceData())), - m_isRegularMode(creature->GetMap()->IsRegularDifficulty()), - m_maxHarpoons(m_isRegularMode ? 2 : 4) + m_instance(dynamic_cast(creature->GetInstanceData())), + m_isRegularMode(creature->GetMap()->IsRegularDifficulty()), + m_maxHarpoons(m_isRegularMode ? 2 : 4) { SetDataType(TYPE_RAZORSCALE); AddCustomAction(RAZORSCALE_GROUNDED_FLAME_BREATH, true, [&]() @@ -200,7 +200,7 @@ struct boss_razorscaleAI : public BossAI } // make the Trappers evade or move to home position - for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) pTrapper->AI()->EnterEvadeMode(); @@ -209,7 +209,7 @@ struct boss_razorscaleAI : public BossAI AddCustomAction(RAZORSCALE_TRANSITION_TO_GROUND, true, [&]() { // cast trap visual - for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) pTrapper->CastSpell(m_creature, SPELL_SHACKLE, TRIGGERED_NONE); @@ -253,16 +253,14 @@ struct boss_razorscaleAI : public BossAI bool m_isGrounded; bool m_enterEvadeMode; - uint8 m_uiGroundedStep; - uint8 m_maxHarpoons; uint8 m_currentHarpoon; uint8 m_harpoonsUsed; uint8 m_airPhaseCount; - GuidList m_lEngineersGuids; - GuidList m_lTrappersGuids; - GuidVector m_vHarpoonsGuids; + GuidList m_engineerGuids; + GuidList m_trapperGuids; + GuidVector m_harpoonGuids; void Reset() override { @@ -294,9 +292,9 @@ struct boss_razorscaleAI : public BossAI if (!m_instance) return; // load engineers and harpoon data - m_instance->GetEngineersGuids(m_lEngineersGuids); - m_instance->GetTrappersGuids(m_lTrappersGuids); - m_instance->GetHarpoonsGuids(m_vHarpoonsGuids); + m_instance->GetEngineersGuids(m_engineerGuids); + m_instance->GetTrappersGuids(m_trapperGuids); + m_instance->GetHarpoonsGuids(m_harpoonGuids); } void JustReachedHome() override @@ -337,8 +335,7 @@ struct boss_razorscaleAI : public BossAI uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); m_creature->SetWalk(false); m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); - //m_creature->GetMotionMaster()->MovePointTOL(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); - m_creature->GetMotionMaster()->MovePoint(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], FORCED_MOVEMENT_FLIGHT, false); + m_creature->GetMotionMaster()->MovePointTOL(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); m_creature->SetSpeedRate(MOVE_RUN, speedRate); ResetTimer(RAZORSCALE_TRANSITION_TO_GROUND, 5s); DisableCombatAction(RAZORSCALE_SPAWN_ADDS); @@ -350,7 +347,7 @@ struct boss_razorscaleAI : public BossAI { if (Creature* controller = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE_CONTROLLER)) { - for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) { @@ -381,12 +378,15 @@ struct boss_razorscaleAI : public BossAI uint8 index = 1; // get the current harpoon and move the engineers in front of it - if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_currentHarpoon])) + if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_harpoonGuids[m_currentHarpoon])) { - for (GuidList::const_iterator itr = m_lEngineersGuids.begin(); itr != m_lEngineersGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_engineerGuids.begin(); itr != m_engineerGuids.end(); ++itr) { if (Creature* engineer = m_creature->GetMap()->GetCreature(*itr)) { + engineer->SetImmuneToNPC(false); + if (engineer->AI()) + engineer->AI()->SetReactState(REACT_PASSIVE); harpoon->GetNearPoint(harpoon, fX, fY, fZ, 0, INTERACTION_DISTANCE, M_PI_F / 4 * index); // ToDo: maybe there should be some emotes here @@ -482,7 +482,7 @@ struct boss_razorscaleAI : public BossAI DoBroadcastText(EMOTE_HARPOON_READY, m_creature); // despawn the current broken harpoon and spawn the repaired one - if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_vHarpoonsGuids[m_currentHarpoon - 1])) + if (GameObject* harpoon = m_creature->GetMap()->GetGameObject(m_harpoonGuids[m_currentHarpoon - 1])) { harpoon->SetRespawnTime(HOUR); harpoon->SetLootState(GO_JUST_DEACTIVATED); @@ -494,7 +494,7 @@ struct boss_razorscaleAI : public BossAI // if all harpoons have been repaired stop if (m_currentHarpoon == m_maxHarpoons) { - for (GuidList::const_iterator itr = m_lEngineersGuids.begin(); itr != m_lEngineersGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_engineerGuids.begin(); itr != m_engineerGuids.end(); ++itr) { if (Creature* engineer = m_creature->GetMap()->GetCreature(*itr)) { @@ -542,13 +542,13 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper { m_instance = (instance_ulduar*)creature->GetInstanceData(); InitializeDialogueHelper(m_instance); - m_bIntroDone = false; + m_introDone = false; Reset(); } instance_ulduar* m_instance; - bool m_bIntroDone; + bool m_introDone; ObjectGuid m_playerGuid; @@ -557,10 +557,10 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper void MoveInLineOfSight(Unit* who) override { // ToDo: verify if all this is correct. There may other parts of the intro which are currently missing - if (!m_bIntroDone && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 20.0f)) + if (!m_introDone && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 20.0f)) { DoBroadcastText(SAY_INTRO_WELCOME, m_creature); - m_bIntroDone = true; + m_introDone = true; } ScriptedAI::MoveInLineOfSight(who); @@ -581,27 +581,30 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper if (Creature* engineer = GetClosestCreatureWithEntry(m_creature, NPC_EXPEDITION_ENGINEER, 15.0f)) DoBroadcastText(SAY_INTRO_1, engineer); - GuidList m_lDefenderGuids; - m_instance->GetDefenderGuids(m_lDefenderGuids); + GuidList m_defenderGuids; + m_instance->GetDefenderGuids(m_defenderGuids); // move the defenders into attack position - for (GuidList::const_iterator itr = m_lDefenderGuids.begin(); itr != m_lDefenderGuids.end(); ++itr) + for (GuidList::const_iterator itr = m_defenderGuids.begin(); itr != m_defenderGuids.end(); ++itr) { - if (Creature* pDefender = m_creature->GetMap()->GetCreature(*itr)) + if (Creature* defender = m_creature->GetMap()->GetCreature(*itr)) { - pDefender->CastSpell(pDefender, SPELL_THREAT, TRIGGERED_OLD_TRIGGERED); - pDefender->SetWalk(false); - pDefender->GetMotionMaster()->MoveWaypoint(); + defender->SetImmuneToNPC(false); + if (defender->AI()) + defender->AI()->SetReactState(REACT_AGGRESSIVE); + defender->CastSpell(defender, SPELL_THREAT, TRIGGERED_OLD_TRIGGERED); + defender->SetWalk(false); + defender->GetMotionMaster()->MoveWaypoint(); } } break; } case NPC_RAZORSCALE: - if (Creature* pRazorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) { - if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid)) - pRazorscale->AI()->AttackStart(pPlayer); - pRazorscale->SetInCombatWithZone(false); + if (Player* player = m_creature->GetMap()->GetPlayer(m_playerGuid)) + razorscale->AI()->AttackStart(player); + razorscale->SetInCombatWithZone(false); } break; case NPC_EXPEDITION_DEFENDER: @@ -609,8 +612,8 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper DoBroadcastText(SAY_INTRO_3, engineer); // inform Razorscale about the start of the harpoon event - if (Creature* pRazorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) - m_creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pRazorscale); + if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + m_creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, razorscale); break; } } @@ -628,28 +631,28 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper void UpdateAI(const uint32 diff) override { DialogueUpdate(diff); } }; -bool GossipHello_npc_expedition_commander(Player* pPlayer, Creature* creature) +bool GossipHello_npc_expedition_commander(Player* player, Creature* creature) { - if (ScriptedInstance* pInstance = (ScriptedInstance*)creature->GetInstanceData()) + if (ScriptedInstance* instance = (ScriptedInstance*)creature->GetInstanceData()) { - if (pInstance->GetData(TYPE_RAZORSCALE) == NOT_STARTED || pInstance->GetData(TYPE_RAZORSCALE) == FAIL) - pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START_RAZORSCALE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + if (instance->GetData(TYPE_RAZORSCALE) == NOT_STARTED || instance->GetData(TYPE_RAZORSCALE) == FAIL) + player->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START_RAZORSCALE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ID_WELCOME, creature->GetObjectGuid()); + player->SEND_GOSSIP_MENU(GOSSIP_MENU_ID_WELCOME, creature->GetObjectGuid()); return true; } return false; } -bool GossipSelect_npc_expedition_commander(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) +bool GossipSelect_npc_expedition_commander(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 action) { - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { // start intro dialogue - creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, pPlayer, creature); + creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, player, creature); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pPlayer->CLOSE_GOSSIP_MENU(); + player->CLOSE_GOSSIP_MENU(); } return true; @@ -662,7 +665,7 @@ bool GossipSelect_npc_expedition_commander(Player* pPlayer, Creature* creature, struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI { npc_razorscale_spawnerAI(Creature* creature) : Scripted_NoMovementAI(creature), - m_instance(dynamic_cast(creature->GetInstanceData())) + m_instance(dynamic_cast(creature->GetInstanceData())) { AddCustomAction(0, true, [&]() { @@ -694,32 +697,9 @@ struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI void JustSummoned(Creature* summoned) override { summoned->SetInCombatWithZone(); + if (summoned->AI()) + summoned->AI()->AttackClosestEnemy(); summoned->SetIgnoreMMAP(true); - if (!m_instance) - return; - GuidList dwarves; - m_instance->GetEngineersGuids(dwarves); - for (ObjectGuid& guid : dwarves) - { - Creature* dwarf = m_creature->GetMap()->GetCreature(guid); - if (!dwarf) - continue; - dwarf->SetImmuneToNPC(false); - if (dwarf->AI()) - dwarf->AI()->SetReactState(REACT_PASSIVE); - m_creature->getThreatManager().addThreat(dwarf, 2000.f); - } - m_instance->GetDefenderGuids(dwarves); - for (ObjectGuid& guid : dwarves) - { - Creature* dwarf = m_creature->GetMap()->GetCreature(guid); - if (!dwarf) - continue; - dwarf->SetImmuneToNPC(false); - if (dwarf->AI()) - dwarf->AI()->SetReactState(REACT_AGGRESSIVE); - m_creature->getThreatManager().addThreat(dwarf, 2000.f); - } } void JustSummoned(GameObject* pGo) override @@ -763,10 +743,10 @@ struct npc_harpoon_fire_stateAI : public Scripted_NoMovementAI void UpdateAI(const uint32 /*diff*/) override { } }; -bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* creatureTarget, ObjectGuid /*originalCasterGuid*/) +bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*caster*/, uint32 spellId, SpellEffectIndex effIdx, Creature* creatureTarget, ObjectGuid /*originalCasterGuid*/) { // always check spellid and effectindex - if (uiSpellId == SPELL_FIREBOLT && uiEffIndex == EFFECT_INDEX_0 && creatureTarget->GetEntry() == NPC_HARPOON_FIRE_STATE) + if (spellId == SPELL_FIREBOLT && effIdx == EFFECT_INDEX_0 && creatureTarget->GetEntry() == NPC_HARPOON_FIRE_STATE) { creatureTarget->CastSpell(creatureTarget, SPELL_HARPOON_FIRE, TRIGGERED_OLD_TRIGGERED); @@ -794,8 +774,8 @@ bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpel } // force reset for harpoon trigger npcs - if (Creature* pTrigger = GetClosestCreatureWithEntry(creatureTarget, NPC_RAZORSCALE_CONTROLLER, 5.0f)) - pTrigger->InterruptNonMeleeSpells(false); + if (Creature* trigger = GetClosestCreatureWithEntry(creatureTarget, NPC_RAZORSCALE_CONTROLLER, 5.0f)) + trigger->InterruptNonMeleeSpells(false); // always return true when we are handling this spell and effect return true; @@ -808,21 +788,21 @@ bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*pCaster*/, uint32 uiSpel ## event_spell_harpoon_shot ######*/ -bool ProcessEventId_event_spell_harpoon_shot(uint32 /*uiEventId*/, Object* source, Object* /*pTarget*/, bool /*bIsStart*/) +bool ProcessEventId_event_spell_harpoon_shot(uint32 /*eventId*/, Object* source, Object* /*target*/, bool /*isStart*/) { - if (((Creature*)source)->GetEntry() == NPC_RAZORSCALE_CONTROLLER) - { - if (instance_ulduar* pInstance = (instance_ulduar*)((Creature*)source)->GetInstanceData()) - { - // event doesn't have target, so we need to give an explicit one - if (Creature* pRazorscale = pInstance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) - ((Creature*)source)->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, (Creature*)source, pRazorscale); - - return true; - } - } - - return false; + Creature* sourceCreature = static_cast(source); + if (!sourceCreature) + return false; + if (sourceCreature->GetEntry() != NPC_RAZORSCALE_CONTROLLER) + return false; + instance_ulduar* instance = dynamic_cast(sourceCreature->GetInstanceData()); + if (!instance) + return false; + // event doesn't have target, so we need to give an explicit one + if (Creature* razorscale = instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + sourceCreature->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, sourceCreature, razorscale); + + return true;; } struct DevouringFlameRazorscale : public SpellScript From 4e47d788c250daf752070016f3ba7ce53d53e0ed Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 09:47:26 +0100 Subject: [PATCH 16/26] Spell Script SQL --- sql/scriptdev2/spell.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 7edb46c5489..ea37a06e1d6 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -965,6 +965,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (62707,'spell_ignis_grab'), (62717,'spell_slag_pot'), (63474,'spell_ignis_scorch'), +(63236,'spell_devouring_flame_razorscale'), (63482,'spell_lightning_whirl_heroic'), (63845,'spell_create_lance'), (64203,'spell_void_zone_xt'), From 8c20f5e8bc0489e94cf630b186ee2e484536d19b Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 09:54:23 +0100 Subject: [PATCH 17/26] Ulduar: Move EffectDummy to Spell Script Razorscale --- .../ulduar/ulduar/boss_razorscale.cpp | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 61f10012c2d..bb363e52f1e 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -743,47 +743,6 @@ struct npc_harpoon_fire_stateAI : public Scripted_NoMovementAI void UpdateAI(const uint32 /*diff*/) override { } }; -bool EffectDummyCreature_npc_harpoon_fire_state(Unit* /*caster*/, uint32 spellId, SpellEffectIndex effIdx, Creature* creatureTarget, ObjectGuid /*originalCasterGuid*/) -{ - // always check spellid and effectindex - if (spellId == SPELL_FIREBOLT && effIdx == EFFECT_INDEX_0 && creatureTarget->GetEntry() == NPC_HARPOON_FIRE_STATE) - { - creatureTarget->CastSpell(creatureTarget, SPELL_HARPOON_FIRE, TRIGGERED_OLD_TRIGGERED); - - // search for each entry of the nearby harpoon - GameObject* harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_1, 5.0f); - if (!harpoon) - harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_2, 5.0f); - if (!harpoon) - harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_3, 5.0f); - if (!harpoon) - harpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_HARPOON_GUN_4, 5.0f); - - // despawn the repaired harpoon - if (harpoon) - { - harpoon->SetLootState(GO_JUST_DEACTIVATED); - harpoon->ForcedDespawn(); - } - - // respawn broken harpoon - if (GameObject* newHarpoon = GetClosestGameObjectWithEntry(creatureTarget, GO_BROKEN_HARPOON, 5.0f)) - { - newHarpoon->Refresh(); - newHarpoon->Respawn(); - } - - // force reset for harpoon trigger npcs - if (Creature* trigger = GetClosestCreatureWithEntry(creatureTarget, NPC_RAZORSCALE_CONTROLLER, 5.0f)) - trigger->InterruptNonMeleeSpells(false); - - // always return true when we are handling this spell and effect - return true; - } - - return false; -} - /*###### ## event_spell_harpoon_shot ######*/ @@ -816,6 +775,48 @@ struct DevouringFlameRazorscale : public SpellScript } }; +struct FireboltRazorscale : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override + { + if (effIdx != EFFECT_INDEX_0) + return; + Unit* target = spell->GetUnitTarget(); + if (!target) + return; + if (target->GetEntry() != NPC_HARPOON_FIRE_STATE) + return; + target->CastSpell(nullptr, SPELL_HARPOON_FIRE, TRIGGERED_OLD_TRIGGERED); + + // search for each entry of the nearby harpoon + GameObject* harpoon = GetClosestGameObjectWithEntry(target, GO_HARPOON_GUN_1, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(target, GO_HARPOON_GUN_2, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(target, GO_HARPOON_GUN_3, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(target, GO_HARPOON_GUN_4, 5.0f); + + // despawn the repaired harpoon + if (harpoon) + { + harpoon->SetLootState(GO_JUST_DEACTIVATED); + harpoon->ForcedDespawn(); + } + + // respawn broken harpoon + if (GameObject* newHarpoon = GetClosestGameObjectWithEntry(target, GO_BROKEN_HARPOON, 5.0f)) + { + newHarpoon->Refresh(); + newHarpoon->Respawn(); + } + + // force reset for harpoon trigger npcs + if (Creature* trigger = GetClosestCreatureWithEntry(target, NPC_RAZORSCALE_CONTROLLER, 5.0f)) + trigger->InterruptNonMeleeSpells(false); + } +}; + void AddSC_boss_razorscale() { Script* pNewScript = new Script; @@ -838,7 +839,6 @@ void AddSC_boss_razorscale() pNewScript = new Script; pNewScript->Name = "npc_harpoon_fire_state"; pNewScript->GetAI = &GetNewAIInstance; - pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_harpoon_fire_state; pNewScript->RegisterSelf(); pNewScript = new Script; @@ -847,4 +847,5 @@ void AddSC_boss_razorscale() pNewScript->RegisterSelf(); RegisterSpellScript("spell_devouring_flame_razorscale"); + RegisterSpellScript("spell_firebolt_razorscale"); } From 4266a7628b932f8d1f1fd305d3b0698b52013d37 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 09:55:49 +0100 Subject: [PATCH 18/26] Firebolt: Spellscript SQL --- sql/scriptdev2/spell.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index ea37a06e1d6..2160e438653 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -965,6 +965,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (62707,'spell_ignis_grab'), (62717,'spell_slag_pot'), (63474,'spell_ignis_scorch'), +(62669,'spell_firebolt_razorscale'), (63236,'spell_devouring_flame_razorscale'), (63482,'spell_lightning_whirl_heroic'), (63845,'spell_create_lance'), From 49783d8d1dba1fdaed36d1325e436cc378078a81 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 10:57:15 +0100 Subject: [PATCH 19/26] Ulduar: Add Achivement: Iron Dwarf, Medium Rare --- .../northrend/ulduar/ulduar/boss_razorscale.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index bb363e52f1e..1144cf426cf 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -78,7 +78,7 @@ enum NPC_DEVOURING_FLAME = 34188, NPC_RAZORSCALE_SPAWNER = 33245, // dwarf spawner npc for Razorscale // NPC_DARK_RUNE_WATCHER = 33453, - // NPC_DARK_RUNE_GUARDIAN = 33388, + NPC_DARK_RUNE_GUARDIAN = 33388, // NPC_DARK_RUNE_SENTINEL = 33846, // GO_MOLE_MACHINE = 194316, @@ -315,6 +315,15 @@ struct boss_razorscaleAI : public BossAI } } + void JustKilledUnit(Unit* who) override + { + if (!who || who->GetEntry() != NPC_DARK_RUNE_GUARDIAN) + return; + for (auto& playerRef : m_creature->GetMap()->GetPlayers()) + if (playerRef.getSource()) + playerRef.getSource()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, NPC_DARK_RUNE_GUARDIAN, 1, m_creature); + } + void ReceiveAIEvent(AIEventType eventType, Unit* /*sender*/, Unit* invoker, uint32 /*miscValue*/) override { // inform about the harpoon repair event From 8b5b6403a490b8f5f76b8d091b3c4013ecf81c40 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 10:59:56 +0100 Subject: [PATCH 20/26] Ulduar: Fix function name --- .../scripts/northrend/ulduar/ulduar/boss_razorscale.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 1144cf426cf..affc2aa72ed 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -315,8 +315,9 @@ struct boss_razorscaleAI : public BossAI } } - void JustKilledUnit(Unit* who) override + void KilledUnit(Unit* who) override { + BossAI::KilledUnit(who); if (!who || who->GetEntry() != NPC_DARK_RUNE_GUARDIAN) return; for (auto& playerRef : m_creature->GetMap()->GetPlayers()) From a4b913fc0425592ac0053f7b81d4dd5bd1525185 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 13:53:37 +0100 Subject: [PATCH 21/26] Ulduar: Various Razorscale fixes --- .../scripts/northrend/ulduar/ulduar/boss_razorscale.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index affc2aa72ed..508adf76b8e 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -159,7 +159,7 @@ struct boss_razorscaleAI : public BossAI }); AddCustomAction(RAZORSCALE_GROUNDED_FIREBOLT, true, [&]() { - if (DoCastSpellIfCan(m_creature, SPELL_FIREBOLT, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_FIREBOLT, CAST_TRIGGERED) == CAST_OK) ResetTimer(RAZORSCALE_GROUNDED_LIFTOFF, 2s); }); AddCustomAction(RAZORSCALE_GROUNDED_LIFTOFF, true, [&]() @@ -707,9 +707,9 @@ struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI void JustSummoned(Creature* summoned) override { summoned->SetInCombatWithZone(); + summoned->SetIgnoreMMAP(true); if (summoned->AI()) summoned->AI()->AttackClosestEnemy(); - summoned->SetIgnoreMMAP(true); } void JustSummoned(GameObject* pGo) override @@ -779,7 +779,11 @@ struct DevouringFlameRazorscale : public SpellScript void OnSummon(Spell* spell, Creature* summon) const override { if (summon->AI()) + { + summon->AI()->SetReactState(REACT_PASSIVE); summon->AI()->SetRootSelf(true); + summon->SetImmuneToNPC(true); + } bool isRegularModed = summon->GetMap()->IsRegularDifficulty(); summon->CastSpell(nullptr, isRegularModed ? SPELL_DEVOURING_FLAME_AURA : SPELL_DEVOURING_FLAME_AURA_H, TRIGGERED_OLD_TRIGGERED); } From 17b3416b502e5bf2a5a468367f102c219f8eb77d Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 19:50:33 +0100 Subject: [PATCH 22/26] Ulduar: Various Razorscale fixes --- sql/scriptdev2/spell.sql | 4 +- .../ulduar/ulduar/boss_razorscale.cpp | 105 +++++++++++++++--- 2 files changed, 90 insertions(+), 19 deletions(-) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 2160e438653..d46bc0f1df6 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -966,7 +966,8 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (62717,'spell_slag_pot'), (63474,'spell_ignis_scorch'), (62669,'spell_firebolt_razorscale'), -(63236,'spell_devouring_flame_razorscale'), +(63308,'spell_devouring_flame_razorscale'), +(63317,'spell_flame_breath_razorscale'), (63482,'spell_lightning_whirl_heroic'), (63845,'spell_create_lance'), (64203,'spell_void_zone_xt'), @@ -978,6 +979,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (64415,'spell_valanyr_equip_effect'), (64475,'spell_ignis_remove_strength'), (64503,'spell_ignis_water'), +(64021,'spell_flame_breath_razorscale'), (64568,'spell_blood_reserve_enchant'), (65121,'spell_searing_light'), (65667,'spell_ignis_heat'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 508adf76b8e..72729a1dae5 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -22,6 +22,8 @@ SDCategory: Ulduar EndScriptData */ #include "AI/ScriptDevAI/include/sc_common.h" +#include "Globals/SharedDefines.h" +#include "Spells/SpellDefines.h" #include "ulduar.h" #include "AI/ScriptDevAI/base/BossAI.h" @@ -145,6 +147,8 @@ struct boss_razorscaleAI : public BossAI SetDataType(TYPE_RAZORSCALE); AddCustomAction(RAZORSCALE_GROUNDED_FLAME_BREATH, true, [&]() { + if (!m_creature->IsAlive()) + return; m_creature->RemoveAurasDueToSpell(SPELL_STUN); if (DoCastSpellIfCan(m_creature, m_isRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) { @@ -154,19 +158,26 @@ struct boss_razorscaleAI : public BossAI }); AddCustomAction(RAZORSCALE_GROUNDED_WING_BUFFET, true, [&]() { + if (!m_creature->IsAlive()) + return; if (DoCastSpellIfCan(m_creature, SPELL_WING_BUFFET, CAST_FORCE_CAST | CAST_INTERRUPT_PREVIOUS) == CAST_OK) ResetTimer(RAZORSCALE_GROUNDED_FIREBOLT, 1s + 510ms); }); AddCustomAction(RAZORSCALE_GROUNDED_FIREBOLT, true, [&]() { + if (!m_creature->IsAlive()) + return; if (DoCastSpellIfCan(m_creature, SPELL_FIREBOLT, CAST_TRIGGERED) == CAST_OK) ResetTimer(RAZORSCALE_GROUNDED_LIFTOFF, 2s); }); AddCustomAction(RAZORSCALE_GROUNDED_LIFTOFF, true, [&]() { + if (!m_creature->IsAlive()) + return; if (m_isGrounded) { SetCombatMovement(true); + SetMeleeEnabled(true); DoResetThreat(); DoStartMovement(m_creature->GetVictim()); m_creature->SetSpellList(m_isRegularMode ? RAZORSCALE_SPELLSET_10N_GROUND : RAZORSCALE_SPELLSET_25N_GROUND); @@ -179,7 +190,11 @@ struct boss_razorscaleAI : public BossAI m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); float fX, fY, fZ; - m_creature->GetRespawnCoord(fX, fY, fZ); + //m_creature->GetRespawnCoord(fX, fY, fZ); + const Position combatPosition = Position(580.63556, -175.46675, 475.54114); + fX=combatPosition.GetPositionX(); + fY=combatPosition.GetPositionY(); + fZ=combatPosition.GetPositionZ(); // use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); @@ -202,17 +217,19 @@ struct boss_razorscaleAI : public BossAI // make the Trappers evade or move to home position for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { - if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) - pTrapper->AI()->EnterEvadeMode(); + if (Creature* trapper = m_creature->GetMap()->GetCreature(*itr)) + trapper->AI()->EnterEvadeMode(); } }); AddCustomAction(RAZORSCALE_TRANSITION_TO_GROUND, true, [&]() { + if (!m_creature->IsAlive()) + return; // cast trap visual for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { - if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) - pTrapper->CastSpell(m_creature, SPELL_SHACKLE, TRIGGERED_NONE); + if (Creature* trapper = m_creature->GetMap()->GetCreature(*itr)) + trapper->CastSpell(m_creature, SPELL_SHACKLE, TRIGGERED_NONE); } // stun Razorscale @@ -225,8 +242,10 @@ struct boss_razorscaleAI : public BossAI ResetTimer(RAZORSCALE_GROUNDED_FLAME_BREATH, 30s); } }); - AddCustomAction(RAZORSCALE_HEALTH_CHECK, 1s, [&]() + AddCustomAction(RAZORSCALE_HEALTH_CHECK, true, [&]() { + if (!m_creature->IsAlive()) + return; if (m_creature->GetHealthPercent() <= 50.f) { DoBroadcastText(EMOTE_GROUNDED, m_creature); @@ -241,9 +260,11 @@ struct boss_razorscaleAI : public BossAI AddCombatAction(RAZORSCALE_REPAIR_HARPOONS, true); AddCombatAction(RAZORSCALE_BERSERK, 10min); AddCombatAction(RAZORSCALE_SPAWN_ADDS, 1s); + AddRespawnOnEvade(30s); m_creature->SetIgnoreMMAP(true); + SetMeleeEnabled(false); - m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); + //m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); Reset(); } @@ -295,12 +316,14 @@ struct boss_razorscaleAI : public BossAI m_instance->GetEngineersGuids(m_engineerGuids); m_instance->GetTrappersGuids(m_trapperGuids); m_instance->GetHarpoonsGuids(m_harpoonGuids); + ResetTimer(RAZORSCALE_HEALTH_CHECK, 1s); } void JustReachedHome() override { BossAI::JustReachedHome(); - m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); + m_creature->GetMotionMaster()->MovePath(0); + //m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); } void JustSummoned(Creature* summoned) override @@ -315,6 +338,16 @@ struct boss_razorscaleAI : public BossAI } } + void MovementInform(uint32 motionType, uint32 pointId) override + { + if (motionType != POINT_MOTION_TYPE) + return; + m_creature->GetMotionMaster()->MoveIdle(); + + if (pointId == 2) + m_creature->CastSpell(nullptr, SPELL_STUN, TRIGGERED_OLD_TRIGGERED); + } + void KilledUnit(Unit* who) override { BossAI::KilledUnit(who); @@ -345,7 +378,7 @@ struct boss_razorscaleAI : public BossAI uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); m_creature->SetWalk(false); m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); - m_creature->GetMotionMaster()->MovePointTOL(1, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); + m_creature->GetMotionMaster()->MovePointTOL(2, afRazorscaleGroundPos[0], afRazorscaleGroundPos[1], afRazorscaleGroundPos[2], false); m_creature->SetSpeedRate(MOVE_RUN, speedRate); ResetTimer(RAZORSCALE_TRANSITION_TO_GROUND, 5s); DisableCombatAction(RAZORSCALE_SPAWN_ADDS); @@ -359,15 +392,15 @@ struct boss_razorscaleAI : public BossAI { for (GuidList::const_iterator itr = m_trapperGuids.begin(); itr != m_trapperGuids.end(); ++itr) { - if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr)) + if (Creature* trapper = m_creature->GetMap()->GetCreature(*itr)) { controller->GetNearPoint(controller, fX, fY, fZ, 0, 50.0f, M_PI_F / 4 * index); - pTrapper->SetWalk(false); - speedRate = pTrapper->GetSpeedRate(MOVE_RUN); - pTrapper->SetSpeedRate(MOVE_RUN, SPEED_RATE_HELPERS); - pTrapper->GetMotionMaster()->MovePoint(1, fX, fY, fZ); - pTrapper->SetSpeedRate(MOVE_RUN, speedRate); + trapper->SetWalk(false); + speedRate = trapper->GetSpeedRate(MOVE_RUN); + trapper->SetSpeedRate(MOVE_RUN, SPEED_RATE_HELPERS); + trapper->GetMotionMaster()->MovePoint(1, fX, fY, fZ); + trapper->SetSpeedRate(MOVE_RUN, speedRate); ++index; } } @@ -424,6 +457,7 @@ struct boss_razorscaleAI : public BossAI if (newHarpoon) { + newHarpoon->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT); newHarpoon->SetRespawnTime(HOUR); newHarpoon->Refresh(); } @@ -602,9 +636,13 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper defender->SetImmuneToNPC(false); if (defender->AI()) defender->AI()->SetReactState(REACT_AGGRESSIVE); - defender->CastSpell(defender, SPELL_THREAT, TRIGGERED_OLD_TRIGGERED); + defender->CastSpell(nullptr, SPELL_THREAT, TRIGGERED_OLD_TRIGGERED); defender->SetWalk(false); defender->GetMotionMaster()->MoveWaypoint(); + if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + { + defender->SetInCombatWith(razorscale); + } } } break; @@ -613,7 +651,10 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) { if (Player* player = m_creature->GetMap()->GetPlayer(m_playerGuid)) - razorscale->AI()->AttackStart(player); + { + razorscale->EngageInCombatWith(player); + //razorscale->AI()->AttackStart(player); + } razorscale->SetInCombatWithZone(false); } break; @@ -635,6 +676,11 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper { StartNextDialogueText(NPC_EXPEDITION_ENGINEER); m_playerGuid = invoker->GetObjectGuid(); + + if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) + { + razorscale->GetMotionMaster()->MovePoint(0, Position(580.63556, -175.46675, 475.54114), FORCED_MOVEMENT_FLIGHT, 0.f, false); + } } } @@ -771,7 +817,19 @@ bool ProcessEventId_event_spell_harpoon_shot(uint32 /*eventId*/, Object* source, if (Creature* razorscale = instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) sourceCreature->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, sourceCreature, razorscale); - return true;; + GameObject* harpoon = GetClosestGameObjectWithEntry(sourceCreature, GO_HARPOON_GUN_1, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(sourceCreature, GO_HARPOON_GUN_2, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(sourceCreature, GO_HARPOON_GUN_3, 5.0f); + if (!harpoon) + harpoon = GetClosestGameObjectWithEntry(sourceCreature, GO_HARPOON_GUN_4, 5.0f); + + if (harpoon) + { + harpoon->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT); + } + return true; } struct DevouringFlameRazorscale : public SpellScript @@ -831,6 +889,16 @@ struct FireboltRazorscale : public SpellScript } }; +struct FlameBreathRazorscale : public SpellScript +{ + bool OnCheckTarget(const Spell* /*spell*/, Unit* target, SpellEffectIndex /*eff*/) const override + { + if (target->GetEntry() == NPC_RAZORSCALE_CONTROLLER || target->GetEntry() == NPC_DEVOURING_FLAME) + return false; + return true; + } +}; + void AddSC_boss_razorscale() { Script* pNewScript = new Script; @@ -862,4 +930,5 @@ void AddSC_boss_razorscale() RegisterSpellScript("spell_devouring_flame_razorscale"); RegisterSpellScript("spell_firebolt_razorscale"); + RegisterSpellScript("spell_flame_breath_razorscale"); } From 30bae43edd7cf9aaf570c81de1e10f46d4c5cc92 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 20:13:49 +0100 Subject: [PATCH 23/26] Ulduar: Minor Razorscale fixes --- .../scripts/northrend/ulduar/ulduar/boss_razorscale.cpp | 8 ++++---- .../scripts/northrend/ulduar/ulduar/ulduar.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 72729a1dae5..1d904ab87df 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -22,8 +22,6 @@ SDCategory: Ulduar EndScriptData */ #include "AI/ScriptDevAI/include/sc_common.h" -#include "Globals/SharedDefines.h" -#include "Spells/SpellDefines.h" #include "ulduar.h" #include "AI/ScriptDevAI/base/BossAI.h" @@ -205,7 +203,7 @@ struct boss_razorscaleAI : public BossAI // reset timers m_currentHarpoon = 0; m_harpoonsUsed = 0; - ResetTimer(RAZORSCALE_REPAIR_HARPOONS, 20s); + ResetCombatAction(RAZORSCALE_REPAIR_HARPOONS, 20s); ResetCombatAction(RAZORSCALE_SPAWN_ADDS, 1s); ++m_airPhaseCount; @@ -263,6 +261,8 @@ struct boss_razorscaleAI : public BossAI AddRespawnOnEvade(30s); m_creature->SetIgnoreMMAP(true); SetMeleeEnabled(false); + //if (m_instance->GetPlayerInMap()) + m_creature->SetActiveObjectState(true); //m_creature->GetMotionMaster()->MoveRandomAroundPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f); Reset(); @@ -641,7 +641,7 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper defender->GetMotionMaster()->MoveWaypoint(); if (Creature* razorscale = m_instance->GetSingleCreatureFromStorage(NPC_RAZORSCALE)) { - defender->SetInCombatWith(razorscale); + //defender->SetInCombatWith(razorscale); } } } diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp index 9d609047461..82779d14a54 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp @@ -593,7 +593,10 @@ void instance_ulduar::SetData(uint32 uiType, uint32 uiData) if (GameObject* pHarpoon = instance->GetGameObject(*itr)) { if (!pHarpoon->IsSpawned()) + { + pHarpoon->Refresh(); pHarpoon->Respawn(); + } } } for (GuidList::const_iterator itr = m_lRepairedHarpoonsGuids.begin(); itr != m_lRepairedHarpoonsGuids.end(); ++itr) @@ -601,7 +604,10 @@ void instance_ulduar::SetData(uint32 uiType, uint32 uiData) if (GameObject* pHarpoon = instance->GetGameObject(*itr)) { if (pHarpoon->IsSpawned()) + { pHarpoon->SetLootState(GO_JUST_DEACTIVATED); + pHarpoon->ForcedDespawn(); + } } } } From 7bb6795abfee9651c0ca8d4bdab7484461052c4c Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 20:22:20 +0100 Subject: [PATCH 24/26] Ulduar: Minor adjustments to Razorscale --- .../northrend/ulduar/ulduar/boss_razorscale.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 1d904ab87df..71d32d06909 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -302,9 +302,8 @@ struct boss_razorscaleAI : public BossAI void EnterEvadeMode() override { - if (m_creature->GetMap()->GetPlayersCountExceptGMs() > 0) - return; - BossAI::EnterEvadeMode(); + if (!m_instance->GetPlayerInMap(true, false)) + BossAI::EnterEvadeMode(); } void Aggro(Unit* who) override @@ -417,6 +416,8 @@ struct boss_razorscaleAI : public BossAI // function to enable harpoon repair animation void DoMoveEngineersToHarpoon() { + if (!m_creature->IsAlive()) + return; float fX, fY, fZ; uint8 index = 1; @@ -752,6 +753,10 @@ struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI void JustSummoned(Creature* summoned) override { + if (Unit* razorscale = m_creature->GetSpawner()) + if (razorscale->GetEntry() == NPC_RAZORSCALE) + razorscale->AddSummonForOnDeathDespawn(summoned->GetObjectGuid()); + summoned->SetInCombatWithZone(); summoned->SetIgnoreMMAP(true); if (summoned->AI()) From 543bd66079d89731e8fc74a16d9eb1ea97a6a5bb Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 9 Jan 2023 20:31:12 +0100 Subject: [PATCH 25/26] Ulduar: Despawn all Razorscale adds --- .../scripts/northrend/ulduar/ulduar/boss_razorscale.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 71d32d06909..9e6401691d9 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -329,6 +329,7 @@ struct boss_razorscaleAI : public BossAI { if (summoned->GetEntry() == NPC_RAZORSCALE_SPAWNER) { + m_creature->AddSummonForOnDeathDespawn(summoned->GetObjectGuid()); summoned->CastSpell(summoned, SPELL_SUMMON_MOLE_MACHINE, TRIGGERED_OLD_TRIGGERED); // for central spawners inform that they should spawn a sentinel From f727729c88e080e2f5f259ab0f661644b275894d Mon Sep 17 00:00:00 2001 From: insunaa Date: Fri, 9 Aug 2024 10:50:00 +0200 Subject: [PATCH 26/26] Razorscale: Minor updates --- .../ulduar/ulduar/boss_razorscale.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index 9e6401691d9..47f723b5798 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -187,17 +187,11 @@ struct boss_razorscaleAI : public BossAI m_creature->SetCanFly(true); m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM); - float fX, fY, fZ; - //m_creature->GetRespawnCoord(fX, fY, fZ); const Position combatPosition = Position(580.63556, -175.46675, 475.54114); - fX=combatPosition.GetPositionX(); - fY=combatPosition.GetPositionY(); - fZ=combatPosition.GetPositionZ(); - // use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail uint32 speedRate = m_creature->GetSpeedRate(MOVE_RUN); m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE); - m_creature->GetMotionMaster()->MovePointTOL(1, fX, fY, fZ, true); + m_creature->GetMotionMaster()->MovePointTOL(1, combatPosition.GetPositionX(), combatPosition.GetPositionY(), combatPosition.GetPositionZ(), true); m_creature->SetSpeedRate(MOVE_RUN, speedRate); // reset timers @@ -472,6 +466,7 @@ struct boss_razorscaleAI : public BossAI case RAZORSCALE_PLAYER_CHECK: return 1s; case RAZORSCALE_REPAIR_HARPOONS: return 20s; case RAZORSCALE_SPAWN_ADDS: return 40s; + default: return 24h; } } @@ -586,7 +581,7 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper npc_expedition_commanderAI(Creature* creature) : ScriptedAI(creature), DialogueHelper(aIntroDialogue) { - m_instance = (instance_ulduar*)creature->GetInstanceData(); + m_instance = dynamic_cast(creature->GetInstanceData()); InitializeDialogueHelper(m_instance); m_introDone = false; Reset(); @@ -691,7 +686,7 @@ struct npc_expedition_commanderAI : public ScriptedAI, private DialogueHelper bool GossipHello_npc_expedition_commander(Player* player, Creature* creature) { - if (ScriptedInstance* instance = (ScriptedInstance*)creature->GetInstanceData()) + if (instance_ulduar* instance = dynamic_cast(creature->GetInstanceData())) { if (instance->GetData(TYPE_RAZORSCALE) == NOT_STARTED || instance->GetData(TYPE_RAZORSCALE) == FAIL) player->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START_RAZORSCALE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -744,7 +739,7 @@ struct npc_razorscale_spawnerAI : public Scripted_NoMovementAI } }); SetReactState(REACT_PASSIVE); - SetRootSelf(true); + SetAIImmobilizedState(true); } uint32 m_uiSpawnTimer; @@ -789,7 +784,7 @@ struct npc_harpoon_fire_stateAI : public Scripted_NoMovementAI npc_harpoon_fire_stateAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetReactState(REACT_PASSIVE); - SetRootSelf(true); + SetAIImmobilizedState(true); } void DamageTaken(Unit* /*dealer*/, uint32& damage, DamageEffectType /*damageType*/, SpellEntry const* spellInfo) override @@ -845,7 +840,7 @@ struct DevouringFlameRazorscale : public SpellScript if (summon->AI()) { summon->AI()->SetReactState(REACT_PASSIVE); - summon->AI()->SetRootSelf(true); + summon->AI()->SetAIImmobilizedState(true); summon->SetImmuneToNPC(true); } bool isRegularModed = summon->GetMap()->IsRegularDifficulty();